From 420364d722dd5c6e98620c0986656e3fec9e26a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Tue, 9 Jul 2024 22:30:26 +0000 Subject: [PATCH] Show diff suggestion format on verbose replacement ``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ``` --- compiler/rustc_errors/src/emitter.rs | 2 +- .../tests/ui-toml/dbg_macro/dbg_macro.stderr | 31 +- .../doc_markdown.stderr | 5 +- .../doc_markdown.stderr | 15 +- .../enum_variant_size.stderr | 5 +- .../index_refutable_slice.stderr | 10 +- .../renamed_function_params.default.stderr | 5 +- .../renamed_function_params.extend.stderr | 5 +- .../ui-toml/unwrap_used/unwrap_used.stderr | 75 +- src/tools/clippy/tests/ui/assign_ops2.stderr | 90 +- .../ui/bind_instead_of_map_multipart.stderr | 20 +- .../ui/borrow_deref_ref_unfixable.stderr | 10 +- src/tools/clippy/tests/ui/cast.stderr | 103 +- .../clippy/tests/ui/cast_lossless_bool.stderr | 75 +- .../tests/ui/cast_lossless_float.stderr | 65 +- .../tests/ui/cast_lossless_integer.stderr | 198 ++-- .../clippy/tests/ui/cast_size.64bit.stderr | 45 +- src/tools/clippy/tests/ui/create_dir.stderr | 10 +- .../tests/ui/dbg_macro/dbg_macro.stderr | 81 +- .../ui/dbg_macro/dbg_macro_unfixable.stderr | 25 +- .../clippy/tests/ui/doc/doc-fixable.stderr | 161 +-- .../clippy/tests/ui/doc/issue_10262.stderr | 5 +- .../clippy/tests/ui/doc/issue_12795.stderr | 20 +- .../clippy/tests/ui/doc/issue_9473.stderr | 5 +- .../tests/ui/doc/unbalanced_ticks.stderr | 15 +- .../clippy/tests/ui/eager_transmute.stderr | 85 +- .../tests/ui/excessive_precision.stderr | 80 +- .../tests/ui/fn_to_numeric_cast_any.stderr | 81 +- src/tools/clippy/tests/ui/for_kv_map.stderr | 30 +- .../tests/ui/four_forward_slashes.stderr | 8 + .../ui/four_forward_slashes_first_line.stderr | 2 + src/tools/clippy/tests/ui/get_unwrap.stderr | 85 +- .../clippy/tests/ui/implicit_hasher.stderr | 15 +- .../clippy/tests/ui/implicit_return.stderr | 67 +- .../if_let_slice_binding.stderr | 95 +- .../slice_indexing_in_macro.stderr | 10 +- src/tools/clippy/tests/ui/iter_nth.stderr | 40 +- .../tests/ui/join_absolute_paths.stderr | 40 +- .../tests/ui/large_enum_variant.64bit.stderr | 65 +- .../tests/ui/legacy_numeric_constants.stderr | 80 +- src/tools/clippy/tests/ui/let_unit.stderr | 13 +- src/tools/clippy/tests/ui/literals.stderr | 35 +- .../tests/ui/lossy_float_literal.stderr | 55 +- .../tests/ui/manual_assert.edition2018.stderr | 10 +- .../tests/ui/manual_assert.edition2021.stderr | 10 +- .../clippy/tests/ui/manual_async_fn.stderr | 149 ++- .../tests/ui/manual_float_methods.stderr | 45 +- .../tests/ui/manual_is_ascii_check.stderr | 10 +- .../clippy/tests/ui/manual_split_once.stderr | 15 +- .../clippy/tests/ui/match_result_ok.stderr | 15 +- .../clippy/tests/ui/match_same_arms.stderr | 35 +- .../clippy/tests/ui/match_same_arms2.stderr | 65 +- .../tests/ui/match_str_case_mismatch.stderr | 35 +- .../tests/ui/needless_borrow_pat.stderr | 10 +- .../ui/needless_for_each_unfixable.stderr | 5 +- .../tests/ui/needless_pass_by_value.stderr | 20 +- .../tests/ui/needless_range_loop.stderr | 70 +- .../tests/ui/needless_range_loop2.stderr | 40 +- .../clippy/tests/ui/needless_return.stderr | 50 +- src/tools/clippy/tests/ui/never_loop.stderr | 10 +- .../ui/non_canonical_partial_ord_impl.stderr | 5 +- .../clippy/tests/ui/nonminimal_bool.stderr | 50 +- .../clippy/tests/ui/octal_escapes.stderr | 110 ++- src/tools/clippy/tests/ui/op_ref.stderr | 5 +- .../tests/ui/option_as_ref_cloned.stderr | 15 +- .../clippy/tests/ui/redundant_guards.stderr | 5 +- .../tests/ui/ref_binding_to_reference.stderr | 10 +- .../tests/ui/repeat_vec_with_capacity.stderr | 15 +- .../ui/reversed_empty_ranges_fixable.stderr | 20 +- ...reversed_empty_ranges_loops_fixable.stderr | 30 +- .../tests/ui/single_range_in_vec_init.stderr | 90 +- .../tests/ui/string_lit_chars_any.stderr | 25 +- .../ui/suspicious_command_arg_space.stderr | 10 +- .../tests/ui/suspicious_doc_comments.stderr | 15 +- .../tests/ui/suspicious_to_owned.stderr | 40 +- .../ui/suspicious_xor_used_as_pow.stderr | 35 +- .../tests/ui/transmute_ptr_to_ptr.stderr | 55 +- ...transmutes_expressible_as_ptr_casts.stderr | 10 +- src/tools/clippy/tests/ui/unit_arg.stderr | 18 +- .../tests/ui/unknown_clippy_lints.stderr | 10 +- .../tests/ui/unnecessary_iter_cloned.stderr | 20 +- .../ui/unnecessary_literal_unwrap.stderr | 50 +- .../tests/ui/unnecessary_to_owned.stderr | 5 +- .../clippy/tests/ui/unnecessary_wraps.stderr | 44 +- .../tests/ui/unnested_or_patterns.stderr | 85 +- .../tests/ui/unnested_or_patterns2.stderr | 40 +- .../tests/ui/unused_enumerate_index.stderr | 10 +- .../ui/unused_format_specs_unfixable.stderr | 10 +- .../clippy/tests/ui/unused_result_ok.stderr | 20 +- .../intra-doc/disambiguator-mismatch.stderr | 45 +- tests/rustdoc-ui/intra-doc/field-ice.stderr | 5 +- ...ncompatible-primitive-disambiguator.stderr | 5 +- .../rustdoc-ui/intra-doc/prim-conflict.stderr | 20 +- .../rustdoc-ui/intra-doc/weird-syntax.stderr | 35 +- tests/rustdoc-ui/issues/issue-102986.stderr | 5 +- tests/rustdoc-ui/issues/issue-105742.stderr | 5 +- tests/rustdoc-ui/issues/issue-120444-1.stderr | 5 +- tests/rustdoc-ui/issues/issue-120444-2.stderr | 5 +- .../lints/redundant_explicit_links.stderr | 300 +++--- .../ui/abi/statics/static-mut-foreign.stderr | 10 +- .../anon-params-denied-2018.stderr | 5 +- tests/ui/argument-suggestions/basic.stderr | 20 +- tests/ui/argument-suggestions/complex.stderr | 5 +- .../display-is-suggestable.stderr | 5 +- .../extern-fn-arg-names.stderr | 5 +- .../argument-suggestions/issue-100478.stderr | 24 +- .../argument-suggestions/issue-101097.stderr | 25 +- .../argument-suggestions/issue-109831.stderr | 5 +- .../argument-suggestions/issue-96638.stderr | 5 +- .../argument-suggestions/issue-97197.stderr | 5 +- .../argument-suggestions/issue-98894.stderr | 5 +- .../argument-suggestions/issue-98897.stderr | 5 +- .../argument-suggestions/issue-99482.stderr | 5 +- .../missing_arguments.stderr | 95 +- .../argument-suggestions/mixed_cases.stderr | 25 +- .../permuted_arguments.stderr | 10 +- .../swapped_arguments.stderr | 25 +- tests/ui/asm/invalid-const-operand.stderr | 15 +- tests/ui/asm/parse-error.stderr | 25 +- tests/ui/asm/x86_64/x86_64_parse_error.stderr | 15 +- .../associated-const-ambiguity-report.stderr | 10 +- .../dont-select-if-disabled.stderr | 5 +- .../issue-109071.no_gate.stderr | 10 +- .../issue-109768.stderr | 5 +- .../associated-item-enum.stderr | 15 +- .../assoc-type-eq-with-dyn-atb-fail.stderr | 5 +- .../ui/associated-type-bounds/elision.stderr | 10 +- .../overlaping-bound-suggestion.stderr | 5 +- .../suggest-assoc-ty-bound-on-eq-bound.stderr | 15 +- ...mbig-between-bound-and-where-clause.stderr | 60 +- ...rojection-from-multiple-supertraits.stderr | 20 +- .../associated-types-eq-1.stderr | 5 +- .../associated-types-eq-2.stderr | 23 +- ...sociated-types-in-ambiguous-context.stderr | 30 +- .../associated-types-path-1.stderr | 10 +- .../associated-types-path-2.stderr | 5 +- ...iated-types-project-from-hrtb-in-fn.stderr | 5 +- ...s-project-from-hrtb-in-trait-method.stderr | 10 +- .../defaults-specialization.stderr | 10 +- .../defaults-suitability.current.stderr | 5 +- .../defaults-suitability.next.stderr | 5 +- .../associated-types/impl-wf-cycle-3.stderr | 5 +- tests/ui/associated-types/issue-22560.stderr | 5 +- tests/ui/associated-types/issue-38821.stderr | 10 +- .../issue-54108.current.stderr | 5 +- .../associated-types/issue-54108.next.stderr | 5 +- tests/ui/associated-types/issue-59324.stderr | 5 +- .../missing-associated-types.stderr | 20 +- .../async-closures/arg-mismatch.stderr | 5 +- .../async-example-desugared-boxed.stderr | 5 +- .../async-example-desugared-manual.stderr | 5 +- ...orrect-move-async-order-issue-79694.stderr | 5 +- ...34-raw-ident-suggestion.edition2015.stderr | 10 +- ...34-raw-ident-suggestion.edition2018.stderr | 10 +- ...st-switching-edition-on-await-cargo.stderr | 5 +- .../suggest-switching-edition-on-await.stderr | 5 +- tests/ui/atomic-from-mut-not-available.stderr | 5 +- tests/ui/attempted-access-non-fatal.stderr | 20 +- .../ui/attributes/key-value-non-ascii.stderr | 5 +- tests/ui/attributes/rustc_confusables.stderr | 15 +- .../rustc_confusables_std_cases.stderr | 40 +- tests/ui/binop/placement-syntax.stderr | 5 +- tests/ui/block-result/issue-3563.stderr | 5 +- .../borrowck-access-permissions.stderr | 5 +- .../borrowck-struct-update-with-dtor.stderr | 20 +- ...rowck-unsafe-static-mutable-borrows.stderr | 5 +- tests/ui/borrowck/index-mut-help.stderr | 15 +- .../issue-115259-suggest-iter-mut.stderr | 5 +- tests/ui/borrowck/issue-20801.stderr | 5 +- ...5492-borrowck-migrate-scans-parents.stderr | 15 +- .../issue-62387-suggest-iter-mut-2.stderr | 5 +- .../issue-62387-suggest-iter-mut.stderr | 10 +- tests/ui/borrowck/issue-85765-closure.stderr | 15 +- tests/ui/borrowck/issue-85765.stderr | 15 +- tests/ui/borrowck/issue-93093.stderr | 5 +- .../suggest-lt-on-ty-alias-w-generics.stderr | 5 +- .../trait-impl-argument-difference-ice.stderr | 10 +- ...atched-arg-and-hir-arg-issue-126385.stderr | 5 +- tests/ui/btreemap/btreemap-index-mut-2.stderr | 15 +- tests/ui/btreemap/btreemap-index-mut.stderr | 15 +- tests/ui/c-variadic/issue-86053-1.stderr | 5 +- tests/ui/c-variadic/variadic-ffi-1.stderr | 10 +- tests/ui/cast/cast-as-bool.stderr | 25 +- tests/ui/cast/cast-rfc0401-2.stderr | 5 +- .../ice-cast-type-with-error-124848.stderr | 5 +- tests/ui/cast/issue-106883-is-empty.stderr | 20 +- tests/ui/cfg/cfg-method-receiver.stderr | 5 +- .../cfg-value-for-cfg-name-multiple.stderr | 10 +- tests/ui/check-cfg/diagnotics.cargo.stderr | 15 +- tests/ui/check-cfg/diagnotics.rustc.stderr | 15 +- tests/ui/check-cfg/well-known-names.stderr | 5 +- tests/ui/closures/issue-78720.stderr | 5 +- tests/ui/closures/multiple-fn-bounds.stderr | 5 +- .../cmse-nonsecure-call/generics.stderr | 5 +- tests/ui/codemap_tests/two_files.stderr | 5 +- tests/ui/compare-method/bad-self-type.stderr | 10 +- tests/ui/compare-method/issue-90444.stderr | 10 +- tests/ui/compare-method/region-extra-2.stderr | 5 +- .../reordered-type-param.stderr | 5 +- .../cfg-attr-parse.stderr | 15 +- .../issue-33784.stderr | 5 +- .../const_param_ty_object_safety.stderr | 10 +- .../early/invalid-const-arguments.stderr | 10 +- .../ensure_is_evaluatable.stderr | 5 +- .../fn_with_two_const_inputs.stderr | 5 +- .../forbid-non-structural_match-types.stderr | 2 +- .../abstract-const-as-cast-3.stderr | 20 +- .../doesnt_unify_evaluatable.stderr | 5 +- .../const_kind_expr/issue_114151.stderr | 5 +- .../const_kind_expr/wf_obligation.stderr | 5 +- ...e-a-closure-or-coroutine-ice-113776.stderr | 10 +- .../generic_const_exprs/issue-109141.stderr | 5 +- .../unify-op-with-fn-call.stderr | 6 +- .../invalid-const-arg-for-type-param.stderr | 5 +- tests/ui/const-generics/issue-80471.stderr | 2 +- .../const-generics/issues/issue-87493.stderr | 5 +- .../const-generics/issues/issue-97278.stderr | 2 +- .../legacy-const-generics-bad.stderr | 5 +- .../issue-89013-no-kw.stderr | 5 +- .../parser-error-recovery/issue-89013.stderr | 5 +- .../type-dependent/type-mismatch.full.stderr | 5 +- .../type-dependent/type-mismatch.min.stderr | 5 +- .../consts/assoc-const-elided-lifetime.stderr | 5 +- .../const-blocks/fn-call-in-non-const.stderr | 5 +- tests/ui/consts/const_let_assign2.stderr | 5 +- .../ice-bad-input-type-for-cast-83056.stderr | 5 +- tests/ui/consts/issue-3521.stderr | 5 +- tests/ui/consts/issue-91560.stderr | 10 +- .../ui/consts/non-const-value-in-const.stderr | 10 +- .../refs_check_const_eq-issue-88384.stderr | 4 +- tests/ui/coroutine/issue-102645.stderr | 5 +- tests/ui/coverage-attr/bad-syntax.stderr | 80 +- tests/ui/coverage-attr/name-value.stderr | 72 +- tests/ui/coverage-attr/subword.stderr | 40 +- tests/ui/coverage-attr/word-only.stderr | 72 +- .../ui/deprecation/atomic_initializers.stderr | 5 +- tests/ui/deprecation/invalid-literal.stderr | 15 +- ...4637-deprecated-associated-function.stderr | 15 +- tests/ui/deprecation/suggestion.stderr | 10 +- tests/ui/deref-patterns/issue-71676-1.stderr | 5 +- tests/ui/derived-errors/issue-30580.stderr | 5 +- .../struct_destructure_fail.stderr | 10 +- .../tuple_struct_destructure_fail.stderr | 10 +- .../diagnostic_namespace/suggest_typos.stderr | 15 +- tests/ui/did_you_mean/bad-assoc-ty.stderr | 95 +- .../brackets-to-braces-single-element.stderr | 15 +- .../compatible-variants-in-pat.stderr | 10 +- .../dont-suggest-hygienic-fields.stderr | 5 +- tests/ui/did_you_mean/issue-36798.stderr | 5 +- tests/ui/did_you_mean/issue-38147-1.stderr | 5 +- tests/ui/did_you_mean/issue-39544.stderr | 15 +- ...1679-tilde-bitwise-negation-attempt.stderr | 25 +- .../issue-42599_available_fields_note.stderr | 10 +- ...ssue-46718-struct-pattern-dotdotdot.stderr | 5 +- ...-identifier-not-instead-of-negation.stderr | 25 +- ...92-tuple-destructure-missing-parens.stderr | 5 +- ...de-confusable-in-float-literal-expt.stderr | 5 +- ...sue-54109-and_instead_of_ampersands.stderr | 40 +- .../issue-54109-without-witness.stderr | 40 +- ...ssue-56028-there-is-an-enum-variant.stderr | 20 +- ...issue-87830-try-brackets-for-arrays.stderr | 10 +- tests/ui/did_you_mean/pub-macro-rules.stderr | 5 +- .../replace-impl-infer-ty-from-trait.stderr | 5 +- .../did_you_mean/use_instead_of_import.stderr | 20 +- ...issue-23338-ensure-param-drop-order.stderr | 5 +- .../drop/issue-23611-enum-swap-in-drop.stderr | 5 +- .../dropck/explicit-drop-bounds.bad1.stderr | 10 +- .../issue-90528-unsizing-suggestion-3.stderr | 5 +- .../ui/empty/empty-struct-braces-expr.stderr | 60 +- .../ui/empty/empty-struct-braces-pat-2.stderr | 40 +- tests/ui/empty/empty-struct-tuple-pat.stderr | 10 +- tests/ui/empty/empty-struct-unit-pat.stderr | 60 +- .../discriminant-ill-typed.stderr | 40 +- .../error-recovery-issue-55897.stderr | 5 +- tests/ui/error-codes/E0027.stderr | 40 +- tests/ui/error-codes/E0034.stderr | 10 +- tests/ui/error-codes/E0040.stderr | 5 +- tests/ui/error-codes/E0054.stderr | 5 +- tests/ui/error-codes/E0057.stderr | 5 +- tests/ui/error-codes/E0060.stderr | 5 +- tests/ui/error-codes/E0061.stderr | 10 +- tests/ui/error-codes/E0214.stderr | 5 +- tests/ui/error-codes/E0221.stderr | 15 +- tests/ui/error-codes/E0259.stderr | 3 +- tests/ui/error-codes/E0260.stderr | 3 +- tests/ui/error-codes/E0283.stderr | 5 +- tests/ui/error-codes/E0423.stderr | 10 +- tests/ui/error-codes/E0435.stderr | 5 +- tests/ui/error-codes/E0516.stderr | 5 +- tests/ui/error-codes/E0617.stderr | 5 +- tests/ui/error-codes/E0637.stderr | 5 +- tests/ui/error-codes/E0642.stderr | 15 +- tests/ui/error-codes/E0746.stderr | 5 +- tests/ui/error-codes/ex-E0612.stderr | 5 +- tests/ui/error-festival.stderr | 5 +- .../ui/explicit/explicit-call-to-dtor.stderr | 5 +- .../explicit-call-to-supertrait-dtor.stderr | 5 +- tests/ui/expr/if/if-branch-types.stderr | 5 +- tests/ui/expr/if/if-else-type-mismatch.stderr | 10 +- tests/ui/expr/issue-22933-2.stderr | 5 +- tests/ui/extern/extern-const.stderr | 5 +- tests/ui/extern/extern-crate-rename.stderr | 5 +- .../ui/extern/extern-crate-visibility.stderr | 10 +- tests/ui/extern/issue-18819.stderr | 5 +- tests/ui/extern/not-in-block.stderr | 20 +- .../feature-gate-extern_absolute_paths.stderr | 5 +- .../feature-gate-negate-unsigned.stderr | 5 +- .../feature-gate-never_patterns.stderr | 3 +- ...-gate-unboxed-closures-manual-impls.stderr | 10 +- .../feature-gate-unsized_fn_params.stderr | 5 +- .../feature-gate-unsized_locals.stderr | 5 +- .../issue-43106-gating-of-macro_use.stderr | 10 +- ...mat-args-non-identifier-diagnostics.stderr | 5 +- tests/ui/fmt/format-string-error-2.stderr | 5 +- .../no-inline-literals-out-of-range.stderr | 15 +- .../struct-field-as-captured-argument.stderr | 35 +- tests/ui/fn/fn-pointer-mismatch.stderr | 15 +- tests/ui/fn/fn-recover-return-sign.stderr | 20 +- tests/ui/fn/fn-recover-return-sign2.stderr | 5 +- ...unctional-struct-update-noncopyable.stderr | 5 +- .../gat-trait-path-parenthesised-args.stderr | 5 +- .../impl_bounds.stderr | 5 +- .../issue-70304.stderr | 5 +- .../mismatched-where-clause-regions.stderr | 5 +- .../missing-bounds.stderr | 5 +- .../duplicate-where-clause.stderr | 6 +- tests/ui/generics/issue-79605.stderr | 5 +- .../generics/issue-95208-ignore-qself.stderr | 5 +- tests/ui/generics/issue-95208.stderr | 5 +- ...pats-inclusive-dotdotdot-bad-syntax.stderr | 25 +- ...pen-range-pats-ref-ambiguous-interp.stderr | 5 +- tests/ui/hashmap/hashmap-index-mut.stderr | 15 +- .../trait-bounds/issue-58451.stderr | 5 +- tests/ui/hygiene/globs.stderr | 10 +- ...n-trait-return-should-be-impl-trait.stderr | 10 +- tests/ui/impl-trait/equality.stderr | 5 +- .../ui/impl-trait/impl-fn-hrtb-bounds.stderr | 5 +- .../impl-generic-mismatch-ab.stderr | 5 +- .../impl-trait/impl-generic-mismatch.stderr | 10 +- .../in-assoc-type-unconstrained.stderr | 5 +- .../bad-item-bound-within-rpitit.stderr | 11 +- ...e-to-map-to-reearlybound-ice-108580.stderr | 5 +- tests/ui/impl-trait/in-trait/foreign.stderr | 10 +- .../method-signature-matches.lt.stderr | 5 +- .../method-signature-matches.mismatch.stderr | 5 +- ...od-signature-matches.mismatch_async.stderr | 5 +- .../opaque-and-lifetime-mismatch.stderr | 5 +- tests/ui/impl-trait/in-trait/refine.stderr | 25 +- .../in-trait/span-bug-issue-121457.stderr | 5 +- .../in-trait/specialization-broken.stderr | 5 +- .../must_outlive_least_region_or_bound.stderr | 50 +- .../no-method-suggested-traits.stderr | 30 +- .../opaque-used-in-extraneous-argument.stderr | 5 +- ...type-err-cause-on-impl-trait-return.stderr | 50 +- .../precise-capturing/bad-lifetimes.stderr | 5 +- .../hidden-type-suggestion.stderr | 10 +- ...s-impl-trait-declaration-too-subtle.stderr | 10 +- tests/ui/impl-trait/trait_type.stderr | 5 +- tests/ui/impl-trait/where-allowed.stderr | 5 +- .../ui/imports/bad-import-with-rename.stderr | 10 +- .../extern-crate-self-fail.stderr | 5 +- tests/ui/imports/glob-resolve1.stderr | 5 +- ...-crate-rename-suggestion-formatting.stderr | 3 +- .../ui/imports/issue-45829/import-self.stderr | 15 +- .../ui/imports/issue-45829/issue-45829.stderr | 5 +- .../issue-45829/rename-extern-vs-use.stderr | 3 +- .../issue-45829/rename-extern-with-tab.stderr | 3 +- .../imports/issue-45829/rename-extern.stderr | 3 +- .../issue-45829/rename-use-vs-extern.stderr | 5 +- .../issue-45829/rename-use-with-tabs.stderr | 5 +- .../issue-45829/rename-with-path.stderr | 5 +- tests/ui/imports/issue-45829/rename.stderr | 5 +- tests/ui/imports/issue-56125.stderr | 20 +- tests/ui/imports/issue-57015.stderr | 5 +- tests/ui/imports/issue-59764.stderr | 10 +- tests/ui/imports/no-std-inject.stderr | 5 +- ...private-std-reexport-suggest-public.stderr | 5 +- ...est-import-issue-120074.edition2015.stderr | 5 +- ...est-import-issue-120074.edition2021.stderr | 5 +- tests/ui/include-macros/parent_dir.stderr | 20 +- .../inference/ambiguous_type_parameter.stderr | 5 +- tests/ui/inference/char-as-str-single.stderr | 20 +- tests/ui/inference/inference_unstable.stderr | 5 +- .../inference_unstable_featured.stderr | 10 +- tests/ui/inference/issue-103587.stderr | 5 +- tests/ui/inference/issue-12028.stderr | 5 +- tests/ui/inference/issue-70082.stderr | 5 +- tests/ui/inference/issue-71584.stderr | 5 +- tests/ui/inference/issue-72616.stderr | 10 +- tests/ui/inference/issue-72690.stderr | 40 +- tests/ui/inference/issue-80816.stderr | 5 +- tests/ui/inference/str-as-char.stderr | 20 +- tests/ui/issues/issue-13497.stderr | 5 +- tests/ui/issues/issue-17546.stderr | 20 +- tests/ui/issues/issue-17800.stderr | 5 +- tests/ui/issues/issue-18107.stderr | 5 +- tests/ui/issues/issue-18446.stderr | 5 +- tests/ui/issues/issue-20225.stderr | 15 +- tests/ui/issues/issue-21332.stderr | 5 +- tests/ui/issues/issue-23041.stderr | 5 +- tests/ui/issues/issue-23073.stderr | 5 +- tests/ui/issues/issue-23217.stderr | 5 +- tests/ui/issues/issue-23589.stderr | 10 +- tests/ui/issues/issue-27433.stderr | 5 +- tests/ui/issues/issue-28971.stderr | 5 +- tests/ui/issues/issue-32004.stderr | 10 +- tests/ui/issues/issue-34209.stderr | 5 +- tests/ui/issues/issue-3521-2.stderr | 5 +- .../issue-3668-2.stderr | 5 +- .../issue-3668.stderr | 5 +- tests/ui/issues/issue-3702-2.stderr | 10 +- tests/ui/issues/issue-40782.stderr | 5 +- .../ui/issues/issue-41652/issue-41652.stderr | 5 +- tests/ui/issues/issue-42312.stderr | 5 +- tests/ui/issues/issue-44239.stderr | 5 +- ...73-zero-padded-tuple-struct-indices.stderr | 5 +- tests/ui/issues/issue-4736.stderr | 5 +- tests/ui/issues/issue-50571.stderr | 5 +- tests/ui/issues/issue-51874.stderr | 5 +- tests/ui/issues/issue-5358-1.stderr | 5 +- tests/ui/issues/issue-54410.stderr | 5 +- tests/ui/issues/issue-56175.stderr | 10 +- tests/ui/issues/issue-5883.stderr | 5 +- tests/ui/issues/issue-69683.stderr | 10 +- .../issue-76077-1.stderr | 5 +- tests/ui/issues/issue-76191.stderr | 5 +- tests/ui/issues/issue-78622.stderr | 5 +- tests/ui/issues/issue-80607.stderr | 5 +- tests/ui/issues/issue-8761.stderr | 10 +- .../iterators/into-iter-on-arrays-2018.stderr | 15 +- .../iterators/into-iter-on-arrays-lint.stderr | 40 +- .../into-iter-on-boxed-slices-2021.stderr | 15 +- .../into-iter-on-boxed-slices-lint.stderr | 10 +- tests/ui/label/label_misspelled.stderr | 30 +- tests/ui/lexer/lex-bad-char-literals-1.stderr | 10 +- tests/ui/lexer/lex-bad-char-literals-2.stderr | 5 +- tests/ui/lexer/lex-bad-char-literals-3.stderr | 10 +- tests/ui/lexer/lex-bad-char-literals-5.stderr | 10 +- tests/ui/lexer/lex-bad-char-literals-6.stderr | 15 +- .../lex-bad-str-literal-as-char-1.stderr | 5 +- .../lex-bad-str-literal-as-char-2.stderr | 5 +- ...-bad-str-literal-as-char-3.rust2015.stderr | 5 +- ...-bad-str-literal-as-char-3.rust2018.stderr | 5 +- ...-bad-str-literal-as-char-3.rust2021.stderr | 10 +- .../lex-bad-str-literal-as-char-4.stderr | 10 +- .../lifetimes/borrowck-let-suggestion.stderr | 5 +- tests/ui/lifetimes/fullwidth-ampersand.stderr | 5 +- tests/ui/lifetimes/issue-26638.stderr | 15 +- .../issue-90170-elision-mismatch.stderr | 5 +- ...ide_pointer_comparisons_suggestions.stderr | 10 +- .../lint/dead-code/tuple-struct-field.stderr | 5 +- tests/ui/lint/for_loop_over_fallibles.stderr | 100 +- tests/ui/lint/issue-109152.stderr | 5 +- tests/ui/lint/issue-109529.stderr | 5 +- tests/ui/lint/issue-35075.stderr | 10 +- .../issue-119696-err-on-fn.stderr | 10 +- .../issue-119697-extra-let.stderr | 20 +- .../let_underscore/let_underscore_drop.stderr | 10 +- .../let_underscore/let_underscore_lock.stderr | 30 +- .../lint-strict-provenance-fuzzy-casts.stderr | 5 +- .../lint-strict-provenance-lossy-casts.stderr | 10 +- tests/ui/lint/lint_map_unit_fn.stderr | 15 +- ...ase-identifiers-suggestion-reserved.stderr | 15 +- tests/ui/lint/recommend-literal.stderr | 15 +- tests/ui/lint/type-overflow.stderr | 30 +- ...ue-67691-unused-field-in-or-pattern.stderr | 30 +- tests/ui/lint/wide_pointer_comparisons.stderr | 180 ++-- .../loops/loop-break-value-no-repeat.stderr | 5 +- tests/ui/loops/loop-break-value.stderr | 45 +- .../macros/expand-full-no-resolution.stderr | 10 +- .../macros/expr_2021_cargo_fix_edition.stderr | 10 +- tests/ui/macros/format-foreign.stderr | 10 +- tests/ui/macros/issue-103529.stderr | 10 +- tests/ui/macros/issue-109237.stderr | 5 +- tests/ui/macros/issue-118786.stderr | 5 +- tests/ui/macros/issue-99265.stderr | 150 +-- .../macro-backtrace-invalid-internals.stderr | 10 +- tests/ui/macros/macro-inner-attributes.stderr | 5 +- tests/ui/macros/macro-use-wrong-name.stderr | 5 +- tests/ui/macros/recovery-allowed.stderr | 5 +- .../ui/malformed/malformed-meta-delim.stderr | 10 +- .../malformed/malformed-special-attrs.stderr | 10 +- tests/ui/match/issue-56685.stderr | 20 +- .../match/match-pattern-field-mismatch.stderr | 5 +- ...ure-gate-ref_pat_eat_one_layer_2024.stderr | 25 +- .../ref_pat_eat_one_layer_2021_fail.stderr | 25 +- ...pat_eat_one_layer_2024_fail.classic.stderr | 40 +- .../meta/expected-error-correct-rev.a.stderr | 5 +- .../meta-expected-error-wrong-rev.a.stderr | 5 +- ...guate-associated-function-first-arg.stderr | 25 +- .../disambiguate-multiple-blanket-impl.stderr | 30 +- .../methods/disambiguate-multiple-impl.stderr | 30 +- .../disambiguate-multiple-trait-2.stderr | 60 +- .../disambiguate-multiple-trait.stderr | 30 +- tests/ui/methods/issues/issue-105732.stderr | 5 +- tests/ui/methods/issues/issue-90315.stderr | 5 +- ...od-ambig-one-trait-unknown-int-type.stderr | 5 +- ...method-ambig-two-traits-cross-crate.stderr | 10 +- ...method-ambig-two-traits-from-bounds.stderr | 10 +- .../method-ambig-two-traits-from-impls.stderr | 10 +- ...method-ambig-two-traits-from-impls2.stderr | 10 +- ...mbig-two-traits-with-default-method.stderr | 10 +- .../methods/method-ambiguity-no-rcvr.stderr | 10 +- tests/ui/methods/method-call-err-msg.stderr | 15 +- ...e-trait-object-with-separate-params.stderr | 15 +- .../method-not-found-but-doc-alias.stderr | 5 +- .../method-on-ambiguous-numeric-type.stderr | 5 +- .../methods/suggest-convert-ptr-to-ref.stderr | 10 +- tests/ui/mir/issue-106062.stderr | 10 +- tests/ui/mismatched_types/E0053.stderr | 10 +- tests/ui/mismatched_types/cast-rfc0401.stderr | 5 +- ...arg-count-expected-type-issue-47244.stderr | 5 +- .../mismatched_types/closure-arg-count.stderr | 35 +- ...loat-literal-inference-restrictions.stderr | 5 +- tests/ui/mismatched_types/issue-106182.stderr | 5 +- tests/ui/mismatched_types/issue-112036.stderr | 5 +- tests/ui/mismatched_types/issue-13033.stderr | 5 +- tests/ui/mismatched_types/issue-1362.stderr | 5 +- tests/ui/mismatched_types/issue-1448-2.stderr | 5 +- .../numeric-literal-cast.stderr | 15 +- .../overloaded-calls-bad.stderr | 5 +- .../ref-pat-suggestions.stderr | 5 +- ...trait-objects-instead-of-impl-trait.stderr | 10 +- .../trait-impl-fn-incompatibility.stderr | 10 +- ...ransforming-option-ref-issue-127545.stderr | 15 +- tests/ui/missing/missing-block-hint.stderr | 5 +- .../missing-fields-in-struct-pattern.stderr | 5 +- .../missing-const-parameter.stderr | 5 +- .../missing-type-parameter2.stderr | 25 +- .../ui/moves/needs-clone-through-deref.stderr | 5 +- ...clone-when-some-obligation-is-unmet.stderr | 5 +- ...use_of_moved_value_copy_suggestions.stderr | 5 +- tests/ui/mut/mutable-class-fields-2.stderr | 5 +- tests/ui/namespace/namespace-mix.stderr | 20 +- tests/ui/never_type/issue-96335.stderr | 10 +- ...local-static-mut-borrow-outlives-fn.stderr | 5 +- .../projection-no-regions-closure.stderr | 10 +- .../projection-no-regions-fn.stderr | 10 +- tests/ui/non-fmt-panic.stderr | 40 +- tests/ui/not-enough-arguments.stderr | 10 +- tests/ui/numeric/const-scope.stderr | 15 +- tests/ui/numeric/numeric-fields.stderr | 5 +- .../numeric-suffix/numeric-suffix-i32.stderr | 55 +- .../numeric-suffix/numeric-suffix-i64.stderr | 55 +- .../numeric-suffix-isize.stderr | 55 +- .../numeric-suffix/numeric-suffix-u32.stderr | 55 +- .../numeric-suffix/numeric-suffix-u64.stderr | 55 +- .../numeric-suffix-usize.stderr | 55 +- .../numeric-suffix/numeric-suffix.stderr | 280 +++--- tests/ui/object-pointer-types.stderr | 5 +- .../avoid-ice-on-warning.new.stderr | 5 +- .../avoid-ice-on-warning.old.stderr | 5 +- ...ject-safety-supertrait-mentions-GAT.stderr | 5 +- ...ect-safety-supertrait-mentions-Self.stderr | 5 +- tests/ui/obsolete-in-place/bad.stderr | 5 +- .../ui/on-unimplemented/bad-annotation.stderr | 6 +- tests/ui/on-unimplemented/issue-104140.stderr | 10 +- .../less-than-greater-than.stderr | 5 +- .../or-patterns/multiple-pattern-typo.stderr | 35 +- .../ui/or-patterns/remove-leading-vert.stderr | 30 +- tests/ui/panic-handler/weak-lang-item.stderr | 3 +- tests/ui/parser/bad-char-literals.stderr | 10 +- tests/ui/parser/bad-crate-name.stderr | 5 +- .../bad-escape-suggest-raw-string.stderr | 5 +- tests/ui/parser/bad-let-else-statement.stderr | 10 +- tests/ui/parser/bad-lit-suffixes.stderr | 6 +- tests/ui/parser/byte-literals.stderr | 10 +- tests/ui/parser/byte-string-literals.stderr | 5 +- .../char/whitespace-character-literal.stderr | 5 +- ...-param-decl-on-type-instead-of-impl.stderr | 5 +- .../parser/default-on-wrong-item-kind.stderr | 5 +- tests/ui/parser/do-catch-suggests-try.stderr | 5 +- tests/ui/parser/dotdotdot-expr.stderr | 10 +- .../ui/parser/duplicate-where-clauses.stderr | 30 +- tests/ui/parser/emoji-identifiers.stderr | 10 +- tests/ui/parser/eq-gt-to-gt-eq.stderr | 35 +- tests/ui/parser/expr-rarrow-call.stderr | 25 +- tests/ui/parser/extern-no-fn.stderr | 5 +- tests/ui/parser/fn-body-eq-expr-semi.stderr | 40 +- tests/ui/parser/fn-colon-return-type.stderr | 5 +- .../parser/foreign-const-semantic-fail.stderr | 10 +- .../foreign-const-syntactic-fail.stderr | 10 +- tests/ui/parser/increment-autofix-2.stderr | 30 +- tests/ui/parser/increment-autofix.stderr | 10 +- .../ui/parser/intersection-patterns-1.stderr | 10 +- .../parser/issues/issue-100197-mut-let.stderr | 5 +- .../ui/parser/issues/issue-101477-enum.stderr | 5 +- .../ui/parser/issues/issue-101477-let.stderr | 5 +- tests/ui/parser/issues/issue-102806.stderr | 15 +- .../issue-103748-ICE-wrong-braces.stderr | 10 +- .../issues/issue-104867-inc-dec-2.stderr | 45 +- .../parser/issues/issue-104867-inc-dec.stderr | 25 +- tests/ui/parser/issues/issue-105366.stderr | 5 +- .../ui/parser/issues/issue-108495-dec.stderr | 25 +- tests/ui/parser/issues/issue-110014.stderr | 5 +- tests/ui/parser/issues/issue-111416.stderr | 5 +- .../ui/parser/issues/issue-118530-ice.stderr | 5 +- .../issues/issue-17718-const-mut.stderr | 3 +- .../issues/issue-23620-invalid-escapes.stderr | 5 +- tests/ui/parser/issues/issue-30318.stderr | 10 +- tests/ui/parser/issues/issue-32214.stderr | 5 +- tests/ui/parser/issues/issue-34255-1.stderr | 5 +- tests/ui/parser/issues/issue-44406.stderr | 5 +- tests/ui/parser/issues/issue-57684.stderr | 10 +- tests/ui/parser/issues/issue-64732.stderr | 10 +- ...sue-65257-invalid-var-decl-recovery.stderr | 30 +- tests/ui/parser/issues/issue-68730.stderr | 10 +- .../issue-73568-lifetime-after-mut.stderr | 10 +- tests/ui/parser/issues/issue-84117.stderr | 15 +- tests/ui/parser/issues/issue-84148-1.stderr | 5 +- .../issues/issue-87086-colon-path-sep.stderr | 45 +- tests/ui/parser/issues/issue-90993.stderr | 15 +- ...9625-enum-struct-mutually-exclusive.stderr | 5 +- ...-99910-const-let-mutually-exclusive.stderr | 10 +- .../issues/recover-ge-as-fat-arrow.stderr | 5 +- tests/ui/parser/item-kw-case-mismatch.stderr | 70 +- tests/ui/parser/kw-in-trait-bounds.stderr | 20 +- tests/ui/parser/lifetime-in-pattern.stderr | 5 +- tests/ui/parser/lifetime-semicolon.stderr | 5 +- .../parser/macros-no-semicolon-items.stderr | 5 +- tests/ui/parser/match-arm-without-body.stderr | 3 +- .../ui/parser/match-arm-without-braces.stderr | 5 +- .../ui/parser/missing-fn-issue-65381-2.stderr | 5 +- tests/ui/parser/mut-patterns.stderr | 20 +- tests/ui/parser/not-a-pred.stderr | 5 +- .../ui/parser/public-instead-of-pub-1.stderr | 5 +- .../ui/parser/public-instead-of-pub-3.stderr | 5 +- tests/ui/parser/public-instead-of-pub.stderr | 5 +- .../range-inclusive-extra-equals.stderr | 5 +- .../parser/range_inclusive_dotdotdot.stderr | 40 +- .../recover-assoc-lifetime-constraint.stderr | 5 +- .../recover-fn-trait-from-fn-kw.stderr | 10 +- ...recover-for-loop-parens-around-head.stderr | 5 +- .../recover/recover-from-bad-variant.stderr | 10 +- .../recover/recover-from-homoglyph.stderr | 5 +- .../parser/recover/recover-range-pats.stderr | 25 +- .../parser/recover/recover-ref-dyn-mut.stderr | 5 +- .../turbofish-arg-with-stray-colon.stderr | 5 +- .../unicode-double-equals-recovery.stderr | 10 +- .../removed-syntax/removed-syntax-box.stderr | 25 +- tests/ui/parser/suggest-assoc-const.stderr | 5 +- ...gest-remove-compount-assign-let-ice.stderr | 5 +- .../parser/trailing-question-in-type.stderr | 10 +- .../parser/type-ascription-in-pattern.stderr | 10 +- .../typod-const-in-const-param-def.stderr | 20 +- .../parser/unicode-character-literal.stderr | 15 +- tests/ui/parser/unicode-chars.stderr | 10 +- .../parser/unicode-control-codepoints.stderr | 35 +- tests/ui/parser/unicode-quote-chars.stderr | 10 +- tests/ui/parser/unnecessary-let.stderr | 5 +- tests/ui/parser/use-colon-as-mod-sep.stderr | 20 +- tests/ui/parser/utf16-be-without-bom.stderr | 5 +- tests/ui/parser/utf16-le-without-bom.stderr | 5 +- ...ld-before-at-syntactically-rejected.stderr | 15 +- ...rect-placement-of-pattern-modifiers.stderr | 5 +- tests/ui/pattern/issue-72574-1.stderr | 5 +- tests/ui/pattern/issue-72574-2.stderr | 5 +- tests/ui/pattern/issue-74539.stderr | 5 +- tests/ui/pattern/issue-74702.stderr | 5 +- ...e-80186-mut-binding-help-suggestion.stderr | 5 +- .../pat-tuple-field-count-cross.stderr | 50 +- tests/ui/pattern/pat-tuple-overfield.stderr | 70 +- tests/ui/pattern/pat-tuple-underfield.stderr | 15 +- .../patkind-ref-binding-issue-114896.stderr | 5 +- .../patkind-ref-binding-issue-122415.stderr | 5 +- .../pattern/pattern-bad-ref-box-order.stderr | 5 +- .../ui/pattern/pattern-error-continue.stderr | 10 +- ...tern-meant-to-be-slice-rest-pattern.stderr | 15 +- .../ui/pattern/slice-pattern-refutable.stderr | 10 +- .../pattern/slice-patterns-ambiguity.stderr | 10 +- .../usefulness/doc-hidden-fields.stderr | 30 +- .../usefulness/stable-gated-fields.stderr | 10 +- .../usefulness/unstable-gated-fields.stderr | 20 +- tests/ui/pptypedef.stderr | 10 +- tests/ui/privacy/issue-75907.stderr | 5 +- tests/ui/privacy/privacy-in-paths.stderr | 5 +- tests/ui/privacy/privacy-ns1.stderr | 15 +- tests/ui/privacy/privacy-ns2.stderr | 10 +- tests/ui/privacy/privacy1.stderr | 10 +- tests/ui/privacy/privacy5.stderr | 50 +- .../sealed-traits/re-exported-trait.stderr | 5 +- tests/ui/privacy/suggest-box-new.stderr | 112 ++- .../suggest-making-field-public.stderr | 10 +- .../proc-macro/disappearing-resolution.stderr | 5 +- tests/ui/proc-macro/issue-66286.stderr | 5 +- .../issue-86781-bad-inner-doc.stderr | 5 +- tests/ui/pub/pub-ident-fn-or-struct.stderr | 5 +- tests/ui/pub/pub-restricted.stderr | 25 +- .../qualified/qualified-path-params-2.stderr | 5 +- .../region-object-lifetime-in-coercion.stderr | 20 +- .../regions-close-object-into-object-2.stderr | 10 +- .../regions-close-object-into-object-4.stderr | 10 +- .../regions/regions-proc-bound-capture.stderr | 10 +- tests/ui/repeat-expr/repeat_count.stderr | 10 +- tests/ui/resolve/issue-101749.stderr | 5 +- tests/ui/resolve/issue-103202.stderr | 5 +- tests/ui/resolve/issue-103474.stderr | 5 +- ...ue-112472-multi-generics-suggestion.stderr | 10 +- tests/ui/resolve/issue-18252.stderr | 5 +- tests/ui/resolve/issue-22692.stderr | 15 +- tests/ui/resolve/issue-35675.stderr | 10 +- tests/ui/resolve/issue-3907.stderr | 3 +- tests/ui/resolve/issue-39226.stderr | 10 +- tests/ui/resolve/issue-42944.stderr | 5 +- tests/ui/resolve/issue-5035.stderr | 8 +- tests/ui/resolve/issue-5099.stderr | 15 +- tests/ui/resolve/issue-55673.stderr | 15 +- tests/ui/resolve/issue-73427.stderr | 60 +- tests/ui/resolve/privacy-enum-ctor.stderr | 55 +- tests/ui/resolve/privacy-struct-ctor.stderr | 10 +- ...nflict-extern-crate-vs-extern-crate.stderr | 3 +- ...lve-conflict-import-vs-extern-crate.stderr | 5 +- .../resolve/resolve-inconsistent-names.stderr | 10 +- .../resolve/resolve-variant-assoc-item.stderr | 15 +- ...uggest-path-instead-of-mod-dot-item.stderr | 20 +- ...e-with-name-similar-to-struct-field.stderr | 25 +- .../typo-suggestion-mistyped-in-path.stderr | 10 +- ...xed-closure-sugar-nonexistent-trait.stderr | 3 +- .../rfc-2008-non-exhaustive/struct.stderr | 15 +- .../rfc-2008-non-exhaustive/variant.stderr | 10 +- .../not-allowed.stderr | 5 +- .../rfc-2396-target_feature-11/fn-ptr.stderr | 5 +- .../ice-119717-constant-lifetime.stderr | 5 +- tests/ui/rmeta/rmeta_meta_main.stderr | 5 +- tests/ui/rust-2018/remove-extern-crate.stderr | 10 +- .../rust-2018/trait-import-suggestions.stderr | 20 +- .../future-prelude-collision-shadow.stderr | 5 +- .../arbitrary_self_type_mut_difference.stderr | 10 +- tests/ui/self/self-infer.stderr | 10 +- .../portable-intrinsics-arent-exposed.stderr | 5 +- tests/ui/span/issue-35987.stderr | 10 +- tests/ui/span/issue-37767.stderr | 30 +- ...4-unknown-receiver-type.generic_arg.stderr | 5 +- tests/ui/span/issue-81800.stderr | 5 +- tests/ui/span/missing-unit-argument.stderr | 30 +- ...lity-attribute-implies-using-stable.stderr | 5 +- ...ty-attribute-implies-using-unstable.stderr | 5 +- ...lity-attribute-implies-using-stable.stderr | 5 +- ...ty-attribute-implies-using-unstable.stderr | 5 +- .../reference-to-mut-static-safe.e2021.stderr | 5 +- .../reference-to-mut-static-safe.e2024.stderr | 5 +- .../reference-to-mut-static-unsafe-fn.stderr | 20 +- .../reference-to-mut-static.e2021.stderr | 25 +- .../reference-to-mut-static.e2024.stderr | 25 +- .../ui/static/safe-extern-statics-mut.stderr | 10 +- .../ui/static/static-reference-to-fn-1.stderr | 5 +- tests/ui/statics/issue-15261.stderr | 5 +- tests/ui/statics/static-mut-xc.stderr | 10 +- tests/ui/statics/static-recursive.stderr | 5 +- tests/ui/str/str-as-char.stderr | 5 +- tests/ui/structs-enums/issue-103869.stderr | 5 +- ...enum-ignoring-field-with-underscore.stderr | 5 +- tests/ui/structs/struct-field-cfg.stderr | 10 +- .../struct-fields-hints-no-dupe.stderr | 5 +- tests/ui/structs/struct-fields-hints.stderr | 5 +- tests/ui/structs/struct-fields-typo.stderr | 5 +- .../structs/struct-pat-derived-error.stderr | 15 +- .../struct-path-self-type-mismatch.stderr | 5 +- .../structs/struct-tuple-field-names.stderr | 20 +- .../ui/structs/suggest-private-fields.stderr | 15 +- ...ing-field-when-specifying-same-type.stderr | 40 +- .../args-instead-of-tuple-errors.stderr | 5 +- .../suggestions/args-instead-of-tuple.stderr | 5 +- .../assoc-ct-for-assoc-method.stderr | 10 +- tests/ui/suggestions/bad-hex-float-lit.stderr | 30 +- .../bad-infer-in-trait-impl.stderr | 5 +- .../suggestions/bool_typo_err_suggest.stderr | 10 +- tests/ui/suggestions/bound-suggestions.stderr | 5 +- .../suggestions/crate-or-module-typo.stderr | 15 +- tests/ui/suggestions/deref-path-method.stderr | 5 +- .../dont-suggest-try_into-in-macros.stderr | 5 +- tests/ui/suggestions/field-access.stderr | 20 +- tests/ui/suggestions/fn-to-method.stderr | 5 +- ...ice-unwrap-probe-many-result-125876.stderr | 5 +- .../imm-ref-trait-object-literal.stderr | 5 +- .../impl-trait-missing-lifetime-gated.stderr | 50 +- .../impl-trait-missing-lifetime.stderr | 20 +- .../impl-trait-with-missing-bounds.stderr | 30 +- .../suggestions/incorrect-variant-literal.svg | 918 ++++++++++-------- tests/ui/suggestions/issue-101465.stderr | 5 +- tests/ui/suggestions/issue-102972.stderr | 10 +- tests/ui/suggestions/issue-109195.stderr | 30 +- tests/ui/suggestions/issue-109291.stderr | 5 +- ...ait-with-missing-bounds-on-async-fn.stderr | 10 +- tests/ui/suggestions/issue-84592.stderr | 5 +- tests/ui/suggestions/issue-89064.stderr | 5 +- tests/ui/suggestions/issue-89640.stderr | 5 +- tests/ui/suggestions/issue-90974.stderr | 5 +- tests/ui/suggestions/issue-94171.stderr | 5 +- .../suggestions/js-style-comparison-op.stderr | 10 +- .../let-binding-init-expr-as-ty.stderr | 10 +- .../suggestions/lifetimes/issue-105544.stderr | 20 +- .../missing-lifetimes-in-signature.stderr | 15 +- .../type-param-missing-lifetime.stderr | 10 +- ...sing-impl-trait-block-but-not-ascii.stderr | 5 +- ...eric-to-trait-in-method-with-params.stderr | 5 +- tests/ui/suggestions/multibyte-escapes.stderr | 10 +- .../nested-non-tuple-tuple-struct.stderr | 40 +- ...it-should-use-self-2021-without-dyn.stderr | 30 +- ...t-unsafe-trait-should-use-self-2021.stderr | 10 +- ...object-unsafe-trait-should-use-self.stderr | 10 +- ...unsafe-trait-should-use-where-sized.stderr | 10 +- .../parenthesized-deref-suggestion.stderr | 5 +- .../range-index-instead-of-colon.stderr | 5 +- .../suggestions/raw-byte-string-prefix.stderr | 5 +- ...-turbofish-surrounding-angle-braket.stderr | 15 +- .../shadowed-lplace-method-2.stderr | 5 +- .../suggestions/shadowed-lplace-method.stderr | 5 +- .../suggestions/silenced-binding-typo.stderr | 5 +- ...t-field-type-including-single-colon.stderr | 10 +- .../suggest-blanket-impl-local-trait.stderr | 25 +- .../ui/suggestions/suggest-change-mut.stderr | 5 +- .../suggest-closure-return-type-1.stderr | 5 +- .../suggest-field-through-deref.stderr | 20 +- .../suggest-let-for-assignment.stderr | 10 +- tests/ui/suggestions/suggest-methods.stderr | 15 +- .../ui/suggestions/suggest-move-types.stderr | 40 +- tests/ui/suggestions/suggest-null-ptr.stderr | 20 +- tests/ui/suggestions/suggest-ref-mut.stderr | 5 +- .../ui/suggestions/suggest-slice-swap.stderr | 5 +- ...ping-self-ty-and-trait-edition-2021.stderr | 15 +- .../suggest-swapping-self-ty-and-trait.stderr | 15 +- .../suggest-trait-in-ufcs-in-hrtb.stderr | 10 +- .../suggest-tryinto-edition-change.stderr | 10 +- .../ui/suggestions/suggest-using-chars.stderr | 15 +- tests/ui/suggestions/suggest-variants.stderr | 20 +- .../suggest_print_over_printf.stderr | 5 +- .../type-ascription-instead-of-path-2.stderr | 5 +- ...-ascription-instead-of-path-in-type.stderr | 5 +- .../type-mismatch-byte-literal.stderr | 15 +- ...e-mismatch-struct-field-shorthand-2.stderr | 5 +- ...sary_dot_for_floating_point_literal.stderr | 15 +- .../inaccessible-test-modules.stderr | 5 +- tests/ui/test-attrs/issue-109816.stderr | 3 +- .../test-attr-non-associated-functions.stderr | 6 +- tests/ui/test-attrs/test-on-not-fn.stderr | 60 +- ...gument-with-unnecessary-method-call.stderr | 5 +- tests/ui/traits/alias/ambiguous.stderr | 10 +- .../alias/dont-elaborate-non-self.stderr | 5 +- ...suggest-trait-alias-instead-of-type.stderr | 3 +- .../assoc_type_bound_with_struct.stderr | 40 +- .../bound/not-on-bare-trait-2021.stderr | 10 +- .../ui/traits/bound/not-on-bare-trait.stderr | 5 +- tests/ui/traits/bound/not-on-struct.stderr | 5 +- ...s-by-name-in-suggestion-issue-96292.stderr | 5 +- tests/ui/traits/issue-28576.stderr | 5 +- tests/ui/traits/issue-35869.stderr | 20 +- tests/ui/traits/issue-50480.stderr | 5 +- tests/ui/traits/issue-77982.stderr | 5 +- tests/ui/traits/issue-78372.stderr | 5 +- tests/ui/traits/item-privacy.stderr | 20 +- ...gument-mismatch-variance-ice-119867.stderr | 5 +- tests/ui/traits/multidispatch-bad.stderr | 5 +- .../missing-assoc-item.stderr | 5 +- .../type-match-with-late-bound.stderr | 15 +- ...t-non-existing-fully-qualified-path.stderr | 5 +- .../suggest-fully-qualified-closure.stderr | 5 +- ...ully-qualified-path-with-adjustment.stderr | 45 +- ...y-qualified-path-without-adjustment.stderr | 55 +- .../trait-upcasting/subtrait-method.stderr | 25 +- .../traits/wrong-mul-method-signature.stderr | 15 +- tests/ui/tuple/tuple-index-not-tuple.stderr | 5 +- .../ui/tuple/tuple-index-out-of-bounds.stderr | 5 +- .../enum-variant-generic-args.stderr | 30 +- ...priority-higher-than-other-inherent.stderr | 5 +- .../unnameable_type.stderr | 5 +- ...solved-assoc-ty-suggest-trait.eager.stderr | 5 +- ...esolved-assoc-ty-suggest-trait.lazy.stderr | 5 +- tests/ui/type/issue-100584.stderr | 10 +- tests/ui/type/issue-103271.stderr | 10 +- ...ascription-instead-of-statement-end.stderr | 5 +- .../type/type-ascription-with-fn-call.stderr | 5 +- tests/ui/type/type-check/issue-41314.stderr | 5 +- .../type-check/point-at-inference-3.stderr | 5 +- .../type-check/point-at-inference-4.stderr | 10 +- .../type-dependent-def-issue-49241.stderr | 5 +- ...call-return-type-due-to-generic-arg.stderr | 20 +- tests/ui/typeck/check-args-on-fn-err-2.stderr | 5 +- tests/ui/typeck/cyclic_type_ice.stderr | 5 +- tests/ui/typeck/deref-multi.stderr | 10 +- .../ice-self-mismatch-const-generics.stderr | 10 +- .../ice-unexpected-region-123863.stderr | 5 +- tests/ui/typeck/issue-104582.stderr | 10 +- tests/ui/typeck/issue-110052.stderr | 10 +- .../issue-112252-ptr-arithmetics-help.stderr | 20 +- ...sue-114529-illegal-break-with-value.stderr | 17 +- tests/ui/typeck/issue-29181.stderr | 5 +- tests/ui/typeck/issue-53712.stderr | 5 +- ...-missing-inaccessible-field-pattern.stderr | 10 +- tests/ui/typeck/method-chain-gats.stderr | 5 +- .../typeck/mismatched-map-under-self.stderr | 5 +- .../ptr-null-mutability-suggestions.stderr | 5 +- .../remove-semi-but-confused-char.stderr | 5 +- tests/ui/typeck/struct-enum-wrong-args.stderr | 20 +- .../suggest-arg-comma-delete-ice.stderr | 5 +- .../typeck_type_placeholder_item.stderr | 120 ++- tests/ui/typeof/issue-100183.stderr | 5 +- tests/ui/typeof/issue-29184.stderr | 5 +- tests/ui/typeof/issue-42060.stderr | 10 +- tests/ui/typeof/type_mismatch.stderr | 10 +- tests/ui/ufcs/bad-builder.stderr | 5 +- tests/ui/ufcs/ufcs-explicit-self-bad.stderr | 5 +- tests/ui/ufcs/ufcs-partially-resolved.stderr | 17 +- tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr | 10 +- ...oxed-closure-sugar-used-on-struct-3.stderr | 5 +- .../unboxed-closures-type-mismatch.stderr | 20 +- .../in-fn-return-illegal.stderr | 5 +- .../underscore-lifetime-binders.stderr | 15 +- ...underscore-lifetime-elison-mismatch.stderr | 5 +- tests/ui/union/union-suggest-field.stderr | 10 +- .../unresolved/unresolved-candidates.stderr | 5 +- ...import-avoid-suggesting-global-path.stderr | 10 +- ...rt-suggest-disambiguated-crate-name.stderr | 5 +- tests/ui/unsigned-literal-negation.stderr | 15 +- tests/ui/unsized/box-instead-of-dyn-fn.stderr | 5 +- tests/ui/unsized/issue-91803.stderr | 5 +- tests/ui/variants/variant-used-as-type.stderr | 20 +- ...ir-wf-check-anon-const-issue-122199.stderr | 5 +- 918 files changed, 9169 insertions(+), 6138 deletions(-) diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 9ce5d77ef6c07..04cea77fbc647 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -1828,7 +1828,7 @@ impl HumanEmitter { for (complete, parts, highlights, _) in suggestions.iter().take(MAX_SUGGESTIONS) { debug!(?complete, ?parts, ?highlights); - let has_deletion = parts.iter().any(|p| p.is_deletion(sm)); + let has_deletion = parts.iter().any(|p| p.is_deletion(sm) || p.is_replacement(sm)); let is_multiline = complete.lines().count() > 1; if let Some(span) = span.primary_span() { diff --git a/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr b/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr index 129fab5ff97a6..f0d7104a57dd0 100644 --- a/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr +++ b/src/tools/clippy/tests/ui-toml/dbg_macro/dbg_macro.stderr @@ -8,8 +8,9 @@ LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n } = help: to override `-D warnings` add `#[allow(clippy::dbg_macro)]` help: remove the invocation before committing it to a version control system | -LL | if let Some(n) = n.checked_sub(4) { n } else { n } - | ~~~~~~~~~~~~~~~~ +LL - if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n } +LL + if let Some(n) = n.checked_sub(4) { n } else { n } + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui-toml/dbg_macro/dbg_macro.rs:10:8 @@ -19,8 +20,9 @@ LL | if dbg!(n <= 1) { | help: remove the invocation before committing it to a version control system | -LL | if n <= 1 { - | ~~~~~~ +LL - if dbg!(n <= 1) { +LL + if n <= 1 { + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui-toml/dbg_macro/dbg_macro.rs:11:9 @@ -30,7 +32,8 @@ LL | dbg!(1) | help: remove the invocation before committing it to a version control system | -LL | 1 +LL - dbg!(1) +LL + 1 | error: the `dbg!` macro is intended as a debugging tool @@ -41,7 +44,8 @@ LL | dbg!(n * factorial(n - 1)) | help: remove the invocation before committing it to a version control system | -LL | n * factorial(n - 1) +LL - dbg!(n * factorial(n - 1)) +LL + n * factorial(n - 1) | error: the `dbg!` macro is intended as a debugging tool @@ -52,8 +56,9 @@ LL | dbg!(42); | help: remove the invocation before committing it to a version control system | -LL | 42; - | ~~ +LL - dbg!(42); +LL + 42; + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui-toml/dbg_macro/dbg_macro.rs:19:14 @@ -63,8 +68,9 @@ LL | foo(3) + dbg!(factorial(4)); | help: remove the invocation before committing it to a version control system | -LL | foo(3) + factorial(4); - | ~~~~~~~~~~~~ +LL - foo(3) + dbg!(factorial(4)); +LL + foo(3) + factorial(4); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui-toml/dbg_macro/dbg_macro.rs:20:5 @@ -74,8 +80,9 @@ LL | dbg!(1, 2, 3, 4, 5); | help: remove the invocation before committing it to a version control system | -LL | (1, 2, 3, 4, 5); - | ~~~~~~~~~~~~~~~ +LL - dbg!(1, 2, 3, 4, 5); +LL + (1, 2, 3, 4, 5); + | error: aborting due to 7 previous errors diff --git a/src/tools/clippy/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr b/src/tools/clippy/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr index a6e0ad0f804c8..8ba237ee75cf5 100644 --- a/src/tools/clippy/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr +++ b/src/tools/clippy/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr @@ -8,8 +8,9 @@ LL | /// TestItemThingyOfCoolness might sound cool but is not on the list and sh = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]` help: try | -LL | /// `TestItemThingyOfCoolness` might sound cool but is not on the list and should be linted. - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// TestItemThingyOfCoolness might sound cool but is not on the list and should be linted. +LL + /// `TestItemThingyOfCoolness` might sound cool but is not on the list and should be linted. + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr b/src/tools/clippy/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr index d4d8a579798c8..9f2d7cf54e0de 100644 --- a/src/tools/clippy/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr +++ b/src/tools/clippy/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr @@ -8,8 +8,9 @@ LL | /// OAuth and LaTeX are inside Clippy's default list. = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]` help: try | -LL | /// `OAuth` and LaTeX are inside Clippy's default list. - | ~~~~~~~ +LL - /// OAuth and LaTeX are inside Clippy's default list. +LL + /// `OAuth` and LaTeX are inside Clippy's default list. + | error: item in documentation is missing backticks --> tests/ui-toml/doc_valid_idents_replace/doc_markdown.rs:6:15 @@ -19,8 +20,9 @@ LL | /// OAuth and LaTeX are inside Clippy's default list. | help: try | -LL | /// OAuth and `LaTeX` are inside Clippy's default list. - | ~~~~~~~ +LL - /// OAuth and LaTeX are inside Clippy's default list. +LL + /// OAuth and `LaTeX` are inside Clippy's default list. + | error: item in documentation is missing backticks --> tests/ui-toml/doc_valid_idents_replace/doc_markdown.rs:9:5 @@ -30,8 +32,9 @@ LL | /// TestItemThingyOfCoolness might sound cool but is not on the list and sh | help: try | -LL | /// `TestItemThingyOfCoolness` might sound cool but is not on the list and should be linted. - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// TestItemThingyOfCoolness might sound cool but is not on the list and should be linted. +LL + /// `TestItemThingyOfCoolness` might sound cool but is not on the list and should be linted. + | error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui-toml/enum_variant_size/enum_variant_size.stderr b/src/tools/clippy/tests/ui-toml/enum_variant_size/enum_variant_size.stderr index 8f7ebbd9546ca..020b3cc787823 100644 --- a/src/tools/clippy/tests/ui-toml/enum_variant_size/enum_variant_size.stderr +++ b/src/tools/clippy/tests/ui-toml/enum_variant_size/enum_variant_size.stderr @@ -14,8 +14,9 @@ LL | | } = help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]` help: consider boxing the large fields to reduce the total size of the enum | -LL | B(Box<[u8; 501]>), - | ~~~~~~~~~~~~~~ +LL - B([u8; 501]), +LL + B(Box<[u8; 501]>), + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr b/src/tools/clippy/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr index 3ea600c7d7b0c..b8367489c5711 100644 --- a/src/tools/clippy/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr +++ b/src/tools/clippy/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr @@ -11,12 +11,14 @@ LL | #![deny(clippy::index_refutable_slice)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a slice pattern here | -LL | if let Some([_, _, _, _, _, _, _, slice_7, ..]) = slice { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(slice) = slice { +LL + if let Some([_, _, _, _, _, _, _, slice_7, ..]) = slice { + | help: and replace the index expressions here | -LL | println!("{}", slice_7); - | ~~~~~~~ +LL - println!("{}", slice[7]); +LL + println!("{}", slice_7); + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr b/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr index 2d700f6075926..de9f17520ff71 100644 --- a/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr +++ b/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr @@ -33,8 +33,9 @@ LL | fn hash_slice(date: &[Self], states: &mut H) { | help: consider using the default names | -LL | fn hash_slice(data: &[Self], state: &mut H) { - | ~~~~ ~~~~~ +LL - fn hash_slice(date: &[Self], states: &mut H) { +LL + fn hash_slice(data: &[Self], state: &mut H) { + | error: renamed function parameter of trait impl --> tests/ui-toml/renamed_function_params/renamed_function_params.rs:80:18 diff --git a/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr b/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr index e57554fa613ac..bdc4eeaad80f4 100644 --- a/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr +++ b/src/tools/clippy/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr @@ -27,8 +27,9 @@ LL | fn hash_slice(date: &[Self], states: &mut H) { | help: consider using the default names | -LL | fn hash_slice(data: &[Self], state: &mut H) { - | ~~~~ ~~~~~ +LL - fn hash_slice(date: &[Self], states: &mut H) { +LL + fn hash_slice(data: &[Self], state: &mut H) { + | error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.stderr b/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.stderr index 320578bfabce0..6c3e360016699 100644 --- a/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.stderr +++ b/src/tools/clippy/tests/ui-toml/unwrap_used/unwrap_used.stderr @@ -8,8 +8,9 @@ LL | let _ = boxed_slice.get(1).unwrap(); = help: to override `-D warnings` add `#[allow(clippy::get_unwrap)]` help: using `[]` is clearer and more concise | -LL | let _ = &boxed_slice[1]; - | ~~~~~~~~~~~~~~~ +LL - let _ = boxed_slice.get(1).unwrap(); +LL + let _ = &boxed_slice[1]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:38:17 @@ -30,8 +31,9 @@ LL | let _ = some_slice.get(0).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_slice[0]; - | ~~~~~~~~~~~~~~ +LL - let _ = some_slice.get(0).unwrap(); +LL + let _ = &some_slice[0]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:39:17 @@ -50,8 +52,9 @@ LL | let _ = some_vec.get(0).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_vec[0]; - | ~~~~~~~~~~~~ +LL - let _ = some_vec.get(0).unwrap(); +LL + let _ = &some_vec[0]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:40:17 @@ -70,8 +73,9 @@ LL | let _ = some_vecdeque.get(0).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_vecdeque[0]; - | ~~~~~~~~~~~~~~~~~ +LL - let _ = some_vecdeque.get(0).unwrap(); +LL + let _ = &some_vecdeque[0]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:41:17 @@ -90,8 +94,9 @@ LL | let _ = some_hashmap.get(&1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_hashmap[&1]; - | ~~~~~~~~~~~~~~~~~ +LL - let _ = some_hashmap.get(&1).unwrap(); +LL + let _ = &some_hashmap[&1]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:42:17 @@ -110,8 +115,9 @@ LL | let _ = some_btreemap.get(&1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_btreemap[&1]; - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = some_btreemap.get(&1).unwrap(); +LL + let _ = &some_btreemap[&1]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:43:17 @@ -130,8 +136,9 @@ LL | let _: u8 = *boxed_slice.get(1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _: u8 = boxed_slice[1]; - | ~~~~~~~~~~~~~~ +LL - let _: u8 = *boxed_slice.get(1).unwrap(); +LL + let _: u8 = boxed_slice[1]; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:47:22 @@ -150,8 +157,9 @@ LL | *boxed_slice.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | boxed_slice[0] = 1; - | ~~~~~~~~~~~~~~ +LL - *boxed_slice.get_mut(0).unwrap() = 1; +LL + boxed_slice[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:52:10 @@ -170,8 +178,9 @@ LL | *some_slice.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | some_slice[0] = 1; - | ~~~~~~~~~~~~~ +LL - *some_slice.get_mut(0).unwrap() = 1; +LL + some_slice[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:53:10 @@ -190,8 +199,9 @@ LL | *some_vec.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | some_vec[0] = 1; - | ~~~~~~~~~~~ +LL - *some_vec.get_mut(0).unwrap() = 1; +LL + some_vec[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:54:10 @@ -210,8 +220,9 @@ LL | *some_vecdeque.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | some_vecdeque[0] = 1; - | ~~~~~~~~~~~~~~~~ +LL - *some_vecdeque.get_mut(0).unwrap() = 1; +LL + some_vecdeque[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:55:10 @@ -230,8 +241,9 @@ LL | let _ = some_vec.get(0..1).unwrap().to_vec(); | help: using `[]` is clearer and more concise | -LL | let _ = some_vec[0..1].to_vec(); - | ~~~~~~~~~~~~~~ +LL - let _ = some_vec.get(0..1).unwrap().to_vec(); +LL + let _ = some_vec[0..1].to_vec(); + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:67:17 @@ -250,8 +262,9 @@ LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec(); | help: using `[]` is clearer and more concise | -LL | let _ = some_vec[0..1].to_vec(); - | ~~~~~~~~~~~~~~ +LL - let _ = some_vec.get_mut(0..1).unwrap().to_vec(); +LL + let _ = some_vec[0..1].to_vec(); + | error: used `unwrap()` on an `Option` value --> tests/ui-toml/unwrap_used/unwrap_used.rs:68:17 @@ -270,8 +283,9 @@ LL | let _ = boxed_slice.get(1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &boxed_slice[1]; - | ~~~~~~~~~~~~~~~ +LL - let _ = boxed_slice.get(1).unwrap(); +LL + let _ = &boxed_slice[1]; + | error: called `.get().unwrap()` on a slice --> tests/ui-toml/unwrap_used/unwrap_used.rs:93:17 @@ -281,8 +295,9 @@ LL | let _ = Box::new([0]).get(1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &Box::new([0])[1]; - | ~~~~~~~~~~~~~~~~~ +LL - let _ = Box::new([0]).get(1).unwrap(); +LL + let _ = &Box::new([0])[1]; + | error: aborting due to 28 previous errors diff --git a/src/tools/clippy/tests/ui/assign_ops2.stderr b/src/tools/clippy/tests/ui/assign_ops2.stderr index ddeba2b2ff8f3..09b101b216a50 100644 --- a/src/tools/clippy/tests/ui/assign_ops2.stderr +++ b/src/tools/clippy/tests/ui/assign_ops2.stderr @@ -8,12 +8,14 @@ LL | a += a + 1; = help: to override `-D warnings` add `#[allow(clippy::misrefactored_assign_op)]` help: did you mean `a = a + 1` or `a = a + a + 1`? Consider replacing it with | -LL | a += 1; - | ~~~~~~ +LL - a += a + 1; +LL + a += 1; + | help: or | -LL | a = a + a + 1; - | ~~~~~~~~~~~~~ +LL - a += a + 1; +LL + a = a + a + 1; + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:11:5 @@ -23,12 +25,14 @@ LL | a += 1 + a; | help: did you mean `a = a + 1` or `a = a + 1 + a`? Consider replacing it with | -LL | a += 1; - | ~~~~~~ +LL - a += 1 + a; +LL + a += 1; + | help: or | -LL | a = a + 1 + a; - | ~~~~~~~~~~~~~ +LL - a += 1 + a; +LL + a = a + 1 + a; + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:13:5 @@ -38,12 +42,14 @@ LL | a -= a - 1; | help: did you mean `a = a - 1` or `a = a - (a - 1)`? Consider replacing it with | -LL | a -= 1; - | ~~~~~~ +LL - a -= a - 1; +LL + a -= 1; + | help: or | -LL | a = a - (a - 1); - | ~~~~~~~~~~~~~~~ +LL - a -= a - 1; +LL + a = a - (a - 1); + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:15:5 @@ -53,12 +59,14 @@ LL | a *= a * 99; | help: did you mean `a = a * 99` or `a = a * a * 99`? Consider replacing it with | -LL | a *= 99; - | ~~~~~~~ +LL - a *= a * 99; +LL + a *= 99; + | help: or | -LL | a = a * a * 99; - | ~~~~~~~~~~~~~~ +LL - a *= a * 99; +LL + a = a * a * 99; + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:17:5 @@ -68,12 +76,14 @@ LL | a *= 42 * a; | help: did you mean `a = a * 42` or `a = a * 42 * a`? Consider replacing it with | -LL | a *= 42; - | ~~~~~~~ +LL - a *= 42 * a; +LL + a *= 42; + | help: or | -LL | a = a * 42 * a; - | ~~~~~~~~~~~~~~ +LL - a *= 42 * a; +LL + a = a * 42 * a; + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:19:5 @@ -83,12 +93,14 @@ LL | a /= a / 2; | help: did you mean `a = a / 2` or `a = a / (a / 2)`? Consider replacing it with | -LL | a /= 2; - | ~~~~~~ +LL - a /= a / 2; +LL + a /= 2; + | help: or | -LL | a = a / (a / 2); - | ~~~~~~~~~~~~~~~ +LL - a /= a / 2; +LL + a = a / (a / 2); + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:21:5 @@ -98,12 +110,14 @@ LL | a %= a % 5; | help: did you mean `a = a % 5` or `a = a % (a % 5)`? Consider replacing it with | -LL | a %= 5; - | ~~~~~~ +LL - a %= a % 5; +LL + a %= 5; + | help: or | -LL | a = a % (a % 5); - | ~~~~~~~~~~~~~~~ +LL - a %= a % 5; +LL + a = a % (a % 5); + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:23:5 @@ -113,12 +127,14 @@ LL | a &= a & 1; | help: did you mean `a = a & 1` or `a = a & a & 1`? Consider replacing it with | -LL | a &= 1; - | ~~~~~~ +LL - a &= a & 1; +LL + a &= 1; + | help: or | -LL | a = a & a & 1; - | ~~~~~~~~~~~~~ +LL - a &= a & 1; +LL + a = a & a & 1; + | error: variable appears on both sides of an assignment operation --> tests/ui/assign_ops2.rs:25:5 @@ -128,12 +144,14 @@ LL | a *= a * a; | help: did you mean `a = a * a` or `a = a * a * a`? Consider replacing it with | -LL | a *= a; - | ~~~~~~ +LL - a *= a * a; +LL + a *= a; + | help: or | -LL | a = a * a * a; - | ~~~~~~~~~~~~~ +LL - a *= a * a; +LL + a = a * a * a; + | error: manual implementation of an assign operation --> tests/ui/assign_ops2.rs:63:5 diff --git a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr index 2adaecc96d6a9..8594b00f79ca4 100644 --- a/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr +++ b/src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr @@ -11,8 +11,9 @@ LL | #![deny(clippy::bind_instead_of_map)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `map` instead | -LL | let _ = Some("42").map(|s| if s.len() < 42 { 0 } else { s.len() }); - | ~~~ ~ ~~~~~~~ +LL - let _ = Some("42").and_then(|s| if s.len() < 42 { Some(0) } else { Some(s.len()) }); +LL + let _ = Some("42").map(|s| if s.len() < 42 { 0 } else { s.len() }); + | error: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)` --> tests/ui/bind_instead_of_map_multipart.rs:8:13 @@ -22,8 +23,9 @@ LL | let _ = Ok::<_, ()>("42").and_then(|s| if s.len() < 42 { Ok(0) } else { | help: use `map` instead | -LL | let _ = Ok::<_, ()>("42").map(|s| if s.len() < 42 { 0 } else { s.len() }); - | ~~~ ~ ~~~~~~~ +LL - let _ = Ok::<_, ()>("42").and_then(|s| if s.len() < 42 { Ok(0) } else { Ok(s.len()) }); +LL + let _ = Ok::<_, ()>("42").map(|s| if s.len() < 42 { 0 } else { s.len() }); + | error: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` --> tests/ui/bind_instead_of_map_multipart.rs:11:13 @@ -33,8 +35,9 @@ LL | let _ = Err::<(), _>("42").or_else(|s| if s.len() < 42 { Err(s.len() + | help: use `map_err` instead | -LL | let _ = Err::<(), _>("42").map_err(|s| if s.len() < 42 { s.len() + 20 } else { s.len() }); - | ~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~ +LL - let _ = Err::<(), _>("42").or_else(|s| if s.len() < 42 { Err(s.len() + 20) } else { Err(s.len()) }); +LL + let _ = Err::<(), _>("42").map_err(|s| if s.len() < 42 { s.len() + 20 } else { s.len() }); + | error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> tests/ui/bind_instead_of_map_multipart.rs:19:5 @@ -84,8 +87,9 @@ LL | let _ = Some("").and_then(|s| if s.len() == 20 { Some(m!()) } else { So | help: use `map` instead | -LL | let _ = Some("").map(|s| if s.len() == 20 { m!() } else { Some(20) }); - | ~~~ ~~~~ ~~~~~~~~ +LL - let _ = Some("").and_then(|s| if s.len() == 20 { Some(m!()) } else { Some(Some(20)) }); +LL + let _ = Some("").map(|s| if s.len() == 20 { m!() } else { Some(20) }); + | error: aborting due to 5 previous errors diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr index 7d3a5c84a8202..71f43af46c241 100644 --- a/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr +++ b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr @@ -8,12 +8,14 @@ LL | let x: &str = &*s; = help: to override `-D warnings` add `#[allow(clippy::borrow_deref_ref)]` help: if you would like to reborrow, try removing `&*` | -LL | let x: &str = s; - | ~ +LL - let x: &str = &*s; +LL + let x: &str = s; + | help: if you would like to deref, try using `&**` | -LL | let x: &str = &**s; - | ~~~~ +LL - let x: &str = &*s; +LL + let x: &str = &**s; + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/cast.stderr b/src/tools/clippy/tests/ui/cast.stderr index 7824bdfac25ef..948e872308771 100644 --- a/src/tools/clippy/tests/ui/cast.stderr +++ b/src/tools/clippy/tests/ui/cast.stderr @@ -81,8 +81,9 @@ LL | 1i32 as i8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i8::try_from(1i32); - | ~~~~~~~~~~~~~~~~~~ +LL - 1i32 as i8; +LL + i8::try_from(1i32); + | error: casting `i32` to `u8` may truncate the value --> tests/ui/cast.rs:53:5 @@ -93,8 +94,9 @@ LL | 1i32 as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u8::try_from(1i32); - | ~~~~~~~~~~~~~~~~~~ +LL - 1i32 as u8; +LL + u8::try_from(1i32); + | error: casting `f64` to `isize` may truncate the value --> tests/ui/cast.rs:55:5 @@ -127,8 +129,9 @@ LL | 1f32 as u32 as u16; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u16::try_from(1f32 as u32); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - 1f32 as u32 as u16; +LL + u16::try_from(1f32 as u32); + | error: casting `f32` to `u32` may truncate the value --> tests/ui/cast.rs:60:5 @@ -153,8 +156,9 @@ LL | let _x: i8 = 1i32 as _; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let _x: i8 = 1i32.try_into(); - | ~~~~~~~~~~~~~~~ +LL - let _x: i8 = 1i32 as _; +LL + let _x: i8 = 1i32.try_into(); + | error: casting `f32` to `i32` may truncate the value --> tests/ui/cast.rs:67:9 @@ -228,8 +232,9 @@ LL | 1usize as i8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i8::try_from(1usize); - | ~~~~~~~~~~~~~~~~~~~~ +LL - 1usize as i8; +LL + i8::try_from(1usize); + | error: casting `usize` to `i16` may truncate the value --> tests/ui/cast.rs:91:5 @@ -240,8 +245,9 @@ LL | 1usize as i16; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i16::try_from(1usize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1usize as i16; +LL + i16::try_from(1usize); + | error: casting `usize` to `i16` may wrap around the value on targets with 16-bit wide pointers --> tests/ui/cast.rs:91:5 @@ -261,8 +267,9 @@ LL | 1usize as i32; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i32::try_from(1usize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1usize as i32; +LL + i32::try_from(1usize); + | error: casting `usize` to `i32` may wrap around the value on targets with 32-bit wide pointers --> tests/ui/cast.rs:96:5 @@ -300,8 +307,9 @@ LL | 1u64 as isize; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | isize::try_from(1u64); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1u64 as isize; +LL + isize::try_from(1u64); + | error: casting `u64` to `isize` may wrap around the value on targets with 64-bit wide pointers --> tests/ui/cast.rs:112:5 @@ -360,8 +368,9 @@ LL | (-99999999999i64).min(1) as i8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i8::try_from((-99999999999i64).min(1)); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (-99999999999i64).min(1) as i8; +LL + i8::try_from((-99999999999i64).min(1)); + | error: casting `u64` to `u8` may truncate the value --> tests/ui/cast.rs:223:5 @@ -372,8 +381,9 @@ LL | 999999u64.clamp(0, 256) as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u8::try_from(999999u64.clamp(0, 256)); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - 999999u64.clamp(0, 256) as u8; +LL + u8::try_from(999999u64.clamp(0, 256)); + | error: casting `main::E2` to `u8` may truncate the value --> tests/ui/cast.rs:246:21 @@ -384,8 +394,9 @@ LL | let _ = self as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let _ = u8::try_from(self); - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = self as u8; +LL + let _ = u8::try_from(self); + | error: casting `main::E2::B` to `u8` will truncate the value --> tests/ui/cast.rs:248:21 @@ -405,8 +416,9 @@ LL | let _ = self as i8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let _ = i8::try_from(self); - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = self as i8; +LL + let _ = i8::try_from(self); + | error: casting `main::E5::A` to `i8` will truncate the value --> tests/ui/cast.rs:292:21 @@ -423,8 +435,9 @@ LL | let _ = self as i16; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let _ = i16::try_from(self); - | ~~~~~~~~~~~~~~~~~~~ +LL - let _ = self as i16; +LL + let _ = i16::try_from(self); + | error: casting `main::E7` to `usize` may truncate the value on targets with 32-bit wide pointers --> tests/ui/cast.rs:328:21 @@ -435,8 +448,9 @@ LL | let _ = self as usize; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let _ = usize::try_from(self); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = self as usize; +LL + let _ = usize::try_from(self); + | error: casting `main::E10` to `u16` may truncate the value --> tests/ui/cast.rs:375:21 @@ -447,8 +461,9 @@ LL | let _ = self as u16; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let _ = u16::try_from(self); - | ~~~~~~~~~~~~~~~~~~~ +LL - let _ = self as u16; +LL + let _ = u16::try_from(self); + | error: casting `u32` to `u8` may truncate the value --> tests/ui/cast.rs:386:13 @@ -459,8 +474,9 @@ LL | let c = (q >> 16) as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let c = u8::try_from(q >> 16); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - let c = (q >> 16) as u8; +LL + let c = u8::try_from(q >> 16); + | error: casting `u32` to `u8` may truncate the value --> tests/ui/cast.rs:390:13 @@ -471,8 +487,9 @@ LL | let c = (q / 1000) as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | let c = u8::try_from(q / 1000); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - let c = (q / 1000) as u8; +LL + let c = u8::try_from(q / 1000); + | error: casting `i32` to `u32` may lose the sign of the value --> tests/ui/cast.rs:402:9 @@ -674,8 +691,9 @@ LL | m!(); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) help: ... or use `try_from` and handle the error accordingly | -LL | let _ = u8::try_from(u32::MAX); // cast_possible_truncation - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = u32::MAX as u8; // cast_possible_truncation +LL + let _ = u8::try_from(u32::MAX); // cast_possible_truncation + | error: casting `f64` to `f32` may truncate the value --> tests/ui/cast.rs:475:21 @@ -698,7 +716,8 @@ LL | bar.unwrap().unwrap() as usize = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | usize::try_from(bar.unwrap().unwrap()) +LL - bar.unwrap().unwrap() as usize +LL + usize::try_from(bar.unwrap().unwrap()) | error: casting `i64` to `usize` may lose the sign of the value @@ -716,8 +735,9 @@ LL | (256 & 999999u64) as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u8::try_from(256 & 999999u64); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (256 & 999999u64) as u8; +LL + u8::try_from(256 & 999999u64); + | error: casting `u64` to `u8` may truncate the value --> tests/ui/cast.rs:501:5 @@ -728,8 +748,9 @@ LL | (255 % 999999u64) as u8; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u8::try_from(255 % 999999u64); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (255 % 999999u64) as u8; +LL + u8::try_from(255 % 999999u64); + | error: aborting due to 92 previous errors diff --git a/src/tools/clippy/tests/ui/cast_lossless_bool.stderr b/src/tools/clippy/tests/ui/cast_lossless_bool.stderr index 82d6b2e4b8e67..6899227176236 100644 --- a/src/tools/clippy/tests/ui/cast_lossless_bool.stderr +++ b/src/tools/clippy/tests/ui/cast_lossless_bool.stderr @@ -9,8 +9,9 @@ LL | let _ = true as u8; = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]` help: use `u8::from` instead | -LL | let _ = u8::from(true); - | ~~~~~~~~~~~~~~ +LL - let _ = true as u8; +LL + let _ = u8::from(true); + | error: casts from `bool` to `u16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:9:13 @@ -21,8 +22,9 @@ LL | let _ = true as u16; = help: an `as` cast can become silently lossy if the types change in the future help: use `u16::from` instead | -LL | let _ = u16::from(true); - | ~~~~~~~~~~~~~~~ +LL - let _ = true as u16; +LL + let _ = u16::from(true); + | error: casts from `bool` to `u32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:10:13 @@ -33,8 +35,9 @@ LL | let _ = true as u32; = help: an `as` cast can become silently lossy if the types change in the future help: use `u32::from` instead | -LL | let _ = u32::from(true); - | ~~~~~~~~~~~~~~~ +LL - let _ = true as u32; +LL + let _ = u32::from(true); + | error: casts from `bool` to `u64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:11:13 @@ -45,8 +48,9 @@ LL | let _ = true as u64; = help: an `as` cast can become silently lossy if the types change in the future help: use `u64::from` instead | -LL | let _ = u64::from(true); - | ~~~~~~~~~~~~~~~ +LL - let _ = true as u64; +LL + let _ = u64::from(true); + | error: casts from `bool` to `u128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:12:13 @@ -57,8 +61,9 @@ LL | let _ = true as u128; = help: an `as` cast can become silently lossy if the types change in the future help: use `u128::from` instead | -LL | let _ = u128::from(true); - | ~~~~~~~~~~~~~~~~ +LL - let _ = true as u128; +LL + let _ = u128::from(true); + | error: casts from `bool` to `usize` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:13:13 @@ -69,8 +74,9 @@ LL | let _ = true as usize; = help: an `as` cast can become silently lossy if the types change in the future help: use `usize::from` instead | -LL | let _ = usize::from(true); - | ~~~~~~~~~~~~~~~~~ +LL - let _ = true as usize; +LL + let _ = usize::from(true); + | error: casts from `bool` to `i8` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:15:13 @@ -81,8 +87,9 @@ LL | let _ = true as i8; = help: an `as` cast can become silently lossy if the types change in the future help: use `i8::from` instead | -LL | let _ = i8::from(true); - | ~~~~~~~~~~~~~~ +LL - let _ = true as i8; +LL + let _ = i8::from(true); + | error: casts from `bool` to `i16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:16:13 @@ -93,8 +100,9 @@ LL | let _ = true as i16; = help: an `as` cast can become silently lossy if the types change in the future help: use `i16::from` instead | -LL | let _ = i16::from(true); - | ~~~~~~~~~~~~~~~ +LL - let _ = true as i16; +LL + let _ = i16::from(true); + | error: casts from `bool` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:17:13 @@ -105,8 +113,9 @@ LL | let _ = true as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | let _ = i32::from(true); - | ~~~~~~~~~~~~~~~ +LL - let _ = true as i32; +LL + let _ = i32::from(true); + | error: casts from `bool` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:18:13 @@ -117,8 +126,9 @@ LL | let _ = true as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | let _ = i64::from(true); - | ~~~~~~~~~~~~~~~ +LL - let _ = true as i64; +LL + let _ = i64::from(true); + | error: casts from `bool` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:19:13 @@ -129,8 +139,9 @@ LL | let _ = true as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | let _ = i128::from(true); - | ~~~~~~~~~~~~~~~~ +LL - let _ = true as i128; +LL + let _ = i128::from(true); + | error: casts from `bool` to `isize` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:20:13 @@ -141,8 +152,9 @@ LL | let _ = true as isize; = help: an `as` cast can become silently lossy if the types change in the future help: use `isize::from` instead | -LL | let _ = isize::from(true); - | ~~~~~~~~~~~~~~~~~ +LL - let _ = true as isize; +LL + let _ = isize::from(true); + | error: casts from `bool` to `u16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:23:13 @@ -153,8 +165,9 @@ LL | let _ = (true | false) as u16; = help: an `as` cast can become silently lossy if the types change in the future help: use `u16::from` instead | -LL | let _ = u16::from(true | false); - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = (true | false) as u16; +LL + let _ = u16::from(true | false); + | error: casts from `bool` to `u8` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:25:13 @@ -165,8 +178,9 @@ LL | let _ = true as U8; = help: an `as` cast can become silently lossy if the types change in the future help: use `U8::from` instead | -LL | let _ = U8::from(true); - | ~~~~~~~~~~~~~~ +LL - let _ = true as U8; +LL + let _ = U8::from(true); + | error: casts from `bool` to `u8` can be expressed infallibly using `From` --> tests/ui/cast_lossless_bool.rs:53:13 @@ -177,8 +191,9 @@ LL | let _ = true as u8; = help: an `as` cast can become silently lossy if the types change in the future help: use `u8::from` instead | -LL | let _ = u8::from(true); - | ~~~~~~~~~~~~~~ +LL - let _ = true as u8; +LL + let _ = u8::from(true); + | error: aborting due to 15 previous errors diff --git a/src/tools/clippy/tests/ui/cast_lossless_float.stderr b/src/tools/clippy/tests/ui/cast_lossless_float.stderr index b36f8bcecf583..3f405e3f402f4 100644 --- a/src/tools/clippy/tests/ui/cast_lossless_float.stderr +++ b/src/tools/clippy/tests/ui/cast_lossless_float.stderr @@ -9,8 +9,9 @@ LL | let _ = x0 as f32; = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]` help: use `f32::from` instead | -LL | let _ = f32::from(x0); - | ~~~~~~~~~~~~~ +LL - let _ = x0 as f32; +LL + let _ = f32::from(x0); + | error: casts from `i8` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:13:13 @@ -21,8 +22,9 @@ LL | let _ = x0 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(x0); - | ~~~~~~~~~~~~~ +LL - let _ = x0 as f64; +LL + let _ = f64::from(x0); + | error: casts from `i8` to `f32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:14:13 @@ -33,8 +35,9 @@ LL | let _ = x0 as F32; = help: an `as` cast can become silently lossy if the types change in the future help: use `F32::from` instead | -LL | let _ = F32::from(x0); - | ~~~~~~~~~~~~~ +LL - let _ = x0 as F32; +LL + let _ = F32::from(x0); + | error: casts from `i8` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:15:13 @@ -45,8 +48,9 @@ LL | let _ = x0 as F64; = help: an `as` cast can become silently lossy if the types change in the future help: use `F64::from` instead | -LL | let _ = F64::from(x0); - | ~~~~~~~~~~~~~ +LL - let _ = x0 as F64; +LL + let _ = F64::from(x0); + | error: casts from `u8` to `f32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:17:13 @@ -57,8 +61,9 @@ LL | let _ = x1 as f32; = help: an `as` cast can become silently lossy if the types change in the future help: use `f32::from` instead | -LL | let _ = f32::from(x1); - | ~~~~~~~~~~~~~ +LL - let _ = x1 as f32; +LL + let _ = f32::from(x1); + | error: casts from `u8` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:18:13 @@ -69,8 +74,9 @@ LL | let _ = x1 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(x1); - | ~~~~~~~~~~~~~ +LL - let _ = x1 as f64; +LL + let _ = f64::from(x1); + | error: casts from `i16` to `f32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:20:13 @@ -81,8 +87,9 @@ LL | let _ = x2 as f32; = help: an `as` cast can become silently lossy if the types change in the future help: use `f32::from` instead | -LL | let _ = f32::from(x2); - | ~~~~~~~~~~~~~ +LL - let _ = x2 as f32; +LL + let _ = f32::from(x2); + | error: casts from `i16` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:21:13 @@ -93,8 +100,9 @@ LL | let _ = x2 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(x2); - | ~~~~~~~~~~~~~ +LL - let _ = x2 as f64; +LL + let _ = f64::from(x2); + | error: casts from `u16` to `f32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:23:13 @@ -105,8 +113,9 @@ LL | let _ = x3 as f32; = help: an `as` cast can become silently lossy if the types change in the future help: use `f32::from` instead | -LL | let _ = f32::from(x3); - | ~~~~~~~~~~~~~ +LL - let _ = x3 as f32; +LL + let _ = f32::from(x3); + | error: casts from `u16` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:24:13 @@ -117,8 +126,9 @@ LL | let _ = x3 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(x3); - | ~~~~~~~~~~~~~ +LL - let _ = x3 as f64; +LL + let _ = f64::from(x3); + | error: casts from `i32` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:26:13 @@ -129,8 +139,9 @@ LL | let _ = x4 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(x4); - | ~~~~~~~~~~~~~ +LL - let _ = x4 as f64; +LL + let _ = f64::from(x4); + | error: casts from `u32` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:28:13 @@ -141,8 +152,9 @@ LL | let _ = x5 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(x5); - | ~~~~~~~~~~~~~ +LL - let _ = x5 as f64; +LL + let _ = f64::from(x5); + | error: casts from `f32` to `f64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_float.rs:31:13 @@ -153,8 +165,9 @@ LL | let _ = 1.0f32 as f64; = help: an `as` cast can become silently lossy if the types change in the future help: use `f64::from` instead | -LL | let _ = f64::from(1.0f32); - | ~~~~~~~~~~~~~~~~~ +LL - let _ = 1.0f32 as f64; +LL + let _ = f64::from(1.0f32); + | error: aborting due to 13 previous errors diff --git a/src/tools/clippy/tests/ui/cast_lossless_integer.stderr b/src/tools/clippy/tests/ui/cast_lossless_integer.stderr index c93ecb8fb5615..d2580913bb549 100644 --- a/src/tools/clippy/tests/ui/cast_lossless_integer.stderr +++ b/src/tools/clippy/tests/ui/cast_lossless_integer.stderr @@ -9,8 +9,9 @@ LL | 0u8 as u16; = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]` help: use `u16::from` instead | -LL | u16::from(0u8); - | ~~~~~~~~~~~~~~ +LL - 0u8 as u16; +LL + u16::from(0u8); + | error: casts from `u8` to `i16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:10:5 @@ -21,8 +22,9 @@ LL | 0u8 as i16; = help: an `as` cast can become silently lossy if the types change in the future help: use `i16::from` instead | -LL | i16::from(0u8); - | ~~~~~~~~~~~~~~ +LL - 0u8 as i16; +LL + i16::from(0u8); + | error: casts from `u8` to `u32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:12:5 @@ -33,8 +35,9 @@ LL | 0u8 as u32; = help: an `as` cast can become silently lossy if the types change in the future help: use `u32::from` instead | -LL | u32::from(0u8); - | ~~~~~~~~~~~~~~ +LL - 0u8 as u32; +LL + u32::from(0u8); + | error: casts from `u8` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:14:5 @@ -45,8 +48,9 @@ LL | 0u8 as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | i32::from(0u8); - | ~~~~~~~~~~~~~~ +LL - 0u8 as i32; +LL + i32::from(0u8); + | error: casts from `u8` to `u64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:16:5 @@ -57,8 +61,9 @@ LL | 0u8 as u64; = help: an `as` cast can become silently lossy if the types change in the future help: use `u64::from` instead | -LL | u64::from(0u8); - | ~~~~~~~~~~~~~~ +LL - 0u8 as u64; +LL + u64::from(0u8); + | error: casts from `u8` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:18:5 @@ -69,8 +74,9 @@ LL | 0u8 as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | i64::from(0u8); - | ~~~~~~~~~~~~~~ +LL - 0u8 as i64; +LL + i64::from(0u8); + | error: casts from `u8` to `u128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:20:5 @@ -81,8 +87,9 @@ LL | 0u8 as u128; = help: an `as` cast can become silently lossy if the types change in the future help: use `u128::from` instead | -LL | u128::from(0u8); - | ~~~~~~~~~~~~~~~ +LL - 0u8 as u128; +LL + u128::from(0u8); + | error: casts from `u8` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:22:5 @@ -93,8 +100,9 @@ LL | 0u8 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0u8); - | ~~~~~~~~~~~~~~~ +LL - 0u8 as i128; +LL + i128::from(0u8); + | error: casts from `u16` to `u32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:25:5 @@ -105,8 +113,9 @@ LL | 0u16 as u32; = help: an `as` cast can become silently lossy if the types change in the future help: use `u32::from` instead | -LL | u32::from(0u16); - | ~~~~~~~~~~~~~~~ +LL - 0u16 as u32; +LL + u32::from(0u16); + | error: casts from `u16` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:27:5 @@ -117,8 +126,9 @@ LL | 0u16 as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | i32::from(0u16); - | ~~~~~~~~~~~~~~~ +LL - 0u16 as i32; +LL + i32::from(0u16); + | error: casts from `u16` to `u64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:29:5 @@ -129,8 +139,9 @@ LL | 0u16 as u64; = help: an `as` cast can become silently lossy if the types change in the future help: use `u64::from` instead | -LL | u64::from(0u16); - | ~~~~~~~~~~~~~~~ +LL - 0u16 as u64; +LL + u64::from(0u16); + | error: casts from `u16` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:31:5 @@ -141,8 +152,9 @@ LL | 0u16 as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | i64::from(0u16); - | ~~~~~~~~~~~~~~~ +LL - 0u16 as i64; +LL + i64::from(0u16); + | error: casts from `u16` to `u128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:33:5 @@ -153,8 +165,9 @@ LL | 0u16 as u128; = help: an `as` cast can become silently lossy if the types change in the future help: use `u128::from` instead | -LL | u128::from(0u16); - | ~~~~~~~~~~~~~~~~ +LL - 0u16 as u128; +LL + u128::from(0u16); + | error: casts from `u16` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:35:5 @@ -165,8 +178,9 @@ LL | 0u16 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0u16); - | ~~~~~~~~~~~~~~~~ +LL - 0u16 as i128; +LL + i128::from(0u16); + | error: casts from `u32` to `u64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:38:5 @@ -177,8 +191,9 @@ LL | 0u32 as u64; = help: an `as` cast can become silently lossy if the types change in the future help: use `u64::from` instead | -LL | u64::from(0u32); - | ~~~~~~~~~~~~~~~ +LL - 0u32 as u64; +LL + u64::from(0u32); + | error: casts from `u32` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:40:5 @@ -189,8 +204,9 @@ LL | 0u32 as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | i64::from(0u32); - | ~~~~~~~~~~~~~~~ +LL - 0u32 as i64; +LL + i64::from(0u32); + | error: casts from `u32` to `u128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:42:5 @@ -201,8 +217,9 @@ LL | 0u32 as u128; = help: an `as` cast can become silently lossy if the types change in the future help: use `u128::from` instead | -LL | u128::from(0u32); - | ~~~~~~~~~~~~~~~~ +LL - 0u32 as u128; +LL + u128::from(0u32); + | error: casts from `u32` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:44:5 @@ -213,8 +230,9 @@ LL | 0u32 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0u32); - | ~~~~~~~~~~~~~~~~ +LL - 0u32 as i128; +LL + i128::from(0u32); + | error: casts from `u64` to `u128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:47:5 @@ -225,8 +243,9 @@ LL | 0u64 as u128; = help: an `as` cast can become silently lossy if the types change in the future help: use `u128::from` instead | -LL | u128::from(0u64); - | ~~~~~~~~~~~~~~~~ +LL - 0u64 as u128; +LL + u128::from(0u64); + | error: casts from `u64` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:49:5 @@ -237,8 +256,9 @@ LL | 0u64 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0u64); - | ~~~~~~~~~~~~~~~~ +LL - 0u64 as i128; +LL + i128::from(0u64); + | error: casts from `i8` to `i16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:52:5 @@ -249,8 +269,9 @@ LL | 0i8 as i16; = help: an `as` cast can become silently lossy if the types change in the future help: use `i16::from` instead | -LL | i16::from(0i8); - | ~~~~~~~~~~~~~~ +LL - 0i8 as i16; +LL + i16::from(0i8); + | error: casts from `i8` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:54:5 @@ -261,8 +282,9 @@ LL | 0i8 as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | i32::from(0i8); - | ~~~~~~~~~~~~~~ +LL - 0i8 as i32; +LL + i32::from(0i8); + | error: casts from `i8` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:56:5 @@ -273,8 +295,9 @@ LL | 0i8 as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | i64::from(0i8); - | ~~~~~~~~~~~~~~ +LL - 0i8 as i64; +LL + i64::from(0i8); + | error: casts from `i8` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:58:5 @@ -285,8 +308,9 @@ LL | 0i8 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0i8); - | ~~~~~~~~~~~~~~~ +LL - 0i8 as i128; +LL + i128::from(0i8); + | error: casts from `i16` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:61:5 @@ -297,8 +321,9 @@ LL | 0i16 as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | i32::from(0i16); - | ~~~~~~~~~~~~~~~ +LL - 0i16 as i32; +LL + i32::from(0i16); + | error: casts from `i16` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:63:5 @@ -309,8 +334,9 @@ LL | 0i16 as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | i64::from(0i16); - | ~~~~~~~~~~~~~~~ +LL - 0i16 as i64; +LL + i64::from(0i16); + | error: casts from `i16` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:65:5 @@ -321,8 +347,9 @@ LL | 0i16 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0i16); - | ~~~~~~~~~~~~~~~~ +LL - 0i16 as i128; +LL + i128::from(0i16); + | error: casts from `i32` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:68:5 @@ -333,8 +360,9 @@ LL | 0i32 as i64; = help: an `as` cast can become silently lossy if the types change in the future help: use `i64::from` instead | -LL | i64::from(0i32); - | ~~~~~~~~~~~~~~~ +LL - 0i32 as i64; +LL + i64::from(0i32); + | error: casts from `i32` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:70:5 @@ -345,8 +373,9 @@ LL | 0i32 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0i32); - | ~~~~~~~~~~~~~~~~ +LL - 0i32 as i128; +LL + i128::from(0i32); + | error: casts from `i64` to `i128` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:73:5 @@ -357,8 +386,9 @@ LL | 0i64 as i128; = help: an `as` cast can become silently lossy if the types change in the future help: use `i128::from` instead | -LL | i128::from(0i64); - | ~~~~~~~~~~~~~~~~ +LL - 0i64 as i128; +LL + i128::from(0i64); + | error: casts from `u8` to `u16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:77:13 @@ -369,8 +399,9 @@ LL | let _ = (1u8 + 1u8) as u16; = help: an `as` cast can become silently lossy if the types change in the future help: use `u16::from` instead | -LL | let _ = u16::from(1u8 + 1u8); - | ~~~~~~~~~~~~~~~~~~~~ +LL - let _ = (1u8 + 1u8) as u16; +LL + let _ = u16::from(1u8 + 1u8); + | error: casts from `i8` to `i64` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:80:13 @@ -381,8 +412,9 @@ LL | let _ = 1i8 as I64Alias; = help: an `as` cast can become silently lossy if the types change in the future help: use `I64Alias::from` instead | -LL | let _ = I64Alias::from(1i8); - | ~~~~~~~~~~~~~~~~~~~ +LL - let _ = 1i8 as I64Alias; +LL + let _ = I64Alias::from(1i8); + | error: casts from `u8` to `u16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:83:18 @@ -393,8 +425,9 @@ LL | let _: u16 = 0u8 as _; = help: an `as` cast can become silently lossy if the types change in the future help: use `Into::into` instead | -LL | let _: u16 = 0u8.into(); - | ~~~~~~~~~~ +LL - let _: u16 = 0u8 as _; +LL + let _: u16 = 0u8.into(); + | error: casts from `i8` to `i16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:85:18 @@ -405,8 +438,9 @@ LL | let _: i16 = -1i8 as _; = help: an `as` cast can become silently lossy if the types change in the future help: use `Into::into` instead | -LL | let _: i16 = (-1i8).into(); - | ~~~~~~~~~~~~~ +LL - let _: i16 = -1i8 as _; +LL + let _: i16 = (-1i8).into(); + | error: casts from `u8` to `u16` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:87:18 @@ -417,8 +451,9 @@ LL | let _: u16 = (1u8 + 2) as _; = help: an `as` cast can become silently lossy if the types change in the future help: use `Into::into` instead | -LL | let _: u16 = (1u8 + 2).into(); - | ~~~~~~~~~~~~~~~~ +LL - let _: u16 = (1u8 + 2) as _; +LL + let _: u16 = (1u8 + 2).into(); + | error: casts from `u16` to `u32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:89:18 @@ -429,8 +464,9 @@ LL | let _: u32 = 1i8 as u16 as _; = help: an `as` cast can become silently lossy if the types change in the future help: use `Into::into` instead | -LL | let _: u32 = (1i8 as u16).into(); - | ~~~~~~~~~~~~~~~~~~~ +LL - let _: u32 = 1i8 as u16 as _; +LL + let _: u32 = (1i8 as u16).into(); + | error: casts from `i8` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:124:13 @@ -441,8 +477,9 @@ LL | let _ = sign_cast!(x, u8, i8) as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | let _ = i32::from(sign_cast!(x, u8, i8)); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = sign_cast!(x, u8, i8) as i32; +LL + let _ = i32::from(sign_cast!(x, u8, i8)); + | error: casts from `i8` to `i32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:126:13 @@ -453,8 +490,9 @@ LL | let _ = (sign_cast!(x, u8, i8) + 1) as i32; = help: an `as` cast can become silently lossy if the types change in the future help: use `i32::from` instead | -LL | let _ = i32::from(sign_cast!(x, u8, i8) + 1); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = (sign_cast!(x, u8, i8) + 1) as i32; +LL + let _ = i32::from(sign_cast!(x, u8, i8) + 1); + | error: casts from `u8` to `u32` can be expressed infallibly using `From` --> tests/ui/cast_lossless_integer.rs:133:13 @@ -469,7 +507,8 @@ LL | let _ = in_macro!(); = note: this error originates in the macro `in_macro` (in Nightly builds, run with -Z macro-backtrace for more info) help: use `u32::from` instead | -LL | u32::from(1u8) +LL - 1u8 as u32 +LL + u32::from(1u8) | error: casts from `u8` to `u32` can be expressed infallibly using `From` @@ -481,8 +520,9 @@ LL | let _ = 0u8 as ty!(); = help: an `as` cast can become silently lossy if the types change in the future help: use `::from` instead | -LL | let _ = ::from(0u8); - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = 0u8 as ty!(); +LL + let _ = ::from(0u8); + | error: aborting due to 40 previous errors diff --git a/src/tools/clippy/tests/ui/cast_size.64bit.stderr b/src/tools/clippy/tests/ui/cast_size.64bit.stderr index bc37107d80e39..6b9919f8a1055 100644 --- a/src/tools/clippy/tests/ui/cast_size.64bit.stderr +++ b/src/tools/clippy/tests/ui/cast_size.64bit.stderr @@ -9,8 +9,9 @@ LL | 1isize as i8; = help: to override `-D warnings` add `#[allow(clippy::cast_possible_truncation)]` help: ... or use `try_from` and handle the error accordingly | -LL | i8::try_from(1isize); - | ~~~~~~~~~~~~~~~~~~~~ +LL - 1isize as i8; +LL + i8::try_from(1isize); + | error: casting `isize` to `f32` causes a loss of precision (`isize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide) --> tests/ui/cast_size.rs:21:5 @@ -48,8 +49,9 @@ LL | 1isize as i32; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i32::try_from(1isize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1isize as i32; +LL + i32::try_from(1isize); + | error: casting `isize` to `u32` may truncate the value on targets with 64-bit wide pointers --> tests/ui/cast_size.rs:29:5 @@ -60,8 +62,9 @@ LL | 1isize as u32; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u32::try_from(1isize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1isize as u32; +LL + u32::try_from(1isize); + | error: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers --> tests/ui/cast_size.rs:30:5 @@ -72,8 +75,9 @@ LL | 1usize as u32; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | u32::try_from(1usize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1usize as u32; +LL + u32::try_from(1usize); + | error: casting `usize` to `i32` may truncate the value on targets with 64-bit wide pointers --> tests/ui/cast_size.rs:31:5 @@ -84,8 +88,9 @@ LL | 1usize as i32; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | i32::try_from(1usize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1usize as i32; +LL + i32::try_from(1usize); + | error: casting `usize` to `i32` may wrap around the value on targets with 32-bit wide pointers --> tests/ui/cast_size.rs:31:5 @@ -105,8 +110,9 @@ LL | 1i64 as isize; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | isize::try_from(1i64); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1i64 as isize; +LL + isize::try_from(1i64); + | error: casting `i64` to `usize` may truncate the value on targets with 32-bit wide pointers --> tests/ui/cast_size.rs:33:5 @@ -117,8 +123,9 @@ LL | 1i64 as usize; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | usize::try_from(1i64); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1i64 as usize; +LL + usize::try_from(1i64); + | error: casting `u64` to `isize` may truncate the value on targets with 32-bit wide pointers --> tests/ui/cast_size.rs:34:5 @@ -129,8 +136,9 @@ LL | 1u64 as isize; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | isize::try_from(1u64); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1u64 as isize; +LL + isize::try_from(1u64); + | error: casting `u64` to `isize` may wrap around the value on targets with 64-bit wide pointers --> tests/ui/cast_size.rs:34:5 @@ -147,8 +155,9 @@ LL | 1u64 as usize; = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... help: ... or use `try_from` and handle the error accordingly | -LL | usize::try_from(1u64); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1u64 as usize; +LL + usize::try_from(1u64); + | error: casting `u32` to `isize` may wrap around the value on targets with 32-bit wide pointers --> tests/ui/cast_size.rs:36:5 diff --git a/src/tools/clippy/tests/ui/create_dir.stderr b/src/tools/clippy/tests/ui/create_dir.stderr index ab51705bb55a5..9bb98a2606dd7 100644 --- a/src/tools/clippy/tests/ui/create_dir.stderr +++ b/src/tools/clippy/tests/ui/create_dir.stderr @@ -8,8 +8,9 @@ LL | std::fs::create_dir("foo"); = help: to override `-D warnings` add `#[allow(clippy::create_dir)]` help: consider calling `std::fs::create_dir_all` instead | -LL | create_dir_all("foo"); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - std::fs::create_dir("foo"); +LL + create_dir_all("foo"); + | error: calling `std::fs::create_dir` where there may be a better way --> tests/ui/create_dir.rs:11:5 @@ -19,8 +20,9 @@ LL | std::fs::create_dir("bar").unwrap(); | help: consider calling `std::fs::create_dir_all` instead | -LL | create_dir_all("bar").unwrap(); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - std::fs::create_dir("bar").unwrap(); +LL + create_dir_all("bar").unwrap(); + | error: aborting due to 2 previous errors diff --git a/src/tools/clippy/tests/ui/dbg_macro/dbg_macro.stderr b/src/tools/clippy/tests/ui/dbg_macro/dbg_macro.stderr index b3d74b9ff6173..f218614fdd622 100644 --- a/src/tools/clippy/tests/ui/dbg_macro/dbg_macro.stderr +++ b/src/tools/clippy/tests/ui/dbg_macro/dbg_macro.stderr @@ -8,8 +8,9 @@ LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n } = help: to override `-D warnings` add `#[allow(clippy::dbg_macro)]` help: remove the invocation before committing it to a version control system | -LL | if let Some(n) = n.checked_sub(4) { n } else { n } - | ~~~~~~~~~~~~~~~~ +LL - if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n } +LL + if let Some(n) = n.checked_sub(4) { n } else { n } + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:11:8 @@ -19,8 +20,9 @@ LL | if dbg!(n <= 1) { | help: remove the invocation before committing it to a version control system | -LL | if n <= 1 { - | ~~~~~~ +LL - if dbg!(n <= 1) { +LL + if n <= 1 { + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:13:9 @@ -30,7 +32,8 @@ LL | dbg!(1) | help: remove the invocation before committing it to a version control system | -LL | 1 +LL - dbg!(1) +LL + 1 | error: the `dbg!` macro is intended as a debugging tool @@ -41,7 +44,8 @@ LL | dbg!(n * factorial(n - 1)) | help: remove the invocation before committing it to a version control system | -LL | n * factorial(n - 1) +LL - dbg!(n * factorial(n - 1)) +LL + n * factorial(n - 1) | error: the `dbg!` macro is intended as a debugging tool @@ -52,8 +56,9 @@ LL | dbg!(42); | help: remove the invocation before committing it to a version control system | -LL | 42; - | ~~ +LL - dbg!(42); +LL + 42; + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:24:14 @@ -63,8 +68,9 @@ LL | foo(3) + dbg!(factorial(4)); | help: remove the invocation before committing it to a version control system | -LL | foo(3) + factorial(4); - | ~~~~~~~~~~~~ +LL - foo(3) + dbg!(factorial(4)); +LL + foo(3) + factorial(4); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:26:5 @@ -74,8 +80,9 @@ LL | dbg!(1, 2, 3, 4, 5); | help: remove the invocation before committing it to a version control system | -LL | (1, 2, 3, 4, 5); - | ~~~~~~~~~~~~~~~ +LL - dbg!(1, 2, 3, 4, 5); +LL + (1, 2, 3, 4, 5); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:48:5 @@ -96,8 +103,9 @@ LL | let _ = dbg!(); | help: remove the invocation before committing it to a version control system | -LL | let _ = (); - | ~~ +LL - let _ = dbg!(); +LL + let _ = (); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:53:9 @@ -107,8 +115,9 @@ LL | bar(dbg!()); | help: remove the invocation before committing it to a version control system | -LL | bar(()); - | ~~ +LL - bar(dbg!()); +LL + bar(()); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:55:10 @@ -118,8 +127,9 @@ LL | foo!(dbg!()); | help: remove the invocation before committing it to a version control system | -LL | foo!(()); - | ~~ +LL - foo!(dbg!()); +LL + foo!(()); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:57:16 @@ -129,8 +139,9 @@ LL | foo2!(foo!(dbg!())); | help: remove the invocation before committing it to a version control system | -LL | foo2!(foo!(())); - | ~~ +LL - foo2!(foo!(dbg!())); +LL + foo2!(foo!(())); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:43:13 @@ -155,8 +166,9 @@ LL | dbg!(2); | help: remove the invocation before committing it to a version control system | -LL | 2; - | ~ +LL - dbg!(2); +LL + 2; + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:86:5 @@ -166,8 +178,9 @@ LL | dbg!(1); | help: remove the invocation before committing it to a version control system | -LL | 1; - | ~ +LL - dbg!(1); +LL + 1; + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:92:5 @@ -177,8 +190,9 @@ LL | dbg!(1); | help: remove the invocation before committing it to a version control system | -LL | 1; - | ~ +LL - dbg!(1); +LL + 1; + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:99:9 @@ -188,8 +202,9 @@ LL | dbg!(1); | help: remove the invocation before committing it to a version control system | -LL | 1; - | ~ +LL - dbg!(1); +LL + 1; + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:106:31 @@ -199,8 +214,9 @@ LL | println!("dbg: {:?}", dbg!(s)); | help: remove the invocation before committing it to a version control system | -LL | println!("dbg: {:?}", s); - | ~ +LL - println!("dbg: {:?}", dbg!(s)); +LL + println!("dbg: {:?}", s); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro.rs:108:22 @@ -210,8 +226,9 @@ LL | print!("{}", dbg!(s)); | help: remove the invocation before committing it to a version control system | -LL | print!("{}", s); - | ~ +LL - print!("{}", dbg!(s)); +LL + print!("{}", s); + | error: aborting due to 19 previous errors diff --git a/src/tools/clippy/tests/ui/dbg_macro/dbg_macro_unfixable.stderr b/src/tools/clippy/tests/ui/dbg_macro/dbg_macro_unfixable.stderr index b8e91906b9317..e8d5f9f2f46f0 100644 --- a/src/tools/clippy/tests/ui/dbg_macro/dbg_macro_unfixable.stderr +++ b/src/tools/clippy/tests/ui/dbg_macro/dbg_macro_unfixable.stderr @@ -19,8 +19,9 @@ LL | dbg!(dbg!(dbg!(42))); | help: remove the invocation before committing it to a version control system | -LL | dbg!(dbg!(42)); - | ~~~~~~~~~~~~~~ +LL - dbg!(dbg!(dbg!(42))); +LL + dbg!(dbg!(42)); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro_unfixable.rs:8:10 @@ -30,8 +31,9 @@ LL | dbg!(dbg!(dbg!(42))); | help: remove the invocation before committing it to a version control system | -LL | dbg!(dbg!(42)); - | ~~~~~~~~ +LL - dbg!(dbg!(dbg!(42))); +LL + dbg!(dbg!(42)); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro_unfixable.rs:8:15 @@ -41,8 +43,9 @@ LL | dbg!(dbg!(dbg!(42))); | help: remove the invocation before committing it to a version control system | -LL | dbg!(dbg!(42)); - | ~~ +LL - dbg!(dbg!(dbg!(42))); +LL + dbg!(dbg!(42)); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro_unfixable.rs:10:5 @@ -52,8 +55,9 @@ LL | dbg!(1, 2, dbg!(3, 4)); | help: remove the invocation before committing it to a version control system | -LL | (1, 2, dbg!(3, 4)); - | ~~~~~~~~~~~~~~~~~~ +LL - dbg!(1, 2, dbg!(3, 4)); +LL + (1, 2, dbg!(3, 4)); + | error: the `dbg!` macro is intended as a debugging tool --> tests/ui/dbg_macro/dbg_macro_unfixable.rs:10:16 @@ -63,8 +67,9 @@ LL | dbg!(1, 2, dbg!(3, 4)); | help: remove the invocation before committing it to a version control system | -LL | dbg!(1, 2, (3, 4)); - | ~~~~~~ +LL - dbg!(1, 2, dbg!(3, 4)); +LL + dbg!(1, 2, (3, 4)); + | error: aborting due to 6 previous errors diff --git a/src/tools/clippy/tests/ui/doc/doc-fixable.stderr b/src/tools/clippy/tests/ui/doc/doc-fixable.stderr index 67c0464149c6e..f5865474cf942 100644 --- a/src/tools/clippy/tests/ui/doc/doc-fixable.stderr +++ b/src/tools/clippy/tests/ui/doc/doc-fixable.stderr @@ -8,8 +8,9 @@ LL | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot t = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]` help: try | -LL | /// The `foo_bar` function does _nothing_. See also foo::bar. (note the dot there) - | ~~~~~~~~~ +LL - /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) +LL + /// The `foo_bar` function does _nothing_. See also foo::bar. (note the dot there) + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:9:51 @@ -19,8 +20,9 @@ LL | /// The foo_bar function does _nothing_. See also foo::bar. (note the dot t | help: try | -LL | /// The foo_bar function does _nothing_. See also `foo::bar`. (note the dot there) - | ~~~~~~~~~~ +LL - /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) +LL + /// The foo_bar function does _nothing_. See also `foo::bar`. (note the dot there) + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:10:83 @@ -30,8 +32,9 @@ LL | /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. B | help: try | -LL | /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not `Foo::some_fun` - | ~~~~~~~~~~~~~~~ +LL - /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun +LL + /// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not `Foo::some_fun` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:12:13 @@ -41,8 +44,9 @@ LL | /// Here be ::a::global:path, and _::another::global::path_. :: is not a p | help: try | -LL | /// Here be `::a::global:path`, and _::another::global::path_. :: is not a path though. - | ~~~~~~~~~~~~~~~~~~ +LL - /// Here be ::a::global:path, and _::another::global::path_. :: is not a path though. +LL + /// Here be `::a::global:path`, and _::another::global::path_. :: is not a path though. + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:12:36 @@ -52,8 +56,9 @@ LL | /// Here be ::a::global:path, and _::another::global::path_. :: is not a p | help: try | -LL | /// Here be ::a::global:path, and _`::another::global::path`_. :: is not a path though. - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// Here be ::a::global:path, and _::another::global::path_. :: is not a path though. +LL + /// Here be ::a::global:path, and _`::another::global::path`_. :: is not a path though. + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:13:25 @@ -63,8 +68,9 @@ LL | /// Import an item from ::awesome::global::blob:: (Intended postfix) | help: try | -LL | /// Import an item from `::awesome::global::blob::` (Intended postfix) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// Import an item from ::awesome::global::blob:: (Intended postfix) +LL + /// Import an item from `::awesome::global::blob::` (Intended postfix) + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:14:31 @@ -74,8 +80,9 @@ LL | /// These are the options for ::Cat: (Intended trailing single colon, shoul | help: try | -LL | /// These are the options for `::Cat`: (Intended trailing single colon, shouldn't be linted) - | ~~~~~~~ +LL - /// These are the options for ::Cat: (Intended trailing single colon, shouldn't be linted) +LL + /// These are the options for `::Cat`: (Intended trailing single colon, shouldn't be linted) + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:15:22 @@ -85,8 +92,9 @@ LL | /// That's not code ~NotInCodeBlock~. | help: try | -LL | /// That's not code ~`NotInCodeBlock`~. - | ~~~~~~~~~~~~~~~~ +LL - /// That's not code ~NotInCodeBlock~. +LL + /// That's not code ~`NotInCodeBlock`~. + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:16:5 @@ -96,8 +104,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:30:5 @@ -107,8 +116,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:37:5 @@ -118,8 +128,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:51:5 @@ -129,8 +140,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:78:5 @@ -140,8 +152,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:95:5 @@ -151,8 +164,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:103:8 @@ -162,8 +176,9 @@ LL | /// ## CamelCaseThing | help: try | -LL | /// ## `CamelCaseThing` - | ~~~~~~~~~~~~~~~~ +LL - /// ## CamelCaseThing +LL + /// ## `CamelCaseThing` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:106:7 @@ -173,8 +188,9 @@ LL | /// # CamelCaseThing | help: try | -LL | /// # `CamelCaseThing` - | ~~~~~~~~~~~~~~~~ +LL - /// # CamelCaseThing +LL + /// # `CamelCaseThing` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:108:22 @@ -184,8 +200,9 @@ LL | /// Not a title #897 CamelCaseThing | help: try | -LL | /// Not a title #897 `CamelCaseThing` - | ~~~~~~~~~~~~~~~~ +LL - /// Not a title #897 CamelCaseThing +LL + /// Not a title #897 `CamelCaseThing` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:109:5 @@ -195,8 +212,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:116:5 @@ -206,8 +224,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:129:5 @@ -217,8 +236,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:140:43 @@ -228,8 +248,9 @@ LL | /** E.g., serialization of an empty list: FooBar | help: try | -LL | /** E.g., serialization of an empty list: `FooBar` - | ~~~~~~~~ +LL - /** E.g., serialization of an empty list: FooBar +LL + /** E.g., serialization of an empty list: `FooBar` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:145:5 @@ -239,8 +260,9 @@ LL | And BarQuz too. | help: try | -LL | And `BarQuz` too. - | ~~~~~~~~ +LL - And BarQuz too. +LL + And `BarQuz` too. + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:146:1 @@ -250,7 +272,8 @@ LL | be_sure_we_got_to_the_end_of_it | help: try | -LL | `be_sure_we_got_to_the_end_of_it` +LL - be_sure_we_got_to_the_end_of_it +LL + `be_sure_we_got_to_the_end_of_it` | error: item in documentation is missing backticks @@ -261,8 +284,9 @@ LL | /** E.g., serialization of an empty list: FooBar | help: try | -LL | /** E.g., serialization of an empty list: `FooBar` - | ~~~~~~~~ +LL - /** E.g., serialization of an empty list: FooBar +LL + /** E.g., serialization of an empty list: `FooBar` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:156:5 @@ -272,8 +296,9 @@ LL | And BarQuz too. | help: try | -LL | And `BarQuz` too. - | ~~~~~~~~ +LL - And BarQuz too. +LL + And `BarQuz` too. + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:157:1 @@ -283,7 +308,8 @@ LL | be_sure_we_got_to_the_end_of_it | help: try | -LL | `be_sure_we_got_to_the_end_of_it` +LL - be_sure_we_got_to_the_end_of_it +LL + `be_sure_we_got_to_the_end_of_it` | error: item in documentation is missing backticks @@ -294,8 +320,9 @@ LL | /// be_sure_we_got_to_the_end_of_it | help: try | -LL | /// `be_sure_we_got_to_the_end_of_it` - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// be_sure_we_got_to_the_end_of_it +LL + /// `be_sure_we_got_to_the_end_of_it` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:187:22 @@ -305,8 +332,9 @@ LL | /// An iterator over mycrate::Collection's values. | help: try | -LL | /// An iterator over `mycrate::Collection`'s values. - | ~~~~~~~~~~~~~~~~~~~~~ +LL - /// An iterator over mycrate::Collection's values. +LL + /// An iterator over `mycrate::Collection`'s values. + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:211:34 @@ -316,8 +344,9 @@ LL | /// Foo \[bar\] \[baz\] \[qux\]. DocMarkdownLint | help: try | -LL | /// Foo \[bar\] \[baz\] \[qux\]. `DocMarkdownLint` - | ~~~~~~~~~~~~~~~~~ +LL - /// Foo \[bar\] \[baz\] \[qux\]. DocMarkdownLint +LL + /// Foo \[bar\] \[baz\] \[qux\]. `DocMarkdownLint` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:234:22 @@ -327,8 +356,9 @@ LL | /// There is no try (do() or do_not()). | help: try | -LL | /// There is no try (`do()` or do_not()). - | ~~~~~~ +LL - /// There is no try (do() or do_not()). +LL + /// There is no try (`do()` or do_not()). + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:234:30 @@ -338,8 +368,9 @@ LL | /// There is no try (do() or do_not()). | help: try | -LL | /// There is no try (do() or `do_not()`). - | ~~~~~~~~~~ +LL - /// There is no try (do() or do_not()). +LL + /// There is no try (do() or `do_not()`). + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:237:5 @@ -349,8 +380,9 @@ LL | /// ABes | help: try | -LL | /// `ABes` - | ~~~~~~ +LL - /// ABes +LL + /// `ABes` + | error: item in documentation is missing backticks --> tests/ui/doc/doc-fixable.rs:243:9 @@ -360,8 +392,9 @@ LL | /// foo() | help: try | -LL | /// `foo()` - | ~~~~~~~ +LL - /// foo() +LL + /// `foo()` + | error: you should put bare URLs between `<`/`>` or make a proper Markdown link --> tests/ui/doc/doc-fixable.rs:247:5 diff --git a/src/tools/clippy/tests/ui/doc/issue_10262.stderr b/src/tools/clippy/tests/ui/doc/issue_10262.stderr index f43d9551e94e0..f9ecb3de219ba 100644 --- a/src/tools/clippy/tests/ui/doc/issue_10262.stderr +++ b/src/tools/clippy/tests/ui/doc/issue_10262.stderr @@ -8,8 +8,9 @@ LL | /// AviSynth documentation: = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]` help: try | -LL | /// `AviSynth` documentation: - | ~~~~~~~~~~ +LL - /// AviSynth documentation: +LL + /// `AviSynth` documentation: + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/doc/issue_12795.stderr b/src/tools/clippy/tests/ui/doc/issue_12795.stderr index 5700145ec8f7a..047de915ed4c6 100644 --- a/src/tools/clippy/tests/ui/doc/issue_12795.stderr +++ b/src/tools/clippy/tests/ui/doc/issue_12795.stderr @@ -8,8 +8,9 @@ LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b( = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]` help: try | -LL | //! A comment with `a_b(x)` and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) - | ~~~~~~~~ +LL - //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) +LL + //! A comment with `a_b(x)` and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) + | error: item in documentation is missing backticks --> tests/ui/doc/issue_12795.rs:3:31 @@ -19,8 +20,9 @@ LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b( | help: try | -LL | //! A comment with a_b(x) and `a_c` in it and (a_b((c)) ) too and (maybe a_b((c))) - | ~~~~~ +LL - //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) +LL + //! A comment with a_b(x) and `a_c` in it and (a_b((c)) ) too and (maybe a_b((c))) + | error: item in documentation is missing backticks --> tests/ui/doc/issue_12795.rs:3:46 @@ -30,8 +32,9 @@ LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b( | help: try | -LL | //! A comment with a_b(x) and a_c in it and (`a_b((c))` ) too and (maybe a_b((c))) - | ~~~~~~~~~~ +LL - //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) +LL + //! A comment with a_b(x) and a_c in it and (`a_b((c))` ) too and (maybe a_b((c))) + | error: item in documentation is missing backticks --> tests/ui/doc/issue_12795.rs:3:72 @@ -41,8 +44,9 @@ LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b( | help: try | -LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe `a_b((c))`) - | ~~~~~~~~~~ +LL - //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) +LL + //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe `a_b((c))`) + | error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui/doc/issue_9473.stderr b/src/tools/clippy/tests/ui/doc/issue_9473.stderr index 35aa2884cc115..744c8dc8c8385 100644 --- a/src/tools/clippy/tests/ui/doc/issue_9473.stderr +++ b/src/tools/clippy/tests/ui/doc/issue_9473.stderr @@ -8,8 +8,9 @@ LL | /// Blah blah blah [FooBar]<[FooBar]>[FooBar]. = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]` help: try | -LL | /// Blah blah blah [FooBar]<[FooBar]>[`FooBar`]. - | ~~~~~~~~ +LL - /// Blah blah blah [FooBar]<[FooBar]>[FooBar]. +LL + /// Blah blah blah [FooBar]<[FooBar]>[`FooBar`]. + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/doc/unbalanced_ticks.stderr b/src/tools/clippy/tests/ui/doc/unbalanced_ticks.stderr index 50324010e97f7..a3a9dfc93d2c1 100644 --- a/src/tools/clippy/tests/ui/doc/unbalanced_ticks.stderr +++ b/src/tools/clippy/tests/ui/doc/unbalanced_ticks.stderr @@ -29,8 +29,9 @@ LL | /// This paragraph is fine and should_be linted normally. | help: try | -LL | /// This paragraph is fine and `should_be` linted normally. - | ~~~~~~~~~~~ +LL - /// This paragraph is fine and should_be linted normally. +LL + /// This paragraph is fine and `should_be` linted normally. + | error: backticks are unbalanced --> tests/ui/doc/unbalanced_ticks.rs:20:5 @@ -48,8 +49,9 @@ LL | /// ## not_fine | help: try | -LL | /// ## `not_fine` - | ~~~~~~~~~~ +LL - /// ## not_fine +LL + /// ## `not_fine` + | error: backticks are unbalanced --> tests/ui/doc/unbalanced_ticks.rs:37:5 @@ -75,8 +77,9 @@ LL | /// - This item needs backticks_here | help: try | -LL | /// - This item needs `backticks_here` - | ~~~~~~~~~~~~~~~~ +LL - /// - This item needs backticks_here +LL + /// - This item needs `backticks_here` + | error: backticks are unbalanced --> tests/ui/doc/unbalanced_ticks.rs:53:5 diff --git a/src/tools/clippy/tests/ui/eager_transmute.stderr b/src/tools/clippy/tests/ui/eager_transmute.stderr index 5cf7bd49a929e..68690c3730d89 100644 --- a/src/tools/clippy/tests/ui/eager_transmute.stderr +++ b/src/tools/clippy/tests/ui/eager_transmute.stderr @@ -8,8 +8,9 @@ LL | (op < 4).then_some(unsafe { std::mem::transmute(op) }) = help: to override `-D warnings` add `#[allow(clippy::eager_transmute)]` help: consider using `bool::then` to only transmute if the condition holds | -LL | (op < 4).then(|| unsafe { std::mem::transmute(op) }) - | ~~~~ ++ +LL - (op < 4).then_some(unsafe { std::mem::transmute(op) }) +LL + (op < 4).then(|| unsafe { std::mem::transmute(op) }) + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:27:33 @@ -19,8 +20,9 @@ LL | (op < 4).then_some(unsafe { std::mem::transmute::<_, Opcode>(op) }); | help: consider using `bool::then` to only transmute if the condition holds | -LL | (op < 4).then(|| unsafe { std::mem::transmute::<_, Opcode>(op) }); - | ~~~~ ++ +LL - (op < 4).then_some(unsafe { std::mem::transmute::<_, Opcode>(op) }); +LL + (op < 4).then(|| unsafe { std::mem::transmute::<_, Opcode>(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:28:33 @@ -30,8 +32,9 @@ LL | (op > 4).then_some(unsafe { std::mem::transmute::<_, Opcode>(op) }); | help: consider using `bool::then` to only transmute if the condition holds | -LL | (op > 4).then(|| unsafe { std::mem::transmute::<_, Opcode>(op) }); - | ~~~~ ++ +LL - (op > 4).then_some(unsafe { std::mem::transmute::<_, Opcode>(op) }); +LL + (op > 4).then(|| unsafe { std::mem::transmute::<_, Opcode>(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:29:34 @@ -41,8 +44,9 @@ LL | (op == 0).then_some(unsafe { std::mem::transmute::<_, Opcode>(op) }); | help: consider using `bool::then` to only transmute if the condition holds | -LL | (op == 0).then(|| unsafe { std::mem::transmute::<_, Opcode>(op) }); - | ~~~~ ++ +LL - (op == 0).then_some(unsafe { std::mem::transmute::<_, Opcode>(op) }); +LL + (op == 0).then(|| unsafe { std::mem::transmute::<_, Opcode>(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:31:68 @@ -52,8 +56,9 @@ LL | let _: Option = (op > 0 && op < 10).then_some(unsafe { std::mem | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (op > 0 && op < 10).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (op > 0 && op < 10).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (op > 0 && op < 10).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:32:86 @@ -63,8 +68,9 @@ LL | let _: Option = (op > 0 && op < 10 && unrelated == 0).then_some | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (op > 0 && op < 10 && unrelated == 0).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (op > 0 && op < 10 && unrelated == 0).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (op > 0 && op < 10 && unrelated == 0).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:35:84 @@ -74,8 +80,9 @@ LL | let _: Option = (op2.foo[0] > 0 && op2.foo[0] < 10).then_some(u | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (op2.foo[0] > 0 && op2.foo[0] < 10).then(|| unsafe { std::mem::transmute(op2.foo[0]) }); - | ~~~~ ++ +LL - let _: Option = (op2.foo[0] > 0 && op2.foo[0] < 10).then_some(unsafe { std::mem::transmute(op2.foo[0]) }); +LL + let _: Option = (op2.foo[0] > 0 && op2.foo[0] < 10).then(|| unsafe { std::mem::transmute(op2.foo[0]) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:47:70 @@ -85,8 +92,9 @@ LL | let _: Option = (1..=3).contains(&op).then_some(unsafe { std::m | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (1..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (1..=3).contains(&op).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (1..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:48:83 @@ -96,8 +104,9 @@ LL | let _: Option = ((1..=3).contains(&op) || op == 4).then_some(un | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = ((1..=3).contains(&op) || op == 4).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = ((1..=3).contains(&op) || op == 4).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = ((1..=3).contains(&op) || op == 4).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:49:69 @@ -107,8 +116,9 @@ LL | let _: Option = (1..3).contains(&op).then_some(unsafe { std::me | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (1..3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (1..3).contains(&op).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (1..3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:50:68 @@ -118,8 +128,9 @@ LL | let _: Option = (1..).contains(&op).then_some(unsafe { std::mem | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (1..).contains(&op).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (1..).contains(&op).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (1..).contains(&op).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:51:68 @@ -129,8 +140,9 @@ LL | let _: Option = (..3).contains(&op).then_some(unsafe { std::mem | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (..3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (..3).contains(&op).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (..3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:52:69 @@ -140,8 +152,9 @@ LL | let _: Option = (..=3).contains(&op).then_some(unsafe { std::me | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); - | ~~~~ ++ +LL - let _: Option = (..=3).contains(&op).then_some(unsafe { std::mem::transmute(op) }); +LL + let _: Option = (..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:61:24 @@ -151,8 +164,9 @@ LL | (op < 4).then_some(std::mem::transmute::<_, Opcode>(op)); | help: consider using `bool::then` to only transmute if the condition holds | -LL | (op < 4).then(|| std::mem::transmute::<_, Opcode>(op)); - | ~~~~ ++ +LL - (op < 4).then_some(std::mem::transmute::<_, Opcode>(op)); +LL + (op < 4).then(|| std::mem::transmute::<_, Opcode>(op)); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:90:62 @@ -162,8 +176,9 @@ LL | let _: Option> = (v1 > 0).then_some(unsafe { std::mem::tran | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option> = (v1 > 0).then(|| unsafe { std::mem::transmute(v1) }); - | ~~~~ ++ +LL - let _: Option> = (v1 > 0).then_some(unsafe { std::mem::transmute(v1) }); +LL + let _: Option> = (v1 > 0).then(|| unsafe { std::mem::transmute(v1) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:96:86 @@ -173,8 +188,9 @@ LL | let _: Option = (v2 < NonZero::new(255u8).unwrap()).then_some | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) }); - | ~~~~ ++ +LL - let _: Option = (v2 < NonZero::new(255u8).unwrap()).then_some(unsafe { std::mem::transmute(v2) }); +LL + let _: Option = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) }); + | error: this transmute is always evaluated eagerly, even if the condition is false --> tests/ui/eager_transmute.rs:102:93 @@ -184,8 +200,9 @@ LL | let _: Option = (v2 < NonZero::new(255u8).unwrap()).th | help: consider using `bool::then` to only transmute if the condition holds | -LL | let _: Option = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) }); - | ~~~~ ++ +LL - let _: Option = (v2 < NonZero::new(255u8).unwrap()).then_some(unsafe { std::mem::transmute(v2) }); +LL + let _: Option = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) }); + | error: aborting due to 17 previous errors diff --git a/src/tools/clippy/tests/ui/excessive_precision.stderr b/src/tools/clippy/tests/ui/excessive_precision.stderr index 81e4fb6765d0b..b1f12eed42007 100644 --- a/src/tools/clippy/tests/ui/excessive_precision.stderr +++ b/src/tools/clippy/tests/ui/excessive_precision.stderr @@ -8,8 +8,9 @@ LL | const BAD32_1: f32 = 0.123_456_789_f32; = help: to override `-D warnings` add `#[allow(clippy::excessive_precision)]` help: consider changing the type or truncating it to | -LL | const BAD32_1: f32 = 0.123_456_79_f32; - | ~~~~~~~~~~~~~~~~ +LL - const BAD32_1: f32 = 0.123_456_789_f32; +LL + const BAD32_1: f32 = 0.123_456_79_f32; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:21:26 @@ -19,8 +20,9 @@ LL | const BAD32_2: f32 = 0.123_456_789; | help: consider changing the type or truncating it to | -LL | const BAD32_2: f32 = 0.123_456_79; - | ~~~~~~~~~~~~ +LL - const BAD32_2: f32 = 0.123_456_789; +LL + const BAD32_2: f32 = 0.123_456_79; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:22:26 @@ -30,8 +32,9 @@ LL | const BAD32_3: f32 = 0.100_000_000_000_1; | help: consider changing the type or truncating it to | -LL | const BAD32_3: f32 = 0.1; - | ~~~ +LL - const BAD32_3: f32 = 0.100_000_000_000_1; +LL + const BAD32_3: f32 = 0.1; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:23:29 @@ -41,8 +44,9 @@ LL | const BAD32_EDGE: f32 = 1.000_000_9; | help: consider changing the type or truncating it to | -LL | const BAD32_EDGE: f32 = 1.000_001; - | ~~~~~~~~~ +LL - const BAD32_EDGE: f32 = 1.000_000_9; +LL + const BAD32_EDGE: f32 = 1.000_001; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:27:26 @@ -52,8 +56,9 @@ LL | const BAD64_3: f64 = 0.100_000_000_000_000_000_1; | help: consider changing the type or truncating it to | -LL | const BAD64_3: f64 = 0.1; - | ~~~ +LL - const BAD64_3: f64 = 0.100_000_000_000_000_000_1; +LL + const BAD64_3: f64 = 0.1; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:30:22 @@ -63,8 +68,9 @@ LL | println!("{:?}", 8.888_888_888_888_888_888_888); | help: consider changing the type or truncating it to | -LL | println!("{:?}", 8.888_888_888_888_89); - | ~~~~~~~~~~~~~~~~~~~~ +LL - println!("{:?}", 8.888_888_888_888_888_888_888); +LL + println!("{:?}", 8.888_888_888_888_89); + | error: float has excessive precision --> tests/ui/excessive_precision.rs:41:22 @@ -74,8 +80,9 @@ LL | let bad32: f32 = 1.123_456_789; | help: consider changing the type or truncating it to | -LL | let bad32: f32 = 1.123_456_8; - | ~~~~~~~~~~~ +LL - let bad32: f32 = 1.123_456_789; +LL + let bad32: f32 = 1.123_456_8; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:42:26 @@ -85,8 +92,9 @@ LL | let bad32_suf: f32 = 1.123_456_789_f32; | help: consider changing the type or truncating it to | -LL | let bad32_suf: f32 = 1.123_456_8_f32; - | ~~~~~~~~~~~~~~~ +LL - let bad32_suf: f32 = 1.123_456_789_f32; +LL + let bad32_suf: f32 = 1.123_456_8_f32; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:43:21 @@ -96,8 +104,9 @@ LL | let bad32_inf = 1.123_456_789_f32; | help: consider changing the type or truncating it to | -LL | let bad32_inf = 1.123_456_8_f32; - | ~~~~~~~~~~~~~~~ +LL - let bad32_inf = 1.123_456_789_f32; +LL + let bad32_inf = 1.123_456_8_f32; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:53:36 @@ -107,8 +116,9 @@ LL | let bad_vec32: Vec = vec![0.123_456_789]; | help: consider changing the type or truncating it to | -LL | let bad_vec32: Vec = vec![0.123_456_79]; - | ~~~~~~~~~~~~ +LL - let bad_vec32: Vec = vec![0.123_456_789]; +LL + let bad_vec32: Vec = vec![0.123_456_79]; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:54:36 @@ -118,8 +128,9 @@ LL | let bad_vec64: Vec = vec![0.123_456_789_123_456_789]; | help: consider changing the type or truncating it to | -LL | let bad_vec64: Vec = vec![0.123_456_789_123_456_78]; - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let bad_vec64: Vec = vec![0.123_456_789_123_456_789]; +LL + let bad_vec64: Vec = vec![0.123_456_789_123_456_78]; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:58:24 @@ -129,8 +140,9 @@ LL | let bad_e32: f32 = 1.123_456_788_888e-10; | help: consider changing the type or truncating it to | -LL | let bad_e32: f32 = 1.123_456_8e-10; - | ~~~~~~~~~~~~~~~ +LL - let bad_e32: f32 = 1.123_456_788_888e-10; +LL + let bad_e32: f32 = 1.123_456_8e-10; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:61:27 @@ -140,8 +152,9 @@ LL | let bad_bige32: f32 = 1.123_456_788_888E-10; | help: consider changing the type or truncating it to | -LL | let bad_bige32: f32 = 1.123_456_8E-10; - | ~~~~~~~~~~~~~~~ +LL - let bad_bige32: f32 = 1.123_456_788_888E-10; +LL + let bad_bige32: f32 = 1.123_456_8E-10; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:70:13 @@ -151,8 +164,9 @@ LL | let _ = 2.225_073_858_507_201_1e-308_f64; | help: consider changing the type or truncating it to | -LL | let _ = 2.225_073_858_507_201e-308_f64; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = 2.225_073_858_507_201_1e-308_f64; +LL + let _ = 2.225_073_858_507_201e-308_f64; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:73:13 @@ -162,8 +176,9 @@ LL | let _ = 1.000_000_000_000_001e-324_f64; | help: consider changing the type or truncating it to | -LL | let _ = 0_f64; - | ~~~~~ +LL - let _ = 1.000_000_000_000_001e-324_f64; +LL + let _ = 0_f64; + | error: float has excessive precision --> tests/ui/excessive_precision.rs:83:20 @@ -173,8 +188,9 @@ LL | const _: f64 = 3.0000000000000000e+00; | help: consider changing the type or truncating it to | -LL | const _: f64 = 3.0; - | ~~~ +LL - const _: f64 = 3.0000000000000000e+00; +LL + const _: f64 = 3.0; + | error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr b/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr index a05b7138bc99b..c069c9d1672de 100644 --- a/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr +++ b/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr @@ -8,8 +8,9 @@ LL | let _ = foo as i8; = help: to override `-D warnings` add `#[allow(clippy::fn_to_numeric_cast_any)]` help: did you mean to invoke the function? | -LL | let _ = foo() as i8; - | ~~~~~~~~~~~ +LL - let _ = foo as i8; +LL + let _ = foo() as i8; + | error: casting function pointer `foo` to `i16` --> tests/ui/fn_to_numeric_cast_any.rs:26:13 @@ -19,8 +20,9 @@ LL | let _ = foo as i16; | help: did you mean to invoke the function? | -LL | let _ = foo() as i16; - | ~~~~~~~~~~~~ +LL - let _ = foo as i16; +LL + let _ = foo() as i16; + | error: casting function pointer `foo` to `i32` --> tests/ui/fn_to_numeric_cast_any.rs:28:13 @@ -30,8 +32,9 @@ LL | let _ = foo as i32; | help: did you mean to invoke the function? | -LL | let _ = foo() as i32; - | ~~~~~~~~~~~~ +LL - let _ = foo as i32; +LL + let _ = foo() as i32; + | error: casting function pointer `foo` to `i64` --> tests/ui/fn_to_numeric_cast_any.rs:30:13 @@ -41,8 +44,9 @@ LL | let _ = foo as i64; | help: did you mean to invoke the function? | -LL | let _ = foo() as i64; - | ~~~~~~~~~~~~ +LL - let _ = foo as i64; +LL + let _ = foo() as i64; + | error: casting function pointer `foo` to `i128` --> tests/ui/fn_to_numeric_cast_any.rs:32:13 @@ -52,8 +56,9 @@ LL | let _ = foo as i128; | help: did you mean to invoke the function? | -LL | let _ = foo() as i128; - | ~~~~~~~~~~~~~ +LL - let _ = foo as i128; +LL + let _ = foo() as i128; + | error: casting function pointer `foo` to `isize` --> tests/ui/fn_to_numeric_cast_any.rs:34:13 @@ -63,8 +68,9 @@ LL | let _ = foo as isize; | help: did you mean to invoke the function? | -LL | let _ = foo() as isize; - | ~~~~~~~~~~~~~~ +LL - let _ = foo as isize; +LL + let _ = foo() as isize; + | error: casting function pointer `foo` to `u8` --> tests/ui/fn_to_numeric_cast_any.rs:37:13 @@ -74,8 +80,9 @@ LL | let _ = foo as u8; | help: did you mean to invoke the function? | -LL | let _ = foo() as u8; - | ~~~~~~~~~~~ +LL - let _ = foo as u8; +LL + let _ = foo() as u8; + | error: casting function pointer `foo` to `u16` --> tests/ui/fn_to_numeric_cast_any.rs:39:13 @@ -85,8 +92,9 @@ LL | let _ = foo as u16; | help: did you mean to invoke the function? | -LL | let _ = foo() as u16; - | ~~~~~~~~~~~~ +LL - let _ = foo as u16; +LL + let _ = foo() as u16; + | error: casting function pointer `foo` to `u32` --> tests/ui/fn_to_numeric_cast_any.rs:41:13 @@ -96,8 +104,9 @@ LL | let _ = foo as u32; | help: did you mean to invoke the function? | -LL | let _ = foo() as u32; - | ~~~~~~~~~~~~ +LL - let _ = foo as u32; +LL + let _ = foo() as u32; + | error: casting function pointer `foo` to `u64` --> tests/ui/fn_to_numeric_cast_any.rs:43:13 @@ -107,8 +116,9 @@ LL | let _ = foo as u64; | help: did you mean to invoke the function? | -LL | let _ = foo() as u64; - | ~~~~~~~~~~~~ +LL - let _ = foo as u64; +LL + let _ = foo() as u64; + | error: casting function pointer `foo` to `u128` --> tests/ui/fn_to_numeric_cast_any.rs:45:13 @@ -118,8 +128,9 @@ LL | let _ = foo as u128; | help: did you mean to invoke the function? | -LL | let _ = foo() as u128; - | ~~~~~~~~~~~~~ +LL - let _ = foo as u128; +LL + let _ = foo() as u128; + | error: casting function pointer `foo` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:47:13 @@ -129,8 +140,9 @@ LL | let _ = foo as usize; | help: did you mean to invoke the function? | -LL | let _ = foo() as usize; - | ~~~~~~~~~~~~~~ +LL - let _ = foo as usize; +LL + let _ = foo() as usize; + | error: casting function pointer `Struct::static_method` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:52:13 @@ -140,8 +152,9 @@ LL | let _ = Struct::static_method as usize; | help: did you mean to invoke the function? | -LL | let _ = Struct::static_method() as usize; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = Struct::static_method as usize; +LL + let _ = Struct::static_method() as usize; + | error: casting function pointer `f` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:57:5 @@ -151,7 +164,8 @@ LL | f as usize | help: did you mean to invoke the function? | -LL | f() as usize +LL - f as usize +LL + f() as usize | error: casting function pointer `T::static_method` to `usize` @@ -162,7 +176,8 @@ LL | T::static_method as usize | help: did you mean to invoke the function? | -LL | T::static_method() as usize +LL - T::static_method as usize +LL + T::static_method() as usize | error: casting function pointer `(clos as fn(u32) -> u32)` to `usize` @@ -173,8 +188,9 @@ LL | let _ = (clos as fn(u32) -> u32) as usize; | help: did you mean to invoke the function? | -LL | let _ = (clos as fn(u32) -> u32)() as usize; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = (clos as fn(u32) -> u32) as usize; +LL + let _ = (clos as fn(u32) -> u32)() as usize; + | error: casting function pointer `foo` to `*const ()` --> tests/ui/fn_to_numeric_cast_any.rs:74:13 @@ -184,8 +200,9 @@ LL | let _ = foo as *const (); | help: did you mean to invoke the function? | -LL | let _ = foo() as *const (); - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = foo as *const (); +LL + let _ = foo() as *const (); + | error: aborting due to 17 previous errors diff --git a/src/tools/clippy/tests/ui/for_kv_map.stderr b/src/tools/clippy/tests/ui/for_kv_map.stderr index adcc3ab8fdb90..11b61c8cbc64c 100644 --- a/src/tools/clippy/tests/ui/for_kv_map.stderr +++ b/src/tools/clippy/tests/ui/for_kv_map.stderr @@ -8,8 +8,9 @@ LL | for (_, v) in &m { = help: to override `-D warnings` add `#[allow(clippy::for_kv_map)]` help: use the corresponding method | -LL | for v in m.values() { - | ~ ~~~~~~~~~~ +LL - for (_, v) in &m { +LL + for v in m.values() { + | error: you seem to want to iterate on a map's values --> tests/ui/for_kv_map.rs:16:19 @@ -19,8 +20,9 @@ LL | for (_, v) in &*m { | help: use the corresponding method | -LL | for v in (*m).values() { - | ~ ~~~~~~~~~~~~~ +LL - for (_, v) in &*m { +LL + for v in (*m).values() { + | error: you seem to want to iterate on a map's values --> tests/ui/for_kv_map.rs:25:19 @@ -30,8 +32,9 @@ LL | for (_, v) in &mut m { | help: use the corresponding method | -LL | for v in m.values_mut() { - | ~ ~~~~~~~~~~~~~~ +LL - for (_, v) in &mut m { +LL + for v in m.values_mut() { + | error: you seem to want to iterate on a map's values --> tests/ui/for_kv_map.rs:31:19 @@ -41,8 +44,9 @@ LL | for (_, v) in &mut *m { | help: use the corresponding method | -LL | for v in (*m).values_mut() { - | ~ ~~~~~~~~~~~~~~~~~ +LL - for (_, v) in &mut *m { +LL + for v in (*m).values_mut() { + | error: you seem to want to iterate on a map's keys --> tests/ui/for_kv_map.rs:38:24 @@ -52,8 +56,9 @@ LL | for (k, _value) in rm { | help: use the corresponding method | -LL | for k in rm.keys() { - | ~ ~~~~~~~~~ +LL - for (k, _value) in rm { +LL + for k in rm.keys() { + | error: you seem to want to iterate on a map's keys --> tests/ui/for_kv_map.rs:45:32 @@ -63,8 +68,9 @@ LL | 'label: for (k, _value) in rm { | help: use the corresponding method | -LL | 'label: for k in rm.keys() { - | ~ ~~~~~~~~~ +LL - 'label: for (k, _value) in rm { +LL + 'label: for k in rm.keys() { + | error: aborting due to 6 previous errors diff --git a/src/tools/clippy/tests/ui/four_forward_slashes.stderr b/src/tools/clippy/tests/ui/four_forward_slashes.stderr index a2218ea4d10b0..615489c850aa1 100644 --- a/src/tools/clippy/tests/ui/four_forward_slashes.stderr +++ b/src/tools/clippy/tests/ui/four_forward_slashes.stderr @@ -9,6 +9,8 @@ LL | | fn a() {} = help: to override `-D warnings` add `#[allow(clippy::four_forward_slashes)]` help: make this a doc comment by removing one `/` | +LL - //// whoops +LL - fn a() {} LL + /// whoops | @@ -22,6 +24,8 @@ LL | | fn b() {} | help: make this a doc comment by removing one `/` | +LL - //// whoops +LL - #[allow(dead_code)] LL + /// whoops | @@ -50,6 +54,8 @@ LL | | fn g() {} | help: make this a doc comment by removing one `/` | +LL - //// between attributes +LL - #[allow(dead_code)] LL + /// between attributes | @@ -62,6 +68,8 @@ LL | | fn h() {} | help: make this a doc comment by removing one `/` | +LL - //// not very start of contents +LL - fn h() {} LL + /// not very start of contents | diff --git a/src/tools/clippy/tests/ui/four_forward_slashes_first_line.stderr b/src/tools/clippy/tests/ui/four_forward_slashes_first_line.stderr index 23937034b7e28..aed301bab0f3a 100644 --- a/src/tools/clippy/tests/ui/four_forward_slashes_first_line.stderr +++ b/src/tools/clippy/tests/ui/four_forward_slashes_first_line.stderr @@ -9,6 +9,8 @@ LL | | fn a() {} = help: to override `-D warnings` add `#[allow(clippy::four_forward_slashes)]` help: make this a doc comment by removing one `/` | +LL - //// borked doc comment on the first line. doesn't combust! +LL - fn a() {} LL + /// borked doc comment on the first line. doesn't combust! | diff --git a/src/tools/clippy/tests/ui/get_unwrap.stderr b/src/tools/clippy/tests/ui/get_unwrap.stderr index 0f8b279da1e7a..63f834bdca883 100644 --- a/src/tools/clippy/tests/ui/get_unwrap.stderr +++ b/src/tools/clippy/tests/ui/get_unwrap.stderr @@ -11,8 +11,9 @@ LL | #![deny(clippy::get_unwrap)] | ^^^^^^^^^^^^^^^^^^ help: using `[]` is clearer and more concise | -LL | let _ = &boxed_slice[1]; - | ~~~~~~~~~~~~~~~ +LL - let _ = boxed_slice.get(1).unwrap(); +LL + let _ = &boxed_slice[1]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:37:17 @@ -33,8 +34,9 @@ LL | let _ = some_slice.get(0).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_slice[0]; - | ~~~~~~~~~~~~~~ +LL - let _ = some_slice.get(0).unwrap(); +LL + let _ = &some_slice[0]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:38:17 @@ -53,8 +55,9 @@ LL | let _ = some_vec.get(0).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_vec[0]; - | ~~~~~~~~~~~~ +LL - let _ = some_vec.get(0).unwrap(); +LL + let _ = &some_vec[0]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:39:17 @@ -73,8 +76,9 @@ LL | let _ = some_vecdeque.get(0).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_vecdeque[0]; - | ~~~~~~~~~~~~~~~~~ +LL - let _ = some_vecdeque.get(0).unwrap(); +LL + let _ = &some_vecdeque[0]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:40:17 @@ -93,8 +97,9 @@ LL | let _ = some_hashmap.get(&1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_hashmap[&1]; - | ~~~~~~~~~~~~~~~~~ +LL - let _ = some_hashmap.get(&1).unwrap(); +LL + let _ = &some_hashmap[&1]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:41:17 @@ -113,8 +118,9 @@ LL | let _ = some_btreemap.get(&1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _ = &some_btreemap[&1]; - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = some_btreemap.get(&1).unwrap(); +LL + let _ = &some_btreemap[&1]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:42:17 @@ -133,8 +139,9 @@ LL | let _: u8 = *boxed_slice.get(1).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _: u8 = boxed_slice[1]; - | ~~~~~~~~~~~~~~ +LL - let _: u8 = *boxed_slice.get(1).unwrap(); +LL + let _: u8 = boxed_slice[1]; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:46:22 @@ -153,8 +160,9 @@ LL | *boxed_slice.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | boxed_slice[0] = 1; - | ~~~~~~~~~~~~~~ +LL - *boxed_slice.get_mut(0).unwrap() = 1; +LL + boxed_slice[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:51:10 @@ -173,8 +181,9 @@ LL | *some_slice.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | some_slice[0] = 1; - | ~~~~~~~~~~~~~ +LL - *some_slice.get_mut(0).unwrap() = 1; +LL + some_slice[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:52:10 @@ -193,8 +202,9 @@ LL | *some_vec.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | some_vec[0] = 1; - | ~~~~~~~~~~~ +LL - *some_vec.get_mut(0).unwrap() = 1; +LL + some_vec[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:53:10 @@ -213,8 +223,9 @@ LL | *some_vecdeque.get_mut(0).unwrap() = 1; | help: using `[]` is clearer and more concise | -LL | some_vecdeque[0] = 1; - | ~~~~~~~~~~~~~~~~ +LL - *some_vecdeque.get_mut(0).unwrap() = 1; +LL + some_vecdeque[0] = 1; + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:54:10 @@ -233,8 +244,9 @@ LL | let _ = some_vec.get(0..1).unwrap().to_vec(); | help: using `[]` is clearer and more concise | -LL | let _ = some_vec[0..1].to_vec(); - | ~~~~~~~~~~~~~~ +LL - let _ = some_vec.get(0..1).unwrap().to_vec(); +LL + let _ = some_vec[0..1].to_vec(); + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:66:17 @@ -253,8 +265,9 @@ LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec(); | help: using `[]` is clearer and more concise | -LL | let _ = some_vec[0..1].to_vec(); - | ~~~~~~~~~~~~~~ +LL - let _ = some_vec.get_mut(0..1).unwrap().to_vec(); +LL + let _ = some_vec[0..1].to_vec(); + | error: used `unwrap()` on an `Option` value --> tests/ui/get_unwrap.rs:67:17 @@ -273,8 +286,9 @@ LL | let _x: &i32 = f.get(1 + 2).unwrap(); | help: using `[]` is clearer and more concise | -LL | let _x: &i32 = &f[1 + 2]; - | ~~~~~~~~~ +LL - let _x: &i32 = f.get(1 + 2).unwrap(); +LL + let _x: &i32 = &f[1 + 2]; + | error: called `.get().unwrap()` on a slice --> tests/ui/get_unwrap.rs:80:18 @@ -284,8 +298,9 @@ LL | let _x = f.get(1 + 2).unwrap().to_string(); | help: using `[]` is clearer and more concise | -LL | let _x = f[1 + 2].to_string(); - | ~~~~~~~~ +LL - let _x = f.get(1 + 2).unwrap().to_string(); +LL + let _x = f[1 + 2].to_string(); + | error: called `.get().unwrap()` on a slice --> tests/ui/get_unwrap.rs:83:18 @@ -295,8 +310,9 @@ LL | let _x = f.get(1 + 2).unwrap().abs(); | help: using `[]` is clearer and more concise | -LL | let _x = f[1 + 2].abs(); - | ~~~~~~~~ +LL - let _x = f.get(1 + 2).unwrap().abs(); +LL + let _x = f[1 + 2].abs(); + | error: called `.get_mut().unwrap()` on a slice --> tests/ui/get_unwrap.rs:100:33 @@ -306,8 +322,9 @@ LL | let b = rest.get_mut(linidx(j, k) - linidx(i, k) - | help: using `[]` is clearer and more concise | -LL | let b = &mut rest[linidx(j, k) - linidx(i, k) - 1]; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let b = rest.get_mut(linidx(j, k) - linidx(i, k) - 1).unwrap(); +LL + let b = &mut rest[linidx(j, k) - linidx(i, k) - 1]; + | error: aborting due to 30 previous errors diff --git a/src/tools/clippy/tests/ui/implicit_hasher.stderr b/src/tools/clippy/tests/ui/implicit_hasher.stderr index 48c6ebc209cf3..11c7cd74a7295 100644 --- a/src/tools/clippy/tests/ui/implicit_hasher.stderr +++ b/src/tools/clippy/tests/ui/implicit_hasher.stderr @@ -78,8 +78,9 @@ LL | pub fn map(map: &mut HashMap) {} | help: add a type parameter for `BuildHasher` | -LL | pub fn map(map: &mut HashMap) {} - | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~ +LL - pub fn map(map: &mut HashMap) {} +LL + pub fn map(map: &mut HashMap) {} + | error: parameter of type `HashSet` should be generalized over different hashers --> tests/ui/implicit_hasher.rs:70:22 @@ -89,8 +90,9 @@ LL | pub fn set(set: &mut HashSet) {} | help: add a type parameter for `BuildHasher` | -LL | pub fn set(set: &mut HashSet) {} - | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~ +LL - pub fn set(set: &mut HashSet) {} +LL + pub fn set(set: &mut HashSet) {} + | error: impl for `HashMap` should be generalized over different hashers --> tests/ui/implicit_hasher.rs:76:43 @@ -114,8 +116,9 @@ LL | pub async fn election_vote(_data: HashMap) {} | help: add a type parameter for `BuildHasher` | -LL | pub async fn election_vote(_data: HashMap) {} - | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~ +LL - pub async fn election_vote(_data: HashMap) {} +LL + pub async fn election_vote(_data: HashMap) {} + | error: aborting due to 9 previous errors diff --git a/src/tools/clippy/tests/ui/implicit_return.stderr b/src/tools/clippy/tests/ui/implicit_return.stderr index 3b06f26f5a05f..0d2faa5e067bf 100644 --- a/src/tools/clippy/tests/ui/implicit_return.stderr +++ b/src/tools/clippy/tests/ui/implicit_return.stderr @@ -8,7 +8,8 @@ LL | true = help: to override `-D warnings` add `#[allow(clippy::implicit_return)]` help: add `return` as shown | -LL | return true +LL - true +LL + return true | error: missing `return` statement @@ -19,8 +20,9 @@ LL | if true { true } else { false } | help: add `return` as shown | -LL | if true { return true } else { false } - | ~~~~~~~~~~~ +LL - if true { true } else { false } +LL + if true { return true } else { false } + | error: missing `return` statement --> tests/ui/implicit_return.rs:19:29 @@ -30,8 +32,9 @@ LL | if true { true } else { false } | help: add `return` as shown | -LL | if true { true } else { return false } - | ~~~~~~~~~~~~ +LL - if true { true } else { false } +LL + if true { true } else { return false } + | error: missing `return` statement --> tests/ui/implicit_return.rs:25:17 @@ -41,8 +44,9 @@ LL | true => false, | help: add `return` as shown | -LL | true => return false, - | ~~~~~~~~~~~~ +LL - true => false, +LL + true => return false, + | error: missing `return` statement --> tests/ui/implicit_return.rs:26:20 @@ -52,8 +56,9 @@ LL | false => { true }, | help: add `return` as shown | -LL | false => { return true }, - | ~~~~~~~~~~~ +LL - false => { true }, +LL + false => { return true }, + | error: missing `return` statement --> tests/ui/implicit_return.rs:39:9 @@ -63,8 +68,9 @@ LL | break true; | help: change `break` to `return` as shown | -LL | return true; - | ~~~~~~~~~~~ +LL - break true; +LL + return true; + | error: missing `return` statement --> tests/ui/implicit_return.rs:46:13 @@ -74,8 +80,9 @@ LL | break true; | help: change `break` to `return` as shown | -LL | return true; - | ~~~~~~~~~~~ +LL - break true; +LL + return true; + | error: missing `return` statement --> tests/ui/implicit_return.rs:54:13 @@ -85,8 +92,9 @@ LL | break true; | help: change `break` to `return` as shown | -LL | return true; - | ~~~~~~~~~~~ +LL - break true; +LL + return true; + | error: missing `return` statement --> tests/ui/implicit_return.rs:72:18 @@ -96,8 +104,9 @@ LL | let _ = || { true }; | help: add `return` as shown | -LL | let _ = || { return true }; - | ~~~~~~~~~~~ +LL - let _ = || { true }; +LL + let _ = || { return true }; + | error: missing `return` statement --> tests/ui/implicit_return.rs:73:16 @@ -107,8 +116,9 @@ LL | let _ = || true; | help: add `return` as shown | -LL | let _ = || return true; - | ~~~~~~~~~~~ +LL - let _ = || true; +LL + let _ = || return true; + | error: missing `return` statement --> tests/ui/implicit_return.rs:81:5 @@ -118,7 +128,8 @@ LL | format!("test {}", "test") | help: add `return` as shown | -LL | return format!("test {}", "test") +LL - format!("test {}", "test") +LL + return format!("test {}", "test") | error: missing `return` statement @@ -129,7 +140,8 @@ LL | m!(true, false) | help: add `return` as shown | -LL | return m!(true, false) +LL - m!(true, false) +LL + return m!(true, false) | error: missing `return` statement @@ -140,8 +152,9 @@ LL | break true; | help: change `break` to `return` as shown | -LL | return true; - | ~~~~~~~~~~~ +LL - break true; +LL + return true; + | error: missing `return` statement --> tests/ui/implicit_return.rs:101:17 @@ -151,8 +164,9 @@ LL | break 'outer false; | help: change `break` to `return` as shown | -LL | return false; - | ~~~~~~~~~~~~ +LL - break 'outer false; +LL + return false; + | error: missing `return` statement --> tests/ui/implicit_return.rs:116:5 @@ -177,7 +191,8 @@ LL | true | help: add `return` as shown | -LL | return true +LL - true +LL + return true | error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/index_refutable_slice/if_let_slice_binding.stderr b/src/tools/clippy/tests/ui/index_refutable_slice/if_let_slice_binding.stderr index 8819cb0e28bfb..d62c749a79e1b 100644 --- a/src/tools/clippy/tests/ui/index_refutable_slice/if_let_slice_binding.stderr +++ b/src/tools/clippy/tests/ui/index_refutable_slice/if_let_slice_binding.stderr @@ -11,12 +11,14 @@ LL | #![deny(clippy::index_refutable_slice)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a slice pattern here | -LL | if let Some([slice_0, ..]) = slice { - | ~~~~~~~~~~~~~ +LL - if let Some(slice) = slice { +LL + if let Some([slice_0, ..]) = slice { + | help: and replace the index expressions here | -LL | println!("{}", slice_0); - | ~~~~~~~ +LL - println!("{}", slice[0]); +LL + println!("{}", slice_0); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:23:17 @@ -26,12 +28,14 @@ LL | if let Some(slice) = slice { | help: try using a slice pattern here | -LL | if let Some([slice_0, ..]) = slice { - | ~~~~~~~~~~~~~ +LL - if let Some(slice) = slice { +LL + if let Some([slice_0, ..]) = slice { + | help: and replace the index expressions here | -LL | println!("{}", slice_0); - | ~~~~~~~ +LL - println!("{}", slice[0]); +LL + println!("{}", slice_0); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:30:17 @@ -41,8 +45,9 @@ LL | if let Some(slice) = slice { | help: try using a slice pattern here | -LL | if let Some([slice_0, _, slice_2, ..]) = slice { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(slice) = slice { +LL + if let Some([slice_0, _, slice_2, ..]) = slice { + | help: and replace the index expressions here | LL ~ println!("{}", slice_2); @@ -57,12 +62,14 @@ LL | if let SomeEnum::One(slice) | SomeEnum::Three(slice) = slice_wrapped { | help: try using a slice pattern here | -LL | if let SomeEnum::One([slice_0, ..]) | SomeEnum::Three([slice_0, ..]) = slice_wrapped { - | ~~~~~~~~~~~~~ ~~~~~~~~~~~~~ +LL - if let SomeEnum::One(slice) | SomeEnum::Three(slice) = slice_wrapped { +LL + if let SomeEnum::One([slice_0, ..]) | SomeEnum::Three([slice_0, ..]) = slice_wrapped { + | help: and replace the index expressions here | -LL | println!("{}", slice_0); - | ~~~~~~~ +LL - println!("{}", slice[0]); +LL + println!("{}", slice_0); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:46:29 @@ -72,12 +79,14 @@ LL | if let (SomeEnum::Three(a), Some(b)) = (a_wrapped, b_wrapped) { | help: try using a slice pattern here | -LL | if let (SomeEnum::Three([_, _, a_2, ..]), Some(b)) = (a_wrapped, b_wrapped) { - | ~~~~~~~~~~~~~~~ +LL - if let (SomeEnum::Three(a), Some(b)) = (a_wrapped, b_wrapped) { +LL + if let (SomeEnum::Three([_, _, a_2, ..]), Some(b)) = (a_wrapped, b_wrapped) { + | help: and replace the index expressions here | -LL | println!("{} -> {}", a_2, b[1]); - | ~~~ +LL - println!("{} -> {}", a[2], b[1]); +LL + println!("{} -> {}", a_2, b[1]); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:46:38 @@ -87,12 +96,14 @@ LL | if let (SomeEnum::Three(a), Some(b)) = (a_wrapped, b_wrapped) { | help: try using a slice pattern here | -LL | if let (SomeEnum::Three(a), Some([_, b_1, ..])) = (a_wrapped, b_wrapped) { - | ~~~~~~~~~~~~ +LL - if let (SomeEnum::Three(a), Some(b)) = (a_wrapped, b_wrapped) { +LL + if let (SomeEnum::Three(a), Some([_, b_1, ..])) = (a_wrapped, b_wrapped) { + | help: and replace the index expressions here | -LL | println!("{} -> {}", a[2], b_1); - | ~~~ +LL - println!("{} -> {}", a[2], b[1]); +LL + println!("{} -> {}", a[2], b_1); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:55:21 @@ -102,12 +113,14 @@ LL | if let Some(ref slice) = slice { | help: try using a slice pattern here | -LL | if let Some([_, ref slice_1, ..]) = slice { - | ~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(ref slice) = slice { +LL + if let Some([_, ref slice_1, ..]) = slice { + | help: and replace the index expressions here | -LL | println!("{:?}", slice_1); - | ~~~~~~~ +LL - println!("{:?}", slice[1]); +LL + println!("{:?}", slice_1); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:64:17 @@ -117,12 +130,14 @@ LL | if let Some(slice) = &slice { | help: try using a slice pattern here | -LL | if let Some([slice_0, ..]) = &slice { - | ~~~~~~~~~~~~~ +LL - if let Some(slice) = &slice { +LL + if let Some([slice_0, ..]) = &slice { + | help: and replace the index expressions here | -LL | println!("{:?}", slice_0); - | ~~~~~~~ +LL - println!("{:?}", slice[0]); +LL + println!("{:?}", slice_0); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:134:17 @@ -132,12 +147,14 @@ LL | if let Some(slice) = wrap.inner { | help: try using a slice pattern here | -LL | if let Some([slice_0, ..]) = wrap.inner { - | ~~~~~~~~~~~~~ +LL - if let Some(slice) = wrap.inner { +LL + if let Some([slice_0, ..]) = wrap.inner { + | help: and replace the index expressions here | -LL | println!("This is awesome! {}", slice_0); - | ~~~~~~~ +LL - println!("This is awesome! {}", slice[0]); +LL + println!("This is awesome! {}", slice_0); + | error: this binding can be a slice pattern to avoid indexing --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:142:17 @@ -147,12 +164,14 @@ LL | if let Some(slice) = wrap.inner { | help: try using a slice pattern here | -LL | if let Some([slice_0, ..]) = wrap.inner { - | ~~~~~~~~~~~~~ +LL - if let Some(slice) = wrap.inner { +LL + if let Some([slice_0, ..]) = wrap.inner { + | help: and replace the index expressions here | -LL | println!("This is super awesome! {}", slice_0); - | ~~~~~~~ +LL - println!("This is super awesome! {}", slice[0]); +LL + println!("This is super awesome! {}", slice_0); + | error: aborting due to 10 previous errors diff --git a/src/tools/clippy/tests/ui/index_refutable_slice/slice_indexing_in_macro.stderr b/src/tools/clippy/tests/ui/index_refutable_slice/slice_indexing_in_macro.stderr index 69f0aaa977785..f1397eb110bf8 100644 --- a/src/tools/clippy/tests/ui/index_refutable_slice/slice_indexing_in_macro.stderr +++ b/src/tools/clippy/tests/ui/index_refutable_slice/slice_indexing_in_macro.stderr @@ -11,12 +11,14 @@ LL | #![deny(clippy::index_refutable_slice)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a slice pattern here | -LL | if let Some([slice_0, ..]) = slice; - | ~~~~~~~~~~~~~ +LL - if let Some(slice) = slice; +LL + if let Some([slice_0, ..]) = slice; + | help: and replace the index expressions here | -LL | println!("{}", slice_0); - | ~~~~~~~ +LL - println!("{}", slice[0]); +LL + println!("{}", slice_0); + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/iter_nth.stderr b/src/tools/clippy/tests/ui/iter_nth.stderr index 178463f534754..1167a604ecdcb 100644 --- a/src/tools/clippy/tests/ui/iter_nth.stderr +++ b/src/tools/clippy/tests/ui/iter_nth.stderr @@ -8,8 +8,9 @@ LL | let bad_vec = some_vec.iter().nth(3); = help: to override `-D warnings` add `#[allow(clippy::iter_nth)]` help: `get` is equivalent but more concise | -LL | let bad_vec = some_vec.get(3); - | ~~~ +LL - let bad_vec = some_vec.iter().nth(3); +LL + let bad_vec = some_vec.get(3); + | error: called `.iter().nth()` on a slice --> tests/ui/iter_nth.rs:35:26 @@ -19,8 +20,9 @@ LL | let bad_slice = &some_vec[..].iter().nth(3); | help: `get` is equivalent but more concise | -LL | let bad_slice = &some_vec[..].get(3); - | ~~~ +LL - let bad_slice = &some_vec[..].iter().nth(3); +LL + let bad_slice = &some_vec[..].get(3); + | error: called `.iter().nth()` on a slice --> tests/ui/iter_nth.rs:36:31 @@ -30,8 +32,9 @@ LL | let bad_boxed_slice = boxed_slice.iter().nth(3); | help: `get` is equivalent but more concise | -LL | let bad_boxed_slice = boxed_slice.get(3); - | ~~~ +LL - let bad_boxed_slice = boxed_slice.iter().nth(3); +LL + let bad_boxed_slice = boxed_slice.get(3); + | error: called `.iter().nth()` on a `VecDeque` --> tests/ui/iter_nth.rs:37:29 @@ -41,8 +44,9 @@ LL | let bad_vec_deque = some_vec_deque.iter().nth(3); | help: `get` is equivalent but more concise | -LL | let bad_vec_deque = some_vec_deque.get(3); - | ~~~ +LL - let bad_vec_deque = some_vec_deque.iter().nth(3); +LL + let bad_vec_deque = some_vec_deque.get(3); + | error: called `.iter_mut().nth()` on a `Vec` --> tests/ui/iter_nth.rs:42:23 @@ -52,8 +56,9 @@ LL | let bad_vec = some_vec.iter_mut().nth(3); | help: `get_mut` is equivalent but more concise | -LL | let bad_vec = some_vec.get_mut(3); - | ~~~~~~~ +LL - let bad_vec = some_vec.iter_mut().nth(3); +LL + let bad_vec = some_vec.get_mut(3); + | error: called `.iter_mut().nth()` on a slice --> tests/ui/iter_nth.rs:45:26 @@ -63,8 +68,9 @@ LL | let bad_slice = &some_vec[..].iter_mut().nth(3); | help: `get_mut` is equivalent but more concise | -LL | let bad_slice = &some_vec[..].get_mut(3); - | ~~~~~~~ +LL - let bad_slice = &some_vec[..].iter_mut().nth(3); +LL + let bad_slice = &some_vec[..].get_mut(3); + | error: called `.iter_mut().nth()` on a `VecDeque` --> tests/ui/iter_nth.rs:48:29 @@ -74,8 +80,9 @@ LL | let bad_vec_deque = some_vec_deque.iter_mut().nth(3); | help: `get_mut` is equivalent but more concise | -LL | let bad_vec_deque = some_vec_deque.get_mut(3); - | ~~~~~~~ +LL - let bad_vec_deque = some_vec_deque.iter_mut().nth(3); +LL + let bad_vec_deque = some_vec_deque.get_mut(3); + | error: called `.iter().nth()` on a `Vec` --> tests/ui/iter_nth.rs:52:5 @@ -85,8 +92,9 @@ LL | vec_ref.iter().nth(3); | help: `get` is equivalent but more concise | -LL | vec_ref.get(3); - | ~~~ +LL - vec_ref.iter().nth(3); +LL + vec_ref.get(3); + | error: aborting due to 8 previous errors diff --git a/src/tools/clippy/tests/ui/join_absolute_paths.stderr b/src/tools/clippy/tests/ui/join_absolute_paths.stderr index e7fd5508823ae..300946bf3b5fc 100644 --- a/src/tools/clippy/tests/ui/join_absolute_paths.stderr +++ b/src/tools/clippy/tests/ui/join_absolute_paths.stderr @@ -9,12 +9,14 @@ LL | path.join("/sh"); = help: to override `-D warnings` add `#[allow(clippy::join_absolute_paths)]` help: if this is unintentional, try removing the starting separator | -LL | path.join("sh"); - | ~~~~ +LL - path.join("/sh"); +LL + path.join("sh"); + | help: if this is intentional, consider using `Path::new` | -LL | PathBuf::from("/sh"); - | ~~~~~~~~~~~~~~~~~~~~ +LL - path.join("/sh"); +LL + PathBuf::from("/sh"); + | error: argument to `Path::join` starts with a path separator --> tests/ui/join_absolute_paths.rs:14:15 @@ -25,12 +27,14 @@ LL | path.join("\\user"); = note: joining a path starting with separator will replace the path instead help: if this is unintentional, try removing the starting separator | -LL | path.join("\user"); - | ~~~~~~~ +LL - path.join("\\user"); +LL + path.join("\user"); + | help: if this is intentional, consider using `Path::new` | -LL | PathBuf::from("\\user"); - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - path.join("\\user"); +LL + PathBuf::from("\\user"); + | error: argument to `Path::join` starts with a path separator --> tests/ui/join_absolute_paths.rs:18:15 @@ -41,12 +45,14 @@ LL | path.join("/sh"); = note: joining a path starting with separator will replace the path instead help: if this is unintentional, try removing the starting separator | -LL | path.join("sh"); - | ~~~~ +LL - path.join("/sh"); +LL + path.join("sh"); + | help: if this is intentional, consider using `Path::new` | -LL | PathBuf::from("/sh"); - | ~~~~~~~~~~~~~~~~~~~~ +LL - path.join("/sh"); +LL + PathBuf::from("/sh"); + | error: argument to `Path::join` starts with a path separator --> tests/ui/join_absolute_paths.rs:22:15 @@ -57,12 +63,14 @@ LL | path.join(r#"/sh"#); = note: joining a path starting with separator will replace the path instead help: if this is unintentional, try removing the starting separator | -LL | path.join(r#"sh"#); - | ~~~~~~~ +LL - path.join(r#"/sh"#); +LL + path.join(r#"sh"#); + | help: if this is intentional, consider using `Path::new` | -LL | PathBuf::from(r#"/sh"#); - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - path.join(r#"/sh"#); +LL + PathBuf::from(r#"/sh"#); + | error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui/large_enum_variant.64bit.stderr b/src/tools/clippy/tests/ui/large_enum_variant.64bit.stderr index 805cb406f8344..60653b4abfb50 100644 --- a/src/tools/clippy/tests/ui/large_enum_variant.64bit.stderr +++ b/src/tools/clippy/tests/ui/large_enum_variant.64bit.stderr @@ -13,8 +13,9 @@ LL | | } = help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]` help: consider boxing the large fields to reduce the total size of the enum | -LL | B(Box<[i32; 8000]>), - | ~~~~~~~~~~~~~~~~ +LL - B([i32; 8000]), +LL + B(Box<[i32; 8000]>), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:35:1 @@ -29,8 +30,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | ContainingLargeEnum(Box), - | ~~~~~~~~~~~~~~ +LL - ContainingLargeEnum(LargeEnum), +LL + ContainingLargeEnum(Box), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:40:1 @@ -46,8 +48,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | ContainingMoreThanOneField(i32, Box<[i32; 8000]>, Box<[i32; 9500]>), - | ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ +LL - ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]), +LL + ContainingMoreThanOneField(i32, Box<[i32; 8000]>, Box<[i32; 9500]>), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:46:1 @@ -62,8 +65,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | StructLikeLarge { x: Box<[i32; 8000]>, y: i32 }, - | ~~~~~~~~~~~~~~~~ +LL - StructLikeLarge { x: [i32; 8000], y: i32 }, +LL + StructLikeLarge { x: Box<[i32; 8000]>, y: i32 }, + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:51:1 @@ -78,8 +82,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | StructLikeLarge2 { x: Box<[i32; 8000]> }, - | ~~~~~~~~~~~~~~~~ +LL - StructLikeLarge2 { x: [i32; 8000] }, +LL + StructLikeLarge2 { x: Box<[i32; 8000]> }, + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:67:1 @@ -95,8 +100,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | B(Box<[u8; 1255]>), - | ~~~~~~~~~~~~~~~ +LL - B([u8; 1255]), +LL + B(Box<[u8; 1255]>), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:73:1 @@ -111,8 +117,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | ContainingMoreThanOneField(Box<[i32; 8000]>, [i32; 2], Box<[i32; 9500]>, [i32; 30]), - | ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ +LL - ContainingMoreThanOneField([i32; 8000], [i32; 2], [i32; 9500], [i32; 30]), +LL + ContainingMoreThanOneField(Box<[i32; 8000]>, [i32; 2], Box<[i32; 9500]>, [i32; 30]), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:78:1 @@ -127,8 +134,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | B(Box), - | ~~~~~~~~~~~~ +LL - B(Struct2), +LL + B(Box), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:83:1 @@ -143,8 +151,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | B(Box), - | ~~~~~~~~~~~~ +LL - B(Struct2), +LL + B(Box), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:88:1 @@ -159,8 +168,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | B(Box), - | ~~~~~~~~~~~~ +LL - B(Struct2), +LL + B(Box), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:103:1 @@ -241,8 +251,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | Large(Box<(T, [u8; 512])>), - | ~~~~~~~~~~~~~~~~~~~ +LL - Large((T, [u8; 512])), +LL + Large(Box<(T, [u8; 512])>), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:143:1 @@ -257,8 +268,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | Large(Box<[Foo; 64]>), - | ~~~~~~~~~~~~~~~~~~~ +LL - Large([Foo; 64]), +LL + Large(Box<[Foo; 64]>), + | error: large size difference between variants --> tests/ui/large_enum_variant.rs:153:1 @@ -273,8 +285,9 @@ LL | | } | help: consider boxing the large fields to reduce the total size of the enum | -LL | Error(Box>), - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Error(PossiblyLargeEnumWithConst<256>), +LL + Error(Box>), + | error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/legacy_numeric_constants.stderr b/src/tools/clippy/tests/ui/legacy_numeric_constants.stderr index 267b9ac8e4d11..74fe09e0f5c60 100644 --- a/src/tools/clippy/tests/ui/legacy_numeric_constants.stderr +++ b/src/tools/clippy/tests/ui/legacy_numeric_constants.stderr @@ -8,8 +8,9 @@ LL | std::f32::EPSILON; = help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]` help: use the associated constant instead | -LL | f32::EPSILON; - | ~~~~~~~~~~~~ +LL - std::f32::EPSILON; +LL + f32::EPSILON; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:34:5 @@ -19,8 +20,9 @@ LL | std::u8::MIN; | help: use the associated constant instead | -LL | u8::MIN; - | ~~~~~~~ +LL - std::u8::MIN; +LL + u8::MIN; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:37:5 @@ -30,8 +32,9 @@ LL | std::usize::MIN; | help: use the associated constant instead | -LL | usize::MIN; - | ~~~~~~~~~~ +LL - std::usize::MIN; +LL + usize::MIN; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:40:5 @@ -41,8 +44,9 @@ LL | std::u32::MAX; | help: use the associated constant instead | -LL | u32::MAX; - | ~~~~~~~~ +LL - std::u32::MAX; +LL + u32::MAX; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:43:5 @@ -52,8 +56,9 @@ LL | core::u32::MAX; | help: use the associated constant instead | -LL | u32::MAX; - | ~~~~~~~~ +LL - core::u32::MAX; +LL + u32::MAX; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:46:5 @@ -63,8 +68,9 @@ LL | MAX; | help: use the associated constant instead | -LL | u32::MAX; - | ~~~~~~~~ +LL - MAX; +LL + u32::MAX; + | error: usage of a legacy numeric method --> tests/ui/legacy_numeric_constants.rs:49:10 @@ -74,8 +80,9 @@ LL | i32::max_value(); | help: use the associated constant instead | -LL | i32::MAX; - | ~~~ +LL - i32::max_value(); +LL + i32::MAX; + | error: usage of a legacy numeric method --> tests/ui/legacy_numeric_constants.rs:52:9 @@ -85,8 +92,9 @@ LL | u8::max_value(); | help: use the associated constant instead | -LL | u8::MAX; - | ~~~ +LL - u8::max_value(); +LL + u8::MAX; + | error: usage of a legacy numeric method --> tests/ui/legacy_numeric_constants.rs:55:9 @@ -96,8 +104,9 @@ LL | u8::min_value(); | help: use the associated constant instead | -LL | u8::MIN; - | ~~~ +LL - u8::min_value(); +LL + u8::MIN; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:58:5 @@ -107,8 +116,9 @@ LL | ::std::u8::MIN; | help: use the associated constant instead | -LL | u8::MIN; - | ~~~~~~~ +LL - ::std::u8::MIN; +LL + u8::MIN; + | error: usage of a legacy numeric method --> tests/ui/legacy_numeric_constants.rs:61:27 @@ -118,8 +128,9 @@ LL | ::std::primitive::u8::min_value(); | help: use the associated constant instead | -LL | ::std::primitive::u8::MIN; - | ~~~ +LL - ::std::primitive::u8::min_value(); +LL + ::std::primitive::u8::MIN; + | error: usage of a legacy numeric method --> tests/ui/legacy_numeric_constants.rs:64:26 @@ -129,8 +140,9 @@ LL | std::primitive::i32::max_value(); | help: use the associated constant instead | -LL | std::primitive::i32::MAX; - | ~~~ +LL - std::primitive::i32::max_value(); +LL + std::primitive::i32::MAX; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:67:5 @@ -140,8 +152,9 @@ LL | self::a::u128::MAX; | help: use the associated constant instead | -LL | u128::MAX; - | ~~~~~~~~~ +LL - self::a::u128::MAX; +LL + u128::MAX; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:17:25 @@ -155,8 +168,9 @@ LL | b!(); = note: this error originates in the macro `b` (in Nightly builds, run with -Z macro-backtrace for more info) help: use the associated constant instead | -LL | let x = u64::MAX; - | ~~~~~~~~ +LL - let x = std::u64::MAX; +LL + let x = u64::MAX; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:81:14 @@ -166,8 +180,9 @@ LL | [(0, "", std::i128::MAX)]; | help: use the associated constant instead | -LL | [(0, "", i128::MAX)]; - | ~~~~~~~~~ +LL - [(0, "", std::i128::MAX)]; +LL + [(0, "", i128::MAX)]; + | error: usage of a legacy numeric constant --> tests/ui/legacy_numeric_constants.rs:115:5 @@ -177,8 +192,9 @@ LL | std::u32::MAX; | help: use the associated constant instead | -LL | u32::MAX; - | ~~~~~~~~ +LL - std::u32::MAX; +LL + u32::MAX; + | error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/let_unit.stderr b/src/tools/clippy/tests/ui/let_unit.stderr index 6f149454af2d0..735bd4b878501 100644 --- a/src/tools/clippy/tests/ui/let_unit.stderr +++ b/src/tools/clippy/tests/ui/let_unit.stderr @@ -59,16 +59,19 @@ LL | let res = returns_unit(); | help: omit the `let` binding | -LL | returns_unit(); +LL - let res = returns_unit(); +LL + returns_unit(); | help: variable `res` of type `()` can be replaced with explicit `()` | -LL | returns_result(()).unwrap(); - | ~~ +LL - returns_result(res).unwrap(); +LL + returns_result(()).unwrap(); + | help: variable `res` of type `()` can be replaced with explicit `()` | -LL | returns_result(()).unwrap(); - | ~~ +LL - returns_result(res).unwrap(); +LL + returns_result(()).unwrap(); + | error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui/literals.stderr b/src/tools/clippy/tests/ui/literals.stderr index 564e0bc4f7472..a9192825b3543 100644 --- a/src/tools/clippy/tests/ui/literals.stderr +++ b/src/tools/clippy/tests/ui/literals.stderr @@ -71,12 +71,14 @@ LL | let fail_multi_zero = 000_123usize; = help: to override `-D warnings` add `#[allow(clippy::zero_prefixed_literal)]` help: if you mean to use a decimal constant, remove the `0` to avoid confusion | -LL | let fail_multi_zero = 123usize; - | ~~~~~~~~ +LL - let fail_multi_zero = 000_123usize; +LL + let fail_multi_zero = 123usize; + | help: if you mean to use an octal constant, use `0o` | -LL | let fail_multi_zero = 0o123usize; - | ~~~~~~~~~~ +LL - let fail_multi_zero = 000_123usize; +LL + let fail_multi_zero = 0o123usize; + | error: integer type suffix should not be separated by an underscore --> tests/ui/literals.rs:36:16 @@ -92,12 +94,14 @@ LL | let fail8 = 0123; | help: if you mean to use a decimal constant, remove the `0` to avoid confusion | -LL | let fail8 = 123; - | ~~~ +LL - let fail8 = 0123; +LL + let fail8 = 123; + | help: if you mean to use an octal constant, use `0o` | -LL | let fail8 = 0o123; - | ~~~~~ +LL - let fail8 = 0123; +LL + let fail8 = 0o123; + | error: integer type suffix should not be separated by an underscore --> tests/ui/literals.rs:48:16 @@ -143,8 +147,9 @@ LL | let _ = 08; | help: if you mean to use a decimal constant, remove the `0` to avoid confusion | -LL | let _ = 8; - | ~ +LL - let _ = 08; +LL + let _ = 8; + | error: this is a decimal constant --> tests/ui/literals.rs:72:13 @@ -154,8 +159,9 @@ LL | let _ = 09; | help: if you mean to use a decimal constant, remove the `0` to avoid confusion | -LL | let _ = 9; - | ~ +LL - let _ = 09; +LL + let _ = 9; + | error: this is a decimal constant --> tests/ui/literals.rs:74:13 @@ -165,8 +171,9 @@ LL | let _ = 089; | help: if you mean to use a decimal constant, remove the `0` to avoid confusion | -LL | let _ = 89; - | ~~ +LL - let _ = 089; +LL + let _ = 89; + | error: aborting due to 20 previous errors diff --git a/src/tools/clippy/tests/ui/lossy_float_literal.stderr b/src/tools/clippy/tests/ui/lossy_float_literal.stderr index 3026854e317ae..118351a62d00c 100644 --- a/src/tools/clippy/tests/ui/lossy_float_literal.stderr +++ b/src/tools/clippy/tests/ui/lossy_float_literal.stderr @@ -8,8 +8,9 @@ LL | let _: f32 = 16_777_217.0; = help: to override `-D warnings` add `#[allow(clippy::lossy_float_literal)]` help: consider changing the type or replacing it with | -LL | let _: f32 = 16_777_216.0; - | ~~~~~~~~~~~~ +LL - let _: f32 = 16_777_217.0; +LL + let _: f32 = 16_777_216.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:15:18 @@ -19,8 +20,9 @@ LL | let _: f32 = 16_777_219.0; | help: consider changing the type or replacing it with | -LL | let _: f32 = 16_777_220.0; - | ~~~~~~~~~~~~ +LL - let _: f32 = 16_777_219.0; +LL + let _: f32 = 16_777_220.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:16:18 @@ -30,8 +32,9 @@ LL | let _: f32 = 16_777_219.; | help: consider changing the type or replacing it with | -LL | let _: f32 = 16_777_220.0; - | ~~~~~~~~~~~~ +LL - let _: f32 = 16_777_219.; +LL + let _: f32 = 16_777_220.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:17:18 @@ -41,8 +44,9 @@ LL | let _: f32 = 16_777_219.000; | help: consider changing the type or replacing it with | -LL | let _: f32 = 16_777_220.0; - | ~~~~~~~~~~~~ +LL - let _: f32 = 16_777_219.000; +LL + let _: f32 = 16_777_220.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:18:13 @@ -52,8 +56,9 @@ LL | let _ = 16_777_219f32; | help: consider changing the type or replacing it with | -LL | let _ = 16_777_220_f32; - | ~~~~~~~~~~~~~~ +LL - let _ = 16_777_219f32; +LL + let _ = 16_777_220_f32; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:19:19 @@ -63,8 +68,9 @@ LL | let _: f32 = -16_777_219.0; | help: consider changing the type or replacing it with | -LL | let _: f32 = -16_777_220.0; - | ~~~~~~~~~~~~ +LL - let _: f32 = -16_777_219.0; +LL + let _: f32 = -16_777_220.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:21:18 @@ -74,8 +80,9 @@ LL | let _: f64 = 9_007_199_254_740_993.0; | help: consider changing the type or replacing it with | -LL | let _: f64 = 9_007_199_254_740_992.0; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: f64 = 9_007_199_254_740_993.0; +LL + let _: f64 = 9_007_199_254_740_992.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:22:18 @@ -85,8 +92,9 @@ LL | let _: f64 = 9_007_199_254_740_993.; | help: consider changing the type or replacing it with | -LL | let _: f64 = 9_007_199_254_740_992.0; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: f64 = 9_007_199_254_740_993.; +LL + let _: f64 = 9_007_199_254_740_992.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:23:18 @@ -96,8 +104,9 @@ LL | let _: f64 = 9_007_199_254_740_993.00; | help: consider changing the type or replacing it with | -LL | let _: f64 = 9_007_199_254_740_992.0; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: f64 = 9_007_199_254_740_993.00; +LL + let _: f64 = 9_007_199_254_740_992.0; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:24:13 @@ -107,8 +116,9 @@ LL | let _ = 9_007_199_254_740_993f64; | help: consider changing the type or replacing it with | -LL | let _ = 9_007_199_254_740_992_f64; - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = 9_007_199_254_740_993f64; +LL + let _ = 9_007_199_254_740_992_f64; + | error: literal cannot be represented as the underlying type without loss of precision --> tests/ui/lossy_float_literal.rs:25:19 @@ -118,8 +128,9 @@ LL | let _: f64 = -9_007_199_254_740_993.0; | help: consider changing the type or replacing it with | -LL | let _: f64 = -9_007_199_254_740_992.0; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: f64 = -9_007_199_254_740_993.0; +LL + let _: f64 = -9_007_199_254_740_992.0; + | error: aborting due to 11 previous errors diff --git a/src/tools/clippy/tests/ui/manual_assert.edition2018.stderr b/src/tools/clippy/tests/ui/manual_assert.edition2018.stderr index 004463720e26b..dfccf7e99396c 100644 --- a/src/tools/clippy/tests/ui/manual_assert.edition2018.stderr +++ b/src/tools/clippy/tests/ui/manual_assert.edition2018.stderr @@ -79,7 +79,15 @@ LL | | } | help: try instead | -LL | assert!(!(a > 2), "panic with comment"); +LL - if a > 2 { +LL - // comment +LL - /* this is a +LL - multiline +LL - comment */ +LL - /// Doc comment +LL - panic!("panic with comment") // comment after `panic!` +LL - } +LL + assert!(!(a > 2), "panic with comment"); | error: only a `panic!` in `if`-then statement diff --git a/src/tools/clippy/tests/ui/manual_assert.edition2021.stderr b/src/tools/clippy/tests/ui/manual_assert.edition2021.stderr index 004463720e26b..dfccf7e99396c 100644 --- a/src/tools/clippy/tests/ui/manual_assert.edition2021.stderr +++ b/src/tools/clippy/tests/ui/manual_assert.edition2021.stderr @@ -79,7 +79,15 @@ LL | | } | help: try instead | -LL | assert!(!(a > 2), "panic with comment"); +LL - if a > 2 { +LL - // comment +LL - /* this is a +LL - multiline +LL - comment */ +LL - /// Doc comment +LL - panic!("panic with comment") // comment after `panic!` +LL - } +LL + assert!(!(a > 2), "panic with comment"); | error: only a `panic!` in `if`-then statement diff --git a/src/tools/clippy/tests/ui/manual_async_fn.stderr b/src/tools/clippy/tests/ui/manual_async_fn.stderr index f88fc30b3b54e..8264ece1fa449 100644 --- a/src/tools/clippy/tests/ui/manual_async_fn.stderr +++ b/src/tools/clippy/tests/ui/manual_async_fn.stderr @@ -8,12 +8,16 @@ LL | fn fut() -> impl Future { = help: to override `-D warnings` add `#[allow(clippy::manual_async_fn)]` help: make the function `async` and return the output of the future directly | -LL | async fn fut() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~ +LL - fn fut() -> impl Future { +LL + async fn fut() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | fn fut() -> impl Future { 42 } - | ~~~~~~ +LL - fn fut() -> impl Future { +LL - async { 42 } +LL - } +LL + fn fut() -> impl Future { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:13:1 @@ -23,12 +27,16 @@ LL | fn fut2() ->impl Future { | help: make the function `async` and return the output of the future directly | -LL | async fn fut2() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - fn fut2() ->impl Future { +LL + async fn fut2() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | fn fut2() ->impl Future { 42 } - | ~~~~~~ +LL - fn fut2() ->impl Future { +LL - async { 42 } +LL - } +LL + fn fut2() ->impl Future { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:18:1 @@ -38,12 +46,16 @@ LL | fn fut3()-> impl Future { | help: make the function `async` and return the output of the future directly | -LL | async fn fut3() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - fn fut3()-> impl Future { +LL + async fn fut3() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | fn fut3()-> impl Future { 42 } - | ~~~~~~ +LL - fn fut3()-> impl Future { +LL - async { 42 } +LL - } +LL + fn fut3()-> impl Future { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:22:1 @@ -53,12 +65,16 @@ LL | fn empty_fut() -> impl Future { | help: make the function `async` and remove the return type | -LL | async fn empty_fut() { - | ~~~~~~~~~~~~~~~~~~~~ +LL - fn empty_fut() -> impl Future { +LL + async fn empty_fut() { + | help: move the body of the async block to the enclosing function | -LL | fn empty_fut() -> impl Future {} - | ~~ +LL - fn empty_fut() -> impl Future { +LL - async {} +LL - } +LL + fn empty_fut() -> impl Future {} + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:27:1 @@ -68,12 +84,16 @@ LL | fn empty_fut2() ->impl Future { | help: make the function `async` and remove the return type | -LL | async fn empty_fut2() { - | ~~~~~~~~~~~~~~~~~~~~~ +LL - fn empty_fut2() ->impl Future { +LL + async fn empty_fut2() { + | help: move the body of the async block to the enclosing function | -LL | fn empty_fut2() ->impl Future {} - | ~~ +LL - fn empty_fut2() ->impl Future { +LL - async {} +LL - } +LL + fn empty_fut2() ->impl Future {} + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:32:1 @@ -83,12 +103,16 @@ LL | fn empty_fut3()-> impl Future { | help: make the function `async` and remove the return type | -LL | async fn empty_fut3() { - | ~~~~~~~~~~~~~~~~~~~~~ +LL - fn empty_fut3()-> impl Future { +LL + async fn empty_fut3() { + | help: move the body of the async block to the enclosing function | -LL | fn empty_fut3()-> impl Future {} - | ~~ +LL - fn empty_fut3()-> impl Future { +LL - async {} +LL - } +LL + fn empty_fut3()-> impl Future {} + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:36:1 @@ -98,12 +122,16 @@ LL | fn core_fut() -> impl core::future::Future { | help: make the function `async` and return the output of the future directly | -LL | async fn core_fut() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn core_fut() -> impl core::future::Future { +LL + async fn core_fut() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | fn core_fut() -> impl core::future::Future { 42 } - | ~~~~~~ +LL - fn core_fut() -> impl core::future::Future { +LL - async move { 42 } +LL - } +LL + fn core_fut() -> impl core::future::Future { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:58:5 @@ -113,8 +141,9 @@ LL | fn inh_fut() -> impl Future { | help: make the function `async` and return the output of the future directly | -LL | async fn inh_fut() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn inh_fut() -> impl Future { +LL + async fn inh_fut() -> i32 { + | help: move the body of the async block to the enclosing function | LL ~ fn inh_fut() -> impl Future { @@ -140,12 +169,16 @@ LL | fn elided(_: &i32) -> impl Future + '_ { | help: make the function `async` and return the output of the future directly | -LL | async fn elided(_: &i32) -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn elided(_: &i32) -> impl Future + '_ { +LL + async fn elided(_: &i32) -> i32 { + | help: move the body of the async block to the enclosing function | -LL | fn elided(_: &i32) -> impl Future + '_ { 42 } - | ~~~~~~ +LL - fn elided(_: &i32) -> impl Future + '_ { +LL - async { 42 } +LL - } +LL + fn elided(_: &i32) -> impl Future + '_ { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:102:1 @@ -155,12 +188,16 @@ LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + | help: make the function `async` and return the output of the future directly | -LL | async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + 'a + 'b { +LL + async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { + | help: move the body of the async block to the enclosing function | -LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + 'a + 'b { 42 } - | ~~~~~~ +LL - fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + 'a + 'b { +LL - async { 42 } +LL - } +LL + fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + 'a + 'b { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:131:1 @@ -170,12 +207,16 @@ LL | pub fn issue_10450() -> impl Future { | help: make the function `async` and return the output of the future directly | -LL | pub async fn issue_10450() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - pub fn issue_10450() -> impl Future { +LL + pub async fn issue_10450() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | pub fn issue_10450() -> impl Future { 42 } - | ~~~~~~ +LL - pub fn issue_10450() -> impl Future { +LL - async { 42 } +LL - } +LL + pub fn issue_10450() -> impl Future { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:135:1 @@ -185,12 +226,16 @@ LL | pub(crate) fn issue_10450_2() -> impl Future { | help: make the function `async` and return the output of the future directly | -LL | pub(crate) async fn issue_10450_2() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - pub(crate) fn issue_10450_2() -> impl Future { +LL + pub(crate) async fn issue_10450_2() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | pub(crate) fn issue_10450_2() -> impl Future { 42 } - | ~~~~~~ +LL - pub(crate) fn issue_10450_2() -> impl Future { +LL - async { 42 } +LL - } +LL + pub(crate) fn issue_10450_2() -> impl Future { 42 } + | error: this function can be simplified using the `async fn` syntax --> tests/ui/manual_async_fn.rs:139:1 @@ -200,12 +245,16 @@ LL | pub(self) fn issue_10450_3() -> impl Future { | help: make the function `async` and return the output of the future directly | -LL | pub(self) async fn issue_10450_3() -> i32 { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - pub(self) fn issue_10450_3() -> impl Future { +LL + pub(self) async fn issue_10450_3() -> i32 { + | help: move the body of the async block to the enclosing function | -LL | pub(self) fn issue_10450_3() -> impl Future { 42 } - | ~~~~~~ +LL - pub(self) fn issue_10450_3() -> impl Future { +LL - async { 42 } +LL - } +LL + pub(self) fn issue_10450_3() -> impl Future { 42 } + | error: aborting due to 13 previous errors diff --git a/src/tools/clippy/tests/ui/manual_float_methods.stderr b/src/tools/clippy/tests/ui/manual_float_methods.stderr index 70057620a4a82..13154b107bb8e 100644 --- a/src/tools/clippy/tests/ui/manual_float_methods.stderr +++ b/src/tools/clippy/tests/ui/manual_float_methods.stderr @@ -17,16 +17,19 @@ LL | if x != f32::INFINITY && x != f32::NEG_INFINITY {} = help: to override `-D warnings` add `#[allow(clippy::manual_is_finite)]` help: use the dedicated method instead | -LL | if x.is_finite() {} - | ~~~~~~~~~~~~~ +LL - if x != f32::INFINITY && x != f32::NEG_INFINITY {} +LL + if x.is_finite() {} + | help: this will alter how it handles NaN; if that is a problem, use instead | -LL | if x.is_finite() || x.is_nan() {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if x != f32::INFINITY && x != f32::NEG_INFINITY {} +LL + if x.is_finite() || x.is_nan() {} + | help: or, for conciseness | -LL | if !x.is_infinite() {} - | ~~~~~~~~~~~~~~~~ +LL - if x != f32::INFINITY && x != f32::NEG_INFINITY {} +LL + if !x.is_infinite() {} + | error: manually checking if a float is infinite --> tests/ui/manual_float_methods.rs:26:8 @@ -42,16 +45,19 @@ LL | if x != INFINITE && x != NEG_INFINITE {} | help: use the dedicated method instead | -LL | if x.is_finite() {} - | ~~~~~~~~~~~~~ +LL - if x != INFINITE && x != NEG_INFINITE {} +LL + if x.is_finite() {} + | help: this will alter how it handles NaN; if that is a problem, use instead | -LL | if x.is_finite() || x.is_nan() {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if x != INFINITE && x != NEG_INFINITE {} +LL + if x.is_finite() || x.is_nan() {} + | help: or, for conciseness | -LL | if !x.is_infinite() {} - | ~~~~~~~~~~~~~~~~ +LL - if x != INFINITE && x != NEG_INFINITE {} +LL + if !x.is_infinite() {} + | error: manually checking if a float is infinite --> tests/ui/manual_float_methods.rs:29:8 @@ -67,16 +73,19 @@ LL | if x != f64::INFINITY && x != f64::NEG_INFINITY {} | help: use the dedicated method instead | -LL | if x.is_finite() {} - | ~~~~~~~~~~~~~ +LL - if x != f64::INFINITY && x != f64::NEG_INFINITY {} +LL + if x.is_finite() {} + | help: this will alter how it handles NaN; if that is a problem, use instead | -LL | if x.is_finite() || x.is_nan() {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if x != f64::INFINITY && x != f64::NEG_INFINITY {} +LL + if x.is_finite() || x.is_nan() {} + | help: or, for conciseness | -LL | if !x.is_infinite() {} - | ~~~~~~~~~~~~~~~~ +LL - if x != f64::INFINITY && x != f64::NEG_INFINITY {} +LL + if !x.is_infinite() {} + | error: aborting due to 6 previous errors diff --git a/src/tools/clippy/tests/ui/manual_is_ascii_check.stderr b/src/tools/clippy/tests/ui/manual_is_ascii_check.stderr index a93ccace28a6e..176e545db1f61 100644 --- a/src/tools/clippy/tests/ui/manual_is_ascii_check.stderr +++ b/src/tools/clippy/tests/ui/manual_is_ascii_check.stderr @@ -153,8 +153,9 @@ LL | take_while(|c| ('A'..='Z').contains(&c)); | help: try | -LL | take_while(|c: char| c.is_ascii_uppercase()); - | ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ +LL - take_while(|c| ('A'..='Z').contains(&c)); +LL + take_while(|c: char| c.is_ascii_uppercase()); + | error: manual check for common ascii range --> tests/ui/manual_is_ascii_check.rs:82:20 @@ -164,8 +165,9 @@ LL | take_while(|c| (b'A'..=b'Z').contains(&c)); | help: try | -LL | take_while(|c: u8| c.is_ascii_uppercase()); - | ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ +LL - take_while(|c| (b'A'..=b'Z').contains(&c)); +LL + take_while(|c: u8| c.is_ascii_uppercase()); + | error: manual check for common ascii range --> tests/ui/manual_is_ascii_check.rs:83:26 diff --git a/src/tools/clippy/tests/ui/manual_split_once.stderr b/src/tools/clippy/tests/ui/manual_split_once.stderr index 566204ad8762e..a43560408b447 100644 --- a/src/tools/clippy/tests/ui/manual_split_once.stderr +++ b/src/tools/clippy/tests/ui/manual_split_once.stderr @@ -91,7 +91,8 @@ LL | let r = iter.next().unwrap(); | help: try `split_once` | -LL | let (l, r) = "a.b.c".split_once('.').unwrap(); +LL - let mut iter = "a.b.c".splitn(2, '.'); +LL + let (l, r) = "a.b.c".split_once('.').unwrap(); | help: remove the `iter` usages | @@ -114,7 +115,8 @@ LL | let r = iter.next()?; | help: try `split_once` | -LL | let (l, r) = "a.b.c".split_once('.')?; +LL - let mut iter = "a.b.c".splitn(2, '.'); +LL + let (l, r) = "a.b.c".split_once('.')?; | help: remove the `iter` usages | @@ -137,7 +139,8 @@ LL | let l = iter.next().unwrap(); | help: try `rsplit_once` | -LL | let (l, r) = "a.b.c".rsplit_once('.').unwrap(); +LL - let mut iter = "a.b.c".rsplitn(2, '.'); +LL + let (l, r) = "a.b.c".rsplit_once('.').unwrap(); | help: remove the `iter` usages | @@ -160,7 +163,8 @@ LL | let l = iter.next()?; | help: try `rsplit_once` | -LL | let (l, r) = "a.b.c".rsplit_once('.')?; +LL - let mut iter = "a.b.c".rsplitn(2, '.'); +LL + let (l, r) = "a.b.c".rsplit_once('.')?; | help: remove the `iter` usages | @@ -189,7 +193,8 @@ LL | let b = iter.next().unwrap(); | help: try `split_once` | -LL | let (a, b) = "a.b.c".split_once('.').unwrap(); +LL - let mut iter = "a.b.c".splitn(2, '.'); +LL + let (a, b) = "a.b.c".split_once('.').unwrap(); | help: remove the `iter` usages | diff --git a/src/tools/clippy/tests/ui/match_result_ok.stderr b/src/tools/clippy/tests/ui/match_result_ok.stderr index b5b91cbe55344..18b23bd784540 100644 --- a/src/tools/clippy/tests/ui/match_result_ok.stderr +++ b/src/tools/clippy/tests/ui/match_result_ok.stderr @@ -8,8 +8,9 @@ LL | if let Some(y) = x.parse().ok() { y } else { 0 } = help: to override `-D warnings` add `#[allow(clippy::match_result_ok)]` help: consider matching on `Ok(y)` and removing the call to `ok` instead | -LL | if let Ok(y) = x.parse() { y } else { 0 } - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(y) = x.parse().ok() { y } else { 0 } +LL + if let Ok(y) = x.parse() { y } else { 0 } + | error: matching on `Some` with `ok()` is redundant --> tests/ui/match_result_ok.rs:23:9 @@ -19,8 +20,9 @@ LL | if let Some(y) = x . parse() . ok () { | help: consider matching on `Ok(y)` and removing the call to `ok` instead | -LL | if let Ok(y) = x . parse() { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(y) = x . parse() . ok () { +LL + if let Ok(y) = x . parse() { + | error: matching on `Some` with `ok()` is redundant --> tests/ui/match_result_ok.rs:49:5 @@ -30,8 +32,9 @@ LL | while let Some(a) = wat.next().ok() { | help: consider matching on `Ok(a)` and removing the call to `ok` instead | -LL | while let Ok(a) = wat.next() { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - while let Some(a) = wat.next().ok() { +LL + while let Ok(a) = wat.next() { + | error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui/match_same_arms.stderr b/src/tools/clippy/tests/ui/match_same_arms.stderr index 3c0382767c3fc..bf432f494d316 100644 --- a/src/tools/clippy/tests/ui/match_same_arms.stderr +++ b/src/tools/clippy/tests/ui/match_same_arms.stderr @@ -22,8 +22,9 @@ LL | (1, .., 3) => 42, = help: try changing either arm body help: or try merging the arm patterns | -LL | (1, .., 3) | (.., 3) => 42, - | ~~~~~~~~~~~~~~~~~~~~ +LL - (1, .., 3) => 42, +LL + (1, .., 3) | (.., 3) => 42, + | help: and remove this obsolete arm | LL - (.., 3) => 42, @@ -38,8 +39,9 @@ LL | 51 => 1, = help: try changing either arm body help: or try merging the arm patterns | -LL | 51 | 42 => 1, - | ~~~~~~~ +LL - 51 => 1, +LL + 51 | 42 => 1, + | help: and remove this obsolete arm | LL - 42 => 1, @@ -54,8 +56,9 @@ LL | 41 => 2, = help: try changing either arm body help: or try merging the arm patterns | -LL | 41 | 52 => 2, - | ~~~~~~~ +LL - 41 => 2, +LL + 41 | 52 => 2, + | help: and remove this obsolete arm | LL - 52 => 2, @@ -70,8 +73,9 @@ LL | 2 => 2, = help: try changing either arm body help: or try merging the arm patterns | -LL | 2 | 1 => 2, - | ~~~~~ +LL - 2 => 2, +LL + 2 | 1 => 2, + | help: and remove this obsolete arm | LL - 1 => 2, @@ -86,8 +90,9 @@ LL | 3 => 2, = help: try changing either arm body help: or try merging the arm patterns | -LL | 3 | 1 => 2, - | ~~~~~ +LL - 3 => 2, +LL + 3 | 1 => 2, + | help: and remove this obsolete arm | LL - 1 => 2, @@ -102,8 +107,9 @@ LL | 2 => 2, = help: try changing either arm body help: or try merging the arm patterns | -LL | 2 | 3 => 2, - | ~~~~~ +LL - 2 => 2, +LL + 2 | 3 => 2, + | help: and remove this obsolete arm | LL - 3 => 2, @@ -119,8 +125,9 @@ LL | CommandInfo::External { name, .. } => name.to_string(), = help: try changing either arm body help: or try merging the arm patterns | -LL | CommandInfo::External { name, .. } | CommandInfo::BuiltIn { name, .. } => name.to_string(), - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - CommandInfo::External { name, .. } => name.to_string(), +LL + CommandInfo::External { name, .. } | CommandInfo::BuiltIn { name, .. } => name.to_string(), + | help: and remove this obsolete arm | LL - CommandInfo::BuiltIn { name, .. } => name.to_string(), diff --git a/src/tools/clippy/tests/ui/match_same_arms2.stderr b/src/tools/clippy/tests/ui/match_same_arms2.stderr index 3a28b5afc2b8a..a3f9d0f4b5701 100644 --- a/src/tools/clippy/tests/ui/match_same_arms2.stderr +++ b/src/tools/clippy/tests/ui/match_same_arms2.stderr @@ -34,8 +34,9 @@ LL | 51 => foo(), = help: try changing either arm body help: or try merging the arm patterns | -LL | 51 | 42 => foo(), - | ~~~~~~~ +LL - 51 => foo(), +LL + 51 | 42 => foo(), + | help: and remove this obsolete arm | LL - 42 => foo(), @@ -50,8 +51,9 @@ LL | None => 24, = help: try changing either arm body help: or try merging the arm patterns | -LL | None | Some(_) => 24, - | ~~~~~~~~~~~~~~ +LL - None => 24, +LL + None | Some(_) => 24, + | help: and remove this obsolete arm | LL - Some(_) => 24, @@ -66,8 +68,9 @@ LL | (None, Some(a)) => bar(a), = help: try changing either arm body help: or try merging the arm patterns | -LL | (None, Some(a)) | (Some(a), None) => bar(a), - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (None, Some(a)) => bar(a), +LL + (None, Some(a)) | (Some(a), None) => bar(a), + | help: and remove this obsolete arm | LL - (Some(a), None) => bar(a), @@ -82,8 +85,9 @@ LL | (None, Some(a)) if a == 42 => a, = help: try changing either arm body help: or try merging the arm patterns | -LL | (None, Some(a)) | (Some(a), None) if a == 42 => a, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (None, Some(a)) if a == 42 => a, +LL + (None, Some(a)) | (Some(a), None) if a == 42 => a, + | help: and remove this obsolete arm | LL - (Some(a), None) if a == 42 => a, @@ -98,8 +102,9 @@ LL | (Some(a), ..) => bar(a), = help: try changing either arm body help: or try merging the arm patterns | -LL | (Some(a), ..) | (.., Some(a)) => bar(a), - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (Some(a), ..) => bar(a), +LL + (Some(a), ..) | (.., Some(a)) => bar(a), + | help: and remove this obsolete arm | LL - (.., Some(a)) => bar(a), @@ -114,8 +119,9 @@ LL | (Ok(x), Some(_)) => println!("ok {}", x), = help: try changing either arm body help: or try merging the arm patterns | -LL | (Ok(x), Some(_)) | (Ok(_), Some(x)) => println!("ok {}", x), - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (Ok(x), Some(_)) => println!("ok {}", x), +LL + (Ok(x), Some(_)) | (Ok(_), Some(x)) => println!("ok {}", x), + | help: and remove this obsolete arm | LL - (Ok(_), Some(x)) => println!("ok {}", x), @@ -130,8 +136,9 @@ LL | Ok(_) => println!("ok"), = help: try changing either arm body help: or try merging the arm patterns | -LL | Ok(_) | Ok(3) => println!("ok"), - | ~~~~~~~~~~~~~ +LL - Ok(_) => println!("ok"), +LL + Ok(_) | Ok(3) => println!("ok"), + | help: and remove this obsolete arm | LL - Ok(3) => println!("ok"), @@ -148,8 +155,9 @@ LL | | }, = help: try changing either arm body help: or try merging the arm patterns | -LL | 1 | 0 => { - | ~~~~~ +LL - 1 => { +LL + 1 | 0 => { + | help: and remove this obsolete arm | LL - 0 => { @@ -166,8 +174,9 @@ LL | Foo::X(0) => 1, = help: try changing either arm body help: or try merging the arm patterns | -LL | Foo::X(0) | Foo::Z(_) => 1, - | ~~~~~~~~~~~~~~~~~~~~~ +LL - Foo::X(0) => 1, +LL + Foo::X(0) | Foo::Z(_) => 1, + | help: and remove this obsolete arm | LL - Foo::Z(_) => 1, @@ -182,8 +191,9 @@ LL | Foo::Z(_) => 1, = help: try changing either arm body help: or try merging the arm patterns | -LL | Foo::Z(_) | Foo::X(0) => 1, - | ~~~~~~~~~~~~~~~~~~~~~ +LL - Foo::Z(_) => 1, +LL + Foo::Z(_) | Foo::X(0) => 1, + | help: and remove this obsolete arm | LL - Foo::X(0) => 1, @@ -198,8 +208,9 @@ LL | Some(Bar { y: 0, x: 5, .. }) => 1, = help: try changing either arm body help: or try merging the arm patterns | -LL | Some(Bar { y: 0, x: 5, .. }) | Some(Bar { x: 0, y: 5, .. }) => 1, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Some(Bar { y: 0, x: 5, .. }) => 1, +LL + Some(Bar { y: 0, x: 5, .. }) | Some(Bar { x: 0, y: 5, .. }) => 1, + | help: and remove this obsolete arm | LL - Some(Bar { x: 0, y: 5, .. }) => 1, @@ -214,8 +225,9 @@ LL | 1 => cfg!(not_enable), = help: try changing either arm body help: or try merging the arm patterns | -LL | 1 | 0 => cfg!(not_enable), - | ~~~~~ +LL - 1 => cfg!(not_enable), +LL + 1 | 0 => cfg!(not_enable), + | help: and remove this obsolete arm | LL - 0 => cfg!(not_enable), @@ -230,8 +242,9 @@ LL | MaybeStaticStr::Borrowed(s) => s, = help: try changing either arm body help: or try merging the arm patterns | -LL | MaybeStaticStr::Borrowed(s) | MaybeStaticStr::Static(s) => s, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - MaybeStaticStr::Borrowed(s) => s, +LL + MaybeStaticStr::Borrowed(s) | MaybeStaticStr::Static(s) => s, + | help: and remove this obsolete arm | LL - MaybeStaticStr::Static(s) => s, diff --git a/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr b/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr index 67e9ccaf6d2fb..5b14fd13a53b1 100644 --- a/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr +++ b/src/tools/clippy/tests/ui/match_str_case_mismatch.stderr @@ -8,8 +8,9 @@ LL | "Bar" => {}, = help: to override `-D warnings` add `#[allow(clippy::match_str_case_mismatch)]` help: consider changing the case of this arm to respect `to_ascii_lowercase` | -LL | "bar" => {}, - | ~~~~~ +LL - "Bar" => {}, +LL + "bar" => {}, + | error: this `match` arm has a differing case than its expression --> tests/ui/match_str_case_mismatch.rs:122:9 @@ -19,8 +20,9 @@ LL | "~!@#$%^&*()-_=+Foo" => {}, | help: consider changing the case of this arm to respect `to_ascii_lowercase` (notice the capitalization difference) | -LL | "~!@#$%^&*()-_=+foo" => {}, - | ~~~~~~~~~~~~~~~~~~~~ +LL - "~!@#$%^&*()-_=+Foo" => {}, +LL + "~!@#$%^&*()-_=+foo" => {}, + | error: this `match` arm has a differing case than its expression --> tests/ui/match_str_case_mismatch.rs:134:9 @@ -30,8 +32,9 @@ LL | "Воды" => {}, | help: consider changing the case of this arm to respect `to_lowercase` | -LL | "воды" => {}, - | ~~~~~~ +LL - "Воды" => {}, +LL + "воды" => {}, + | error: this `match` arm has a differing case than its expression --> tests/ui/match_str_case_mismatch.rs:145:9 @@ -41,8 +44,9 @@ LL | "barDz" => {}, | help: consider changing the case of this arm to respect `to_lowercase` | -LL | "bardz" => {}, - | ~~~~~~ +LL - "barDz" => {}, +LL + "bardz" => {}, + | error: this `match` arm has a differing case than its expression --> tests/ui/match_str_case_mismatch.rs:155:9 @@ -52,8 +56,9 @@ LL | "bARʁ" => {}, | help: consider changing the case of this arm to respect `to_uppercase` | -LL | "BARʁ" => {}, - | ~~~~~~ +LL - "bARʁ" => {}, +LL + "BARʁ" => {}, + | error: this `match` arm has a differing case than its expression --> tests/ui/match_str_case_mismatch.rs:165:9 @@ -63,8 +68,9 @@ LL | "Bar" => {}, | help: consider changing the case of this arm to respect `to_ascii_lowercase` | -LL | "bar" => {}, - | ~~~~~ +LL - "Bar" => {}, +LL + "bar" => {}, + | error: this `match` arm has a differing case than its expression --> tests/ui/match_str_case_mismatch.rs:180:9 @@ -74,8 +80,9 @@ LL | "bAR" => {}, | help: consider changing the case of this arm to respect `to_ascii_uppercase` | -LL | "BAR" => {}, - | ~~~~~ +LL - "bAR" => {}, +LL + "BAR" => {}, + | error: aborting due to 7 previous errors diff --git a/src/tools/clippy/tests/ui/needless_borrow_pat.stderr b/src/tools/clippy/tests/ui/needless_borrow_pat.stderr index 2ad6944903967..035376cabaf42 100644 --- a/src/tools/clippy/tests/ui/needless_borrow_pat.stderr +++ b/src/tools/clippy/tests/ui/needless_borrow_pat.stderr @@ -15,8 +15,9 @@ LL | Some(ref x) => *x, | help: try | -LL | Some(x) => x, - | ~ ~ +LL - Some(ref x) => *x, +LL + Some(x) => x, + | error: this pattern creates a reference to a reference --> tests/ui/needless_borrow_pat.rs:74:14 @@ -71,8 +72,9 @@ LL | E::A(ref x) | E::B(ref x) => *x, | help: try | -LL | E::A(x) | E::B(x) => x, - | ~ ~ ~ +LL - E::A(ref x) | E::B(ref x) => *x, +LL + E::A(x) | E::B(x) => x, + | error: this pattern creates a reference to a reference --> tests/ui/needless_borrow_pat.rs:126:21 diff --git a/src/tools/clippy/tests/ui/needless_for_each_unfixable.stderr b/src/tools/clippy/tests/ui/needless_for_each_unfixable.stderr index 9d3f639efbf27..3f7bc98c99369 100644 --- a/src/tools/clippy/tests/ui/needless_for_each_unfixable.stderr +++ b/src/tools/clippy/tests/ui/needless_for_each_unfixable.stderr @@ -26,8 +26,9 @@ LL + } | help: ...and replace `return` with `continue` | -LL | continue; - | ~~~~~~~~ +LL - return; +LL + continue; + | error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/needless_pass_by_value.stderr b/src/tools/clippy/tests/ui/needless_pass_by_value.stderr index 827a200ba6819..1525a8c5c0d04 100644 --- a/src/tools/clippy/tests/ui/needless_pass_by_value.stderr +++ b/src/tools/clippy/tests/ui/needless_pass_by_value.stderr @@ -63,12 +63,14 @@ LL | fn issue_2114(s: String, t: String, u: Vec, v: Vec) { | help: consider changing the type to | -LL | fn issue_2114(s: String, t: &str, u: Vec, v: Vec) { - | ~~~~ +LL - fn issue_2114(s: String, t: String, u: Vec, v: Vec) { +LL + fn issue_2114(s: String, t: &str, u: Vec, v: Vec) { + | help: change `t.clone()` to | -LL | let _ = t.to_string(); - | ~~~~~~~~~~~~~ +LL - let _ = t.clone(); +LL + let _ = t.to_string(); + | error: this argument is passed by value, but not consumed in the function body --> tests/ui/needless_pass_by_value.rs:90:40 @@ -84,12 +86,14 @@ LL | fn issue_2114(s: String, t: String, u: Vec, v: Vec) { | help: consider changing the type to | -LL | fn issue_2114(s: String, t: String, u: Vec, v: &[i32]) { - | ~~~~~~ +LL - fn issue_2114(s: String, t: String, u: Vec, v: Vec) { +LL + fn issue_2114(s: String, t: String, u: Vec, v: &[i32]) { + | help: change `v.clone()` to | -LL | let _ = v.to_owned(); - | ~~~~~~~~~~~~ +LL - let _ = v.clone(); +LL + let _ = v.to_owned(); + | error: this argument is passed by value, but not consumed in the function body --> tests/ui/needless_pass_by_value.rs:107:12 diff --git a/src/tools/clippy/tests/ui/needless_range_loop.stderr b/src/tools/clippy/tests/ui/needless_range_loop.stderr index dc2cf437e02ea..22b8bffb99b2e 100644 --- a/src/tools/clippy/tests/ui/needless_range_loop.stderr +++ b/src/tools/clippy/tests/ui/needless_range_loop.stderr @@ -8,8 +8,9 @@ LL | for i in 0..vec.len() { = help: to override `-D warnings` add `#[allow(clippy::needless_range_loop)]` help: consider using an iterator | -LL | for in &vec { - | ~~~~~~ ~~~~ +LL - for i in 0..vec.len() { +LL + for in &vec { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop.rs:26:14 @@ -19,8 +20,9 @@ LL | for i in 0..vec.len() { | help: consider using an iterator | -LL | for in &vec { - | ~~~~~~ ~~~~ +LL - for i in 0..vec.len() { +LL + for in &vec { + | error: the loop variable `j` is only used to index `STATIC` --> tests/ui/needless_range_loop.rs:32:14 @@ -30,8 +32,9 @@ LL | for j in 0..4 { | help: consider using an iterator | -LL | for in &STATIC { - | ~~~~~~ ~~~~~~~ +LL - for j in 0..4 { +LL + for in &STATIC { + | error: the loop variable `j` is only used to index `CONST` --> tests/ui/needless_range_loop.rs:37:14 @@ -41,8 +44,9 @@ LL | for j in 0..4 { | help: consider using an iterator | -LL | for in &CONST { - | ~~~~~~ ~~~~~~ +LL - for j in 0..4 { +LL + for in &CONST { + | error: the loop variable `i` is used to index `vec` --> tests/ui/needless_range_loop.rs:42:14 @@ -52,8 +56,9 @@ LL | for i in 0..vec.len() { | help: consider using an iterator and enumerate() | -LL | for (i, ) in vec.iter().enumerate() { - | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 0..vec.len() { +LL + for (i, ) in vec.iter().enumerate() { + | error: the loop variable `i` is only used to index `vec2` --> tests/ui/needless_range_loop.rs:51:14 @@ -63,8 +68,9 @@ LL | for i in 0..vec.len() { | help: consider using an iterator | -LL | for in vec2.iter().take(vec.len()) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 0..vec.len() { +LL + for in vec2.iter().take(vec.len()) { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop.rs:56:14 @@ -74,8 +80,9 @@ LL | for i in 5..vec.len() { | help: consider using an iterator | -LL | for in vec.iter().skip(5) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~ +LL - for i in 5..vec.len() { +LL + for in vec.iter().skip(5) { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop.rs:61:14 @@ -85,8 +92,9 @@ LL | for i in 0..MAX_LEN { | help: consider using an iterator | -LL | for in vec.iter().take(MAX_LEN) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 0..MAX_LEN { +LL + for in vec.iter().take(MAX_LEN) { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop.rs:66:14 @@ -96,8 +104,9 @@ LL | for i in 0..=MAX_LEN { | help: consider using an iterator | -LL | for in vec.iter().take(MAX_LEN + 1) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 0..=MAX_LEN { +LL + for in vec.iter().take(MAX_LEN + 1) { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop.rs:71:14 @@ -107,8 +116,9 @@ LL | for i in 5..10 { | help: consider using an iterator | -LL | for in vec.iter().take(10).skip(5) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 5..10 { +LL + for in vec.iter().take(10).skip(5) { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop.rs:76:14 @@ -118,8 +128,9 @@ LL | for i in 5..=10 { | help: consider using an iterator | -LL | for in vec.iter().take(10 + 1).skip(5) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 5..=10 { +LL + for in vec.iter().take(10 + 1).skip(5) { + | error: the loop variable `i` is used to index `vec` --> tests/ui/needless_range_loop.rs:81:14 @@ -129,8 +140,9 @@ LL | for i in 5..vec.len() { | help: consider using an iterator and enumerate() | -LL | for (i, ) in vec.iter().enumerate().skip(5) { - | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 5..vec.len() { +LL + for (i, ) in vec.iter().enumerate().skip(5) { + | error: the loop variable `i` is used to index `vec` --> tests/ui/needless_range_loop.rs:86:14 @@ -140,8 +152,9 @@ LL | for i in 5..10 { | help: consider using an iterator and enumerate() | -LL | for (i, ) in vec.iter().enumerate().take(10).skip(5) { - | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 5..10 { +LL + for (i, ) in vec.iter().enumerate().take(10).skip(5) { + | error: the loop variable `i` is used to index `vec` --> tests/ui/needless_range_loop.rs:92:14 @@ -151,8 +164,9 @@ LL | for i in 0..vec.len() { | help: consider using an iterator and enumerate() | -LL | for (i, ) in vec.iter_mut().enumerate() { - | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 0..vec.len() { +LL + for (i, ) in vec.iter_mut().enumerate() { + | error: aborting due to 14 previous errors diff --git a/src/tools/clippy/tests/ui/needless_range_loop2.stderr b/src/tools/clippy/tests/ui/needless_range_loop2.stderr index 353f30b1b26dc..f37e1f2872d04 100644 --- a/src/tools/clippy/tests/ui/needless_range_loop2.stderr +++ b/src/tools/clippy/tests/ui/needless_range_loop2.stderr @@ -8,8 +8,9 @@ LL | for i in 3..10 { = help: to override `-D warnings` add `#[allow(clippy::needless_range_loop)]` help: consider using an iterator | -LL | for in ns.iter().take(10).skip(3) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in 3..10 { +LL + for in ns.iter().take(10).skip(3) { + | error: the loop variable `i` is only used to index `ms` --> tests/ui/needless_range_loop2.rs:34:14 @@ -19,8 +20,9 @@ LL | for i in 0..ms.len() { | help: consider using an iterator | -LL | for in &mut ms { - | ~~~~~~ ~~~~~~~ +LL - for i in 0..ms.len() { +LL + for in &mut ms { + | error: the loop variable `i` is only used to index `ms` --> tests/ui/needless_range_loop2.rs:41:14 @@ -30,8 +32,9 @@ LL | for i in 0..ms.len() { | help: consider using an iterator | -LL | for in &mut ms { - | ~~~~~~ ~~~~~~~ +LL - for i in 0..ms.len() { +LL + for in &mut ms { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop2.rs:66:14 @@ -41,8 +44,9 @@ LL | for i in x..x + 4 { | help: consider using an iterator | -LL | for in vec.iter_mut().skip(x).take(4) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in x..x + 4 { +LL + for in vec.iter_mut().skip(x).take(4) { + | error: the loop variable `i` is only used to index `vec` --> tests/ui/needless_range_loop2.rs:74:14 @@ -52,8 +56,9 @@ LL | for i in x..=x + 4 { | help: consider using an iterator | -LL | for in vec.iter_mut().skip(x).take(4 + 1) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in x..=x + 4 { +LL + for in vec.iter_mut().skip(x).take(4 + 1) { + | error: the loop variable `i` is only used to index `arr` --> tests/ui/needless_range_loop2.rs:81:14 @@ -63,8 +68,9 @@ LL | for i in 0..3 { | help: consider using an iterator | -LL | for in &arr { - | ~~~~~~ ~~~~ +LL - for i in 0..3 { +LL + for in &arr { + | error: the loop variable `i` is only used to index `arr` --> tests/ui/needless_range_loop2.rs:86:14 @@ -74,8 +80,9 @@ LL | for i in 0..2 { | help: consider using an iterator | -LL | for in arr.iter().take(2) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~ +LL - for i in 0..2 { +LL + for in arr.iter().take(2) { + | error: the loop variable `i` is only used to index `arr` --> tests/ui/needless_range_loop2.rs:91:14 @@ -85,8 +92,9 @@ LL | for i in 1..3 { | help: consider using an iterator | -LL | for in arr.iter().skip(1) { - | ~~~~~~ ~~~~~~~~~~~~~~~~~~ +LL - for i in 1..3 { +LL + for in arr.iter().skip(1) { + | error: aborting due to 8 previous errors diff --git a/src/tools/clippy/tests/ui/needless_return.stderr b/src/tools/clippy/tests/ui/needless_return.stderr index ea9c230eafd22..d474734cbc826 100644 --- a/src/tools/clippy/tests/ui/needless_return.stderr +++ b/src/tools/clippy/tests/ui/needless_return.stderr @@ -80,8 +80,9 @@ LL | true => return false, | help: remove `return` | -LL | true => false, - | ~~~~~ +LL - true => return false, +LL + true => false, + | error: unneeded `return` statement --> tests/ui/needless_return.rs:54:13 @@ -115,8 +116,9 @@ LL | let _ = || return true; | help: remove `return` | -LL | let _ = || true; - | ~~~~ +LL - let _ = || return true; +LL + let _ = || true; + | error: unneeded `return` statement --> tests/ui/needless_return.rs:67:5 @@ -183,8 +185,9 @@ LL | _ => return, | help: replace `return` with a unit value | -LL | _ => (), - | ~~ +LL - _ => return, +LL + _ => (), + | error: unneeded `return` statement --> tests/ui/needless_return.rs:93:24 @@ -209,8 +212,9 @@ LL | _ => return, | help: replace `return` with a unit value | -LL | _ => (), - | ~~ +LL - _ => return, +LL + _ => (), + | error: unneeded `return` statement --> tests/ui/needless_return.rs:109:9 @@ -244,8 +248,9 @@ LL | bar.unwrap_or_else(|_| return) | help: replace `return` with an empty block | -LL | bar.unwrap_or_else(|_| {}) - | ~~ +LL - bar.unwrap_or_else(|_| return) +LL + bar.unwrap_or_else(|_| {}) + | error: unneeded `return` statement --> tests/ui/needless_return.rs:137:21 @@ -270,8 +275,9 @@ LL | let _ = || return; | help: replace `return` with an empty block | -LL | let _ = || {}; - | ~~ +LL - let _ = || return; +LL + let _ = || {}; + | error: unneeded `return` statement --> tests/ui/needless_return.rs:146:32 @@ -281,8 +287,9 @@ LL | res.unwrap_or_else(|_| return Foo) | help: remove `return` | -LL | res.unwrap_or_else(|_| Foo) - | ~~~ +LL - res.unwrap_or_else(|_| return Foo) +LL + res.unwrap_or_else(|_| Foo) + | error: unneeded `return` statement --> tests/ui/needless_return.rs:155:5 @@ -340,8 +347,9 @@ LL | true => return false, | help: remove `return` | -LL | true => false, - | ~~~~~ +LL - true => return false, +LL + true => false, + | error: unneeded `return` statement --> tests/ui/needless_return.rs:174:13 @@ -375,8 +383,9 @@ LL | let _ = || return true; | help: remove `return` | -LL | let _ = || true; - | ~~~~ +LL - let _ = || return true; +LL + let _ = || true; + | error: unneeded `return` statement --> tests/ui/needless_return.rs:187:5 @@ -443,8 +452,9 @@ LL | _ => return, | help: replace `return` with a unit value | -LL | _ => (), - | ~~ +LL - _ => return, +LL + _ => (), + | error: unneeded `return` statement --> tests/ui/needless_return.rs:218:9 diff --git a/src/tools/clippy/tests/ui/never_loop.stderr b/src/tools/clippy/tests/ui/never_loop.stderr index 440a2b5aabaae..d49b07e3de472 100644 --- a/src/tools/clippy/tests/ui/never_loop.stderr +++ b/src/tools/clippy/tests/ui/never_loop.stderr @@ -81,8 +81,9 @@ LL | | } | help: if you need the first element of the iterator, try writing | -LL | if let Some(x) = (0..10).next() { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for x in 0..10 { +LL + if let Some(x) = (0..10).next() { + | error: this loop never actually loops --> tests/ui/never_loop.rs:167:5 @@ -150,8 +151,9 @@ LL | | } | help: if you need the first element of the iterator, try writing | -LL | if let Some(_) = (0..20).next() { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for _ in 0..20 { +LL + if let Some(_) = (0..20).next() { + | error: this loop never actually loops --> tests/ui/never_loop.rs:378:13 diff --git a/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr b/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr index a15379c5b1a5e..9f0c2ec43015a 100644 --- a/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr +++ b/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr @@ -25,8 +25,9 @@ LL | | } | help: change this to | -LL | fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } - | ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn partial_cmp(&self, _: &Self) -> Option { +LL + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } + | error: aborting due to 2 previous errors diff --git a/src/tools/clippy/tests/ui/nonminimal_bool.stderr b/src/tools/clippy/tests/ui/nonminimal_bool.stderr index eafffdaf8a638..837f958a0a7c6 100644 --- a/src/tools/clippy/tests/ui/nonminimal_bool.stderr +++ b/src/tools/clippy/tests/ui/nonminimal_bool.stderr @@ -51,10 +51,12 @@ LL | let _ = a == b && c == 5 && a == b; | help: try | -LL | let _ = !(a != b || c != 5); - | ~~~~~~~~~~~~~~~~~~~ -LL | let _ = a == b && c == 5; - | ~~~~~~~~~~~~~~~~ +LL - let _ = a == b && c == 5 && a == b; +LL + let _ = !(a != b || c != 5); + | +LL - let _ = a == b && c == 5 && a == b; +LL + let _ = a == b && c == 5; + | error: this boolean expression can be simplified --> tests/ui/nonminimal_bool.rs:44:13 @@ -64,10 +66,12 @@ LL | let _ = a == b || c == 5 || a == b; | help: try | -LL | let _ = !(a != b && c != 5); - | ~~~~~~~~~~~~~~~~~~~ -LL | let _ = a == b || c == 5; - | ~~~~~~~~~~~~~~~~ +LL - let _ = a == b || c == 5 || a == b; +LL + let _ = !(a != b && c != 5); + | +LL - let _ = a == b || c == 5 || a == b; +LL + let _ = a == b || c == 5; + | error: this boolean expression can be simplified --> tests/ui/nonminimal_bool.rs:46:13 @@ -77,10 +81,12 @@ LL | let _ = a == b && c == 5 && b == a; | help: try | -LL | let _ = !(a != b || c != 5); - | ~~~~~~~~~~~~~~~~~~~ -LL | let _ = a == b && c == 5; - | ~~~~~~~~~~~~~~~~ +LL - let _ = a == b && c == 5 && b == a; +LL + let _ = !(a != b || c != 5); + | +LL - let _ = a == b && c == 5 && b == a; +LL + let _ = a == b && c == 5; + | error: this boolean expression can be simplified --> tests/ui/nonminimal_bool.rs:48:13 @@ -90,10 +96,12 @@ LL | let _ = a != b || !(a != b || c == d); | help: try | -LL | let _ = !(a == b && c == d); - | ~~~~~~~~~~~~~~~~~~~ -LL | let _ = a != b || c != d; - | ~~~~~~~~~~~~~~~~ +LL - let _ = a != b || !(a != b || c == d); +LL + let _ = !(a == b && c == d); + | +LL - let _ = a != b || !(a != b || c == d); +LL + let _ = a != b || c != d; + | error: this boolean expression can be simplified --> tests/ui/nonminimal_bool.rs:50:13 @@ -103,10 +111,12 @@ LL | let _ = a != b && !(a != b && c == d); | help: try | -LL | let _ = !(a == b || c == d); - | ~~~~~~~~~~~~~~~~~~~ -LL | let _ = a != b && c != d; - | ~~~~~~~~~~~~~~~~ +LL - let _ = a != b && !(a != b && c == d); +LL + let _ = !(a == b || c == d); + | +LL - let _ = a != b && !(a != b && c == d); +LL + let _ = a != b && c != d; + | error: this boolean expression can be simplified --> tests/ui/nonminimal_bool.rs:81:8 diff --git a/src/tools/clippy/tests/ui/octal_escapes.stderr b/src/tools/clippy/tests/ui/octal_escapes.stderr index 9343ba64a30b3..c8a89ac8bea42 100644 --- a/src/tools/clippy/tests/ui/octal_escapes.stderr +++ b/src/tools/clippy/tests/ui/octal_escapes.stderr @@ -9,12 +9,14 @@ LL | let _bad1 = "\033[0m"; = help: to override `-D warnings` add `#[allow(clippy::octal_escapes)]` help: if an octal escape is intended, use a hex escape instead | -LL | let _bad1 = "\x1b[0m"; - | ~~~~ +LL - let _bad1 = "\033[0m"; +LL + let _bad1 = "\x1b[0m"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad1 = "\x0033[0m"; - | ~~~~~~ +LL - let _bad1 = "\033[0m"; +LL + let _bad1 = "\x0033[0m"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:6:19 @@ -24,12 +26,14 @@ LL | let _bad2 = b"\033[0m"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad2 = b"\x1b[0m"; - | ~~~~ +LL - let _bad2 = b"\033[0m"; +LL + let _bad2 = b"\x1b[0m"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad2 = b"\x0033[0m"; - | ~~~~~~ +LL - let _bad2 = b"\033[0m"; +LL + let _bad2 = b"\x0033[0m"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:7:20 @@ -39,12 +43,14 @@ LL | let _bad3 = "\\\033[0m"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad3 = "\\\x1b[0m"; - | ~~~~ +LL - let _bad3 = "\\\033[0m"; +LL + let _bad3 = "\\\x1b[0m"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad3 = "\\\x0033[0m"; - | ~~~~~~ +LL - let _bad3 = "\\\033[0m"; +LL + let _bad3 = "\\\x0033[0m"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:9:18 @@ -54,12 +60,14 @@ LL | let _bad4 = "\01234567"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad4 = "\x0a34567"; - | ~~~~ +LL - let _bad4 = "\01234567"; +LL + let _bad4 = "\x0a34567"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad4 = "\x001234567"; - | ~~~~~~ +LL - let _bad4 = "\01234567"; +LL + let _bad4 = "\x001234567"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:10:20 @@ -69,12 +77,14 @@ LL | let _bad5 = "\0\03"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad5 = "\0\x03"; - | ~~~~ +LL - let _bad5 = "\0\03"; +LL + let _bad5 = "\0\x03"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad5 = "\0\x0003"; - | ~~~~~~ +LL - let _bad5 = "\0\03"; +LL + let _bad5 = "\0\x0003"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:11:23 @@ -84,12 +94,14 @@ LL | let _bad6 = "Text-\055\077-MoreText"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad6 = "Text-\x2d\077-MoreText"; - | ~~~~ +LL - let _bad6 = "Text-\055\077-MoreText"; +LL + let _bad6 = "Text-\x2d\077-MoreText"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad6 = "Text-\x0055\077-MoreText"; - | ~~~~~~ +LL - let _bad6 = "Text-\055\077-MoreText"; +LL + let _bad6 = "Text-\x0055\077-MoreText"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:11:27 @@ -99,12 +111,14 @@ LL | let _bad6 = "Text-\055\077-MoreText"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad6 = "Text-\055\x3f-MoreText"; - | ~~~~ +LL - let _bad6 = "Text-\055\077-MoreText"; +LL + let _bad6 = "Text-\055\x3f-MoreText"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad6 = "Text-\055\x0077-MoreText"; - | ~~~~~~ +LL - let _bad6 = "Text-\055\077-MoreText"; +LL + let _bad6 = "Text-\055\x0077-MoreText"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:14:31 @@ -114,12 +128,14 @@ LL | let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad7 = "EvenMoreText-\x01\02-ShortEscapes"; - | ~~~~ +LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; +LL + let _bad7 = "EvenMoreText-\x01\02-ShortEscapes"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad7 = "EvenMoreText-\x0001\02-ShortEscapes"; - | ~~~~~~ +LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; +LL + let _bad7 = "EvenMoreText-\x0001\02-ShortEscapes"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:14:34 @@ -129,12 +145,14 @@ LL | let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad7 = "EvenMoreText-\01\x02-ShortEscapes"; - | ~~~~ +LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; +LL + let _bad7 = "EvenMoreText-\01\x02-ShortEscapes"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad7 = "EvenMoreText-\01\x0002-ShortEscapes"; - | ~~~~~~ +LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; +LL + let _bad7 = "EvenMoreText-\01\x0002-ShortEscapes"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:17:19 @@ -144,12 +162,14 @@ LL | let _bad8 = "锈\01锈"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad8 = "锈\x01锈"; - | ~~~~ +LL - let _bad8 = "锈\01锈"; +LL + let _bad8 = "锈\x01锈"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad8 = "锈\x0001锈"; - | ~~~~~~ +LL - let _bad8 = "锈\01锈"; +LL + let _bad8 = "锈\x0001锈"; + | error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:18:19 @@ -159,12 +179,14 @@ LL | let _bad9 = "锈\011锈"; | help: if an octal escape is intended, use a hex escape instead | -LL | let _bad9 = "锈\x09锈"; - | ~~~~ +LL - let _bad9 = "锈\011锈"; +LL + let _bad9 = "锈\x09锈"; + | help: if a null escape is intended, disambiguate using | -LL | let _bad9 = "锈\x0011锈"; - | ~~~~~~ +LL - let _bad9 = "锈\011锈"; +LL + let _bad9 = "锈\x0011锈"; + | error: aborting due to 11 previous errors diff --git a/src/tools/clippy/tests/ui/op_ref.stderr b/src/tools/clippy/tests/ui/op_ref.stderr index c5b68730a8f26..ad002437c0c6b 100644 --- a/src/tools/clippy/tests/ui/op_ref.stderr +++ b/src/tools/clippy/tests/ui/op_ref.stderr @@ -8,8 +8,9 @@ LL | let foo = &5 - &6; = help: to override `-D warnings` add `#[allow(clippy::op_ref)]` help: use the values directly | -LL | let foo = 5 - 6; - | ~ ~ +LL - let foo = &5 - &6; +LL + let foo = 5 - 6; + | error: taken reference of right operand --> tests/ui/op_ref.rs:58:13 diff --git a/src/tools/clippy/tests/ui/option_as_ref_cloned.stderr b/src/tools/clippy/tests/ui/option_as_ref_cloned.stderr index 5892f2bdec56e..0eda42b91b96b 100644 --- a/src/tools/clippy/tests/ui/option_as_ref_cloned.stderr +++ b/src/tools/clippy/tests/ui/option_as_ref_cloned.stderr @@ -8,8 +8,9 @@ LL | let _: Option = x.as_ref().cloned(); = help: to override `-D warnings` add `#[allow(clippy::option_as_ref_cloned)]` help: this can be written more concisely by cloning the `Option<_>` directly | -LL | let _: Option = x.clone(); - | ~~~~~ +LL - let _: Option = x.as_ref().cloned(); +LL + let _: Option = x.clone(); + | error: cloning an `Option<_>` using `.as_mut().cloned()` --> tests/ui/option_as_ref_cloned.rs:8:31 @@ -19,8 +20,9 @@ LL | let _: Option = x.as_mut().cloned(); | help: this can be written more concisely by cloning the `Option<_>` directly | -LL | let _: Option = x.clone(); - | ~~~~~ +LL - let _: Option = x.as_mut().cloned(); +LL + let _: Option = x.clone(); + | error: cloning an `Option<_>` using `.as_ref().cloned()` --> tests/ui/option_as_ref_cloned.rs:11:32 @@ -30,8 +32,9 @@ LL | let _: Option<&String> = y.as_ref().cloned(); | help: this can be written more concisely by cloning the `Option<_>` directly | -LL | let _: Option<&String> = y.clone(); - | ~~~~~ +LL - let _: Option<&String> = y.as_ref().cloned(); +LL + let _: Option<&String> = y.clone(); + | error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui/redundant_guards.stderr b/src/tools/clippy/tests/ui/redundant_guards.stderr index fd12e08328231..8d45723f3a61b 100644 --- a/src/tools/clippy/tests/ui/redundant_guards.stderr +++ b/src/tools/clippy/tests/ui/redundant_guards.stderr @@ -20,8 +20,9 @@ LL | Some(x) if matches!(x, Some(1) if true) => .., | help: try | -LL | Some(Some(1)) if true => .., - | ~~~~~~~ ~~~~~~~ +LL - Some(x) if matches!(x, Some(1) if true) => .., +LL + Some(Some(1)) if true => .., + | error: redundant guard --> tests/ui/redundant_guards.rs:41:20 diff --git a/src/tools/clippy/tests/ui/ref_binding_to_reference.stderr b/src/tools/clippy/tests/ui/ref_binding_to_reference.stderr index 25ab982238273..233416351a0a5 100644 --- a/src/tools/clippy/tests/ui/ref_binding_to_reference.stderr +++ b/src/tools/clippy/tests/ui/ref_binding_to_reference.stderr @@ -8,8 +8,9 @@ LL | Some(ref x) => x, = help: to override `-D warnings` add `#[allow(clippy::ref_binding_to_reference)]` help: try | -LL | Some(x) => &x, - | ~ ~~ +LL - Some(ref x) => x, +LL + Some(x) => &x, + | error: this pattern creates a reference to a reference --> tests/ui/ref_binding_to_reference.rs:38:14 @@ -34,8 +35,9 @@ LL | Some(ref x) => m2!(x), | help: try | -LL | Some(x) => m2!(&x), - | ~ ~~ +LL - Some(ref x) => m2!(x), +LL + Some(x) => m2!(&x), + | error: this pattern creates a reference to a reference --> tests/ui/ref_binding_to_reference.rs:55:15 diff --git a/src/tools/clippy/tests/ui/repeat_vec_with_capacity.stderr b/src/tools/clippy/tests/ui/repeat_vec_with_capacity.stderr index cec9c6ea84a27..3da26a12ae38a 100644 --- a/src/tools/clippy/tests/ui/repeat_vec_with_capacity.stderr +++ b/src/tools/clippy/tests/ui/repeat_vec_with_capacity.stderr @@ -9,8 +9,9 @@ LL | vec![Vec::<()>::with_capacity(42); 123]; = help: to override `-D warnings` add `#[allow(clippy::repeat_vec_with_capacity)]` help: if you intended to initialize multiple `Vec`s with an initial capacity, try | -LL | (0..123).map(|_| Vec::<()>::with_capacity(42)).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![Vec::<()>::with_capacity(42); 123]; +LL + (0..123).map(|_| Vec::<()>::with_capacity(42)).collect::>(); + | error: repeating `Vec::with_capacity` using `vec![x; n]`, which does not retain capacity --> tests/ui/repeat_vec_with_capacity.rs:11:9 @@ -21,8 +22,9 @@ LL | vec![Vec::<()>::with_capacity(42); n]; = note: only the last `Vec` will have the capacity help: if you intended to initialize multiple `Vec`s with an initial capacity, try | -LL | (0..n).map(|_| Vec::<()>::with_capacity(42)).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![Vec::<()>::with_capacity(42); n]; +LL + (0..n).map(|_| Vec::<()>::with_capacity(42)).collect::>(); + | error: repeating `Vec::with_capacity` using `iter::repeat`, which does not retain capacity --> tests/ui/repeat_vec_with_capacity.rs:26:9 @@ -33,8 +35,9 @@ LL | std::iter::repeat(Vec::<()>::with_capacity(42)); = note: none of the yielded `Vec`s will have the requested capacity help: if you intended to create an iterator that yields `Vec`s with an initial capacity, try | -LL | std::iter::repeat_with(|| Vec::<()>::with_capacity(42)); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - std::iter::repeat(Vec::<()>::with_capacity(42)); +LL + std::iter::repeat_with(|| Vec::<()>::with_capacity(42)); + | error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui/reversed_empty_ranges_fixable.stderr b/src/tools/clippy/tests/ui/reversed_empty_ranges_fixable.stderr index 3747eb9deebc4..24cb959c96af9 100644 --- a/src/tools/clippy/tests/ui/reversed_empty_ranges_fixable.stderr +++ b/src/tools/clippy/tests/ui/reversed_empty_ranges_fixable.stderr @@ -8,8 +8,9 @@ LL | (42..=21).for_each(|x| println!("{}", x)); = help: to override `-D warnings` add `#[allow(clippy::reversed_empty_ranges)]` help: consider using the following if you are attempting to iterate over this range in reverse | -LL | (21..=42).rev().for_each(|x| println!("{}", x)); - | ~~~~~~~~~~~~~~~ +LL - (42..=21).for_each(|x| println!("{}", x)); +LL + (21..=42).rev().for_each(|x| println!("{}", x)); + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_fixable.rs:10:13 @@ -19,8 +20,9 @@ LL | let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::>( | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | let _ = (21..ANSWER).rev().filter(|x| x % 2 == 0).take(10).collect::>(); - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::>(); +LL + let _ = (21..ANSWER).rev().filter(|x| x % 2 == 0).take(10).collect::>(); + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_fixable.rs:12:14 @@ -30,8 +32,9 @@ LL | for _ in -21..=-42 {} | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for _ in (-42..=-21).rev() {} - | ~~~~~~~~~~~~~~~~~ +LL - for _ in -21..=-42 {} +LL + for _ in (-42..=-21).rev() {} + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_fixable.rs:13:14 @@ -41,8 +44,9 @@ LL | for _ in 42u32..21u32 {} | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for _ in (21u32..42u32).rev() {} - | ~~~~~~~~~~~~~~~~~~~~ +LL - for _ in 42u32..21u32 {} +LL + for _ in (21u32..42u32).rev() {} + | error: aborting due to 4 previous errors diff --git a/src/tools/clippy/tests/ui/reversed_empty_ranges_loops_fixable.stderr b/src/tools/clippy/tests/ui/reversed_empty_ranges_loops_fixable.stderr index d5df34c42f4f0..3e9ccb653fe71 100644 --- a/src/tools/clippy/tests/ui/reversed_empty_ranges_loops_fixable.stderr +++ b/src/tools/clippy/tests/ui/reversed_empty_ranges_loops_fixable.stderr @@ -8,8 +8,9 @@ LL | for i in 10..0 { = help: to override `-D warnings` add `#[allow(clippy::reversed_empty_ranges)]` help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for i in (0..10).rev() { - | ~~~~~~~~~~~~~ +LL - for i in 10..0 { +LL + for i in (0..10).rev() { + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_loops_fixable.rs:11:14 @@ -19,8 +20,9 @@ LL | for i in 10..=0 { | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for i in (0..=10).rev() { - | ~~~~~~~~~~~~~~ +LL - for i in 10..=0 { +LL + for i in (0..=10).rev() { + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_loops_fixable.rs:15:14 @@ -30,8 +32,9 @@ LL | for i in MAX_LEN..0 { | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for i in (0..MAX_LEN).rev() { - | ~~~~~~~~~~~~~~~~~~ +LL - for i in MAX_LEN..0 { +LL + for i in (0..MAX_LEN).rev() { + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_loops_fixable.rs:34:14 @@ -41,8 +44,9 @@ LL | for i in (10..0).map(|x| x * 2) { | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for i in (0..10).rev().map(|x| x * 2) { - | ~~~~~~~~~~~~~ +LL - for i in (10..0).map(|x| x * 2) { +LL + for i in (0..10).rev().map(|x| x * 2) { + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_loops_fixable.rs:39:14 @@ -52,8 +56,9 @@ LL | for i in 10..5 + 4 { | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for i in (5 + 4..10).rev() { - | ~~~~~~~~~~~~~~~~~ +LL - for i in 10..5 + 4 { +LL + for i in (5 + 4..10).rev() { + | error: this range is empty so it will yield no values --> tests/ui/reversed_empty_ranges_loops_fixable.rs:43:14 @@ -63,8 +68,9 @@ LL | for i in (5 + 2)..(3 - 1) { | help: consider using the following if you are attempting to iterate over this range in reverse | -LL | for i in ((3 - 1)..(5 + 2)).rev() { - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for i in (5 + 2)..(3 - 1) { +LL + for i in ((3 - 1)..(5 + 2)).rev() { + | error: aborting due to 6 previous errors diff --git a/src/tools/clippy/tests/ui/single_range_in_vec_init.stderr b/src/tools/clippy/tests/ui/single_range_in_vec_init.stderr index 9c125adb51a73..b3bc8dd4aca19 100644 --- a/src/tools/clippy/tests/ui/single_range_in_vec_init.stderr +++ b/src/tools/clippy/tests/ui/single_range_in_vec_init.stderr @@ -8,12 +8,14 @@ LL | [0..200]; = help: to override `-D warnings` add `#[allow(clippy::single_range_in_vec_init)]` help: if you wanted a `Vec` that contains the entire range, try | -LL | (0..200).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - [0..200]; +LL + (0..200).collect::>(); + | help: if you wanted an array of len 200, try | -LL | [0; 200]; - | ~~~~~~ +LL - [0..200]; +LL + [0; 200]; + | error: a `Vec` of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:27:5 @@ -23,12 +25,14 @@ LL | vec![0..200]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0..200).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![0..200]; +LL + (0..200).collect::>(); + | help: if you wanted a `Vec` of len 200, try | -LL | vec![0; 200]; - | ~~~~~~ +LL - vec![0..200]; +LL + vec![0; 200]; + | error: an array of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:28:5 @@ -38,12 +42,14 @@ LL | [0u8..200]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0u8..200).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - [0u8..200]; +LL + (0u8..200).collect::>(); + | help: if you wanted an array of len 200, try | -LL | [0u8; 200]; - | ~~~~~~~~ +LL - [0u8..200]; +LL + [0u8; 200]; + | error: an array of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:29:5 @@ -53,12 +59,14 @@ LL | [0usize..200]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0usize..200).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - [0usize..200]; +LL + (0usize..200).collect::>(); + | help: if you wanted an array of len 200, try | -LL | [0usize; 200]; - | ~~~~~~~~~~~ +LL - [0usize..200]; +LL + [0usize; 200]; + | error: an array of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:30:5 @@ -68,12 +76,14 @@ LL | [0..200usize]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0..200usize).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - [0..200usize]; +LL + (0..200usize).collect::>(); + | help: if you wanted an array of len 200usize, try | -LL | [0; 200usize]; - | ~~~~~~~~~~~ +LL - [0..200usize]; +LL + [0; 200usize]; + | error: a `Vec` of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:31:5 @@ -83,12 +93,14 @@ LL | vec![0u8..200]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0u8..200).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![0u8..200]; +LL + (0u8..200).collect::>(); + | help: if you wanted a `Vec` of len 200, try | -LL | vec![0u8; 200]; - | ~~~~~~~~ +LL - vec![0u8..200]; +LL + vec![0u8; 200]; + | error: a `Vec` of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:32:5 @@ -98,12 +110,14 @@ LL | vec![0usize..200]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0usize..200).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![0usize..200]; +LL + (0usize..200).collect::>(); + | help: if you wanted a `Vec` of len 200, try | -LL | vec![0usize; 200]; - | ~~~~~~~~~~~ +LL - vec![0usize..200]; +LL + vec![0usize; 200]; + | error: a `Vec` of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:33:5 @@ -113,12 +127,14 @@ LL | vec![0..200usize]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0..200usize).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![0..200usize]; +LL + (0..200usize).collect::>(); + | help: if you wanted a `Vec` of len 200usize, try | -LL | vec![0; 200usize]; - | ~~~~~~~~~~~ +LL - vec![0..200usize]; +LL + vec![0; 200usize]; + | error: an array of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:35:5 @@ -128,8 +144,9 @@ LL | [0..200isize]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0..200isize).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - [0..200isize]; +LL + (0..200isize).collect::>(); + | error: a `Vec` of `Range` that is only one element --> tests/ui/single_range_in_vec_init.rs:36:5 @@ -139,8 +156,9 @@ LL | vec![0..200isize]; | help: if you wanted a `Vec` that contains the entire range, try | -LL | (0..200isize).collect::>(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - vec![0..200isize]; +LL + (0..200isize).collect::>(); + | error: aborting due to 10 previous errors diff --git a/src/tools/clippy/tests/ui/string_lit_chars_any.stderr b/src/tools/clippy/tests/ui/string_lit_chars_any.stderr index 4d3ca98e62371..1e28ae7b163e6 100644 --- a/src/tools/clippy/tests/ui/string_lit_chars_any.stderr +++ b/src/tools/clippy/tests/ui/string_lit_chars_any.stderr @@ -8,8 +8,9 @@ LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| x == c); = help: to override `-D warnings` add `#[allow(clippy::string_lit_chars_any)]` help: use `matches!(...)` instead | -LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - "\\.+*?()|[]{}^$#&-~".chars().any(|x| x == c); +LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); + | error: usage of `.chars().any(...)` to check if a char matches any from a string literal --> tests/ui/string_lit_chars_any.rs:19:5 @@ -19,8 +20,9 @@ LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| x == c); | help: use `matches!(...)` instead | -LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| x == c); +LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); + | error: usage of `.chars().any(...)` to check if a char matches any from a string literal --> tests/ui/string_lit_chars_any.rs:20:5 @@ -30,8 +32,9 @@ LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| c == x); | help: use `matches!(...)` instead | -LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - "\\.+*?()|[]{}^$#&-~".chars().any(|x| c == x); +LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); + | error: usage of `.chars().any(...)` to check if a char matches any from a string literal --> tests/ui/string_lit_chars_any.rs:21:5 @@ -41,8 +44,9 @@ LL | r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| c == x); | help: use `matches!(...)` instead | -LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - r#"\.+*?()|[]{}^$#&-~"#.chars().any(|x| c == x); +LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); + | error: usage of `.chars().any(...)` to check if a char matches any from a string literal --> tests/ui/string_lit_chars_any.rs:23:5 @@ -52,8 +56,9 @@ LL | "\\.+*?()|[]{}^$#&-~".chars().any(|x| { x == c }); | help: use `matches!(...)` instead | -LL | matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - "\\.+*?()|[]{}^$#&-~".chars().any(|x| { x == c }); +LL + matches!(c, '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~'); + | error: aborting due to 5 previous errors diff --git a/src/tools/clippy/tests/ui/suspicious_command_arg_space.stderr b/src/tools/clippy/tests/ui/suspicious_command_arg_space.stderr index d2517b66b5661..a1670424ca168 100644 --- a/src/tools/clippy/tests/ui/suspicious_command_arg_space.stderr +++ b/src/tools/clippy/tests/ui/suspicious_command_arg_space.stderr @@ -8,8 +8,9 @@ LL | std::process::Command::new("echo").arg("-n hello").spawn().unwrap(); = help: to override `-D warnings` add `#[allow(clippy::suspicious_command_arg_space)]` help: consider splitting the argument | -LL | std::process::Command::new("echo").args(["-n", "hello"]).spawn().unwrap(); - | ~~~~ ~~~~~~~~~~~~~~~ +LL - std::process::Command::new("echo").arg("-n hello").spawn().unwrap(); +LL + std::process::Command::new("echo").args(["-n", "hello"]).spawn().unwrap(); + | error: single argument that looks like it should be multiple arguments --> tests/ui/suspicious_command_arg_space.rs:6:43 @@ -19,8 +20,9 @@ LL | std::process::Command::new("cat").arg("--number file").spawn().unwrap() | help: consider splitting the argument | -LL | std::process::Command::new("cat").args(["--number", "file"]).spawn().unwrap(); - | ~~~~ ~~~~~~~~~~~~~~~~~~~~ +LL - std::process::Command::new("cat").arg("--number file").spawn().unwrap(); +LL + std::process::Command::new("cat").args(["--number", "file"]).spawn().unwrap(); + | error: aborting due to 2 previous errors diff --git a/src/tools/clippy/tests/ui/suspicious_doc_comments.stderr b/src/tools/clippy/tests/ui/suspicious_doc_comments.stderr index f12053b1595a1..67775ce6fbff9 100644 --- a/src/tools/clippy/tests/ui/suspicious_doc_comments.stderr +++ b/src/tools/clippy/tests/ui/suspicious_doc_comments.stderr @@ -8,7 +8,8 @@ LL | ///! Fake module documentation. = help: to override `-D warnings` add `#[allow(clippy::suspicious_doc_comments)]` help: use an inner doc comment to document the parent module or crate | -LL | //! Fake module documentation. +LL - ///! Fake module documentation. +LL + //! Fake module documentation. | error: this is an outer doc comment and does not apply to the parent module or crate @@ -19,7 +20,8 @@ LL | ///! This module contains useful functions. | help: use an inner doc comment to document the parent module or crate | -LL | //! This module contains useful functions. +LL - ///! This module contains useful functions. +LL + //! This module contains useful functions. | error: this is an outer doc comment and does not apply to the parent module or crate @@ -71,7 +73,8 @@ LL | ///! a | help: use an inner doc comment to document the parent module or crate | -LL | //! a +LL - ///! a +LL + //! a | error: this is an outer doc comment and does not apply to the parent module or crate @@ -97,7 +100,8 @@ LL | ///! Very cool macro | help: use an inner doc comment to document the parent module or crate | -LL | //! Very cool macro +LL - ///! Very cool macro +LL + //! Very cool macro | error: this is an outer doc comment and does not apply to the parent module or crate @@ -108,7 +112,8 @@ LL | ///! Huh. | help: use an inner doc comment to document the parent module or crate | -LL | //! Huh. +LL - ///! Huh. +LL + //! Huh. | error: aborting due to 9 previous errors diff --git a/src/tools/clippy/tests/ui/suspicious_to_owned.stderr b/src/tools/clippy/tests/ui/suspicious_to_owned.stderr index 255f211e65509..74bbcfcca51e1 100644 --- a/src/tools/clippy/tests/ui/suspicious_to_owned.stderr +++ b/src/tools/clippy/tests/ui/suspicious_to_owned.stderr @@ -8,12 +8,14 @@ LL | let _ = cow.to_owned(); = help: to override `-D warnings` add `#[allow(clippy::suspicious_to_owned)]` help: depending on intent, either make the Cow an Owned variant | -LL | let _ = cow.into_owned(); - | ~~~~~~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.into_owned(); + | help: or clone the Cow itself | -LL | let _ = cow.clone(); - | ~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.clone(); + | error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned --> tests/ui/suspicious_to_owned.rs:29:13 @@ -23,12 +25,14 @@ LL | let _ = cow.to_owned(); | help: depending on intent, either make the Cow an Owned variant | -LL | let _ = cow.into_owned(); - | ~~~~~~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.into_owned(); + | help: or clone the Cow itself | -LL | let _ = cow.clone(); - | ~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.clone(); + | error: this `to_owned` call clones the Cow<'_, Vec> itself and does not cause the Cow<'_, Vec> contents to become owned --> tests/ui/suspicious_to_owned.rs:40:13 @@ -38,12 +42,14 @@ LL | let _ = cow.to_owned(); | help: depending on intent, either make the Cow an Owned variant | -LL | let _ = cow.into_owned(); - | ~~~~~~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.into_owned(); + | help: or clone the Cow itself | -LL | let _ = cow.clone(); - | ~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.clone(); + | error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned --> tests/ui/suspicious_to_owned.rs:51:13 @@ -53,12 +59,14 @@ LL | let _ = cow.to_owned(); | help: depending on intent, either make the Cow an Owned variant | -LL | let _ = cow.into_owned(); - | ~~~~~~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.into_owned(); + | help: or clone the Cow itself | -LL | let _ = cow.clone(); - | ~~~~~~~~~~~ +LL - let _ = cow.to_owned(); +LL + let _ = cow.clone(); + | error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> tests/ui/suspicious_to_owned.rs:66:13 diff --git a/src/tools/clippy/tests/ui/suspicious_xor_used_as_pow.stderr b/src/tools/clippy/tests/ui/suspicious_xor_used_as_pow.stderr index 43b03676b1db5..2a153169bd347 100644 --- a/src/tools/clippy/tests/ui/suspicious_xor_used_as_pow.stderr +++ b/src/tools/clippy/tests/ui/suspicious_xor_used_as_pow.stderr @@ -8,8 +8,9 @@ LL | let _ = 2 ^ 5; = help: to override `-D warnings` add `#[allow(clippy::suspicious_xor_used_as_pow)]` help: did you mean to write | -LL | let _ = 2.pow(5); - | ~~~~~~~~ +LL - let _ = 2 ^ 5; +LL + let _ = 2.pow(5); + | error: `^` is not the exponentiation operator --> tests/ui/suspicious_xor_used_as_pow.rs:22:13 @@ -19,8 +20,9 @@ LL | let _ = 2i32 ^ 9i32; | help: did you mean to write | -LL | let _ = 2i32.pow(9i32); - | ~~~~~~~~~~~~~~ +LL - let _ = 2i32 ^ 9i32; +LL + let _ = 2i32.pow(9i32); + | error: `^` is not the exponentiation operator --> tests/ui/suspicious_xor_used_as_pow.rs:24:13 @@ -30,8 +32,9 @@ LL | let _ = 2i32 ^ 2i32; | help: did you mean to write | -LL | let _ = 2i32.pow(2i32); - | ~~~~~~~~~~~~~~ +LL - let _ = 2i32 ^ 2i32; +LL + let _ = 2i32.pow(2i32); + | error: `^` is not the exponentiation operator --> tests/ui/suspicious_xor_used_as_pow.rs:26:13 @@ -41,8 +44,9 @@ LL | let _ = 50i32 ^ 3i32; | help: did you mean to write | -LL | let _ = 50i32.pow(3i32); - | ~~~~~~~~~~~~~~~ +LL - let _ = 50i32 ^ 3i32; +LL + let _ = 50i32.pow(3i32); + | error: `^` is not the exponentiation operator --> tests/ui/suspicious_xor_used_as_pow.rs:28:13 @@ -52,8 +56,9 @@ LL | let _ = 5i32 ^ 8i32; | help: did you mean to write | -LL | let _ = 5i32.pow(8i32); - | ~~~~~~~~~~~~~~ +LL - let _ = 5i32 ^ 8i32; +LL + let _ = 5i32.pow(8i32); + | error: `^` is not the exponentiation operator --> tests/ui/suspicious_xor_used_as_pow.rs:30:13 @@ -63,8 +68,9 @@ LL | let _ = 2i32 ^ 32i32; | help: did you mean to write | -LL | let _ = 2i32.pow(32i32); - | ~~~~~~~~~~~~~~~ +LL - let _ = 2i32 ^ 32i32; +LL + let _ = 2i32.pow(32i32); + | error: `^` is not the exponentiation operator --> tests/ui/suspicious_xor_used_as_pow.rs:13:9 @@ -78,8 +84,9 @@ LL | macro_test_inside!(); = note: this error originates in the macro `macro_test_inside` (in Nightly builds, run with -Z macro-backtrace for more info) help: did you mean to write | -LL | 1.pow(2) // should warn even if inside macro - | ~~~~~~~~ +LL - 1 ^ 2 // should warn even if inside macro +LL + 1.pow(2) // should warn even if inside macro + | error: aborting due to 7 previous errors diff --git a/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr b/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr index 8801eb943ce8d..f4f83cd7ac6a7 100644 --- a/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr +++ b/src/tools/clippy/tests/ui/transmute_ptr_to_ptr.stderr @@ -8,8 +8,9 @@ LL | let _: *const f32 = transmute(ptr); = help: to override `-D warnings` add `#[allow(clippy::transmute_ptr_to_ptr)]` help: use `pointer::cast` instead | -LL | let _: *const f32 = ptr.cast::(); - | ~~~~~~~~~~~~~~~~~ +LL - let _: *const f32 = transmute(ptr); +LL + let _: *const f32 = ptr.cast::(); + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:34:27 @@ -19,8 +20,9 @@ LL | let _: *mut f32 = transmute(mut_ptr); | help: use `pointer::cast` instead | -LL | let _: *mut f32 = mut_ptr.cast::(); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - let _: *mut f32 = transmute(mut_ptr); +LL + let _: *mut f32 = mut_ptr.cast::(); + | error: transmute from a reference to a reference --> tests/ui/transmute_ptr_to_ptr.rs:37:23 @@ -60,8 +62,9 @@ LL | let _: *const u32 = transmute(mut_ptr); | help: use `pointer::cast_const` instead | -LL | let _: *const u32 = mut_ptr.cast_const(); - | ~~~~~~~~~~~~~~~~~~~~ +LL - let _: *const u32 = transmute(mut_ptr); +LL + let _: *const u32 = mut_ptr.cast_const(); + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:52:27 @@ -71,8 +74,9 @@ LL | let _: *mut u32 = transmute(ptr); | help: use `pointer::cast_mut` instead | -LL | let _: *mut u32 = ptr.cast_mut(); - | ~~~~~~~~~~~~~~ +LL - let _: *mut u32 = transmute(ptr); +LL + let _: *mut u32 = ptr.cast_mut(); + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:64:14 @@ -82,8 +86,9 @@ LL | unsafe { transmute(v) } | help: use an `as` cast instead | -LL | unsafe { v as *const &() } - | ~~~~~~~~~~~~~~~ +LL - unsafe { transmute(v) } +LL + unsafe { v as *const &() } + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:79:28 @@ -93,8 +98,9 @@ LL | let _: *const i8 = transmute(ptr); | help: use an `as` cast instead | -LL | let _: *const i8 = ptr as *const i8; - | ~~~~~~~~~~~~~~~~ +LL - let _: *const i8 = transmute(ptr); +LL + let _: *const i8 = ptr as *const i8; + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:86:28 @@ -104,8 +110,9 @@ LL | let _: *const i8 = transmute(ptr); | help: use `pointer::cast` instead | -LL | let _: *const i8 = ptr.cast::(); - | ~~~~~~~~~~~~~~~~ +LL - let _: *const i8 = transmute(ptr); +LL + let _: *const i8 = ptr.cast::(); + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:93:26 @@ -115,8 +122,9 @@ LL | let _: *mut u8 = transmute(ptr); | help: use an `as` cast instead | -LL | let _: *mut u8 = ptr as *mut u8; - | ~~~~~~~~~~~~~~ +LL - let _: *mut u8 = transmute(ptr); +LL + let _: *mut u8 = ptr as *mut u8; + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:94:28 @@ -126,8 +134,9 @@ LL | let _: *const u8 = transmute(mut_ptr); | help: use an `as` cast instead | -LL | let _: *const u8 = mut_ptr as *const u8; - | ~~~~~~~~~~~~~~~~~~~~ +LL - let _: *const u8 = transmute(mut_ptr); +LL + let _: *const u8 = mut_ptr as *const u8; + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:101:26 @@ -137,8 +146,9 @@ LL | let _: *mut u8 = transmute(ptr); | help: use `pointer::cast_mut` instead | -LL | let _: *mut u8 = ptr.cast_mut(); - | ~~~~~~~~~~~~~~ +LL - let _: *mut u8 = transmute(ptr); +LL + let _: *mut u8 = ptr.cast_mut(); + | error: transmute from a pointer to a pointer --> tests/ui/transmute_ptr_to_ptr.rs:102:28 @@ -148,8 +158,9 @@ LL | let _: *const u8 = transmute(mut_ptr); | help: use `pointer::cast_const` instead | -LL | let _: *const u8 = mut_ptr.cast_const(); - | ~~~~~~~~~~~~~~~~~~~~ +LL - let _: *const u8 = transmute(mut_ptr); +LL + let _: *const u8 = mut_ptr.cast_const(); + | error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.stderr b/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.stderr index 2d74967ede56c..21edd39e7ad65 100644 --- a/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.stderr +++ b/src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.stderr @@ -17,8 +17,9 @@ LL | let _ptr_i8_transmute = unsafe { transmute::<*const i32, *const i8>(ptr = help: to override `-D warnings` add `#[allow(clippy::transmute_ptr_to_ptr)]` help: use `pointer::cast` instead | -LL | let _ptr_i8_transmute = unsafe { ptr_i32.cast::() }; - | ~~~~~~~~~~~~~~~~~~~~ +LL - let _ptr_i8_transmute = unsafe { transmute::<*const i32, *const i8>(ptr_i32) }; +LL + let _ptr_i8_transmute = unsafe { ptr_i32.cast::() }; + | error: transmute from a pointer to a pointer --> tests/ui/transmutes_expressible_as_ptr_casts.rs:27:46 @@ -28,8 +29,9 @@ LL | let _ptr_to_unsized_transmute = unsafe { transmute::<*const [i32], *con | help: use an `as` cast instead | -LL | let _ptr_to_unsized_transmute = unsafe { slice_ptr as *const [u32] }; - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ptr_to_unsized_transmute = unsafe { transmute::<*const [i32], *const [u32]>(slice_ptr) }; +LL + let _ptr_to_unsized_transmute = unsafe { slice_ptr as *const [u32] }; + | error: transmute from `*const i32` to `usize` which could be expressed as a pointer cast instead --> tests/ui/transmutes_expressible_as_ptr_casts.rs:33:50 diff --git a/src/tools/clippy/tests/ui/unit_arg.stderr b/src/tools/clippy/tests/ui/unit_arg.stderr index 41ad1a2d3834f..bf79e93e44405 100644 --- a/src/tools/clippy/tests/ui/unit_arg.stderr +++ b/src/tools/clippy/tests/ui/unit_arg.stderr @@ -10,7 +10,8 @@ LL | | }); = help: to override `-D warnings` add `#[allow(clippy::unit_arg)]` help: remove the semicolon from the last statement in the block | -LL | 1 +LL - 1; +LL + 1 | help: or move the expression in front of the call and replace it with the unit literal `()` | @@ -43,7 +44,8 @@ LL | | }); | help: remove the semicolon from the last statement in the block | -LL | foo(2) +LL - foo(2); +LL + foo(2) | help: or move the expression in front of the call and replace it with the unit literal `()` | @@ -64,7 +66,8 @@ LL | | }); | help: remove the semicolon from the last statement in the block | -LL | 1 +LL - 1; +LL + 1 | help: or move the expression in front of the call and replace it with the unit literal `()` | @@ -98,7 +101,8 @@ LL | | }); | help: remove the semicolon from the last statement in the block | -LL | foo(2) +LL - foo(2); +LL + foo(2) | help: or move the expressions in front of the call and replace them with the unit literal `()` | @@ -124,11 +128,13 @@ LL | | ); | help: remove the semicolon from the last statement in the block | -LL | foo(1) +LL - foo(1); +LL + foo(1) | help: remove the semicolon from the last statement in the block | -LL | foo(3) +LL - foo(3); +LL + foo(3) | help: or move the expressions in front of the call and replace them with the unit literal `()` | diff --git a/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr b/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr index aa2c2f3c0e202..ea925cd3a9fc4 100644 --- a/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr +++ b/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr @@ -39,8 +39,9 @@ LL | #[warn(clippy::dead_cod)] | help: a lint with a similar name exists in `rustc` lints | -LL | #[warn(dead_code)] - | ~~~~~~~~~ +LL - #[warn(clippy::dead_cod)] +LL + #[warn(dead_code)] + | error: unknown lint: `clippy::unused_colle` --> tests/ui/unknown_clippy_lints.rs:13:8 @@ -62,8 +63,9 @@ LL | #[warn(clippy::missing_docs)] | help: a lint with a similar name exists in `rustc` lints | -LL | #[warn(missing_docs)] - | ~~~~~~~~~~~~ +LL - #[warn(clippy::missing_docs)] +LL + #[warn(missing_docs)] + | error: aborting due to 9 previous errors diff --git a/src/tools/clippy/tests/ui/unnecessary_iter_cloned.stderr b/src/tools/clippy/tests/ui/unnecessary_iter_cloned.stderr index e3592e3cbbd82..54e6d8b44b121 100644 --- a/src/tools/clippy/tests/ui/unnecessary_iter_cloned.stderr +++ b/src/tools/clippy/tests/ui/unnecessary_iter_cloned.stderr @@ -8,8 +8,9 @@ LL | for (t, path) in files.iter().copied() { = help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]` help: use | -LL | for (t, path) in files { - | ~~~~~ +LL - for (t, path) in files.iter().copied() { +LL + for (t, path) in files { + | help: remove any references to the binding | LL - let other = match get_file_path(&t) { @@ -24,8 +25,9 @@ LL | for (t, path) in files.iter().copied() { | help: use | -LL | for (t, path) in files.iter() { - | ~~~~~~~~~~~~ +LL - for (t, path) in files.iter().copied() { +LL + for (t, path) in files.iter() { + | help: remove any references to the binding | LL - let other = match get_file_path(&t) { @@ -46,8 +48,9 @@ LL | for c in v.iter().cloned() { | help: use | -LL | for c in v.iter() { - | ~~~~~~~~ +LL - for c in v.iter().cloned() { +LL + for c in v.iter() { + | help: remove any references to the binding | LL - let ref_c = &c; @@ -62,8 +65,9 @@ LL | for (i, c) in v.iter().cloned() { | help: use | -LL | for (i, c) in v.iter() { - | ~~~~~~~~ +LL - for (i, c) in v.iter().cloned() { +LL + for (i, c) in v.iter() { + | help: remove any references to the binding | LL ~ let ref_c = c; diff --git a/src/tools/clippy/tests/ui/unnecessary_literal_unwrap.stderr b/src/tools/clippy/tests/ui/unnecessary_literal_unwrap.stderr index 37ee9195fce66..631bf08372666 100644 --- a/src/tools/clippy/tests/ui/unnecessary_literal_unwrap.stderr +++ b/src/tools/clippy/tests/ui/unnecessary_literal_unwrap.stderr @@ -62,8 +62,9 @@ LL | let _val = None::<()>.expect("this always happens"); | help: remove the `None` and `expect()` | -LL | let _val = panic!("this always happens"); - | ~~~~~~~ +LL - let _val = None::<()>.expect("this always happens"); +LL + let _val = panic!("this always happens"); + | error: used `unwrap_or_default()` on `None` value --> tests/ui/unnecessary_literal_unwrap.rs:22:24 @@ -133,8 +134,9 @@ LL | None::<()>.expect("this always happens"); | help: remove the `None` and `expect()` | -LL | panic!("this always happens"); - | ~~~~~~~ +LL - None::<()>.expect("this always happens"); +LL + panic!("this always happens"); + | error: used `unwrap_or_default()` on `None` value --> tests/ui/unnecessary_literal_unwrap.rs:30:5 @@ -222,8 +224,9 @@ LL | let _val = Ok::<_, ()>(1).unwrap_err(); | help: remove the `Ok` and `unwrap_err()` | -LL | let _val = panic!("{:?}", 1); - | ~~~~~~~~~~~~~~ ~ +LL - let _val = Ok::<_, ()>(1).unwrap_err(); +LL + let _val = panic!("{:?}", 1); + | error: used `expect_err()` on `Ok` value --> tests/ui/unnecessary_literal_unwrap.rs:41:16 @@ -233,8 +236,9 @@ LL | let _val = Ok::<_, ()>(1).expect_err("this always happens"); | help: remove the `Ok` and `expect_err()` | -LL | let _val = panic!("{1}: {:?}", 1, "this always happens"); - | ~~~~~~~~~~~~~~~~~~~ ~ +LL - let _val = Ok::<_, ()>(1).expect_err("this always happens"); +LL + let _val = panic!("{1}: {:?}", 1, "this always happens"); + | error: used `unwrap()` on `Ok` value --> tests/ui/unnecessary_literal_unwrap.rs:43:5 @@ -268,8 +272,9 @@ LL | Ok::<_, ()>(1).unwrap_err(); | help: remove the `Ok` and `unwrap_err()` | -LL | panic!("{:?}", 1); - | ~~~~~~~~~~~~~~ ~ +LL - Ok::<_, ()>(1).unwrap_err(); +LL + panic!("{:?}", 1); + | error: used `expect_err()` on `Ok` value --> tests/ui/unnecessary_literal_unwrap.rs:46:5 @@ -279,8 +284,9 @@ LL | Ok::<_, ()>(1).expect_err("this always happens"); | help: remove the `Ok` and `expect_err()` | -LL | panic!("{1}: {:?}", 1, "this always happens"); - | ~~~~~~~~~~~~~~~~~~~ ~ +LL - Ok::<_, ()>(1).expect_err("this always happens"); +LL + panic!("{1}: {:?}", 1, "this always happens"); + | error: used `unwrap_err()` on `Err` value --> tests/ui/unnecessary_literal_unwrap.rs:50:16 @@ -314,8 +320,9 @@ LL | let _val = Err::<(), _>(1).unwrap(); | help: remove the `Err` and `unwrap()` | -LL | let _val = panic!("{:?}", 1); - | ~~~~~~~~~~~~~~ ~ +LL - let _val = Err::<(), _>(1).unwrap(); +LL + let _val = panic!("{:?}", 1); + | error: used `expect()` on `Err` value --> tests/ui/unnecessary_literal_unwrap.rs:53:16 @@ -325,8 +332,9 @@ LL | let _val = Err::<(), _>(1).expect("this always happens"); | help: remove the `Err` and `expect()` | -LL | let _val = panic!("{1}: {:?}", 1, "this always happens"); - | ~~~~~~~~~~~~~~~~~~~ ~ +LL - let _val = Err::<(), _>(1).expect("this always happens"); +LL + let _val = panic!("{1}: {:?}", 1, "this always happens"); + | error: used `unwrap_err()` on `Err` value --> tests/ui/unnecessary_literal_unwrap.rs:55:5 @@ -360,8 +368,9 @@ LL | Err::<(), _>(1).unwrap(); | help: remove the `Err` and `unwrap()` | -LL | panic!("{:?}", 1); - | ~~~~~~~~~~~~~~ ~ +LL - Err::<(), _>(1).unwrap(); +LL + panic!("{:?}", 1); + | error: used `expect()` on `Err` value --> tests/ui/unnecessary_literal_unwrap.rs:58:5 @@ -371,8 +380,9 @@ LL | Err::<(), _>(1).expect("this always happens"); | help: remove the `Err` and `expect()` | -LL | panic!("{1}: {:?}", 1, "this always happens"); - | ~~~~~~~~~~~~~~~~~~~ ~ +LL - Err::<(), _>(1).expect("this always happens"); +LL + panic!("{1}: {:?}", 1, "this always happens"); + | error: used `unwrap_or()` on `Some` value --> tests/ui/unnecessary_literal_unwrap.rs:62:16 diff --git a/src/tools/clippy/tests/ui/unnecessary_to_owned.stderr b/src/tools/clippy/tests/ui/unnecessary_to_owned.stderr index 7ab1f667d9b58..7c67a751f930a 100644 --- a/src/tools/clippy/tests/ui/unnecessary_to_owned.stderr +++ b/src/tools/clippy/tests/ui/unnecessary_to_owned.stderr @@ -521,8 +521,9 @@ LL | for t in file_types.to_vec() { | help: use | -LL | for t in file_types { - | ~~~~~~~~~~ +LL - for t in file_types.to_vec() { +LL + for t in file_types { + | help: remove any references to the binding | LL - let path = match get_file_path(&t) { diff --git a/src/tools/clippy/tests/ui/unnecessary_wraps.stderr b/src/tools/clippy/tests/ui/unnecessary_wraps.stderr index 59986d895b30e..239dae3216197 100644 --- a/src/tools/clippy/tests/ui/unnecessary_wraps.stderr +++ b/src/tools/clippy/tests/ui/unnecessary_wraps.stderr @@ -14,8 +14,9 @@ LL | | } = help: to override `-D warnings` add `#[allow(clippy::unnecessary_wraps)]` help: remove `Option` from the return type... | -LL | fn func1(a: bool, b: bool) -> i32 { - | ~~~ +LL - fn func1(a: bool, b: bool) -> Option { +LL + fn func1(a: bool, b: bool) -> i32 { + | help: ...and then change returning expressions | LL ~ return 42; @@ -41,8 +42,9 @@ LL | | } | help: remove `Option` from the return type... | -LL | fn func2(a: bool, b: bool) -> i32 { - | ~~~ +LL - fn func2(a: bool, b: bool) -> Option { +LL + fn func2(a: bool, b: bool) -> i32 { + | help: ...and then change returning expressions | LL ~ return 10; @@ -61,11 +63,13 @@ LL | | } | help: remove `Option` from the return type... | -LL | fn func5() -> i32 { - | ~~~ +LL - fn func5() -> Option { +LL + fn func5() -> i32 { + | help: ...and then change returning expressions | -LL | 1 +LL - Some(1) +LL + 1 | error: this function's return value is unnecessarily wrapped by `Result` @@ -79,11 +83,13 @@ LL | | } | help: remove `Result` from the return type... | -LL | fn func7() -> i32 { - | ~~~ +LL - fn func7() -> Result { +LL + fn func7() -> i32 { + | help: ...and then change returning expressions | -LL | 1 +LL - Ok(1) +LL + 1 | error: this function's return value is unnecessarily wrapped by `Option` @@ -97,11 +103,13 @@ LL | | } | help: remove `Option` from the return type... | -LL | fn func12() -> i32 { - | ~~~ +LL - fn func12() -> Option { +LL + fn func12() -> i32 { + | help: ...and then change returning expressions | -LL | 1 +LL - Some(1) +LL + 1 | error: this function's return value is unnecessary @@ -118,8 +126,9 @@ LL | | } | help: remove the return type... | -LL | fn issue_6640_1(a: bool, b: bool) -> () { - | ~~ +LL - fn issue_6640_1(a: bool, b: bool) -> Option<()> { +LL + fn issue_6640_1(a: bool, b: bool) -> () { + | help: ...and then remove returned values | LL ~ return ; @@ -145,8 +154,9 @@ LL | | } | help: remove the return type... | -LL | fn issue_6640_2(a: bool, b: bool) -> () { - | ~~ +LL - fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> { +LL + fn issue_6640_2(a: bool, b: bool) -> () { + | help: ...and then remove returned values | LL ~ return ; diff --git a/src/tools/clippy/tests/ui/unnested_or_patterns.stderr b/src/tools/clippy/tests/ui/unnested_or_patterns.stderr index bd15ef62368ea..4325df1430423 100644 --- a/src/tools/clippy/tests/ui/unnested_or_patterns.stderr +++ b/src/tools/clippy/tests/ui/unnested_or_patterns.stderr @@ -8,8 +8,9 @@ LL | if let box 0 | box 2 = Box::new(0) {} = help: to override `-D warnings` add `#[allow(clippy::unnested_or_patterns)]` help: nest the patterns | -LL | if let box (0 | 2) = Box::new(0) {} - | ~~~~~~~~~~~ +LL - if let box 0 | box 2 = Box::new(0) {} +LL + if let box (0 | 2) = Box::new(0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:17:12 @@ -19,8 +20,9 @@ LL | if let box ((0 | 1)) | box (2 | 3) | box 4 = Box::new(0) {} | help: nest the patterns | -LL | if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {} - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let box ((0 | 1)) | box (2 | 3) | box 4 = Box::new(0) {} +LL + if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:19:12 @@ -30,8 +32,9 @@ LL | if let Some(1) | C0 | Some(2) = None {} | help: nest the patterns | -LL | if let Some(1 | 2) | C0 = None {} - | ~~~~~~~~~~~~~~~~ +LL - if let Some(1) | C0 | Some(2) = None {} +LL + if let Some(1 | 2) | C0 = None {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:20:12 @@ -41,8 +44,9 @@ LL | if let &mut 0 | &mut 2 = &mut 0 {} | help: nest the patterns | -LL | if let &mut (0 | 2) = &mut 0 {} - | ~~~~~~~~~~~~ +LL - if let &mut 0 | &mut 2 = &mut 0 {} +LL + if let &mut (0 | 2) = &mut 0 {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:21:12 @@ -52,8 +56,9 @@ LL | if let x @ 0 | x @ 2 = 0 {} | help: nest the patterns | -LL | if let x @ (0 | 2) = 0 {} - | ~~~~~~~~~~~ +LL - if let x @ 0 | x @ 2 = 0 {} +LL + if let x @ (0 | 2) = 0 {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:22:12 @@ -63,8 +68,9 @@ LL | if let (0, 1) | (0, 2) | (0, 3) = (0, 0) {} | help: nest the patterns | -LL | if let (0, 1 | 2 | 3) = (0, 0) {} - | ~~~~~~~~~~~~~~ +LL - if let (0, 1) | (0, 2) | (0, 3) = (0, 0) {} +LL + if let (0, 1 | 2 | 3) = (0, 0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:23:12 @@ -74,8 +80,9 @@ LL | if let (1, 0) | (2, 0) | (3, 0) = (0, 0) {} | help: nest the patterns | -LL | if let (1 | 2 | 3, 0) = (0, 0) {} - | ~~~~~~~~~~~~~~ +LL - if let (1, 0) | (2, 0) | (3, 0) = (0, 0) {} +LL + if let (1 | 2 | 3, 0) = (0, 0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:24:12 @@ -85,8 +92,9 @@ LL | if let (x, ..) | (x, 1) | (x, 2) = (0, 1) {} | help: nest the patterns | -LL | if let (x, ..) | (x, 1 | 2) = (0, 1) {} - | ~~~~~~~~~~~~~~~~~~~~ +LL - if let (x, ..) | (x, 1) | (x, 2) = (0, 1) {} +LL + if let (x, ..) | (x, 1 | 2) = (0, 1) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:25:12 @@ -96,8 +104,9 @@ LL | if let [0] | [1] = [0] {} | help: nest the patterns | -LL | if let [0 | 1] = [0] {} - | ~~~~~~~ +LL - if let [0] | [1] = [0] {} +LL + if let [0 | 1] = [0] {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:26:12 @@ -107,8 +116,9 @@ LL | if let [x, 0] | [x, 1] = [0, 1] {} | help: nest the patterns | -LL | if let [x, 0 | 1] = [0, 1] {} - | ~~~~~~~~~~ +LL - if let [x, 0] | [x, 1] = [0, 1] {} +LL + if let [x, 0 | 1] = [0, 1] {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:27:12 @@ -118,8 +128,9 @@ LL | if let [x, 0] | [x, 1] | [x, 2] = [0, 1] {} | help: nest the patterns | -LL | if let [x, 0 | 1 | 2] = [0, 1] {} - | ~~~~~~~~~~~~~~ +LL - if let [x, 0] | [x, 1] | [x, 2] = [0, 1] {} +LL + if let [x, 0 | 1 | 2] = [0, 1] {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:28:12 @@ -129,8 +140,9 @@ LL | if let [x, ..] | [x, 1] | [x, 2] = [0, 1] {} | help: nest the patterns | -LL | if let [x, ..] | [x, 1 | 2] = [0, 1] {} - | ~~~~~~~~~~~~~~~~~~~~ +LL - if let [x, ..] | [x, 1] | [x, 2] = [0, 1] {} +LL + if let [x, ..] | [x, 1 | 2] = [0, 1] {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:30:12 @@ -140,8 +152,9 @@ LL | if let TS(0, x) | TS(1, x) = TS(0, 0) {} | help: nest the patterns | -LL | if let TS(0 | 1, x) = TS(0, 0) {} - | ~~~~~~~~~~~~ +LL - if let TS(0, x) | TS(1, x) = TS(0, 0) {} +LL + if let TS(0 | 1, x) = TS(0, 0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:31:12 @@ -151,8 +164,9 @@ LL | if let TS(1, 0) | TS(2, 0) | TS(3, 0) = TS(0, 0) {} | help: nest the patterns | -LL | if let TS(1 | 2 | 3, 0) = TS(0, 0) {} - | ~~~~~~~~~~~~~~~~ +LL - if let TS(1, 0) | TS(2, 0) | TS(3, 0) = TS(0, 0) {} +LL + if let TS(1 | 2 | 3, 0) = TS(0, 0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:32:12 @@ -162,8 +176,9 @@ LL | if let TS(x, ..) | TS(x, 1) | TS(x, 2) = TS(0, 0) {} | help: nest the patterns | -LL | if let TS(x, ..) | TS(x, 1 | 2) = TS(0, 0) {} - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let TS(x, ..) | TS(x, 1) | TS(x, 2) = TS(0, 0) {} +LL + if let TS(x, ..) | TS(x, 1 | 2) = TS(0, 0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:37:12 @@ -173,8 +188,9 @@ LL | if let S { x: 0, y } | S { y, x: 1 } = (S { x: 0, y: 1 }) {} | help: nest the patterns | -LL | if let S { x: 0 | 1, y } = (S { x: 0, y: 1 }) {} - | ~~~~~~~~~~~~~~~~~ +LL - if let S { x: 0, y } | S { y, x: 1 } = (S { x: 0, y: 1 }) {} +LL + if let S { x: 0 | 1, y } = (S { x: 0, y: 1 }) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns.rs:48:12 @@ -184,8 +200,9 @@ LL | if let [1] | [53] = [0] {} | help: nest the patterns | -LL | if let [1 | 53] = [0] {} - | ~~~~~~~~ +LL - if let [1] | [53] = [0] {} +LL + if let [1 | 53] = [0] {} + | error: aborting due to 17 previous errors diff --git a/src/tools/clippy/tests/ui/unnested_or_patterns2.stderr b/src/tools/clippy/tests/ui/unnested_or_patterns2.stderr index 54f03937508a9..3d8968551b969 100644 --- a/src/tools/clippy/tests/ui/unnested_or_patterns2.stderr +++ b/src/tools/clippy/tests/ui/unnested_or_patterns2.stderr @@ -8,8 +8,9 @@ LL | if let Some(Some(0)) | Some(Some(1)) = None {} = help: to override `-D warnings` add `#[allow(clippy::unnested_or_patterns)]` help: nest the patterns | -LL | if let Some(Some(0 | 1)) = None {} - | ~~~~~~~~~~~~~~~~~ +LL - if let Some(Some(0)) | Some(Some(1)) = None {} +LL + if let Some(Some(0 | 1)) = None {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:13:12 @@ -19,8 +20,9 @@ LL | if let Some(Some(0)) | Some(Some(1) | Some(2)) = None {} | help: nest the patterns | -LL | if let Some(Some(0 | 1 | 2)) = None {} - | ~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(Some(0)) | Some(Some(1) | Some(2)) = None {} +LL + if let Some(Some(0 | 1 | 2)) = None {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:14:12 @@ -30,8 +32,9 @@ LL | if let Some(Some(0 | 1) | Some(2)) | Some(Some(3) | Some(4)) = None {} | help: nest the patterns | -LL | if let Some(Some(0 | 1 | 2 | 3 | 4)) = None {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(Some(0 | 1) | Some(2)) | Some(Some(3) | Some(4)) = None {} +LL + if let Some(Some(0 | 1 | 2 | 3 | 4)) = None {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:15:12 @@ -41,8 +44,9 @@ LL | if let Some(Some(0) | Some(1 | 2)) = None {} | help: nest the patterns | -LL | if let Some(Some(0 | 1 | 2)) = None {} - | ~~~~~~~~~~~~~~~~~~~~~ +LL - if let Some(Some(0) | Some(1 | 2)) = None {} +LL + if let Some(Some(0 | 1 | 2)) = None {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:16:12 @@ -52,8 +56,9 @@ LL | if let ((0,),) | ((1,) | (2,),) = ((0,),) {} | help: nest the patterns | -LL | if let ((0 | 1 | 2,),) = ((0,),) {} - | ~~~~~~~~~~~~~~~ +LL - if let ((0,),) | ((1,) | (2,),) = ((0,),) {} +LL + if let ((0 | 1 | 2,),) = ((0,),) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:17:12 @@ -63,8 +68,9 @@ LL | if let 0 | (1 | 2) = 0 {} | help: nest the patterns | -LL | if let 0 | 1 | 2 = 0 {} - | ~~~~~~~~~ +LL - if let 0 | (1 | 2) = 0 {} +LL + if let 0 | 1 | 2 = 0 {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:18:12 @@ -74,8 +80,9 @@ LL | if let box (0 | 1) | (box 2 | box (3 | 4)) = Box::new(0) {} | help: nest the patterns | -LL | if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {} - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - if let box (0 | 1) | (box 2 | box (3 | 4)) = Box::new(0) {} +LL + if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {} + | error: unnested or-patterns --> tests/ui/unnested_or_patterns2.rs:19:12 @@ -85,8 +92,9 @@ LL | if let box box 0 | box (box 2 | box 4) = Box::new(Box::new(0)) {} | help: nest the patterns | -LL | if let box box (0 | 2 | 4) = Box::new(Box::new(0)) {} - | ~~~~~~~~~~~~~~~~~~~ +LL - if let box box 0 | box (box 2 | box 4) = Box::new(Box::new(0)) {} +LL + if let box box (0 | 2 | 4) = Box::new(Box::new(0)) {} + | error: aborting due to 8 previous errors diff --git a/src/tools/clippy/tests/ui/unused_enumerate_index.stderr b/src/tools/clippy/tests/ui/unused_enumerate_index.stderr index 6ec07dcbff0a3..02d65f064308b 100644 --- a/src/tools/clippy/tests/ui/unused_enumerate_index.stderr +++ b/src/tools/clippy/tests/ui/unused_enumerate_index.stderr @@ -8,8 +8,9 @@ LL | for (_, x) in v.iter().enumerate() { = help: to override `-D warnings` add `#[allow(clippy::unused_enumerate_index)]` help: remove the `.enumerate()` call | -LL | for x in v.iter() { - | ~ ~~~~~~~~ +LL - for (_, x) in v.iter().enumerate() { +LL + for x in v.iter() { + | error: you seem to use `.enumerate()` and immediately discard the index --> tests/ui/unused_enumerate_index.rs:59:19 @@ -19,8 +20,9 @@ LL | for (_, x) in dummy.enumerate() { | help: remove the `.enumerate()` call | -LL | for x in dummy { - | ~ ~~~~~ +LL - for (_, x) in dummy.enumerate() { +LL + for x in dummy { + | error: you seem to use `.enumerate()` and immediately discard the index --> tests/ui/unused_enumerate_index.rs:63:39 diff --git a/src/tools/clippy/tests/ui/unused_format_specs_unfixable.stderr b/src/tools/clippy/tests/ui/unused_format_specs_unfixable.stderr index d3b334c6092ed..07ba3a67b4beb 100644 --- a/src/tools/clippy/tests/ui/unused_format_specs_unfixable.stderr +++ b/src/tools/clippy/tests/ui/unused_format_specs_unfixable.stderr @@ -8,8 +8,9 @@ LL | println!("{:5}.", format_args!("")); = help: to override `-D warnings` add `#[allow(clippy::unused_format_specs)]` help: for the width to apply consider using `format!()` | -LL | println!("{:5}.", format!("")); - | ~~~~~~ +LL - println!("{:5}.", format_args!("")); +LL + println!("{:5}.", format!("")); + | help: if the current behavior is intentional, remove the format specifiers | LL - println!("{:5}.", format_args!("")); @@ -24,8 +25,9 @@ LL | println!("{:.3}", format_args!("abcde")); | help: for the precision to apply consider using `format!()` | -LL | println!("{:.3}", format!("abcde")); - | ~~~~~~ +LL - println!("{:.3}", format_args!("abcde")); +LL + println!("{:.3}", format!("abcde")); + | help: if the current behavior is intentional, remove the format specifiers | LL - println!("{:.3}", format_args!("abcde")); diff --git a/src/tools/clippy/tests/ui/unused_result_ok.stderr b/src/tools/clippy/tests/ui/unused_result_ok.stderr index 241e0c71261e3..024aafa6bbb89 100644 --- a/src/tools/clippy/tests/ui/unused_result_ok.stderr +++ b/src/tools/clippy/tests/ui/unused_result_ok.stderr @@ -8,8 +8,9 @@ LL | x.parse::().ok(); = help: to override `-D warnings` add `#[allow(clippy::unused_result_ok)]` help: consider using `let _ =` and removing the call to `.ok()` instead | -LL | let _ = x.parse::(); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - x.parse::().ok(); +LL + let _ = x.parse::(); + | error: ignoring a result with `.ok()` is misleading --> tests/ui/unused_result_ok.rs:18:5 @@ -19,8 +20,9 @@ LL | x . parse::() . ok (); | help: consider using `let _ =` and removing the call to `.ok()` instead | -LL | let _ = x . parse::(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - x . parse::() . ok (); +LL + let _ = x . parse::(); + | error: ignoring a result with `.ok()` is misleading --> tests/ui/unused_result_ok.rs:34:5 @@ -30,8 +32,9 @@ LL | v!().ok(); | help: consider using `let _ =` and removing the call to `.ok()` instead | -LL | let _ = v!(); - | ~~~~~~~~~~~~ +LL - v!().ok(); +LL + let _ = v!(); + | error: ignoring a result with `.ok()` is misleading --> tests/ui/unused_result_ok.rs:29:9 @@ -45,8 +48,9 @@ LL | w!(); = note: this error originates in the macro `w` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider using `let _ =` and removing the call to `.ok()` instead | -LL | let _ = Ok::<(), ()>(()); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Ok::<(), ()>(()).ok(); +LL + let _ = Ok::<(), ()>(()); + | error: aborting due to 4 previous errors diff --git a/tests/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr b/tests/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr index ee35749ce7f43..397695f393bcd 100644 --- a/tests/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr +++ b/tests/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr @@ -11,8 +11,9 @@ LL | #![deny(rustdoc::broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the enum, prefix with `enum@` | -LL | /// Link to [enum@S] - | ~~~~~ +LL - /// Link to [struct@S] +LL + /// Link to [enum@S] + | error: incompatible link kind for `S` --> $DIR/disambiguator-mismatch.rs:21:14 @@ -22,8 +23,9 @@ LL | /// Link to [mod@S] | help: to link to the enum, prefix with `enum@` | -LL | /// Link to [enum@S] - | ~~~~~ +LL - /// Link to [mod@S] +LL + /// Link to [enum@S] + | error: incompatible link kind for `S` --> $DIR/disambiguator-mismatch.rs:26:14 @@ -33,8 +35,9 @@ LL | /// Link to [union@S] | help: to link to the enum, prefix with `enum@` | -LL | /// Link to [enum@S] - | ~~~~~ +LL - /// Link to [union@S] +LL + /// Link to [enum@S] + | error: incompatible link kind for `S` --> $DIR/disambiguator-mismatch.rs:31:14 @@ -44,8 +47,9 @@ LL | /// Link to [trait@S] | help: to link to the enum, prefix with `enum@` | -LL | /// Link to [enum@S] - | ~~~~~ +LL - /// Link to [trait@S] +LL + /// Link to [enum@S] + | error: incompatible link kind for `T` --> $DIR/disambiguator-mismatch.rs:36:14 @@ -55,8 +59,9 @@ LL | /// Link to [struct@T] | help: to link to the trait, prefix with `trait@` | -LL | /// Link to [trait@T] - | ~~~~~~ +LL - /// Link to [struct@T] +LL + /// Link to [trait@T] + | error: incompatible link kind for `m` --> $DIR/disambiguator-mismatch.rs:41:14 @@ -89,8 +94,9 @@ LL | /// Link to [const@s] | help: to link to the static, prefix with `static@` | -LL | /// Link to [static@s] - | ~~~~~~~ +LL - /// Link to [const@s] +LL + /// Link to [static@s] + | error: incompatible link kind for `c` --> $DIR/disambiguator-mismatch.rs:57:14 @@ -100,8 +106,9 @@ LL | /// Link to [static@c] | help: to link to the constant, prefix with `const@` | -LL | /// Link to [const@c] - | ~~~~~~ +LL - /// Link to [static@c] +LL + /// Link to [const@c] + | error: incompatible link kind for `c` --> $DIR/disambiguator-mismatch.rs:62:14 @@ -111,8 +118,9 @@ LL | /// Link to [fn@c] | help: to link to the constant, prefix with `const@` | -LL | /// Link to [const@c] - | ~~~~~~ +LL - /// Link to [fn@c] +LL + /// Link to [const@c] + | error: incompatible link kind for `c` --> $DIR/disambiguator-mismatch.rs:67:14 @@ -146,8 +154,9 @@ LL | /// Link to [fn@std] | help: to link to the crate, prefix with `mod@` | -LL | /// Link to [mod@std] - | ~~~~ +LL - /// Link to [fn@std] +LL + /// Link to [mod@std] + | error: aborting due to 13 previous errors diff --git a/tests/rustdoc-ui/intra-doc/field-ice.stderr b/tests/rustdoc-ui/intra-doc/field-ice.stderr index cc0ada873af51..7ab72facf31cd 100644 --- a/tests/rustdoc-ui/intra-doc/field-ice.stderr +++ b/tests/rustdoc-ui/intra-doc/field-ice.stderr @@ -11,8 +11,9 @@ LL | #![deny(rustdoc::broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the field, remove the disambiguator | -LL | /// [`Foo::bar`] - | ~~~~~~~~ +LL - /// [`Foo::bar()`] +LL + /// [`Foo::bar`] + | error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/intra-doc/incompatible-primitive-disambiguator.stderr b/tests/rustdoc-ui/intra-doc/incompatible-primitive-disambiguator.stderr index b952517022b75..2818b6b4bbabd 100644 --- a/tests/rustdoc-ui/intra-doc/incompatible-primitive-disambiguator.stderr +++ b/tests/rustdoc-ui/intra-doc/incompatible-primitive-disambiguator.stderr @@ -11,8 +11,9 @@ LL | #![deny(rustdoc::broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the associated constant, prefix with `const@` | -LL | //! [const@u8::MIN] - | ~~~~~~ +LL - //! [static@u8::MIN] +LL + //! [const@u8::MIN] + | error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/intra-doc/prim-conflict.stderr b/tests/rustdoc-ui/intra-doc/prim-conflict.stderr index 03ce8f15f0a5e..c50f6bb9b8753 100644 --- a/tests/rustdoc-ui/intra-doc/prim-conflict.stderr +++ b/tests/rustdoc-ui/intra-doc/prim-conflict.stderr @@ -26,12 +26,14 @@ LL | /// [type@char] | help: to link to the module, prefix with `mod@` | -LL | /// [mod@char] - | ~~~~ +LL - /// [type@char] +LL + /// [mod@char] + | help: to link to the primitive type, prefix with `prim@` | -LL | /// [prim@char] - | ~~~~~ +LL - /// [type@char] +LL + /// [prim@char] + | error: incompatible link kind for `char` --> $DIR/prim-conflict.rs:19:6 @@ -41,8 +43,9 @@ LL | /// [struct@char] | help: to link to the module, prefix with `mod@` | -LL | /// [mod@char] - | ~~~~ +LL - /// [struct@char] +LL + /// [mod@char] + | error: incompatible link kind for `char` --> $DIR/prim-conflict.rs:26:10 @@ -52,8 +55,9 @@ LL | //! [struct@char] | help: to link to the primitive type, prefix with `prim@` | -LL | //! [prim@char] - | ~~~~~ +LL - //! [struct@char] +LL + //! [prim@char] + | error: aborting due to 4 previous errors diff --git a/tests/rustdoc-ui/intra-doc/weird-syntax.stderr b/tests/rustdoc-ui/intra-doc/weird-syntax.stderr index f50feb57fccf2..b8d50619e7e96 100644 --- a/tests/rustdoc-ui/intra-doc/weird-syntax.stderr +++ b/tests/rustdoc-ui/intra-doc/weird-syntax.stderr @@ -11,8 +11,9 @@ LL | #![deny(rustdoc::broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to link to the trait, prefix with `trait@` | -LL | /// [`trait@Clone`] - | ~~~~~~ +LL - /// [`struct@Clone`] +LL + /// [`trait@Clone`] + | error: incompatible link kind for `Clone` --> $DIR/weird-syntax.rs:21:9 @@ -22,8 +23,9 @@ LL | /// [```struct@Clone```] | help: to link to the trait, prefix with `trait@` | -LL | /// [```trait@Clone```] - | ~~~~~~ +LL - /// [```struct@Clone```] +LL + /// [```trait@Clone```] + | error: incompatible link kind for `Clone` --> $DIR/weird-syntax.rs:24:11 @@ -33,8 +35,9 @@ LL | /// [ ` struct@Clone ` ] | help: to link to the trait, prefix with `trait@` | -LL | /// [ ` trait@Clone ` ] - | ~~~~~~ +LL - /// [ ` struct@Clone ` ] +LL + /// [ ` trait@Clone ` ] + | error: unresolved link to `Clone` --> $DIR/weird-syntax.rs:27:9 @@ -104,8 +107,9 @@ LL | /// [x][ struct@Clone] | help: to link to the trait, prefix with `trait@` | -LL | /// [x][ trait@Clone] - | ~~~~~~ +LL - /// [x][ struct@Clone] +LL + /// [x][ trait@Clone] + | error: incompatible link kind for `Clone` --> $DIR/weird-syntax.rs:65:9 @@ -115,8 +119,9 @@ LL | /// [x][struct@Clone ] | help: to link to the trait, prefix with `trait@` | -LL | /// [x][trait@Clone ] - | ~~~~~~ +LL - /// [x][struct@Clone ] +LL + /// [x][trait@Clone ] + | error: unresolved link to `Clone` --> $DIR/weird-syntax.rs:74:9 @@ -158,8 +163,9 @@ LL | /// [w]( struct@Clone) | help: to link to the trait, prefix with `trait@` | -LL | /// [w]( trait@Clone) - | ~~~~~~ +LL - /// [w]( struct@Clone) +LL + /// [w]( trait@Clone) + | error: incompatible link kind for `Clone` --> $DIR/weird-syntax.rs:94:9 @@ -169,8 +175,9 @@ LL | /// [w](struct@Clone ) | help: to link to the trait, prefix with `trait@` | -LL | /// [w](trait@Clone ) - | ~~~~~~ +LL - /// [w](struct@Clone ) +LL + /// [w](trait@Clone ) + | error: unresolved link to `Clone` --> $DIR/weird-syntax.rs:97:9 diff --git a/tests/rustdoc-ui/issues/issue-102986.stderr b/tests/rustdoc-ui/issues/issue-102986.stderr index d91f93f394a5b..a0f255a226562 100644 --- a/tests/rustdoc-ui/issues/issue-102986.stderr +++ b/tests/rustdoc-ui/issues/issue-102986.stderr @@ -6,8 +6,9 @@ LL | y: (typeof("hey"),), | help: consider replacing `typeof(...)` with an actual type | -LL | y: (&str,), - | ~~~~ +LL - y: (typeof("hey"),), +LL + y: (&str,), + | error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/issues/issue-105742.stderr b/tests/rustdoc-ui/issues/issue-105742.stderr index 0f01bc59759d1..4453bad7e8226 100644 --- a/tests/rustdoc-ui/issues/issue-105742.stderr +++ b/tests/rustdoc-ui/issues/issue-105742.stderr @@ -325,8 +325,9 @@ LL | | > { | |__^ ...because it uses `Self` as a type parameter help: consider using an opaque type instead | -LL | pub fn next<'a, T>(s: &'a mut impl SVec) { - | ~~~~ +LL - pub fn next<'a, T>(s: &'a mut dyn SVec) { +LL + pub fn next<'a, T>(s: &'a mut impl SVec) { + | error[E0107]: missing generics for associated type `SVec::Item` --> $DIR/issue-105742.rs:15:21 diff --git a/tests/rustdoc-ui/issues/issue-120444-1.stderr b/tests/rustdoc-ui/issues/issue-120444-1.stderr index 7bc56b4263f26..aabdc91df2bdc 100644 --- a/tests/rustdoc-ui/issues/issue-120444-1.stderr +++ b/tests/rustdoc-ui/issues/issue-120444-1.stderr @@ -15,8 +15,9 @@ LL | #![deny(rustdoc::redundant_explicit_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove explicit link target | -LL | /// [`Vfs`] - | ~~~~~~~ +LL - /// [`Vfs`][crate::Vfs] +LL + /// [`Vfs`] + | error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/issues/issue-120444-2.stderr b/tests/rustdoc-ui/issues/issue-120444-2.stderr index 310bf08e2b525..ee160736b4d26 100644 --- a/tests/rustdoc-ui/issues/issue-120444-2.stderr +++ b/tests/rustdoc-ui/issues/issue-120444-2.stderr @@ -15,8 +15,9 @@ LL | #![deny(rustdoc::redundant_explicit_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove explicit link target | -LL | /// [`Vfs`] - | ~~~~~~~ +LL - /// [`Vfs`][crate::Vfs] +LL + /// [`Vfs`] + | error: aborting due to 1 previous error diff --git a/tests/rustdoc-ui/lints/redundant_explicit_links.stderr b/tests/rustdoc-ui/lints/redundant_explicit_links.stderr index 34ec9be6646c8..f90c41af9f1ac 100644 --- a/tests/rustdoc-ui/lints/redundant_explicit_links.stderr +++ b/tests/rustdoc-ui/lints/redundant_explicit_links.stderr @@ -15,8 +15,9 @@ LL | #![deny(rustdoc::redundant_explicit_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove explicit link target | -LL | /// [dummy_target] - | ~~~~~~~~~~~~~~ +LL - /// [dummy_target](dummy_target) +LL + /// [dummy_target] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:9:22 @@ -30,8 +31,9 @@ LL | /// [`dummy_target`](dummy_target) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`dummy_target`] - | ~~~~~~~~~~~~~~~~ +LL - /// [`dummy_target`](dummy_target) +LL + /// [`dummy_target`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:12:11 @@ -45,8 +47,9 @@ LL | /// [Vec](Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [Vec] - | ~~~~~ +LL - /// [Vec](Vec) +LL + /// [Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:14:13 @@ -60,8 +63,9 @@ LL | /// [`Vec`](Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`Vec`] - | ~~~~~~~ +LL - /// [`Vec`](Vec) +LL + /// [`Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:16:11 @@ -75,8 +79,9 @@ LL | /// [Vec](std::vec::Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [Vec] - | ~~~~~ +LL - /// [Vec](std::vec::Vec) +LL + /// [Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:18:13 @@ -90,8 +95,9 @@ LL | /// [`Vec`](std::vec::Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`Vec`] - | ~~~~~~~ +LL - /// [`Vec`](std::vec::Vec) +LL + /// [`Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:20:21 @@ -105,8 +111,9 @@ LL | /// [std::vec::Vec](Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::vec::Vec] - | ~~~~~~~~~~~~~~~ +LL - /// [std::vec::Vec](Vec) +LL + /// [std::vec::Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:22:23 @@ -120,8 +127,9 @@ LL | /// [`std::vec::Vec`](Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::vec::Vec`] - | ~~~~~~~~~~~~~~~~~ +LL - /// [`std::vec::Vec`](Vec) +LL + /// [`std::vec::Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:24:21 @@ -135,8 +143,9 @@ LL | /// [std::vec::Vec](std::vec::Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::vec::Vec] - | ~~~~~~~~~~~~~~~ +LL - /// [std::vec::Vec](std::vec::Vec) +LL + /// [std::vec::Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:26:23 @@ -150,8 +159,9 @@ LL | /// [`std::vec::Vec`](std::vec::Vec) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::vec::Vec`] - | ~~~~~~~~~~~~~~~~~ +LL - /// [`std::vec::Vec`](std::vec::Vec) +LL + /// [`std::vec::Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:29:13 @@ -165,8 +175,9 @@ LL | /// [usize](usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [usize] - | ~~~~~~~ +LL - /// [usize](usize) +LL + /// [usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:31:15 @@ -180,8 +191,9 @@ LL | /// [`usize`](usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`usize`] - | ~~~~~~~~~ +LL - /// [`usize`](usize) +LL + /// [`usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:33:13 @@ -195,8 +207,9 @@ LL | /// [usize](std::primitive::usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [usize] - | ~~~~~~~ +LL - /// [usize](std::primitive::usize) +LL + /// [usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:35:15 @@ -210,8 +223,9 @@ LL | /// [`usize`](std::primitive::usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`usize`] - | ~~~~~~~~~ +LL - /// [`usize`](std::primitive::usize) +LL + /// [`usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:37:29 @@ -225,8 +239,9 @@ LL | /// [std::primitive::usize](usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::primitive::usize] - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [std::primitive::usize](usize) +LL + /// [std::primitive::usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:39:31 @@ -240,8 +255,9 @@ LL | /// [`std::primitive::usize`](usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::primitive::usize`] - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [`std::primitive::usize`](usize) +LL + /// [`std::primitive::usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:41:29 @@ -255,8 +271,9 @@ LL | /// [std::primitive::usize](std::primitive::usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::primitive::usize] - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [std::primitive::usize](std::primitive::usize) +LL + /// [std::primitive::usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:43:31 @@ -270,8 +287,9 @@ LL | /// [`std::primitive::usize`](std::primitive::usize) the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::primitive::usize`] - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [`std::primitive::usize`](std::primitive::usize) +LL + /// [`std::primitive::usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:46:20 @@ -285,8 +303,9 @@ LL | /// [dummy_target](dummy_target) TEXT the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [dummy_target] TEXT - | ~~~~~~~~~~~~~~ +LL - /// [dummy_target](dummy_target) TEXT +LL + /// [dummy_target] TEXT + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:48:22 @@ -300,8 +319,9 @@ LL | /// [`dummy_target`](dummy_target) TEXT the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`dummy_target`] TEXT - | ~~~~~~~~~~~~~~~~ +LL - /// [`dummy_target`](dummy_target) TEXT +LL + /// [`dummy_target`] TEXT + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:56:20 @@ -315,8 +335,9 @@ LL | /// [dummy_target][dummy_target] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [dummy_target] - | ~~~~~~~~~~~~~~ +LL - /// [dummy_target][dummy_target] +LL + /// [dummy_target] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:58:22 @@ -330,8 +351,9 @@ LL | /// [`dummy_target`][dummy_target] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`dummy_target`] - | ~~~~~~~~~~~~~~~~ +LL - /// [`dummy_target`][dummy_target] +LL + /// [`dummy_target`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:61:11 @@ -345,8 +367,9 @@ LL | /// [Vec][Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [Vec] - | ~~~~~ +LL - /// [Vec][Vec] +LL + /// [Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:63:13 @@ -360,8 +383,9 @@ LL | /// [`Vec`][Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`Vec`] - | ~~~~~~~ +LL - /// [`Vec`][Vec] +LL + /// [`Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:65:11 @@ -375,8 +399,9 @@ LL | /// [Vec][std::vec::Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [Vec] - | ~~~~~ +LL - /// [Vec][std::vec::Vec] +LL + /// [Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:67:13 @@ -390,8 +415,9 @@ LL | /// [`Vec`][std::vec::Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`Vec`] - | ~~~~~~~ +LL - /// [`Vec`][std::vec::Vec] +LL + /// [`Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:69:21 @@ -405,8 +431,9 @@ LL | /// [std::vec::Vec][Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::vec::Vec] - | ~~~~~~~~~~~~~~~ +LL - /// [std::vec::Vec][Vec] +LL + /// [std::vec::Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:71:23 @@ -420,8 +447,9 @@ LL | /// [`std::vec::Vec`][Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::vec::Vec`] - | ~~~~~~~~~~~~~~~~~ +LL - /// [`std::vec::Vec`][Vec] +LL + /// [`std::vec::Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:73:21 @@ -435,8 +463,9 @@ LL | /// [std::vec::Vec][std::vec::Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::vec::Vec] - | ~~~~~~~~~~~~~~~ +LL - /// [std::vec::Vec][std::vec::Vec] +LL + /// [std::vec::Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:75:23 @@ -450,8 +479,9 @@ LL | /// [`std::vec::Vec`][std::vec::Vec] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::vec::Vec`] - | ~~~~~~~~~~~~~~~~~ +LL - /// [`std::vec::Vec`][std::vec::Vec] +LL + /// [`std::vec::Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:78:13 @@ -465,8 +495,9 @@ LL | /// [usize][usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [usize] - | ~~~~~~~ +LL - /// [usize][usize] +LL + /// [usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:80:15 @@ -480,8 +511,9 @@ LL | /// [`usize`][usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`usize`] - | ~~~~~~~~~ +LL - /// [`usize`][usize] +LL + /// [`usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:82:13 @@ -495,8 +527,9 @@ LL | /// [usize][std::primitive::usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [usize] - | ~~~~~~~ +LL - /// [usize][std::primitive::usize] +LL + /// [usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:84:15 @@ -510,8 +543,9 @@ LL | /// [`usize`][std::primitive::usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`usize`] - | ~~~~~~~~~ +LL - /// [`usize`][std::primitive::usize] +LL + /// [`usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:86:29 @@ -525,8 +559,9 @@ LL | /// [std::primitive::usize][usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::primitive::usize] - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [std::primitive::usize][usize] +LL + /// [std::primitive::usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:88:31 @@ -540,8 +575,9 @@ LL | /// [`std::primitive::usize`][usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::primitive::usize`] - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [`std::primitive::usize`][usize] +LL + /// [`std::primitive::usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:90:29 @@ -555,8 +591,9 @@ LL | /// [std::primitive::usize][std::primitive::usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::primitive::usize] - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [std::primitive::usize][std::primitive::usize] +LL + /// [std::primitive::usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:92:31 @@ -570,8 +607,9 @@ LL | /// [`std::primitive::usize`][std::primitive::usize] the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::primitive::usize`] - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [`std::primitive::usize`][std::primitive::usize] +LL + /// [`std::primitive::usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:95:20 @@ -585,8 +623,9 @@ LL | /// [dummy_target][dummy_target] TEXT the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [dummy_target] TEXT - | ~~~~~~~~~~~~~~ +LL - /// [dummy_target][dummy_target] TEXT +LL + /// [dummy_target] TEXT + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:97:22 @@ -600,8 +639,9 @@ LL | /// [`dummy_target`][dummy_target] TEXT the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`dummy_target`] TEXT - | ~~~~~~~~~~~~~~~~ +LL - /// [`dummy_target`][dummy_target] TEXT +LL + /// [`dummy_target`] TEXT + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:105:20 @@ -620,8 +660,9 @@ LL | /// [dummy_target]: dummy_target the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [dummy_target] - | ~~~~~~~~~~~~~~ +LL - /// [dummy_target][dummy_target] +LL + /// [dummy_target] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:107:22 @@ -640,8 +681,9 @@ LL | /// [dummy_target]: dummy_target the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`dummy_target`] - | ~~~~~~~~~~~~~~~~ +LL - /// [`dummy_target`][dummy_target] +LL + /// [`dummy_target`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:110:11 @@ -660,8 +702,9 @@ LL | /// [Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [Vec] - | ~~~~~ +LL - /// [Vec][Vec] +LL + /// [Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:112:13 @@ -680,8 +723,9 @@ LL | /// [Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`Vec`] - | ~~~~~~~ +LL - /// [`Vec`][Vec] +LL + /// [`Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:114:11 @@ -700,8 +744,9 @@ LL | /// [std::vec::Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [Vec] - | ~~~~~ +LL - /// [Vec][std::vec::Vec] +LL + /// [Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:116:13 @@ -720,8 +765,9 @@ LL | /// [std::vec::Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`Vec`] - | ~~~~~~~ +LL - /// [`Vec`][std::vec::Vec] +LL + /// [`Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:118:21 @@ -740,8 +786,9 @@ LL | /// [Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::vec::Vec] - | ~~~~~~~~~~~~~~~ +LL - /// [std::vec::Vec][Vec] +LL + /// [std::vec::Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:120:23 @@ -760,8 +807,9 @@ LL | /// [Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::vec::Vec`] - | ~~~~~~~~~~~~~~~~~ +LL - /// [`std::vec::Vec`][Vec] +LL + /// [`std::vec::Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:122:21 @@ -780,8 +828,9 @@ LL | /// [std::vec::Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::vec::Vec] - | ~~~~~~~~~~~~~~~ +LL - /// [std::vec::Vec][std::vec::Vec] +LL + /// [std::vec::Vec] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:124:23 @@ -800,8 +849,9 @@ LL | /// [std::vec::Vec]: Vec the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::vec::Vec`] - | ~~~~~~~~~~~~~~~~~ +LL - /// [`std::vec::Vec`][std::vec::Vec] +LL + /// [`std::vec::Vec`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:127:13 @@ -820,8 +870,9 @@ LL | /// [usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [usize] - | ~~~~~~~ +LL - /// [usize][usize] +LL + /// [usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:129:15 @@ -840,8 +891,9 @@ LL | /// [usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`usize`] - | ~~~~~~~~~ +LL - /// [`usize`][usize] +LL + /// [`usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:131:13 @@ -860,8 +912,9 @@ LL | /// [std::primitive::usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [usize] - | ~~~~~~~ +LL - /// [usize][std::primitive::usize] +LL + /// [usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:133:15 @@ -880,8 +933,9 @@ LL | /// [std::primitive::usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`usize`] - | ~~~~~~~~~ +LL - /// [`usize`][std::primitive::usize] +LL + /// [`usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:135:29 @@ -900,8 +954,9 @@ LL | /// [usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::primitive::usize] - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [std::primitive::usize][usize] +LL + /// [std::primitive::usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:137:31 @@ -920,8 +975,9 @@ LL | /// [usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::primitive::usize`] - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [`std::primitive::usize`][usize] +LL + /// [`std::primitive::usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:139:29 @@ -940,8 +996,9 @@ LL | /// [std::primitive::usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [std::primitive::usize] - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [std::primitive::usize][std::primitive::usize] +LL + /// [std::primitive::usize] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:141:31 @@ -960,8 +1017,9 @@ LL | /// [std::primitive::usize]: usize the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`std::primitive::usize`] - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - /// [`std::primitive::usize`][std::primitive::usize] +LL + /// [`std::primitive::usize`] + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:144:20 @@ -980,8 +1038,9 @@ LL | /// [dummy_target]: dummy_target the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [dummy_target] TEXT - | ~~~~~~~~~~~~~~ +LL - /// [dummy_target][dummy_target] TEXT +LL + /// [dummy_target] TEXT + | error: redundant explicit link target --> $DIR/redundant_explicit_links.rs:146:22 @@ -1000,8 +1059,9 @@ LL | /// [dummy_target]: dummy_target the label is used to resolve intra-doc links help: remove explicit link target | -LL | /// [`dummy_target`] TEXT - | ~~~~~~~~~~~~~~~~ +LL - /// [`dummy_target`][dummy_target] TEXT +LL + /// [`dummy_target`] TEXT + | error: aborting due to 60 previous errors diff --git a/tests/ui/abi/statics/static-mut-foreign.stderr b/tests/ui/abi/statics/static-mut-foreign.stderr index 0c4bd5382a1f0..2260940c7f2f4 100644 --- a/tests/ui/abi/statics/static-mut-foreign.stderr +++ b/tests/ui/abi/statics/static-mut-foreign.stderr @@ -10,8 +10,9 @@ LL | static_bound(&rust_dbg_static_mut); = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | static_bound(addr_of!(rust_dbg_static_mut)); - | ~~~~~~~~~ + +LL - static_bound(&rust_dbg_static_mut); +LL + static_bound(addr_of!(rust_dbg_static_mut)); + | warning: creating a mutable reference to mutable static is discouraged --> $DIR/static-mut-foreign.rs:33:22 @@ -24,8 +25,9 @@ LL | static_bound_set(&mut rust_dbg_static_mut); = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | static_bound_set(addr_of_mut!(rust_dbg_static_mut)); - | ~~~~~~~~~~~~~ + +LL - static_bound_set(&mut rust_dbg_static_mut); +LL + static_bound_set(addr_of_mut!(rust_dbg_static_mut)); + | warning: 2 warnings emitted diff --git a/tests/ui/anon-params/anon-params-denied-2018.stderr b/tests/ui/anon-params/anon-params-denied-2018.stderr index 2d6356ffcb1c0..0c38987ca6f1a 100644 --- a/tests/ui/anon-params/anon-params-denied-2018.stderr +++ b/tests/ui/anon-params/anon-params-denied-2018.stderr @@ -31,8 +31,9 @@ LL | fn foo_with_ref(self: &mut i32); | +++++ help: if this is a parameter name, give it a type | -LL | fn foo_with_ref(i32: &mut TypeName); - | ~~~~~~~~~~~~~~~~~~ +LL - fn foo_with_ref(&mut i32); +LL + fn foo_with_ref(i32: &mut TypeName); + | help: if this is a type, explicitly ignore the parameter name | LL | fn foo_with_ref(_: &mut i32); diff --git a/tests/ui/argument-suggestions/basic.stderr b/tests/ui/argument-suggestions/basic.stderr index 2d52df2123369..422ac01737094 100644 --- a/tests/ui/argument-suggestions/basic.stderr +++ b/tests/ui/argument-suggestions/basic.stderr @@ -42,8 +42,9 @@ LL | fn missing(_i: u32) {} | ^^^^^^^ ------- help: provide the argument | -LL | missing(/* u32 */); - | ~~~~~~~~~~~ +LL - missing(); +LL + missing(/* u32 */); + | error[E0308]: arguments to this function are incorrect --> $DIR/basic.rs:23:5 @@ -60,8 +61,9 @@ LL | fn swapped(_i: u32, _s: &str) {} | ^^^^^^^ ------- -------- help: swap these arguments | -LL | swapped(1, ""); - | ~~~~~~~ +LL - swapped("", 1); +LL + swapped(1, ""); + | error[E0308]: arguments to this function are incorrect --> $DIR/basic.rs:24:5 @@ -79,8 +81,9 @@ LL | fn permuted(_x: X, _y: Y, _z: Z) {} | ^^^^^^^^ ----- ----- ----- help: reorder these arguments | -LL | permuted(X {}, Y {}, Z {}); - | ~~~~~~~~~~~~~~~~~~ +LL - permuted(Y {}, Z {}, X {}); +LL + permuted(X {}, Y {}, Z {}); + | error[E0057]: this function takes 1 argument but 0 arguments were supplied --> $DIR/basic.rs:27:5 @@ -95,8 +98,9 @@ LL | let closure = |x| x; | ^^^ help: provide the argument | -LL | closure(/* x */); - | ~~~~~~~~~ +LL - closure(); +LL + closure(/* x */); + | error: aborting due to 6 previous errors diff --git a/tests/ui/argument-suggestions/complex.stderr b/tests/ui/argument-suggestions/complex.stderr index bb3817421df19..fd04c2f208777 100644 --- a/tests/ui/argument-suggestions/complex.stderr +++ b/tests/ui/argument-suggestions/complex.stderr @@ -11,8 +11,9 @@ LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {} | ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- ----- help: did you mean | -LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {}); +LL + complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {}); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/display-is-suggestable.stderr b/tests/ui/argument-suggestions/display-is-suggestable.stderr index eea88c3e78d70..bb5df1ec234cd 100644 --- a/tests/ui/argument-suggestions/display-is-suggestable.stderr +++ b/tests/ui/argument-suggestions/display-is-suggestable.stderr @@ -11,8 +11,9 @@ LL | fn foo(x: &(dyn Display + Send)) {} | ^^^ ------------------------ help: provide the argument | -LL | foo(/* &dyn std::fmt::Display + Send */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - foo(); +LL + foo(/* &dyn std::fmt::Display + Send */); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/extern-fn-arg-names.stderr b/tests/ui/argument-suggestions/extern-fn-arg-names.stderr index 47fbfc98c676a..5d2d9c3bf39e2 100644 --- a/tests/ui/argument-suggestions/extern-fn-arg-names.stderr +++ b/tests/ui/argument-suggestions/extern-fn-arg-names.stderr @@ -17,8 +17,9 @@ LL | fn dstfn(src: i32, dst: err); | ^^^^^ help: provide the argument | -LL | dstfn(1, /* dst */); - | ~~~~~~~~~~~~~~ +LL - dstfn(1); +LL + dstfn(1, /* dst */); + | error: aborting due to 2 previous errors diff --git a/tests/ui/argument-suggestions/issue-100478.stderr b/tests/ui/argument-suggestions/issue-100478.stderr index 94709f0ebc6a4..ac171250bfd28 100644 --- a/tests/ui/argument-suggestions/issue-100478.stderr +++ b/tests/ui/argument-suggestions/issue-100478.stderr @@ -14,8 +14,9 @@ LL | fn three_diff(_a: T1, _b: T2, _c: T3) {} | ^^^^^^^^^^ ------ ------ ------ help: provide the arguments | -LL | three_diff(/* T1 */, T2::new(0), /* T3 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_diff(T2::new(0)); +LL + three_diff(/* T1 */, T2::new(0), /* T3 */); + | error[E0308]: arguments to this function are incorrect --> $DIR/issue-100478.rs:35:5 @@ -34,8 +35,9 @@ LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {} | ^^^^^^^^^^^^ ------ ------ ------ ------ help: did you mean | -LL | four_shuffle(T1::default(), T2::default(), T3::default(), T4::default()); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - four_shuffle(T3::default(), T4::default(), T1::default(), T2::default()); +LL + four_shuffle(T1::default(), T2::default(), T3::default(), T4::default()); + | error[E0308]: arguments to this function are incorrect --> $DIR/issue-100478.rs:36:5 @@ -53,8 +55,9 @@ LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {} | ^^^^^^^^^^^^ ------ ------ ------ ------ help: swap these arguments | -LL | four_shuffle(T1::default(), T2::default(), T3::default(), /* T4 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - four_shuffle(T3::default(), T2::default(), T1::default(), T3::default()); +LL + four_shuffle(T1::default(), T2::default(), T3::default(), /* T4 */); + | error[E0061]: this function takes 8 arguments but 7 arguments were supplied --> $DIR/issue-100478.rs:47:5 @@ -72,8 +75,13 @@ LL | fn foo(p1: T1, p2: Arc, p3: T3, p4: Arc, p5: T5, p6: T6, p7: T7, p8 | ^^^ ------ ----------- ------ ----------- ------ ------ ------ ----------- help: provide the argument | -LL | foo(p1, /* Arc */, p3, p4, p5, p6, p7, p8); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - foo( +LL - +LL - p1, //p2, +LL - p3, p4, p5, p6, p7, p8, +LL - ); +LL + foo(p1, /* Arc */, p3, p4, p5, p6, p7, p8); + | error: aborting due to 4 previous errors diff --git a/tests/ui/argument-suggestions/issue-101097.stderr b/tests/ui/argument-suggestions/issue-101097.stderr index 6e21f19ab4fb4..59101cf91b60b 100644 --- a/tests/ui/argument-suggestions/issue-101097.stderr +++ b/tests/ui/argument-suggestions/issue-101097.stderr @@ -27,8 +27,9 @@ LL | c2: C, | ----- help: did you mean | -LL | f(A, A, B, B, C, C); - | ~~~~~~~~~~~~~~~~~~ +LL - f(C, A, A, A, B, B, C); +LL + f(A, A, B, B, C, C); + | error[E0308]: arguments to this function are incorrect --> $DIR/issue-101097.rs:17:5 @@ -55,8 +56,9 @@ LL | c2: C, | ----- help: did you mean | -LL | f(A, A, B, B, C, C); - | ~~~~~~~~~~~~~~~~~~ +LL - f(C, C, A, A, B, B); +LL + f(A, A, B, B, C, C); + | error[E0308]: arguments to this function are incorrect --> $DIR/issue-101097.rs:18:5 @@ -86,8 +88,9 @@ LL | c2: C, | ----- help: did you mean | -LL | f(A, A, B, B, /* C */, /* C */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - f(A, A, D, D, B, B); +LL + f(A, A, B, B, /* C */, /* C */); + | error[E0308]: arguments to this function are incorrect --> $DIR/issue-101097.rs:19:5 @@ -118,8 +121,9 @@ LL | c2: C, | ----- help: did you mean | -LL | f(A, A, B, B, C, C); - | ~~~~~~~~~~~~~~~~~~ +LL - f(C, C, B, B, A, A); +LL + f(A, A, B, B, C, C); + | error[E0308]: arguments to this function are incorrect --> $DIR/issue-101097.rs:20:5 @@ -151,8 +155,9 @@ LL | c2: C, | ----- help: did you mean | -LL | f(A, A, /* B */, B, C, C); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - f(C, C, A, B, A, A); +LL + f(A, A, /* B */, B, C, C); + | error: aborting due to 5 previous errors diff --git a/tests/ui/argument-suggestions/issue-109831.stderr b/tests/ui/argument-suggestions/issue-109831.stderr index 12be0887121a2..71540e8f0fa23 100644 --- a/tests/ui/argument-suggestions/issue-109831.stderr +++ b/tests/ui/argument-suggestions/issue-109831.stderr @@ -9,8 +9,9 @@ LL | fn f(b1: B, b2: B, a2: C) {} | help: a struct with a similar name exists | -LL | fn f(b1: B, b2: B, a2: A) {} - | ~ +LL - fn f(b1: B, b2: B, a2: C) {} +LL + fn f(b1: B, b2: B, a2: A) {} + | help: you might be missing a type parameter | LL | fn f(b1: B, b2: B, a2: C) {} diff --git a/tests/ui/argument-suggestions/issue-96638.stderr b/tests/ui/argument-suggestions/issue-96638.stderr index 6492acbad9403..33dbd8c27a904 100644 --- a/tests/ui/argument-suggestions/issue-96638.stderr +++ b/tests/ui/argument-suggestions/issue-96638.stderr @@ -13,8 +13,9 @@ LL | fn f(_: usize, _: &usize, _: usize) {} | ^ -------- --------- -------- help: provide the argument | -LL | f(/* usize */, &x, /* usize */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - f(&x, ""); +LL + f(/* usize */, &x, /* usize */); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-97197.stderr b/tests/ui/argument-suggestions/issue-97197.stderr index 3768367a5e61a..f58713830bfbe 100644 --- a/tests/ui/argument-suggestions/issue-97197.stderr +++ b/tests/ui/argument-suggestions/issue-97197.stderr @@ -11,8 +11,9 @@ LL | pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {} | ^ ------ -------- -------- -------- -------- ------ help: provide the arguments | -LL | g((), /* bool */, /* bool */, /* bool */, /* bool */, ()); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - g((), ()); +LL + g((), /* bool */, /* bool */, /* bool */, /* bool */, ()); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-98894.stderr b/tests/ui/argument-suggestions/issue-98894.stderr index 93e604c3101fb..44353cb33388a 100644 --- a/tests/ui/argument-suggestions/issue-98894.stderr +++ b/tests/ui/argument-suggestions/issue-98894.stderr @@ -11,8 +11,9 @@ LL | (|_, ()| ())(if true {} else {return;}); | ^^^^^^^ help: provide the argument | -LL | (|_, ()| ())(if true {} else {return;}, ()); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - (|_, ()| ())(if true {} else {return;}); +LL + (|_, ()| ())(if true {} else {return;}, ()); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-98897.stderr b/tests/ui/argument-suggestions/issue-98897.stderr index 671e3d99d8552..fd3ef467b1c39 100644 --- a/tests/ui/argument-suggestions/issue-98897.stderr +++ b/tests/ui/argument-suggestions/issue-98897.stderr @@ -11,8 +11,9 @@ LL | (|_, ()| ())([return, ()]); | ^^^^^^^ help: provide the argument | -LL | (|_, ()| ())([return, ()], ()); - | ~~~~~~~~~~~~~~~~~~ +LL - (|_, ()| ())([return, ()]); +LL + (|_, ()| ())([return, ()], ()); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-99482.stderr b/tests/ui/argument-suggestions/issue-99482.stderr index be40787461523..b3c39604a99b0 100644 --- a/tests/ui/argument-suggestions/issue-99482.stderr +++ b/tests/ui/argument-suggestions/issue-99482.stderr @@ -11,8 +11,9 @@ LL | let f = |_: (), f: fn()| f; | ^^^^^^^^^^^^^^^^ help: provide the argument | -LL | let _f = f((), main); - | ~~~~~~~~~~ +LL - let _f = f(main); +LL + let _f = f((), main); + | error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/missing_arguments.stderr b/tests/ui/argument-suggestions/missing_arguments.stderr index 3a27a51d0320f..a88934e3ba406 100644 --- a/tests/ui/argument-suggestions/missing_arguments.stderr +++ b/tests/ui/argument-suggestions/missing_arguments.stderr @@ -11,8 +11,9 @@ LL | fn one_arg(_a: i32) {} | ^^^^^^^ ------- help: provide the argument | -LL | one_arg(/* i32 */); - | ~~~~~~~~~~~ +LL - one_arg(); +LL + one_arg(/* i32 */); + | error[E0061]: this function takes 2 arguments but 0 arguments were supplied --> $DIR/missing_arguments.rs:14:3 @@ -27,8 +28,9 @@ LL | fn two_same(_a: i32, _b: i32) {} | ^^^^^^^^ ------- ------- help: provide the arguments | -LL | two_same(/* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - two_same( ); +LL + two_same(/* i32 */, /* i32 */); + | error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:15:3 @@ -43,8 +45,9 @@ LL | fn two_same(_a: i32, _b: i32) {} | ^^^^^^^^ ------- ------- help: provide the argument | -LL | two_same(1, /* i32 */); - | ~~~~~~~~~~~~~~ +LL - two_same( 1 ); +LL + two_same(1, /* i32 */); + | error[E0061]: this function takes 2 arguments but 0 arguments were supplied --> $DIR/missing_arguments.rs:16:3 @@ -59,8 +62,9 @@ LL | fn two_diff(_a: i32, _b: f32) {} | ^^^^^^^^ ------- ------- help: provide the arguments | -LL | two_diff(/* i32 */, /* f32 */); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - two_diff( ); +LL + two_diff(/* i32 */, /* f32 */); + | error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:17:3 @@ -75,8 +79,9 @@ LL | fn two_diff(_a: i32, _b: f32) {} | ^^^^^^^^ ------- ------- help: provide the argument | -LL | two_diff(1, /* f32 */); - | ~~~~~~~~~~~~~~ +LL - two_diff( 1 ); +LL + two_diff(1, /* f32 */); + | error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:18:3 @@ -91,8 +96,9 @@ LL | fn two_diff(_a: i32, _b: f32) {} | ^^^^^^^^ ------- ------- help: provide the argument | -LL | two_diff(/* i32 */, 1.0); - | ~~~~~~~~~~~~~~~~ +LL - two_diff( 1.0 ); +LL + two_diff(/* i32 */, 1.0); + | error[E0061]: this function takes 3 arguments but 0 arguments were supplied --> $DIR/missing_arguments.rs:21:3 @@ -107,8 +113,9 @@ LL | fn three_same(_a: i32, _b: i32, _c: i32) {} | ^^^^^^^^^^ ------- ------- ------- help: provide the arguments | -LL | three_same(/* i32 */, /* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_same( ); +LL + three_same(/* i32 */, /* i32 */, /* i32 */); + | error[E0061]: this function takes 3 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:22:3 @@ -123,8 +130,9 @@ LL | fn three_same(_a: i32, _b: i32, _c: i32) {} | ^^^^^^^^^^ ------- ------- ------- help: provide the arguments | -LL | three_same(1, /* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_same( 1 ); +LL + three_same(1, /* i32 */, /* i32 */); + | error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/missing_arguments.rs:23:3 @@ -139,8 +147,9 @@ LL | fn three_same(_a: i32, _b: i32, _c: i32) {} | ^^^^^^^^^^ ------- ------- ------- help: provide the argument | -LL | three_same(1, 1, /* i32 */); - | ~~~~~~~~~~~~~~~~~ +LL - three_same( 1, 1 ); +LL + three_same(1, 1, /* i32 */); + | error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/missing_arguments.rs:26:3 @@ -155,8 +164,9 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the argument | -LL | three_diff(/* i32 */, 1.0, ""); - | ~~~~~~~~~~~~~~~~~~~~ +LL - three_diff( 1.0, "" ); +LL + three_diff(/* i32 */, 1.0, ""); + | error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/missing_arguments.rs:27:3 @@ -171,8 +181,9 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the argument | -LL | three_diff(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ +LL - three_diff( 1, "" ); +LL + three_diff(1, /* f32 */, ""); + | error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/missing_arguments.rs:28:3 @@ -187,8 +198,9 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the argument | -LL | three_diff(1, 1.0, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~ +LL - three_diff( 1, 1.0 ); +LL + three_diff(1, 1.0, /* &str */); + | error[E0061]: this function takes 3 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:29:3 @@ -203,8 +215,9 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the arguments | -LL | three_diff(/* i32 */, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_diff( "" ); +LL + three_diff(/* i32 */, /* f32 */, ""); + | error[E0061]: this function takes 3 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:30:3 @@ -222,8 +235,9 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the arguments | -LL | three_diff(/* i32 */, 1.0, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_diff( 1.0 ); +LL + three_diff(/* i32 */, 1.0, /* &str */); + | error[E0061]: this function takes 3 arguments but 1 argument was supplied --> $DIR/missing_arguments.rs:31:3 @@ -238,8 +252,9 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the arguments | -LL | three_diff(1, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_diff( 1 ); +LL + three_diff(1, /* f32 */, /* &str */); + | error[E0061]: this function takes 4 arguments but 0 arguments were supplied --> $DIR/missing_arguments.rs:34:3 @@ -254,8 +269,9 @@ LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {} | ^^^^^^^^^^^^^ ------- ------- ------- -------- help: provide the arguments | -LL | four_repeated(/* i32 */, /* f32 */, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - four_repeated( ); +LL + four_repeated(/* i32 */, /* f32 */, /* f32 */, /* &str */); + | error[E0061]: this function takes 4 arguments but 2 arguments were supplied --> $DIR/missing_arguments.rs:35:3 @@ -270,8 +286,9 @@ LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {} | ^^^^^^^^^^^^^ ------- ------- ------- -------- help: provide the arguments | -LL | four_repeated(1, /* f32 */, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - four_repeated( 1, "" ); +LL + four_repeated(1, /* f32 */, /* f32 */, ""); + | error[E0061]: this function takes 5 arguments but 0 arguments were supplied --> $DIR/missing_arguments.rs:38:3 @@ -286,8 +303,9 @@ LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {} | ^^^^^^^ ------- ------- ------- ------- -------- help: provide the arguments | -LL | complex(/* i32 */, /* f32 */, /* i32 */, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - complex( ); +LL + complex(/* i32 */, /* f32 */, /* i32 */, /* f32 */, /* &str */); + | error[E0061]: this function takes 5 arguments but 2 arguments were supplied --> $DIR/missing_arguments.rs:39:3 @@ -302,8 +320,9 @@ LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {} | ^^^^^^^ ------- ------- ------- ------- -------- help: provide the arguments | -LL | complex(1, /* f32 */, /* i32 */, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - complex( 1, "" ); +LL + complex(1, /* f32 */, /* i32 */, /* f32 */, ""); + | error: aborting due to 19 previous errors diff --git a/tests/ui/argument-suggestions/mixed_cases.stderr b/tests/ui/argument-suggestions/mixed_cases.stderr index bec5d4dc16ba1..3edc05c9bf264 100644 --- a/tests/ui/argument-suggestions/mixed_cases.stderr +++ b/tests/ui/argument-suggestions/mixed_cases.stderr @@ -33,8 +33,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: did you mean | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ +LL - three_args(1, "", X {}, ""); +LL + three_args(1, /* f32 */, ""); + | error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/mixed_cases.rs:14:3 @@ -52,8 +53,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: provide the argument | -LL | three_args(1, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - three_args(1, X {}); +LL + three_args(1, /* f32 */, /* &str */); + | error[E0308]: arguments to this function are incorrect --> $DIR/mixed_cases.rs:17:3 @@ -70,8 +72,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: did you mean | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ +LL - three_args(1, "", X {}); +LL + three_args(1, /* f32 */, ""); + | error[E0308]: arguments to this function are incorrect --> $DIR/mixed_cases.rs:20:3 @@ -89,8 +92,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: swap these arguments | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ +LL - three_args("", X {}, 1); +LL + three_args(1, /* f32 */, ""); + | error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/mixed_cases.rs:23:3 @@ -109,8 +113,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: did you mean | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ +LL - three_args("", 1); +LL + three_args(1, /* f32 */, ""); + | error: aborting due to 6 previous errors diff --git a/tests/ui/argument-suggestions/permuted_arguments.stderr b/tests/ui/argument-suggestions/permuted_arguments.stderr index 655807a7f382f..a6b51292b13c5 100644 --- a/tests/ui/argument-suggestions/permuted_arguments.stderr +++ b/tests/ui/argument-suggestions/permuted_arguments.stderr @@ -14,8 +14,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: reorder these arguments | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ +LL - three_args(1.0, "", 1); +LL + three_args(1, 1.0, ""); + | error[E0308]: arguments to this function are incorrect --> $DIR/permuted_arguments.rs:12:3 @@ -35,8 +36,9 @@ LL | fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {} | ^^^^^^^^^ ------- ------- -------- ----- ----- help: reorder these arguments | -LL | many_args(1, 1.0, "", X {}, Y {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - many_args(X {}, Y {}, 1, 1.0, ""); +LL + many_args(1, 1.0, "", X {}, Y {}); + | error: aborting due to 2 previous errors diff --git a/tests/ui/argument-suggestions/swapped_arguments.stderr b/tests/ui/argument-suggestions/swapped_arguments.stderr index dabf5e952b26b..332c6d2152e9a 100644 --- a/tests/ui/argument-suggestions/swapped_arguments.stderr +++ b/tests/ui/argument-suggestions/swapped_arguments.stderr @@ -13,8 +13,9 @@ LL | fn two_args(_a: i32, _b: f32) {} | ^^^^^^^^ ------- ------- help: swap these arguments | -LL | two_args(1, 1.0); - | ~~~~~~~~ +LL - two_args(1.0, 1); +LL + two_args(1, 1.0); + | error[E0308]: arguments to this function are incorrect --> $DIR/swapped_arguments.rs:9:3 @@ -31,8 +32,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: swap these arguments | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ +LL - three_args(1.0, 1, ""); +LL + three_args(1, 1.0, ""); + | error[E0308]: arguments to this function are incorrect --> $DIR/swapped_arguments.rs:10:3 @@ -49,8 +51,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: swap these arguments | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ +LL - three_args( 1, "", 1.0); +LL + three_args(1, 1.0, ""); + | error[E0308]: arguments to this function are incorrect --> $DIR/swapped_arguments.rs:11:3 @@ -67,8 +70,9 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {} | ^^^^^^^^^^ ------- ------- -------- help: swap these arguments | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ +LL - three_args( "", 1.0, 1); +LL + three_args(1, 1.0, ""); + | error[E0308]: arguments to this function are incorrect --> $DIR/swapped_arguments.rs:13:3 @@ -87,8 +91,9 @@ LL | fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {} | ^^^^^^^^^ ------- ------- -------- ----- help: did you mean | -LL | four_args(1, 1.0, "", X {}); - | ~~~~~~~~~~~~~~~~~~ +LL - four_args(1.0, 1, X {}, ""); +LL + four_args(1, 1.0, "", X {}); + | error: aborting due to 5 previous errors diff --git a/tests/ui/asm/invalid-const-operand.stderr b/tests/ui/asm/invalid-const-operand.stderr index bda4b0355b7c4..13bb10e84a533 100644 --- a/tests/ui/asm/invalid-const-operand.stderr +++ b/tests/ui/asm/invalid-const-operand.stderr @@ -6,8 +6,9 @@ LL | asm!("{}", const x); | help: consider using `const` instead of `let` | -LL | const x: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let x = 0; +LL + const x: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/invalid-const-operand.rs:43:36 @@ -17,8 +18,9 @@ LL | asm!("{}", const const_foo(x)); | help: consider using `const` instead of `let` | -LL | const x: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let x = 0; +LL + const x: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/invalid-const-operand.rs:46:36 @@ -28,8 +30,9 @@ LL | asm!("{}", const const_bar(x)); | help: consider using `const` instead of `let` | -LL | const x: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let x = 0; +LL + const x: /* Type */ = 0; + | error: invalid type for `const` operand --> $DIR/invalid-const-operand.rs:12:19 diff --git a/tests/ui/asm/parse-error.stderr b/tests/ui/asm/parse-error.stderr index 6d0e629b93775..74647372a3557 100644 --- a/tests/ui/asm/parse-error.stderr +++ b/tests/ui/asm/parse-error.stderr @@ -424,8 +424,9 @@ LL | asm!("{}", options(), const foo); | help: consider using `const` instead of `let` | -LL | const foo: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut foo = 0; +LL + const foo: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/parse-error.rs:69:44 @@ -435,8 +436,9 @@ LL | asm!("{}", clobber_abi("C"), const foo); | help: consider using `const` instead of `let` | -LL | const foo: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut foo = 0; +LL + const foo: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/parse-error.rs:72:55 @@ -446,8 +448,9 @@ LL | asm!("{}", options(), clobber_abi("C"), const foo); | help: consider using `const` instead of `let` | -LL | const foo: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut foo = 0; +LL + const foo: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/parse-error.rs:74:31 @@ -457,8 +460,9 @@ LL | asm!("{a}", a = const foo, a = const bar); | help: consider using `const` instead of `let` | -LL | const foo: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut foo = 0; +LL + const foo: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/parse-error.rs:74:46 @@ -468,8 +472,9 @@ LL | asm!("{a}", a = const foo, a = const bar); | help: consider using `const` instead of `let` | -LL | const bar: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut bar = 0; +LL + const bar: /* Type */ = 0; + | error: aborting due to 72 previous errors diff --git a/tests/ui/asm/x86_64/x86_64_parse_error.stderr b/tests/ui/asm/x86_64/x86_64_parse_error.stderr index b64f6c1127eb6..dfa3e1d0ef207 100644 --- a/tests/ui/asm/x86_64/x86_64_parse_error.stderr +++ b/tests/ui/asm/x86_64/x86_64_parse_error.stderr @@ -20,8 +20,9 @@ LL | asm!("{a}", in("eax") foo, a = const bar); | help: consider using `const` instead of `let` | -LL | const bar: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut bar = 0; +LL + const bar: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/x86_64_parse_error.rs:13:46 @@ -31,8 +32,9 @@ LL | asm!("{a}", in("eax") foo, a = const bar); | help: consider using `const` instead of `let` | -LL | const bar: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut bar = 0; +LL + const bar: /* Type */ = 0; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/x86_64_parse_error.rs:15:42 @@ -42,8 +44,9 @@ LL | asm!("{1}", in("eax") foo, const bar); | help: consider using `const` instead of `let` | -LL | const bar: /* Type */ = 0; - | ~~~~~ ++++++++++++ +LL - let mut bar = 0; +LL + const bar: /* Type */ = 0; + | error: aborting due to 5 previous errors diff --git a/tests/ui/associated-consts/associated-const-ambiguity-report.stderr b/tests/ui/associated-consts/associated-const-ambiguity-report.stderr index 35ee95d1215b1..e68ba503c5059 100644 --- a/tests/ui/associated-consts/associated-const-ambiguity-report.stderr +++ b/tests/ui/associated-consts/associated-const-ambiguity-report.stderr @@ -16,10 +16,12 @@ LL | const ID: i32 = 1; | ^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | const X: i32 = ::ID; - | ~~~~~~~~~~~~~~ -LL | const X: i32 = ::ID; - | ~~~~~~~~~~~~~~ +LL - const X: i32 = ::ID; +LL + const X: i32 = ::ID; + | +LL - const X: i32 = ::ID; +LL + const X: i32 = ::ID; + | error: aborting due to 1 previous error diff --git a/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr b/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr index edf54894cd4e1..d245659c20978 100644 --- a/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr +++ b/tests/ui/associated-inherent-types/dont-select-if-disabled.stderr @@ -6,8 +6,9 @@ LL | struct S(S::P); | help: if there were a trait named `Example` with associated type `P` implemented for `S`, you could use the fully-qualified path | -LL | struct S(::P); - | ~~~~~~~~~~~~~~~~~ +LL - struct S(S::P); +LL + struct S(::P); + | error[E0658]: inherent associated types are unstable --> $DIR/dont-select-if-disabled.rs:15:10 diff --git a/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr b/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr index 72d3f5c6d4d42..d5e8fd69645ba 100644 --- a/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr +++ b/tests/ui/associated-inherent-types/issue-109071.no_gate.stderr @@ -28,10 +28,12 @@ LL | fn T() -> Option {} | help: use fully-qualified syntax | -LL | fn T() -> Option< as IntoAsyncIterator>::Item> {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | fn T() -> Option< as IntoIterator>::Item> {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn T() -> Option {} +LL + fn T() -> Option< as IntoAsyncIterator>::Item> {} + | +LL - fn T() -> Option {} +LL + fn T() -> Option< as IntoIterator>::Item> {} + | error[E0658]: inherent associated types are unstable --> $DIR/issue-109071.rs:8:5 diff --git a/tests/ui/associated-inherent-types/issue-109768.stderr b/tests/ui/associated-inherent-types/issue-109768.stderr index e71551f9e7328..18455f4669e91 100644 --- a/tests/ui/associated-inherent-types/issue-109768.stderr +++ b/tests/ui/associated-inherent-types/issue-109768.stderr @@ -43,8 +43,9 @@ LL | struct Wrapper(T); | ^^^^^^^ help: provide the argument | -LL | const WRAPPED_ASSOC_3: Wrapper = Wrapper(/* value */); - | ~~~~~~~~~~~~~ +LL - const WRAPPED_ASSOC_3: Wrapper = Wrapper(); +LL + const WRAPPED_ASSOC_3: Wrapper = Wrapper(/* value */); + | error: aborting due to 4 previous errors diff --git a/tests/ui/associated-item/associated-item-enum.stderr b/tests/ui/associated-item/associated-item-enum.stderr index 3b00588f1d1a5..49f168b854407 100644 --- a/tests/ui/associated-item/associated-item-enum.stderr +++ b/tests/ui/associated-item/associated-item-enum.stderr @@ -9,8 +9,9 @@ LL | Enum::mispellable(); | help: there is an associated function `misspellable` with a similar name | -LL | Enum::misspellable(); - | ~~~~~~~~~~~~ +LL - Enum::mispellable(); +LL + Enum::misspellable(); + | error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:18:11 @@ -23,8 +24,9 @@ LL | Enum::mispellable_trait(); | help: there is an associated function `misspellable_trait` with a similar name | -LL | Enum::misspellable_trait(); - | ~~~~~~~~~~~~~~~~~~ +LL - Enum::mispellable_trait(); +LL + Enum::misspellable_trait(); + | error[E0599]: no variant or associated item named `MISPELLABLE` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:19:11 @@ -37,8 +39,9 @@ LL | Enum::MISPELLABLE; | help: there is an associated constant `MISSPELLABLE` with a similar name | -LL | Enum::MISSPELLABLE; - | ~~~~~~~~~~~~ +LL - Enum::MISPELLABLE; +LL + Enum::MISSPELLABLE; + | error: aborting due to 3 previous errors diff --git a/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr b/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr index b1575abe57112..d5795e7ed7db8 100644 --- a/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr +++ b/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr @@ -6,8 +6,9 @@ LL | type Out = Box>; | help: use `impl Trait` to introduce a type instead | -LL | type Out = Box>; - | ~~~~~~ +LL - type Out = Box>; +LL + type Out = Box>; + | error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/elision.stderr b/tests/ui/associated-type-bounds/elision.stderr index 36ca5a80024af..75141080dbf2e 100644 --- a/tests/ui/associated-type-bounds/elision.stderr +++ b/tests/ui/associated-type-bounds/elision.stderr @@ -7,8 +7,9 @@ LL | fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> = help: this function's return type contains a borrowed value, but the signature does not say which one of `x`'s 2 lifetimes it is borrowed from help: consider introducing a named lifetime parameter | -LL | fn f<'a>(x: &'a mut dyn Iterator>) -> Option<&'a ()> { x.next() } - | ++++ ++ ~~ ~~ +LL - fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> { x.next() } +LL + fn f<'a>(x: &'a mut dyn Iterator>) -> Option<&'a ()> { x.next() } + | error: associated type bounds are not allowed in `dyn` types --> $DIR/elision.rs:4:27 @@ -18,8 +19,9 @@ LL | fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> | help: use `impl Trait` to introduce a type instead | -LL | fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> { x.next() } - | ~~~~~~ +LL - fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> { x.next() } +LL + fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> { x.next() } + | error: aborting due to 2 previous errors diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr index 39a2b98e2e2d1..6b9cc85a99dbb 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr @@ -12,8 +12,9 @@ LL | inner: >::IntoIterator as Item> | help: if there were a trait named `Example` with associated type `IntoIterator` implemented for `(dyn IntoIterator + 'static)`, you could use the fully-qualified path | -LL | inner: <<(dyn IntoIterator + 'static) as Example>::IntoIterator as Item>::Core, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - inner: >::IntoIterator as Item>::Core, +LL + inner: <<(dyn IntoIterator + 'static) as Example>::IntoIterator as Item>::Core, + | error: aborting due to 2 previous errors diff --git a/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr b/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr index 13be2162c52b1..f8f92af5300c8 100644 --- a/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr +++ b/tests/ui/associated-type-bounds/suggest-assoc-ty-bound-on-eq-bound.stderr @@ -41,8 +41,9 @@ LL | fn f(_: impl Trait) {} | +++ help: you might have meant to write a bound here | -LL | fn f(_: impl Trait) {} - | ~ +LL - fn f(_: impl Trait) {} +LL + fn f(_: impl Trait) {} + | error[E0782]: trait objects must include the `dyn` keyword --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:10:24 @@ -56,8 +57,9 @@ LL | fn g(_: impl Trait) {} | +++ help: you might have meant to write a bound here | -LL | fn g(_: impl Trait) {} - | ~ +LL - fn g(_: impl Trait) {} +LL + fn g(_: impl Trait) {} + | error[E0782]: trait objects must include the `dyn` keyword --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:18:26 @@ -71,8 +73,9 @@ LL | fn h(_: impl Trait = dyn 'static + for<'a> Fn(&'a ())>) {} | +++ help: you might have meant to write a bound here | -LL | fn h(_: impl Trait: 'static + for<'a> Fn(&'a ())>) {} - | ~ +LL - fn h(_: impl Trait = 'static + for<'a> Fn(&'a ())>) {} +LL + fn h(_: impl Trait: 'static + for<'a> Fn(&'a ())>) {} + | error[E0782]: trait objects must include the `dyn` keyword --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:24:26 diff --git a/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr b/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr index df01e1e376869..b828eb86b439c 100644 --- a/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr +++ b/tests/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr @@ -12,12 +12,14 @@ LL | fn a(_: C::Color) { | help: use fully-qualified syntax to disambiguate | -LL | fn a(_: ::Color) { - | ~~~~~~~~~~~~ +LL - fn a(_: C::Color) { +LL + fn a(_: ::Color) { + | help: use fully-qualified syntax to disambiguate | -LL | fn a(_: ::Color) { - | ~~~~~~~~~~~~~~~~ +LL - fn a(_: C::Color) { +LL + fn a(_: ::Color) { + | error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:20:12 @@ -33,12 +35,14 @@ LL | fn b(_: C::Color) where C : Vehicle+Box { | help: use fully-qualified syntax to disambiguate | -LL | fn b(_: ::Color) where C : Vehicle+Box { - | ~~~~~~~~~~~~ +LL - fn b(_: C::Color) where C : Vehicle+Box { +LL + fn b(_: ::Color) where C : Vehicle+Box { + | help: use fully-qualified syntax to disambiguate | -LL | fn b(_: ::Color) where C : Vehicle+Box { - | ~~~~~~~~~~~~~~~~ +LL - fn b(_: C::Color) where C : Vehicle+Box { +LL + fn b(_: ::Color) where C : Vehicle+Box { + | error[E0221]: ambiguous associated type `Color` in bounds of `C` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:24:12 @@ -54,12 +58,14 @@ LL | fn c(_: C::Color) where C : Vehicle, C : Box { | help: use fully-qualified syntax to disambiguate | -LL | fn c(_: ::Color) where C : Vehicle, C : Box { - | ~~~~~~~~~~~~ +LL - fn c(_: C::Color) where C : Vehicle, C : Box { +LL + fn c(_: ::Color) where C : Vehicle, C : Box { + | help: use fully-qualified syntax to disambiguate | -LL | fn c(_: ::Color) where C : Vehicle, C : Box { - | ~~~~~~~~~~~~~~~~ +LL - fn c(_: C::Color) where C : Vehicle, C : Box { +LL + fn c(_: ::Color) where C : Vehicle, C : Box { + | error[E0221]: ambiguous associated type `Color` in bounds of `X` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20 @@ -75,12 +81,14 @@ LL | fn e(&self, _: X::Color) where X : Box; | help: use fully-qualified syntax to disambiguate | -LL | fn e(&self, _: ::Color) where X : Box; - | ~~~~~~~~~~~~ +LL - fn e(&self, _: X::Color) where X : Box; +LL + fn e(&self, _: ::Color) where X : Box; + | help: use fully-qualified syntax to disambiguate | -LL | fn e(&self, _: ::Color) where X : Box; - | ~~~~~~~~~~~~~~~~ +LL - fn e(&self, _: X::Color) where X : Box; +LL + fn e(&self, _: ::Color) where X : Box; + | error[E0221]: ambiguous associated type `Color` in bounds of `X` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20 @@ -96,12 +104,14 @@ LL | fn f(&self, _: X::Color) where X : Box { } | help: use fully-qualified syntax to disambiguate | -LL | fn f(&self, _: ::Color) where X : Box { } - | ~~~~~~~~~~~~ +LL - fn f(&self, _: X::Color) where X : Box { } +LL + fn f(&self, _: ::Color) where X : Box { } + | help: use fully-qualified syntax to disambiguate | -LL | fn f(&self, _: ::Color) where X : Box { } - | ~~~~~~~~~~~~~~~~ +LL - fn f(&self, _: X::Color) where X : Box { } +LL + fn f(&self, _: ::Color) where X : Box { } + | error[E0221]: ambiguous associated type `Color` in bounds of `X` --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20 @@ -117,12 +127,14 @@ LL | fn d(&self, _: X::Color) where X : Box { } | help: use fully-qualified syntax to disambiguate | -LL | fn d(&self, _: ::Color) where X : Box { } - | ~~~~~~~~~~~~ +LL - fn d(&self, _: X::Color) where X : Box { } +LL + fn d(&self, _: ::Color) where X : Box { } + | help: use fully-qualified syntax to disambiguate | -LL | fn d(&self, _: ::Color) where X : Box { } - | ~~~~~~~~~~~~~~~~ +LL - fn d(&self, _: X::Color) where X : Box { } +LL + fn d(&self, _: ::Color) where X : Box { } + | error: aborting due to 6 previous errors diff --git a/tests/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr b/tests/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr index a4874903285aa..063623ebd123f 100644 --- a/tests/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr +++ b/tests/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr @@ -20,12 +20,14 @@ LL | fn dent(c: C, color: C::Color) { | help: use fully-qualified syntax to disambiguate | -LL | fn dent(c: C, color: ::Color) { - | ~~~~~~~~~~~~~~~~ +LL - fn dent(c: C, color: C::Color) { +LL + fn dent(c: C, color: ::Color) { + | help: use fully-qualified syntax to disambiguate | -LL | fn dent(c: C, color: ::Color) { - | ~~~~~~~~~~~~ +LL - fn dent(c: C, color: C::Color) { +LL + fn dent(c: C, color: ::Color) { + | error[E0222]: ambiguous associated type `Color` in bounds of `BoxCar` --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:38 @@ -73,12 +75,14 @@ LL | fn paint(c: C, d: C::Color) { | help: use fully-qualified syntax to disambiguate | -LL | fn paint(c: C, d: ::Color) { - | ~~~~~~~~~~~~~~~~ +LL - fn paint(c: C, d: C::Color) { +LL + fn paint(c: C, d: ::Color) { + | help: use fully-qualified syntax to disambiguate | -LL | fn paint(c: C, d: ::Color) { - | ~~~~~~~~~~~~ +LL - fn paint(c: C, d: C::Color) { +LL + fn paint(c: C, d: ::Color) { + | error[E0191]: the value of the associated types `Color` in `Box`, `Color` in `Vehicle` must be specified --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:33 diff --git a/tests/ui/associated-types/associated-types-eq-1.stderr b/tests/ui/associated-types/associated-types-eq-1.stderr index 14ef36876740b..581ad25d88ac0 100644 --- a/tests/ui/associated-types/associated-types-eq-1.stderr +++ b/tests/ui/associated-types/associated-types-eq-1.stderr @@ -8,8 +8,9 @@ LL | let _: A = x.boo(); | help: a type parameter with a similar name exists | -LL | let _: I = x.boo(); - | ~ +LL - let _: A = x.boo(); +LL + let _: I = x.boo(); + | help: you might be missing a type parameter | LL | fn foo2(x: I) { diff --git a/tests/ui/associated-types/associated-types-eq-2.stderr b/tests/ui/associated-types/associated-types-eq-2.stderr index e5013a35d453b..c650fee55d3fb 100644 --- a/tests/ui/associated-types/associated-types-eq-2.stderr +++ b/tests/ui/associated-types/associated-types-eq-2.stderr @@ -101,8 +101,9 @@ LL | impl Tr2 for Bar { | help: to use `Qux` as a generic argument specify it directly | -LL | impl Tr2 for Bar { - | ~~~ +LL - impl Tr2 for Bar { +LL + impl Tr2 for Bar { + | error[E0107]: trait takes 3 generic arguments but 1 generic argument was supplied --> $DIR/associated-types-eq-2.rs:47:6 @@ -190,8 +191,9 @@ LL | impl Tr2> for Bar { | help: to use `GenericTerm` as a generic argument specify it directly | -LL | impl Tr2> for Bar { - | ~~~~~~~~~~~~~~~~ +LL - impl Tr2> for Bar { +LL + impl Tr2> for Bar { + | error[E0229]: associated item constraints are not allowed here --> $DIR/associated-types-eq-2.rs:76:10 @@ -205,8 +207,12 @@ LL | | = 42, T2 = Qux, T3 = usize> for Bar { | help: to use `42` as a generic argument specify it directly | -LL | impl Tr3<42, T2 = Qux, T3 = usize> for Bar { - | ~~ +LL - impl Tr3 for Bar { +LL + impl Tr3<42, T2 = Qux, T3 = usize> for Bar { + | error[E0107]: trait takes 3 generic arguments but 0 generic arguments were supplied --> $DIR/associated-types-eq-2.rs:84:6 @@ -330,8 +336,9 @@ LL | impl<'a, T> St<'a , T = Qux> { | help: to use `Qux` as a generic argument specify it directly | -LL | impl<'a, T> St<'a , Qux> { - | ~~~ +LL - impl<'a, T> St<'a , T = Qux> { +LL + impl<'a, T> St<'a , Qux> { + | error: aborting due to 25 previous errors diff --git a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr index c5260adbed43a..0eac23bcb1843 100644 --- a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr +++ b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr @@ -6,8 +6,9 @@ LL | fn get(x: T, y: U) -> Get::Value {} | help: if there were a type named `Example` that implemented `Get`, you could use the fully-qualified path | -LL | fn get(x: T, y: U) -> ::Value {} - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn get(x: T, y: U) -> Get::Value {} +LL + fn get(x: T, y: U) -> ::Value {} + | error[E0223]: ambiguous associated type --> $DIR/associated-types-in-ambiguous-context.rs:13:23 @@ -23,8 +24,9 @@ LL | fn get(&self) -> Get::Value; | help: if there were a type named `Example` that implemented `Get`, you could use the fully-qualified path | -LL | fn get(&self) -> ::Value; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn get(&self) -> Get::Value; +LL + fn get(&self) -> ::Value; + | error[E0223]: ambiguous associated type --> $DIR/associated-types-in-ambiguous-context.rs:22:17 @@ -40,14 +42,18 @@ LL | type X = std::ops::Deref::Target; | help: use fully-qualified syntax | -LL | type X = ::Target; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | type X = as Deref>::Target; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | type X = as Deref>::Target; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | type X = ::Target; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type X = std::ops::Deref::Target; +LL + type X = ::Target; + | +LL - type X = std::ops::Deref::Target; +LL + type X = as Deref>::Target; + | +LL - type X = std::ops::Deref::Target; +LL + type X = as Deref>::Target; + | +LL - type X = std::ops::Deref::Target; +LL + type X = ::Target; + | and N other candidates error: aborting due to 5 previous errors diff --git a/tests/ui/associated-types/associated-types-path-1.stderr b/tests/ui/associated-types/associated-types-path-1.stderr index cab9dcec0b6b7..aea70e085c196 100644 --- a/tests/ui/associated-types/associated-types-path-1.stderr +++ b/tests/ui/associated-types/associated-types-path-1.stderr @@ -18,12 +18,14 @@ LL | pub fn f2(a: T, x: T::A) {} | help: use fully-qualified syntax to disambiguate | -LL | pub fn f2(a: T, x: ::A) {} - | ~~~~~~~~~~~~ +LL - pub fn f2(a: T, x: T::A) {} +LL + pub fn f2(a: T, x: ::A) {} + | help: use fully-qualified syntax to disambiguate | -LL | pub fn f2(a: T, x: ::A) {} - | ~~~~~~~~~~~~ +LL - pub fn f2(a: T, x: T::A) {} +LL + pub fn f2(a: T, x: ::A) {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/associated-types/associated-types-path-2.stderr b/tests/ui/associated-types/associated-types-path-2.stderr index 5edd5c864e135..897eb75e3e3d2 100644 --- a/tests/ui/associated-types/associated-types-path-2.stderr +++ b/tests/ui/associated-types/associated-types-path-2.stderr @@ -13,8 +13,9 @@ LL | pub fn f1(a: T, x: T::A) {} | ^^ ------- help: change the type of the numeric literal from `i32` to `u32` | -LL | f1(2i32, 4u32); - | ~~~ +LL - f1(2i32, 4i32); +LL + f1(2i32, 4u32); + | error[E0277]: the trait bound `u32: Foo` is not satisfied --> $DIR/associated-types-path-2.rs:29:8 diff --git a/tests/ui/associated-types/associated-types-project-from-hrtb-in-fn.stderr b/tests/ui/associated-types/associated-types-project-from-hrtb-in-fn.stderr index 83bad291e5666..b0c904fe62be6 100644 --- a/tests/ui/associated-types/associated-types-project-from-hrtb-in-fn.stderr +++ b/tests/ui/associated-types/associated-types-project-from-hrtb-in-fn.stderr @@ -6,8 +6,9 @@ LL | x: I::A) | help: use a fully qualified path with inferred lifetimes | -LL | x: >::A) - | ~~~~~~~~~~~~~~~~~~~~ +LL - x: I::A) +LL + x: >::A) + | error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr b/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr index 48433b15286d4..bd30c25c97bdc 100644 --- a/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr +++ b/tests/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr @@ -6,8 +6,9 @@ LL | fn some_method(&self, arg: I::A); | help: use a fully qualified path with inferred lifetimes | -LL | fn some_method(&self, arg: >::A); - | ~~~~~~~~~~~~~~~~~~~~ +LL - fn some_method(&self, arg: I::A); +LL + fn some_method(&self, arg: >::A); + | error[E0212]: cannot use the associated type of a trait with uninferred generic parameters --> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:32:24 @@ -17,8 +18,9 @@ LL | fn mango(&self) -> X::Assoc { | help: use a fully qualified path with inferred lifetimes | -LL | fn mango(&self) -> >::Assoc { - | ~~~~~~~~~~~~~~~~~~~ +LL - fn mango(&self) -> X::Assoc { +LL + fn mango(&self) -> >::Assoc { + | error: aborting due to 2 previous errors diff --git a/tests/ui/associated-types/defaults-specialization.stderr b/tests/ui/associated-types/defaults-specialization.stderr index b4ed99f36f44a..fd2a1a0c2d13a 100644 --- a/tests/ui/associated-types/defaults-specialization.stderr +++ b/tests/ui/associated-types/defaults-specialization.stderr @@ -23,8 +23,9 @@ LL | fn make() -> Self::Ty { found signature `fn() -> u8` help: change the output type to match the trait | -LL | fn make() -> as Tr>::Ty { 0 } - | ~~~~~~~~~~~~~~~~ +LL - fn make() -> u8 { 0 } +LL + fn make() -> as Tr>::Ty { 0 } + | error[E0053]: method `make` has an incompatible type for trait --> $DIR/defaults-specialization.rs:35:18 @@ -44,8 +45,9 @@ LL | fn make() -> Self::Ty { found signature `fn() -> bool` help: change the output type to match the trait | -LL | fn make() -> as Tr>::Ty { true } - | ~~~~~~~~~~~~~~~~ +LL - fn make() -> bool { true } +LL + fn make() -> as Tr>::Ty { true } + | error[E0308]: mismatched types --> $DIR/defaults-specialization.rs:10:9 diff --git a/tests/ui/associated-types/defaults-suitability.current.stderr b/tests/ui/associated-types/defaults-suitability.current.stderr index 3cdeaa93a340a..fcf5e9554f7ad 100644 --- a/tests/ui/associated-types/defaults-suitability.current.stderr +++ b/tests/ui/associated-types/defaults-suitability.current.stderr @@ -134,8 +134,9 @@ LL | type Baz = T; | --- required by a bound in this associated type help: consider further restricting type parameter `T` | -LL | Self::Baz: Clone, T: std::clone::Clone - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - Self::Baz: Clone, +LL + Self::Baz: Clone, T: std::clone::Clone + | error: aborting due to 8 previous errors diff --git a/tests/ui/associated-types/defaults-suitability.next.stderr b/tests/ui/associated-types/defaults-suitability.next.stderr index 3cdeaa93a340a..fcf5e9554f7ad 100644 --- a/tests/ui/associated-types/defaults-suitability.next.stderr +++ b/tests/ui/associated-types/defaults-suitability.next.stderr @@ -134,8 +134,9 @@ LL | type Baz = T; | --- required by a bound in this associated type help: consider further restricting type parameter `T` | -LL | Self::Baz: Clone, T: std::clone::Clone - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - Self::Baz: Clone, +LL + Self::Baz: Clone, T: std::clone::Clone + | error: aborting due to 8 previous errors diff --git a/tests/ui/associated-types/impl-wf-cycle-3.stderr b/tests/ui/associated-types/impl-wf-cycle-3.stderr index d3ca06f890b34..b97117a9aab69 100644 --- a/tests/ui/associated-types/impl-wf-cycle-3.stderr +++ b/tests/ui/associated-types/impl-wf-cycle-3.stderr @@ -19,8 +19,9 @@ LL | T: A, | ------------- unsatisfied trait bound introduced here help: replace the associated type with the type specified in this `impl` | -LL | T: A, - | ~~~~ +LL - T: A, +LL + T: A, + | error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-22560.stderr b/tests/ui/associated-types/issue-22560.stderr index 834040490f940..42e849a49b033 100644 --- a/tests/ui/associated-types/issue-22560.stderr +++ b/tests/ui/associated-types/issue-22560.stderr @@ -25,8 +25,9 @@ LL | type Test = dyn Add + Sub; | help: specify the associated types | -LL | type Test = dyn Add + Sub; - | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ +LL - type Test = dyn Add + Sub; +LL + type Test = dyn Add + Sub; + | error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-22560.rs:9:17 diff --git a/tests/ui/associated-types/issue-38821.stderr b/tests/ui/associated-types/issue-38821.stderr index f1c8f83e30c8f..a1fec5cd35318 100644 --- a/tests/ui/associated-types/issue-38821.stderr +++ b/tests/ui/associated-types/issue-38821.stderr @@ -13,8 +13,9 @@ LL | impl IntoNullable for T { | unsatisfied trait bound introduced here help: consider extending the `where` clause, but there might be an alternative better way to express this requirement | -LL | Expr: Expression::Nullable>, ::SqlType: NotNull - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Expr: Expression::Nullable>, +LL + Expr: Expression::Nullable>, ::SqlType: NotNull + | error[E0277]: the trait bound `::SqlType: NotNull` is not satisfied --> $DIR/issue-38821.rs:40:1 @@ -37,8 +38,9 @@ LL | impl IntoNullable for T { | unsatisfied trait bound introduced here help: consider extending the `where` clause, but there might be an alternative better way to express this requirement | -LL | Expr: Expression::Nullable>, ::SqlType: NotNull - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Expr: Expression::Nullable>, +LL + Expr: Expression::Nullable>, ::SqlType: NotNull + | error[E0277]: the trait bound `::SqlType: NotNull` is not satisfied --> $DIR/issue-38821.rs:23:10 diff --git a/tests/ui/associated-types/issue-54108.current.stderr b/tests/ui/associated-types/issue-54108.current.stderr index 8850b4548e33a..1b2285b214fe1 100644 --- a/tests/ui/associated-types/issue-54108.current.stderr +++ b/tests/ui/associated-types/issue-54108.current.stderr @@ -12,8 +12,9 @@ LL | type Size: Add; | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size` help: consider further restricting the associated type | -LL | T: SubEncoder, ::ActualSize: Add - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T: SubEncoder, +LL + T: SubEncoder, ::ActualSize: Add + | error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-54108.next.stderr b/tests/ui/associated-types/issue-54108.next.stderr index 5e2fa551afe30..cc80ab63901e3 100644 --- a/tests/ui/associated-types/issue-54108.next.stderr +++ b/tests/ui/associated-types/issue-54108.next.stderr @@ -12,8 +12,9 @@ LL | type Size: Add; | ^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size` help: consider further restricting the associated type | -LL | T: SubEncoder, ::ActualSize: Add - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T: SubEncoder, +LL + T: SubEncoder, ::ActualSize: Add + | error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-59324.stderr b/tests/ui/associated-types/issue-59324.stderr index f50d86580f8b0..af242cfa3bbfd 100644 --- a/tests/ui/associated-types/issue-59324.stderr +++ b/tests/ui/associated-types/issue-59324.stderr @@ -88,8 +88,9 @@ LL | fn with_factory(factory: dyn ThriftService<()>) {} = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | fn with_factory(factory: impl ThriftService<()>) {} - | ~~~~ +LL - fn with_factory(factory: dyn ThriftService<()>) {} +LL + fn with_factory(factory: impl ThriftService<()>) {} + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | fn with_factory(factory: &dyn ThriftService<()>) {} diff --git a/tests/ui/associated-types/missing-associated-types.stderr b/tests/ui/associated-types/missing-associated-types.stderr index 0636667ea1fd5..7f885b4afc7df 100644 --- a/tests/ui/associated-types/missing-associated-types.stderr +++ b/tests/ui/associated-types/missing-associated-types.stderr @@ -24,8 +24,9 @@ LL | type Foo = dyn Add + Sub + X + Y; | help: specify the associated types | -LL | type Foo = dyn Add + Sub + X + Y; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ +LL - type Foo = dyn Add + Sub + X + Y; +LL + type Foo = dyn Add + Sub + X + Y; + | error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/missing-associated-types.rs:15:32 @@ -60,8 +61,9 @@ LL | type Bar = dyn Add + Sub + X + Z; | ^^^^^^ help: specify the associated types | -LL | type Bar = dyn Add + Sub + X + Z; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type Bar = dyn Add + Sub + X + Z; +LL + type Bar = dyn Add + Sub + X + Z; + | error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/missing-associated-types.rs:18:32 @@ -88,8 +90,9 @@ LL | type Baz = dyn Add + Sub + Y; | help: specify the associated types | -LL | type Baz = dyn Add + Sub + Y; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ +LL - type Baz = dyn Add + Sub + Y; +LL + type Baz = dyn Add + Sub + Y; + | error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/missing-associated-types.rs:21:32 @@ -112,8 +115,9 @@ LL | type Bat = dyn Add + Sub + Fine; | help: specify the associated types | -LL | type Bat = dyn Add + Sub + Fine; - | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ +LL - type Bat = dyn Add + Sub + Fine; +LL + type Bat = dyn Add + Sub + Fine; + | error[E0191]: the value of the associated types `Output` in `Div`, `Output` in `Mul` must be specified --> $DIR/missing-associated-types.rs:24:21 diff --git a/tests/ui/async-await/async-closures/arg-mismatch.stderr b/tests/ui/async-await/async-closures/arg-mismatch.stderr index 70853ae28156f..33e8d94d85fa5 100644 --- a/tests/ui/async-await/async-closures/arg-mismatch.stderr +++ b/tests/ui/async-await/async-closures/arg-mismatch.stderr @@ -13,8 +13,9 @@ LL | let c = async |x| {}; | ^ help: change the type of the numeric literal from `usize` to `i32` | -LL | c(2i32).await; - | ~~~ +LL - c(2usize).await; +LL + c(2i32).await; + | error: aborting due to 1 previous error diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr index 36f90c7bcd5fe..b7f2879727f24 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr @@ -17,8 +17,9 @@ LL | #[warn(refining_impl_trait)] = note: `#[warn(refining_impl_trait_reachable)]` implied by `#[warn(refining_impl_trait)]` help: replace the return type so that it matches the trait | -LL | fn foo(&self) -> impl Future { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn foo(&self) -> Pin + '_>> { +LL + fn foo(&self) -> impl Future { + | warning: 1 warning emitted diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr index 8e39559071f16..86546df88c175 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr +++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr @@ -17,8 +17,9 @@ LL | #[warn(refining_impl_trait)] = note: `#[warn(refining_impl_trait_reachable)]` implied by `#[warn(refining_impl_trait)]` help: replace the return type so that it matches the trait | -LL | fn foo(&self) -> impl Future { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn foo(&self) -> MyFuture { +LL + fn foo(&self) -> impl Future { + | warning: 1 warning emitted diff --git a/tests/ui/async-await/incorrect-move-async-order-issue-79694.stderr b/tests/ui/async-await/incorrect-move-async-order-issue-79694.stderr index 782fa4295fd7f..2a3d46cc97f28 100644 --- a/tests/ui/async-await/incorrect-move-async-order-issue-79694.stderr +++ b/tests/ui/async-await/incorrect-move-async-order-issue-79694.stderr @@ -6,8 +6,9 @@ LL | let _ = move async { }; | help: try switching the order | -LL | let _ = async move { }; - | ~~~~~~~~~~ +LL - let _ = move async { }; +LL + let _ = async move { }; + | error: aborting due to 1 previous error diff --git a/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2015.stderr b/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2015.stderr index d4266814a7c47..2bdc1347c815d 100644 --- a/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2015.stderr +++ b/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2015.stderr @@ -16,12 +16,14 @@ LL | fn r#struct(&self) { | ^^^^^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | async::r#struct(&r#fn {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - r#fn {}.r#struct(); +LL + async::r#struct(&r#fn {}); + | help: disambiguate the method for candidate #2 | -LL | await::r#struct(&r#fn {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - r#fn {}.r#struct(); +LL + await::r#struct(&r#fn {}); + | error: aborting due to 1 previous error diff --git a/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2018.stderr b/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2018.stderr index fe104bfe44544..ab10ab749fedf 100644 --- a/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2018.stderr +++ b/tests/ui/async-await/issue-65634-raw-ident-suggestion.edition2018.stderr @@ -16,12 +16,14 @@ LL | fn r#struct(&self) { | ^^^^^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | r#async::r#struct(&r#fn {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - r#fn {}.r#struct(); +LL + r#async::r#struct(&r#fn {}); + | help: disambiguate the method for candidate #2 | -LL | r#await::r#struct(&r#fn {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - r#fn {}.r#struct(); +LL + r#await::r#struct(&r#fn {}); + | error: aborting due to 1 previous error diff --git a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr index dd863ca541c9e..f4b62d60308a0 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr +++ b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.stderr @@ -19,8 +19,9 @@ LL | x.await; = note: for more on editions, read https://doc.rust-lang.org/edition-guide help: a field with a similar name exists | -LL | x.awai; - | ~~~~ +LL - x.await; +LL + x.awai; + | error[E0609]: no field `await` on type `Pin<&mut dyn Future>` --> $DIR/suggest-switching-edition-on-await-cargo.rs:34:7 diff --git a/tests/ui/async-await/suggest-switching-edition-on-await.stderr b/tests/ui/async-await/suggest-switching-edition-on-await.stderr index 0ed256b059ffe..559173fbc8798 100644 --- a/tests/ui/async-await/suggest-switching-edition-on-await.stderr +++ b/tests/ui/async-await/suggest-switching-edition-on-await.stderr @@ -19,8 +19,9 @@ LL | x.await; = note: for more on editions, read https://doc.rust-lang.org/edition-guide help: a field with a similar name exists | -LL | x.awai; - | ~~~~ +LL - x.await; +LL + x.awai; + | error[E0609]: no field `await` on type `Pin<&mut dyn Future>` --> $DIR/suggest-switching-edition-on-await.rs:32:7 diff --git a/tests/ui/atomic-from-mut-not-available.stderr b/tests/ui/atomic-from-mut-not-available.stderr index a4514524f48f5..9d7fa1f2ee3ab 100644 --- a/tests/ui/atomic-from-mut-not-available.stderr +++ b/tests/ui/atomic-from-mut-not-available.stderr @@ -9,8 +9,9 @@ note: if you're trying to build a new `AtomicU64`, consider using `AtomicU64::ne = note: this error originates in the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info) help: there is an associated function `from` with a similar name | -LL | core::sync::atomic::AtomicU64::from(&mut 0u64); - | ~~~~ +LL - core::sync::atomic::AtomicU64::from_mut(&mut 0u64); +LL + core::sync::atomic::AtomicU64::from(&mut 0u64); + | error: aborting due to 1 previous error diff --git a/tests/ui/attempted-access-non-fatal.stderr b/tests/ui/attempted-access-non-fatal.stderr index bff669727a1b8..03334759baf52 100644 --- a/tests/ui/attempted-access-non-fatal.stderr +++ b/tests/ui/attempted-access-non-fatal.stderr @@ -18,8 +18,9 @@ LL | let _ = 0.f; | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f32` suffix | -LL | let _ = 0.0f32; - | ~~~~ +LL - let _ = 0.f; +LL + let _ = 0.0f32; + | error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 @@ -29,8 +30,9 @@ LL | let _ = 2.l; | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | -LL | let _ = 2.0f64; - | ~~~~ +LL - let _ = 2.l; +LL + let _ = 2.0f64; + | error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:8:16 @@ -40,8 +42,9 @@ LL | let _ = 12.F; | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f32` suffix | -LL | let _ = 12.0f32; - | ~~~~ +LL - let _ = 12.F; +LL + let _ = 12.0f32; + | error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:9:16 @@ -51,8 +54,9 @@ LL | let _ = 34.L; | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | -LL | let _ = 34.0f64; - | ~~~~ +LL - let _ = 34.L; +LL + let _ = 34.0f64; + | error: aborting due to 6 previous errors diff --git a/tests/ui/attributes/key-value-non-ascii.stderr b/tests/ui/attributes/key-value-non-ascii.stderr index cc01bc46ebd29..fa87ad5ee6d21 100644 --- a/tests/ui/attributes/key-value-non-ascii.stderr +++ b/tests/ui/attributes/key-value-non-ascii.stderr @@ -6,8 +6,9 @@ LL | #[rustc_dummy = b"ffi.rs"] | help: if you meant to use the UTF-8 encoding of 'ffi', use \xHH escapes | -LL | #[rustc_dummy = b"/xEF/xAC/x83.rs"] - | ~~~~~~~~~~~~ +LL - #[rustc_dummy = b"ffi.rs"] +LL + #[rustc_dummy = b"/xEF/xAC/x83.rs"] + | error: aborting due to 1 previous error diff --git a/tests/ui/attributes/rustc_confusables.stderr b/tests/ui/attributes/rustc_confusables.stderr index 9e37d5f50837d..f475e9c494e0e 100644 --- a/tests/ui/attributes/rustc_confusables.stderr +++ b/tests/ui/attributes/rustc_confusables.stderr @@ -35,8 +35,9 @@ LL | x.inser(); | help: there is a method `insert` with a similar name | -LL | x.insert(); - | ~~~~~~ +LL - x.inser(); +LL + x.insert(); + | error[E0599]: no method named `foo` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope --> $DIR/rustc_confusables.rs:15:7 @@ -52,8 +53,9 @@ LL | x.push(); | help: you might have meant to use `insert` | -LL | x.insert(); - | ~~~~~~ +LL - x.push(); +LL + x.insert(); + | error[E0599]: no method named `test` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope --> $DIR/rustc_confusables.rs:20:7 @@ -69,8 +71,9 @@ LL | x.pulled(); | help: you might have meant to use `pull` | -LL | x.pull(); - | ~~~~ +LL - x.pulled(); +LL + x.pull(); + | error: aborting due to 9 previous errors diff --git a/tests/ui/attributes/rustc_confusables_std_cases.stderr b/tests/ui/attributes/rustc_confusables_std_cases.stderr index f4b6947ccd94a..80d086daade0f 100644 --- a/tests/ui/attributes/rustc_confusables_std_cases.stderr +++ b/tests/ui/attributes/rustc_confusables_std_cases.stderr @@ -6,8 +6,9 @@ LL | x.push(1); | help: you might have meant to use `insert` | -LL | x.insert(1); - | ~~~~~~ +LL - x.push(1); +LL + x.insert(1); + | error[E0599]: no method named `push_back` found for struct `Vec<_>` in the current scope --> $DIR/rustc_confusables_std_cases.rs:9:7 @@ -17,8 +18,9 @@ LL | x.push_back(1); | help: you might have meant to use `push` | -LL | x.push(1); - | ~~~~ +LL - x.push_back(1); +LL + x.push(1); + | error[E0599]: no method named `push` found for struct `VecDeque` in the current scope --> $DIR/rustc_confusables_std_cases.rs:12:7 @@ -36,8 +38,9 @@ LL | let mut x = VecDeque::new(); | ----- earlier `x` shadowed here with type `VecDeque` help: you might have meant to use `push_back` | -LL | x.push_back(1); - | ~~~~~~~~~ +LL - x.push(1); +LL + x.push_back(1); + | error[E0599]: no method named `length` found for struct `Vec<{integer}>` in the current scope --> $DIR/rustc_confusables_std_cases.rs:15:7 @@ -47,8 +50,9 @@ LL | x.length(); | help: you might have meant to use `len` | -LL | x.len(); - | ~~~ +LL - x.length(); +LL + x.len(); + | error[E0599]: no method named `size` found for struct `Vec<{integer}>` in the current scope --> $DIR/rustc_confusables_std_cases.rs:17:7 @@ -60,8 +64,9 @@ help: there is a method `resize` with a similar name, but with different argumen --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL help: you might have meant to use `len` | -LL | x.len(); - | ~~~ +LL - x.size(); +LL + x.len(); + | error[E0308]: mismatched types --> $DIR/rustc_confusables_std_cases.rs:20:14 @@ -77,8 +82,9 @@ note: method defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL help: you might have meant to use `push` | -LL | x.push(42); - | ~~~~ +LL - x.append(42); +LL + x.push(42); + | error[E0308]: mismatched types --> $DIR/rustc_confusables_std_cases.rs:22:24 @@ -92,8 +98,9 @@ note: method defined here --> $SRC_DIR/alloc/src/string.rs:LL:COL help: you might have meant to use `push_str` | -LL | String::new().push_str(""); - | ~~~~~~~~ +LL - String::new().push(""); +LL + String::new().push_str(""); + | error[E0599]: no method named `append` found for struct `String` in the current scope --> $DIR/rustc_confusables_std_cases.rs:24:19 @@ -103,8 +110,9 @@ LL | String::new().append(""); | help: you might have meant to use `push_str` | -LL | String::new().push_str(""); - | ~~~~~~~~ +LL - String::new().append(""); +LL + String::new().push_str(""); + | error: aborting due to 8 previous errors diff --git a/tests/ui/binop/placement-syntax.stderr b/tests/ui/binop/placement-syntax.stderr index b20a2ee63538b..e398c0b0702ab 100644 --- a/tests/ui/binop/placement-syntax.stderr +++ b/tests/ui/binop/placement-syntax.stderr @@ -6,8 +6,9 @@ LL | if x<-1 { | help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` | -LL | if x< -1 { - | ~~~ +LL - if x<-1 { +LL + if x< -1 { + | error: aborting due to 1 previous error diff --git a/tests/ui/block-result/issue-3563.stderr b/tests/ui/block-result/issue-3563.stderr index 22606a52f851e..e03453f394647 100644 --- a/tests/ui/block-result/issue-3563.stderr +++ b/tests/ui/block-result/issue-3563.stderr @@ -6,8 +6,9 @@ LL | || self.b() | help: there is a method `a` with a similar name | -LL | || self.a() - | ~ +LL - || self.b() +LL + || self.a() + | error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/borrowck-access-permissions.stderr b/tests/ui/borrowck/borrowck-access-permissions.stderr index 36e259fa6e8ee..339ef79f97b07 100644 --- a/tests/ui/borrowck/borrowck-access-permissions.stderr +++ b/tests/ui/borrowck/borrowck-access-permissions.stderr @@ -10,8 +10,9 @@ LL | let _y2 = &mut static_x_mut; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of_mut!` instead to create a raw pointer | -LL | let _y2 = addr_of_mut!(static_x_mut); - | ~~~~~~~~~~~~~ + +LL - let _y2 = &mut static_x_mut; +LL + let _y2 = addr_of_mut!(static_x_mut); + | error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-access-permissions.rs:10:19 diff --git a/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr b/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr index bc11204acf288..d953ed2ad3ef0 100644 --- a/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr +++ b/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr @@ -33,8 +33,9 @@ LL | struct B; | ^^^^^^^^ help: if `B` implemented `Clone`, you could clone the value from the field instead of using the functional record update syntax | -LL | let _s2 = S { a: 2, b: s0.b.clone(), c: s0.c.clone() }; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _s2 = S { a: 2, ..s0 }; +LL + let _s2 = S { a: 2, b: s0.b.clone(), c: s0.c.clone() }; + | error[E0509]: cannot move out of type `S`, which implements the `Drop` trait --> $DIR/borrowck-struct-update-with-dtor.rs:24:19 @@ -52,8 +53,9 @@ LL | struct B; | ^^^^^^^^ help: if `B` implemented `Clone`, you could clone the value from the field instead of using the functional record update syntax | -LL | let _s2 = S { a: 2, b: s0.b.clone(), c: s0.c.clone() }; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _s2 = S { a: 2, ..s0 }; +LL + let _s2 = S { a: 2, b: s0.b.clone(), c: s0.c.clone() }; + | error[E0509]: cannot move out of type `S`, which implements the `Drop` trait --> $DIR/borrowck-struct-update-with-dtor.rs:29:19 @@ -99,8 +101,9 @@ LL | let _s2 = T { a: 2, ..s0 }; | help: clone the value from the field instead of using the functional record update syntax | -LL | let _s2 = T { a: 2, b: s0.b.clone() }; - | ~~~~~~~~~~~~~~~~~ +LL - let _s2 = T { a: 2, ..s0 }; +LL + let _s2 = T { a: 2, b: s0.b.clone() }; + | error[E0509]: cannot move out of type `T`, which implements the `Drop` trait --> $DIR/borrowck-struct-update-with-dtor.rs:42:19 @@ -113,8 +116,9 @@ LL | let _s2 = T { ..s0 }; | help: clone the value from the field instead of using the functional record update syntax | -LL | let _s2 = T { b: s0.b.clone(), ..s0 }; - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _s2 = T { ..s0 }; +LL + let _s2 = T { b: s0.b.clone(), ..s0 }; + | error[E0509]: cannot move out of type `T`, which implements the `Drop` trait --> $DIR/borrowck-struct-update-with-dtor.rs:47:32 diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr index a727c9414c556..228381d23b45c 100644 --- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr +++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr @@ -10,8 +10,9 @@ LL | let sfoo: *mut Foo = &mut SFOO; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of_mut!` instead to create a raw pointer | -LL | let sfoo: *mut Foo = addr_of_mut!(SFOO); - | ~~~~~~~~~~~~~ + +LL - let sfoo: *mut Foo = &mut SFOO; +LL + let sfoo: *mut Foo = addr_of_mut!(SFOO); + | warning: 1 warning emitted diff --git a/tests/ui/borrowck/index-mut-help.stderr b/tests/ui/borrowck/index-mut-help.stderr index fde2b5dc07626..6750c503a334c 100644 --- a/tests/ui/borrowck/index-mut-help.stderr +++ b/tests/ui/borrowck/index-mut-help.stderr @@ -16,12 +16,15 @@ LL | map["peter"] = "0".to_string(); = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>` help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API | -LL | map.insert("peter", "0".to_string()); - | ~~~~~~~~ ~ + -LL | map.get_mut("peter").map(|val| { *val = "0".to_string(); }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ -LL | let val = map.entry("peter").or_insert("0".to_string()); - | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + +LL - map["peter"] = "0".to_string(); +LL + map.insert("peter", "0".to_string()); + | +LL - map["peter"] = "0".to_string(); +LL + map.get_mut("peter").map(|val| { *val = "0".to_string(); }); + | +LL - map["peter"] = "0".to_string(); +LL + let val = map.entry("peter").or_insert("0".to_string()); + | error[E0596]: cannot borrow data in an index of `HashMap<&str, String>` as mutable --> $DIR/index-mut-help.rs:12:13 diff --git a/tests/ui/borrowck/issue-115259-suggest-iter-mut.stderr b/tests/ui/borrowck/issue-115259-suggest-iter-mut.stderr index 40ab2e61d6a42..53b833e7c9194 100644 --- a/tests/ui/borrowck/issue-115259-suggest-iter-mut.stderr +++ b/tests/ui/borrowck/issue-115259-suggest-iter-mut.stderr @@ -8,8 +8,9 @@ LL | self.layers.iter().fold(0, |result, mut layer| result + layer.proce | help: you may want to use `iter_mut` here | -LL | self.layers.iter_mut().fold(0, |result, mut layer| result + layer.process()) - | ~~~~~~~~ +LL - self.layers.iter().fold(0, |result, mut layer| result + layer.process()) +LL + self.layers.iter_mut().fold(0, |result, mut layer| result + layer.process()) + | error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/issue-20801.stderr b/tests/ui/borrowck/issue-20801.stderr index 769b34831c120..f6eaf46e92287 100644 --- a/tests/ui/borrowck/issue-20801.stderr +++ b/tests/ui/borrowck/issue-20801.stderr @@ -10,8 +10,9 @@ LL | unsafe { &mut GLOBAL_MUT_T } = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of_mut!` instead to create a raw pointer | -LL | unsafe { addr_of_mut!(GLOBAL_MUT_T) } - | ~~~~~~~~~~~~~ + +LL - unsafe { &mut GLOBAL_MUT_T } +LL + unsafe { addr_of_mut!(GLOBAL_MUT_T) } + | error[E0507]: cannot move out of a mutable reference --> $DIR/issue-20801.rs:27:22 diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr index 72fd0d8ce161e..c9dd0245abb99 100644 --- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr +++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr @@ -10,8 +10,9 @@ LL | c1(&mut Y); = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of_mut!` instead to create a raw pointer | -LL | c1(addr_of_mut!(Y)); - | ~~~~~~~~~~~~~ + +LL - c1(&mut Y); +LL + c1(addr_of_mut!(Y)); + | warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:27:16 @@ -24,8 +25,9 @@ LL | c1(&mut Z); = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | c1(addr_of_mut!(Z)); - | ~~~~~~~~~~~~~ + +LL - c1(&mut Z); +LL + c1(addr_of_mut!(Z)); + | warning: creating a mutable reference to mutable static is discouraged --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:37 @@ -38,8 +40,9 @@ LL | borrowck_closures_unique::e(&mut X); = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | borrowck_closures_unique::e(addr_of_mut!(X)); - | ~~~~~~~~~~~~~ + +LL - borrowck_closures_unique::e(&mut X); +LL + borrowck_closures_unique::e(addr_of_mut!(X)); + | error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46 diff --git a/tests/ui/borrowck/issue-62387-suggest-iter-mut-2.stderr b/tests/ui/borrowck/issue-62387-suggest-iter-mut-2.stderr index 466f19eb0ab95..86d53012cf357 100644 --- a/tests/ui/borrowck/issue-62387-suggest-iter-mut-2.stderr +++ b/tests/ui/borrowck/issue-62387-suggest-iter-mut-2.stderr @@ -8,8 +8,9 @@ LL | vec.iter().flat_map(|container| container.things()).cloned().co | help: you may want to use `iter_mut` here | -LL | vec.iter_mut().flat_map(|container| container.things()).cloned().collect::>(); - | ~~~~~~~~ +LL - vec.iter().flat_map(|container| container.things()).cloned().collect::>(); +LL + vec.iter_mut().flat_map(|container| container.things()).cloned().collect::>(); + | error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/issue-62387-suggest-iter-mut.stderr b/tests/ui/borrowck/issue-62387-suggest-iter-mut.stderr index fd58e43302025..f0a17d76a6787 100644 --- a/tests/ui/borrowck/issue-62387-suggest-iter-mut.stderr +++ b/tests/ui/borrowck/issue-62387-suggest-iter-mut.stderr @@ -8,8 +8,9 @@ LL | v.iter().for_each(|a| a.double()); | help: you may want to use `iter_mut` here | -LL | v.iter_mut().for_each(|a| a.double()); - | ~~~~~~~~ +LL - v.iter().for_each(|a| a.double()); +LL + v.iter_mut().for_each(|a| a.double()); + | error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference --> $DIR/issue-62387-suggest-iter-mut.rs:25:39 @@ -21,8 +22,9 @@ LL | v.iter().rev().rev().for_each(|a| a.double()); | help: you may want to use `iter_mut` here | -LL | v.iter_mut().rev().rev().for_each(|a| a.double()); - | ~~~~~~~~ +LL - v.iter().rev().rev().for_each(|a| a.double()); +LL + v.iter_mut().rev().rev().for_each(|a| a.double()); + | error: aborting due to 2 previous errors diff --git a/tests/ui/borrowck/issue-85765-closure.stderr b/tests/ui/borrowck/issue-85765-closure.stderr index 936ddd67bcd81..fa4e544150877 100644 --- a/tests/ui/borrowck/issue-85765-closure.stderr +++ b/tests/ui/borrowck/issue-85765-closure.stderr @@ -6,8 +6,9 @@ LL | rofl.push(Vec::new()); | help: consider changing this binding's type | -LL | let rofl: &mut Vec> = &mut test; - | ~~~~~~~~~~~~~~~~~~ +LL - let rofl: &Vec> = &mut test; +LL + let rofl: &mut Vec> = &mut test; + | error[E0594]: cannot assign to `*r`, which is behind a `&` reference --> $DIR/issue-85765-closure.rs:13:9 @@ -28,8 +29,9 @@ LL | *x = 1; | help: consider changing this binding's type | -LL | let x: &mut usize = &mut{0}; - | ~~~~~~~~~~ +LL - let x: &usize = &mut{0}; +LL + let x: &mut usize = &mut{0}; + | error[E0594]: cannot assign to `*y`, which is behind a `&` reference --> $DIR/issue-85765-closure.rs:27:9 @@ -39,8 +41,9 @@ LL | *y = 1; | help: consider changing this binding's type | -LL | let y: &mut usize = &mut(0); - | ~~~~~~~~~~ +LL - let y: &usize = &mut(0); +LL + let y: &mut usize = &mut(0); + | error: aborting due to 4 previous errors diff --git a/tests/ui/borrowck/issue-85765.stderr b/tests/ui/borrowck/issue-85765.stderr index 57900bfb612e1..9354294f52b21 100644 --- a/tests/ui/borrowck/issue-85765.stderr +++ b/tests/ui/borrowck/issue-85765.stderr @@ -6,8 +6,9 @@ LL | rofl.push(Vec::new()); | help: consider changing this binding's type | -LL | let rofl: &mut Vec> = &mut test; - | ~~~~~~~~~~~~~~~~~~ +LL - let rofl: &Vec> = &mut test; +LL + let rofl: &mut Vec> = &mut test; + | error[E0594]: cannot assign to `*r`, which is behind a `&` reference --> $DIR/issue-85765.rs:12:5 @@ -28,8 +29,9 @@ LL | *x = 1; | help: consider changing this binding's type | -LL | let x: &mut usize = &mut{0}; - | ~~~~~~~~~~ +LL - let x: &usize = &mut{0}; +LL + let x: &mut usize = &mut{0}; + | error[E0594]: cannot assign to `*y`, which is behind a `&` reference --> $DIR/issue-85765.rs:26:5 @@ -39,8 +41,9 @@ LL | *y = 1; | help: consider changing this binding's type | -LL | let y: &mut usize = &mut(0); - | ~~~~~~~~~~ +LL - let y: &usize = &mut(0); +LL + let y: &mut usize = &mut(0); + | error: aborting due to 4 previous errors diff --git a/tests/ui/borrowck/issue-93093.stderr b/tests/ui/borrowck/issue-93093.stderr index b6a2768b61da3..422b3c1d12859 100644 --- a/tests/ui/borrowck/issue-93093.stderr +++ b/tests/ui/borrowck/issue-93093.stderr @@ -6,8 +6,9 @@ LL | self.foo += 1; | help: consider changing this to be a mutable reference | -LL | async fn bar(&mut self) { - | ~~~~~~~~~ +LL - async fn bar(&self) { +LL + async fn bar(&mut self) { + | error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr b/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr index 28b4b4aa290d5..98fb49824ae93 100644 --- a/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr +++ b/tests/ui/borrowck/suggest-lt-on-ty-alias-w-generics.stderr @@ -12,8 +12,9 @@ LL | | }) | help: to declare that the trait object captures data from argument `x`, you can add a lifetime parameter `'a` in the type alias | -LL | type Lazy<'a, T> = Box T + 'a>; - | +++ ~~ +LL - type Lazy = Box T + 'static>; +LL + type Lazy<'a, T> = Box T + 'a>; + | error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function --> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:14 diff --git a/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr b/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr index 5c70eccfbd35c..24719161a333d 100644 --- a/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr +++ b/tests/ui/borrowck/trait-impl-argument-difference-ice.stderr @@ -40,8 +40,9 @@ LL | let a16 = self.read_word() as u16; | help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition | -LL | extern "C" fn read_dword(&'_ mut self) -> u16 { - | ~~~~~~~~~~~~ +LL - extern "C" fn read_dword(&'_ self) -> u16 { +LL + extern "C" fn read_dword(&'_ mut self) -> u16 { + | error[E0596]: cannot borrow `*self` as mutable, as it is behind a `&` reference --> $DIR/trait-impl-argument-difference-ice.rs:18:19 @@ -51,8 +52,9 @@ LL | let b16 = self.read_word() as u16; | help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition | -LL | extern "C" fn read_dword(&'_ mut self) -> u16 { - | ~~~~~~~~~~~~ +LL - extern "C" fn read_dword(&'_ self) -> u16 { +LL + extern "C" fn read_dword(&'_ mut self) -> u16 { + | error: aborting due to 5 previous errors; 1 warning emitted diff --git a/tests/ui/borrowck/unmatched-arg-and-hir-arg-issue-126385.stderr b/tests/ui/borrowck/unmatched-arg-and-hir-arg-issue-126385.stderr index 0ae301b2090ac..a18c4e7271949 100644 --- a/tests/ui/borrowck/unmatched-arg-and-hir-arg-issue-126385.stderr +++ b/tests/ui/borrowck/unmatched-arg-and-hir-arg-issue-126385.stderr @@ -16,8 +16,9 @@ LL | impl MyStruct<'_> { | ----------------- `Self` is on type `MyStruct` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `MyStruct` instead if you want to specify its type parameters | -LL | pub fn f(field: &[u32]) -> MyStruct { - | ~~~~~~~~ +LL - pub fn f(field: &[u32]) -> Self { +LL + pub fn f(field: &[u32]) -> MyStruct { + | error: lifetime may not live long enough --> $DIR/unmatched-arg-and-hir-arg-issue-126385.rs:10:9 diff --git a/tests/ui/btreemap/btreemap-index-mut-2.stderr b/tests/ui/btreemap/btreemap-index-mut-2.stderr index 0b8c77cb9e104..0a12c652b99b7 100644 --- a/tests/ui/btreemap/btreemap-index-mut-2.stderr +++ b/tests/ui/btreemap/btreemap-index-mut-2.stderr @@ -7,12 +7,15 @@ LL | map[&0] = 1; = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `BTreeMap` help: to modify a `BTreeMap`, use `.get_mut()`, `.insert()` or the entry API | -LL | map.insert(&0, 1); - | ~~~~~~~~ ~ + -LL | map.get_mut(&0).map(|val| { *val = 1; }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ -LL | let val = map.entry(&0).or_insert(1); - | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + +LL - map[&0] = 1; +LL + map.insert(&0, 1); + | +LL - map[&0] = 1; +LL + map.get_mut(&0).map(|val| { *val = 1; }); + | +LL - map[&0] = 1; +LL + let val = map.entry(&0).or_insert(1); + | error: aborting due to 1 previous error diff --git a/tests/ui/btreemap/btreemap-index-mut.stderr b/tests/ui/btreemap/btreemap-index-mut.stderr index cc465fbf3def8..50be31fc351b7 100644 --- a/tests/ui/btreemap/btreemap-index-mut.stderr +++ b/tests/ui/btreemap/btreemap-index-mut.stderr @@ -7,12 +7,15 @@ LL | map[&0] = 1; = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `BTreeMap` help: to modify a `BTreeMap`, use `.get_mut()`, `.insert()` or the entry API | -LL | map.insert(&0, 1); - | ~~~~~~~~ ~ + -LL | map.get_mut(&0).map(|val| { *val = 1; }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ -LL | let val = map.entry(&0).or_insert(1); - | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + +LL - map[&0] = 1; +LL + map.insert(&0, 1); + | +LL - map[&0] = 1; +LL + map.get_mut(&0).map(|val| { *val = 1; }); + | +LL - map[&0] = 1; +LL + let val = map.entry(&0).or_insert(1); + | error: aborting due to 1 previous error diff --git a/tests/ui/c-variadic/issue-86053-1.stderr b/tests/ui/c-variadic/issue-86053-1.stderr index 67a619e46d57d..4ad3b73fd661a 100644 --- a/tests/ui/c-variadic/issue-86053-1.stderr +++ b/tests/ui/c-variadic/issue-86053-1.stderr @@ -63,8 +63,9 @@ LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize | help: a trait with a similar name exists | -LL | self , ... , self , self , ... ) where Fn : FnOnce ( & 'a & 'b usize ) { - | ~~ +LL - self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { +LL + self , ... , self , self , ... ) where Fn : FnOnce ( & 'a & 'b usize ) { + | help: you might be missing a type parameter | LL | fn ordering4 < 'a , 'b, F > ( a : , self , self , self , diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr index 72d60a1439afc..f4a401f14d317 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.stderr +++ b/tests/ui/c-variadic/variadic-ffi-1.stderr @@ -17,8 +17,9 @@ LL | fn foo(f: isize, x: u8, ...); | ^^^ help: provide the arguments | -LL | foo(/* isize */, /* u8 */); - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - foo(); +LL + foo(/* isize */, /* u8 */); + | error[E0060]: this function takes at least 2 arguments but 1 argument was supplied --> $DIR/variadic-ffi-1.rs:23:9 @@ -33,8 +34,9 @@ LL | fn foo(f: isize, x: u8, ...); | ^^^ help: provide the argument | -LL | foo(1, /* u8 */); - | ~~~~~~~~~~~~~ +LL - foo(1); +LL + foo(1, /* u8 */); + | error[E0308]: mismatched types --> $DIR/variadic-ffi-1.rs:25:56 diff --git a/tests/ui/cast/cast-as-bool.stderr b/tests/ui/cast/cast-as-bool.stderr index 4ff56a95e49a3..b2c9ae5c6ad61 100644 --- a/tests/ui/cast/cast-as-bool.stderr +++ b/tests/ui/cast/cast-as-bool.stderr @@ -6,8 +6,9 @@ LL | let u = 5 as bool; | help: compare with zero instead | -LL | let u = 5 != 0; - | ~~~~ +LL - let u = 5 as bool; +LL + let u = 5 != 0; + | error[E0054]: cannot cast `i32` as `bool` --> $DIR/cast-as-bool.rs:6:13 @@ -17,8 +18,9 @@ LL | let t = (1 + 2) as bool; | help: compare with zero instead | -LL | let t = (1 + 2) != 0; - | ~~~~ +LL - let t = (1 + 2) as bool; +LL + let t = (1 + 2) != 0; + | error[E0054]: cannot cast `u32` as `bool` --> $DIR/cast-as-bool.rs:10:13 @@ -28,8 +30,9 @@ LL | let _ = 5_u32 as bool; | help: compare with zero instead | -LL | let _ = 5_u32 != 0; - | ~~~~ +LL - let _ = 5_u32 as bool; +LL + let _ = 5_u32 != 0; + | error[E0054]: cannot cast `f64` as `bool` --> $DIR/cast-as-bool.rs:13:13 @@ -39,8 +42,9 @@ LL | let _ = 64.0_f64 as bool; | help: compare with zero instead | -LL | let _ = 64.0_f64 != 0; - | ~~~~ +LL - let _ = 64.0_f64 as bool; +LL + let _ = 64.0_f64 != 0; + | error[E0054]: cannot cast `IntEnum` as `bool` --> $DIR/cast-as-bool.rs:24:13 @@ -86,8 +90,9 @@ LL | let v = "hello" as bool; | help: consider using the `is_empty` method on `&'static str` to determine if it contains anything | -LL | let v = !"hello".is_empty(); - | + ~~~~~~~~~~~ +LL - let v = "hello" as bool; +LL + let v = !"hello".is_empty(); + | error: aborting due to 11 previous errors diff --git a/tests/ui/cast/cast-rfc0401-2.stderr b/tests/ui/cast/cast-rfc0401-2.stderr index b7fb420533e65..f2956cdfa3356 100644 --- a/tests/ui/cast/cast-rfc0401-2.stderr +++ b/tests/ui/cast/cast-rfc0401-2.stderr @@ -6,8 +6,9 @@ LL | let _ = 3 as bool; | help: compare with zero instead | -LL | let _ = 3 != 0; - | ~~~~ +LL - let _ = 3 as bool; +LL + let _ = 3 != 0; + | error: aborting due to 1 previous error diff --git a/tests/ui/cast/ice-cast-type-with-error-124848.stderr b/tests/ui/cast/ice-cast-type-with-error-124848.stderr index 1e2adcc7d9ee1..402ee27386ddd 100644 --- a/tests/ui/cast/ice-cast-type-with-error-124848.stderr +++ b/tests/ui/cast/ice-cast-type-with-error-124848.stderr @@ -48,8 +48,9 @@ LL | struct MyType<'a>(Cell>>, Pin); | ^^^^^^ help: provide the argument | -LL | let mut unpinned = MyType(Cell::new(None), /* value */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let mut unpinned = MyType(Cell::new(None)); +LL + let mut unpinned = MyType(Cell::new(None), /* value */); + | error[E0606]: casting `&MyType<'_>` as `*const Cell>>` is invalid --> $DIR/ice-cast-type-with-error-124848.rs:14:20 diff --git a/tests/ui/cast/issue-106883-is-empty.stderr b/tests/ui/cast/issue-106883-is-empty.stderr index 7115c7704ca29..5ebabc9ed8378 100644 --- a/tests/ui/cast/issue-106883-is-empty.stderr +++ b/tests/ui/cast/issue-106883-is-empty.stderr @@ -6,8 +6,9 @@ LL | let _ = "foo" as bool; | help: consider using the `is_empty` method on `&'static str` to determine if it contains anything | -LL | let _ = !"foo".is_empty(); - | + ~~~~~~~~~~~ +LL - let _ = "foo" as bool; +LL + let _ = !"foo".is_empty(); + | error[E0605]: non-primitive cast: `String` as `bool` --> $DIR/issue-106883-is-empty.rs:17:13 @@ -22,8 +23,9 @@ LL | let _ = String::from("foo") as bool; | ^^^^^^^^^^^^^^^^^^^ help: consider using the `is_empty` method on `String` to determine if it contains anything | -LL | let _ = !String::from("foo").is_empty(); - | + ~~~~~~~~~~~ +LL - let _ = String::from("foo") as bool; +LL + let _ = !String::from("foo").is_empty(); + | error[E0605]: non-primitive cast: `Foo` as `bool` --> $DIR/issue-106883-is-empty.rs:20:13 @@ -38,8 +40,9 @@ LL | let _ = Foo as bool; | ^^^ help: consider using the `is_empty` method on `Foo` to determine if it contains anything | -LL | let _ = !Foo.is_empty(); - | + ~~~~~~~~~~~ +LL - let _ = Foo as bool; +LL + let _ = !Foo.is_empty(); + | error[E0606]: casting `&[i32]` as `bool` is invalid --> $DIR/issue-106883-is-empty.rs:25:5 @@ -49,8 +52,9 @@ LL | bar as bool | help: consider using the `is_empty` method on `&[i32]` to determine if it contains anything | -LL | !bar.is_empty() - | + ~~~~~~~~~~~ +LL - bar as bool +LL + !bar.is_empty() + | error: aborting due to 4 previous errors diff --git a/tests/ui/cfg/cfg-method-receiver.stderr b/tests/ui/cfg/cfg-method-receiver.stderr index 5767a7c1b4b1c..639413b90faa3 100644 --- a/tests/ui/cfg/cfg-method-receiver.stderr +++ b/tests/ui/cfg/cfg-method-receiver.stderr @@ -16,8 +16,9 @@ LL | cbor_map! { #[cfg(test)] 4}; = note: this error originates in the macro `cbor_map` (in Nightly builds, run with -Z macro-backtrace for more info) help: you must specify a concrete type for this numeric value, like `i32` | -LL | cbor_map! { #[cfg(test)] 4_i32}; - | ~~~~~ +LL - cbor_map! { #[cfg(test)] 4}; +LL + cbor_map! { #[cfg(test)] 4_i32}; + | error: aborting due to 2 previous errors diff --git a/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr b/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr index 6db1144eada41..4224f5c08514e 100644 --- a/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr +++ b/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr @@ -10,12 +10,14 @@ LL | #[cfg(my_value)] = note: `#[warn(unexpected_cfgs)]` on by default help: found config with similar value | -LL | #[cfg(foo = "my_value")] - | ~~~~~~~~~~~~~~~~ +LL - #[cfg(my_value)] +LL + #[cfg(foo = "my_value")] + | help: found config with similar value | -LL | #[cfg(bar = "my_value")] - | ~~~~~~~~~~~~~~~~ +LL - #[cfg(my_value)] +LL + #[cfg(bar = "my_value")] + | warning: 1 warning emitted diff --git a/tests/ui/check-cfg/diagnotics.cargo.stderr b/tests/ui/check-cfg/diagnotics.cargo.stderr index a440ccaaf584a..ab7111eca24ce 100644 --- a/tests/ui/check-cfg/diagnotics.cargo.stderr +++ b/tests/ui/check-cfg/diagnotics.cargo.stderr @@ -17,8 +17,9 @@ LL | #[cfg(featur = "foo")] = note: see for more information about checking conditional configuration help: there is a config with a similar name and value | -LL | #[cfg(feature = "foo")] - | ~~~~~~~ +LL - #[cfg(featur = "foo")] +LL + #[cfg(feature = "foo")] + | warning: unexpected `cfg` condition name: `featur` --> $DIR/diagnotics.rs:17:7 @@ -30,8 +31,9 @@ LL | #[cfg(featur = "fo")] = note: see for more information about checking conditional configuration help: there is a config with a similar name and different values | -LL | #[cfg(feature = "foo")] - | ~~~~~~~~~~~~~~~ +LL - #[cfg(featur = "fo")] +LL + #[cfg(feature = "foo")] + | warning: unexpected `cfg` condition name: `no_value` --> $DIR/diagnotics.rs:24:7 @@ -60,8 +62,9 @@ LL | #[cfg(no_value = "foo")] = note: see for more information about checking conditional configuration help: there is a config with a similar name and no value | -LL | #[cfg(no_values)] - | ~~~~~~~~~ +LL - #[cfg(no_value = "foo")] +LL + #[cfg(no_values)] + | warning: unexpected `cfg` condition value: `bar` --> $DIR/diagnotics.rs:32:7 diff --git a/tests/ui/check-cfg/diagnotics.rustc.stderr b/tests/ui/check-cfg/diagnotics.rustc.stderr index 6868be482d87f..4aae1f00e7067 100644 --- a/tests/ui/check-cfg/diagnotics.rustc.stderr +++ b/tests/ui/check-cfg/diagnotics.rustc.stderr @@ -19,8 +19,9 @@ LL | #[cfg(featur = "foo")] = note: see for more information about checking conditional configuration help: there is a config with a similar name and value | -LL | #[cfg(feature = "foo")] - | ~~~~~~~ +LL - #[cfg(featur = "foo")] +LL + #[cfg(feature = "foo")] + | warning: unexpected `cfg` condition name: `featur` --> $DIR/diagnotics.rs:17:7 @@ -33,8 +34,9 @@ LL | #[cfg(featur = "fo")] = note: see for more information about checking conditional configuration help: there is a config with a similar name and different values | -LL | #[cfg(feature = "foo")] - | ~~~~~~~~~~~~~~~ +LL - #[cfg(featur = "fo")] +LL + #[cfg(feature = "foo")] + | warning: unexpected `cfg` condition name: `no_value` --> $DIR/diagnotics.rs:24:7 @@ -55,8 +57,9 @@ LL | #[cfg(no_value = "foo")] = note: see for more information about checking conditional configuration help: there is a config with a similar name and no value | -LL | #[cfg(no_values)] - | ~~~~~~~~~ +LL - #[cfg(no_value = "foo")] +LL + #[cfg(no_values)] + | warning: unexpected `cfg` condition value: `bar` --> $DIR/diagnotics.rs:32:7 diff --git a/tests/ui/check-cfg/well-known-names.stderr b/tests/ui/check-cfg/well-known-names.stderr index 41130210df1ec..7771c5177837b 100644 --- a/tests/ui/check-cfg/well-known-names.stderr +++ b/tests/ui/check-cfg/well-known-names.stderr @@ -9,8 +9,9 @@ LL | #[cfg(target_oz = "linux")] = note: `#[warn(unexpected_cfgs)]` on by default help: there is a config with a similar name and value | -LL | #[cfg(target_os = "linux")] - | ~~~~~~~~~ +LL - #[cfg(target_oz = "linux")] +LL + #[cfg(target_os = "linux")] + | warning: unexpected `cfg` condition name: `features` --> $DIR/well-known-names.rs:14:7 diff --git a/tests/ui/closures/issue-78720.stderr b/tests/ui/closures/issue-78720.stderr index 5d65c87b0fd61..acce1dc191a2b 100644 --- a/tests/ui/closures/issue-78720.stderr +++ b/tests/ui/closures/issue-78720.stderr @@ -15,8 +15,9 @@ LL | _func: F, | help: a trait with a similar name exists | -LL | _func: Fn, - | ~~ +LL - _func: F, +LL + _func: Fn, + | help: you might be missing a type parameter | LL | struct Map2 { diff --git a/tests/ui/closures/multiple-fn-bounds.stderr b/tests/ui/closures/multiple-fn-bounds.stderr index 861b39b4d076e..9b824fa0eefbd 100644 --- a/tests/ui/closures/multiple-fn-bounds.stderr +++ b/tests/ui/closures/multiple-fn-bounds.stderr @@ -21,8 +21,9 @@ LL | fn foo bool + Fn(char) -> bool>(f: F) { | ^^^^^^^^^^^^^^^^ required by this bound in `foo` help: consider adjusting the signature so it does not borrow its argument | -LL | foo(move |char| v); - | ~~~~ +LL - foo(move |x| v); +LL + foo(move |char| v); + | error: aborting due to 1 previous error diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr index fa68d95218ccd..c9e935098566f 100644 --- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr @@ -14,8 +14,9 @@ LL | f1: extern "C-cmse-nonsecure-call" fn(U, u32, u32, u32) -> u64 | help: a type parameter with a similar name exists | -LL | f1: extern "C-cmse-nonsecure-call" fn(T, u32, u32, u32) -> u64, - | ~ +LL - f1: extern "C-cmse-nonsecure-call" fn(U, u32, u32, u32) -> u64, +LL + f1: extern "C-cmse-nonsecure-call" fn(T, u32, u32, u32) -> u64, + | help: you might be missing a type parameter | LL | struct Test { diff --git a/tests/ui/codemap_tests/two_files.stderr b/tests/ui/codemap_tests/two_files.stderr index d833d4944bfe9..64df1429a7c61 100644 --- a/tests/ui/codemap_tests/two_files.stderr +++ b/tests/ui/codemap_tests/two_files.stderr @@ -6,8 +6,9 @@ LL | impl Bar for Baz { } | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias --> $DIR/two_files_data.rs:5:1 - | -LL | trait Bar = dyn Foo; + +LL - type Bar = dyn Foo; +LL + trait Bar = dyn Foo; | error: aborting due to 1 previous error diff --git a/tests/ui/compare-method/bad-self-type.stderr b/tests/ui/compare-method/bad-self-type.stderr index a3a31f4344717..f662b5a11cb39 100644 --- a/tests/ui/compare-method/bad-self-type.stderr +++ b/tests/ui/compare-method/bad-self-type.stderr @@ -8,8 +8,9 @@ LL | fn poll(self, _: &mut Context<'_>) -> Poll<()> { found signature `fn(MyFuture, &mut Context<'_>) -> Poll<_>` help: change the self-receiver type to match the trait | -LL | fn poll(self: Pin<&mut MyFuture>, _: &mut Context<'_>) -> Poll<()> { - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn poll(self, _: &mut Context<'_>) -> Poll<()> { +LL + fn poll(self: Pin<&mut MyFuture>, _: &mut Context<'_>) -> Poll<()> { + | error[E0053]: method `foo` has an incompatible type for trait --> $DIR/bad-self-type.rs:22:18 @@ -26,8 +27,9 @@ LL | fn foo(self); found signature `fn(Box)` help: change the self-receiver type to match the trait | -LL | fn foo(self) {} - | ~~~~ +LL - fn foo(self: Box) {} +LL + fn foo(self) {} + | error[E0053]: method `bar` has an incompatible type for trait --> $DIR/bad-self-type.rs:24:17 diff --git a/tests/ui/compare-method/issue-90444.stderr b/tests/ui/compare-method/issue-90444.stderr index f05c9939c0096..c69d63b3e30bc 100644 --- a/tests/ui/compare-method/issue-90444.stderr +++ b/tests/ui/compare-method/issue-90444.stderr @@ -8,8 +8,9 @@ LL | fn from(_: fn((), (), &mut ())) -> Self { found signature `fn(for<'a> fn((), (), &'a mut ())) -> A` help: change the parameter type to match the trait | -LL | fn from(_: for<'a> fn((), (), &'a ())) -> Self { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn from(_: fn((), (), &mut ())) -> Self { +LL + fn from(_: for<'a> fn((), (), &'a ())) -> Self { + | error[E0053]: method `from` has an incompatible type for trait --> $DIR/issue-90444.rs:11:16 @@ -21,8 +22,9 @@ LL | fn from(_: fn((), (), u64)) -> Self { found signature `fn(fn((), (), u64)) -> B` help: change the parameter type to match the trait | -LL | fn from(_: fn((), (), u32)) -> Self { - | ~~~~~~~~~~~~~~~ +LL - fn from(_: fn((), (), u64)) -> Self { +LL + fn from(_: fn((), (), u32)) -> Self { + | error: aborting due to 2 previous errors diff --git a/tests/ui/compare-method/region-extra-2.stderr b/tests/ui/compare-method/region-extra-2.stderr index 3f55f67311763..d19d4f28f12a9 100644 --- a/tests/ui/compare-method/region-extra-2.stderr +++ b/tests/ui/compare-method/region-extra-2.stderr @@ -9,8 +9,9 @@ LL | fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b { | help: copy the `where` clause predicates from the trait | -LL | fn renew<'b: 'a>(self) -> &'b mut [T] where 'b: 'a { - | ~~~~~~~~~~~~ +LL - fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b { +LL + fn renew<'b: 'a>(self) -> &'b mut [T] where 'b: 'a { + | error: aborting due to 1 previous error diff --git a/tests/ui/compare-method/reordered-type-param.stderr b/tests/ui/compare-method/reordered-type-param.stderr index 1e8266e213d7f..536364871a368 100644 --- a/tests/ui/compare-method/reordered-type-param.stderr +++ b/tests/ui/compare-method/reordered-type-param.stderr @@ -18,8 +18,9 @@ LL | fn b(&self, x: C) -> C; = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters help: change the parameter type to match the trait | -LL | fn b(&self, _x: F) -> G { panic!() } - | ~ +LL - fn b(&self, _x: G) -> G { panic!() } +LL + fn b(&self, _x: F) -> G { panic!() } + | error: aborting due to 1 previous error diff --git a/tests/ui/conditional-compilation/cfg-attr-parse.stderr b/tests/ui/conditional-compilation/cfg-attr-parse.stderr index 759df3c90c6f3..1605761e59195 100644 --- a/tests/ui/conditional-compilation/cfg-attr-parse.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-parse.stderr @@ -7,8 +7,9 @@ LL | #[cfg_attr()] = note: for more information, visit help: missing condition and attribute | -LL | #[cfg_attr(condition, attribute, other_attribute, ...)] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - #[cfg_attr()] +LL + #[cfg_attr(condition, attribute, other_attribute, ...)] + | error: expected `,`, found end of `cfg_attr` input --> $DIR/cfg-attr-parse.rs:8:17 @@ -54,8 +55,9 @@ LL | #[cfg_attr[all(),,]] | help: the delimiters should be `(` and `)` | -LL | #[cfg_attr(all(),,)] - | ~ ~ +LL - #[cfg_attr[all(),,]] +LL + #[cfg_attr(all(),,)] + | error: expected identifier, found `,` --> $DIR/cfg-attr-parse.rs:44:18 @@ -74,8 +76,9 @@ LL | #[cfg_attr{all(),,}] | help: the delimiters should be `(` and `)` | -LL | #[cfg_attr(all(),,)] - | ~ ~ +LL - #[cfg_attr{all(),,}] +LL + #[cfg_attr(all(),,)] + | error: expected identifier, found `,` --> $DIR/cfg-attr-parse.rs:50:18 diff --git a/tests/ui/confuse-field-and-method/issue-33784.stderr b/tests/ui/confuse-field-and-method/issue-33784.stderr index 8acd1f8ff1ee9..d984e4f37da01 100644 --- a/tests/ui/confuse-field-and-method/issue-33784.stderr +++ b/tests/ui/confuse-field-and-method/issue-33784.stderr @@ -10,8 +10,9 @@ LL | (p.closure)(); | + + help: there is a method `clone` with a similar name | -LL | p.clone(); - | ~~~~~ +LL - p.closure(); +LL + p.clone(); + | error[E0599]: no method named `fn_ptr` found for reference `&&Obj<{closure@$DIR/issue-33784.rs:25:43: 25:45}>` in the current scope --> $DIR/issue-33784.rs:29:7 diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_object_safety.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_object_safety.stderr index ba38f63d5df7b..a5c14a0b43870 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_object_safety.stderr +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_object_safety.stderr @@ -10,8 +10,9 @@ note: for a trait to be "object safe" it needs to allow building a vtable to all = note: the trait cannot be made into an object because it uses `Self` as a type parameter help: consider using an opaque type instead | -LL | fn foo(a: &impl ConstParamTy_) {} - | ~~~~ +LL - fn foo(a: &dyn ConstParamTy_) {} +LL + fn foo(a: &impl ConstParamTy_) {} + | error[E0038]: the trait `UnsizedConstParamTy` cannot be made into an object --> $DIR/const_param_ty_object_safety.rs:9:12 @@ -25,8 +26,9 @@ note: for a trait to be "object safe" it needs to allow building a vtable to all = note: the trait cannot be made into an object because it uses `Self` as a type parameter help: consider using an opaque type instead | -LL | fn bar(a: &impl UnsizedConstParamTy) {} - | ~~~~ +LL - fn bar(a: &dyn UnsizedConstParamTy) {} +LL + fn bar(a: &impl UnsizedConstParamTy) {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/early/invalid-const-arguments.stderr b/tests/ui/const-generics/early/invalid-const-arguments.stderr index cee34e3b71593..86b4d006454f7 100644 --- a/tests/ui/const-generics/early/invalid-const-arguments.stderr +++ b/tests/ui/const-generics/early/invalid-const-arguments.stderr @@ -9,8 +9,9 @@ LL | impl Foo for A {} | help: a struct with a similar name exists | -LL | impl Foo for A {} - | ~ +LL - impl Foo for A {} +LL + impl Foo for A {} + | help: you might be missing a type parameter | LL | impl Foo for A {} @@ -27,8 +28,9 @@ LL | impl Foo for C {} | help: a struct with a similar name exists | -LL | impl Foo for C {} - | ~ +LL - impl Foo for C {} +LL + impl Foo for C {} + | help: you might be missing a type parameter | LL | impl Foo for C {} diff --git a/tests/ui/const-generics/ensure_is_evaluatable.stderr b/tests/ui/const-generics/ensure_is_evaluatable.stderr index 62f8bc34f2edd..397902846ecb0 100644 --- a/tests/ui/const-generics/ensure_is_evaluatable.stderr +++ b/tests/ui/const-generics/ensure_is_evaluatable.stderr @@ -14,8 +14,9 @@ LL | [(); N + 1]:, | ^^^^^ required by this bound in `bar` help: try adding a `where` bound | -LL | [(); M + 1]:, [(); N + 1]: - | ~~~~~~~~~~~~~~ +LL - [(); M + 1]:, +LL + [(); M + 1]:, [(); N + 1]: + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/fn_with_two_const_inputs.stderr b/tests/ui/const-generics/fn_with_two_const_inputs.stderr index c0a913a21fd2d..147a2c91fd075 100644 --- a/tests/ui/const-generics/fn_with_two_const_inputs.stderr +++ b/tests/ui/const-generics/fn_with_two_const_inputs.stderr @@ -14,8 +14,9 @@ LL | [(); N + 1]:, | ^^^^^ required by this bound in `bar` help: try adding a `where` bound | -LL | [(); both(N + 1, M + 1)]:, [(); N + 1]: - | ~~~~~~~~~~~~~~ +LL - [(); both(N + 1, M + 1)]:, +LL + [(); both(N + 1, M + 1)]:, [(); N + 1]: + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/forbid-non-structural_match-types.stderr b/tests/ui/const-generics/forbid-non-structural_match-types.stderr index 94afded9469e8..8ef629329f103 100644 --- a/tests/ui/const-generics/forbid-non-structural_match-types.stderr +++ b/tests/ui/const-generics/forbid-non-structural_match-types.stderr @@ -6,8 +6,8 @@ LL | struct D; | help: add `#[derive(ConstParamTy, PartialEq, Eq)]` to the struct | +LL - struct C; LL + #[derive(ConstParamTy, PartialEq, Eq)] -LL | struct C; | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr b/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr index 3622ef16a9608..9cb71ad8a0966 100644 --- a/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr +++ b/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr @@ -16,8 +16,9 @@ LL | fn assert_impl() {} | ^^^^^ required by this bound in `assert_impl` help: try adding a `where` bound | -LL | EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - EvaluatableU128<{N as u128}>:, { +LL + EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: { + | error[E0308]: mismatched types --> $DIR/abstract-const-as-cast-3.rs:17:5 @@ -51,8 +52,9 @@ LL | fn assert_impl() {} | ^^^^^ required by this bound in `assert_impl` help: try adding a `where` bound | -LL | EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - EvaluatableU128<{N as u128}>:, { +LL + EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: { + | error[E0308]: mismatched types --> $DIR/abstract-const-as-cast-3.rs:20:5 @@ -114,8 +116,9 @@ LL | fn assert_impl() {} | ^^^^^ required by this bound in `assert_impl` help: try adding a `where` bound | -LL | EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - EvaluatableU128<{N as _}>:, { +LL + EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: { + | error[E0308]: mismatched types --> $DIR/abstract-const-as-cast-3.rs:35:5 @@ -149,8 +152,9 @@ LL | fn assert_impl() {} | ^^^^^ required by this bound in `assert_impl` help: try adding a `where` bound | -LL | EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - EvaluatableU128<{N as _}>:, { +LL + EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: { + | error[E0308]: mismatched types --> $DIR/abstract-const-as-cast-3.rs:38:5 diff --git a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr index f3a38fcc00544..b43ce5eca4359 100644 --- a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr +++ b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr @@ -6,8 +6,9 @@ LL | bar::<{ T::ASSOC }>(); | help: try adding a `where` bound | -LL | fn foo() where [(); U::ASSOC]:, [(); { T::ASSOC }]: { - | ~~~~~~~~~~~~~~~~~~~~~ +LL - fn foo() where [(); U::ASSOC]:, { +LL + fn foo() where [(); U::ASSOC]:, [(); { T::ASSOC }]: { + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr index 4d1fb02b59e91..86e35e17a0771 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr @@ -26,8 +26,9 @@ LL | foo::<_, L>([(); L + 1 + L]); | help: try adding a `where` bound | -LL | [(); (L - 1) + 1 + L]:, [(); L + 1 + L]: - | ~~~~~~~~~~~~~~~~~~ +LL - [(); (L - 1) + 1 + L]:, +LL + [(); (L - 1) + 1 + L]:, [(); L + 1 + L]: + | error: unconstrained generic constant --> $DIR/issue_114151.rs:17:17 diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr index 99eab935a094c..c63a79e64ed94 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr @@ -15,8 +15,9 @@ LL | foo::<_, L>([(); L + 1 + L]); | help: try adding a `where` bound | -LL | [(); (L - 1) + 1 + L]:, [(); L + 1 + L]: - | ~~~~~~~~~~~~~~~~~~ +LL - [(); (L - 1) + 1 + L]:, +LL + [(); (L - 1) + 1 + L]:, [(); L + 1 + L]: + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr index 416a938112424..5c10120325d9c 100644 --- a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr +++ b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr @@ -9,8 +9,9 @@ LL | let f: F = async { 1 }; | help: a trait with a similar name exists | -LL | let f: Fn = async { 1 }; - | ~~ +LL - let f: F = async { 1 }; +LL + let f: Fn = async { 1 }; + | help: you might be missing a type parameter | LL | fn f( @@ -67,8 +68,9 @@ LL | ) -> impl Iterator { | +++ help: you might have meant to write a bound here | -LL | ) -> impl Iterator { - | ~ +LL - ) -> impl Iterator { +LL + ) -> impl Iterator { + | error: aborting due to 5 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr index 7a9572d000d5a..5166ce7ba8c14 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr @@ -17,8 +17,9 @@ LL | self.0.iter_mut() | help: consider changing this to be a mutable reference | -LL | fn a(&mut self) -> impl Iterator { - | ~~~~~~~~~ +LL - fn a(&self) -> impl Iterator { +LL + fn a(&mut self) -> impl Iterator { + | error[E0700]: hidden type for `impl Iterator` captures lifetime that does not appear in bounds --> $DIR/issue-109141.rs:6:9 diff --git a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr index db93bcca60fb3..e81929fd6c1fa 100644 --- a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr @@ -15,8 +15,8 @@ LL | struct Evaluatable; | help: add `#[derive(ConstParamTy)]` to the struct | +LL - struct Foo(u8); LL + #[derive(ConstParamTy)] -LL | struct Foo(u8); | error[E0284]: type annotations needed: cannot normalize `foo::{constant#0}` @@ -33,8 +33,8 @@ LL | fn foo(a: Evaluatable<{ N + N }>) { | help: add `#[derive(ConstParamTy)]` to the struct | +LL - struct Foo(u8); LL + #[derive(ConstParamTy)] -LL | struct Foo(u8); | error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter @@ -45,8 +45,8 @@ LL | fn bar() {} | help: add `#[derive(ConstParamTy)]` to the struct | +LL - struct Foo(u8); LL + #[derive(ConstParamTy)] -LL | struct Foo(u8); | error[E0284]: type annotations needed: cannot normalize `foo2::{constant#0}` diff --git a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr index 4004ad1903258..2b4c7f4bcff86 100644 --- a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr +++ b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr @@ -6,8 +6,9 @@ LL | let _: u32 = 5i32.try_into::<32>().unwrap(); | help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument | -LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: u32 = 5i32.try_into::<32>().unwrap(); +LL + let _: u32 = TryInto::<32>::try_into(5i32).unwrap(); + | help: remove the unnecessary generics | LL - let _: u32 = 5i32.try_into::<32>().unwrap(); diff --git a/tests/ui/const-generics/issue-80471.stderr b/tests/ui/const-generics/issue-80471.stderr index a8514c5cc0746..8cf3d68e5d691 100644 --- a/tests/ui/const-generics/issue-80471.stderr +++ b/tests/ui/const-generics/issue-80471.stderr @@ -6,8 +6,8 @@ LL | fn foo() {} | help: add `#[derive(ConstParamTy)]` to the struct | +LL - enum Nat { LL + #[derive(ConstParamTy)] -LL | enum Nat { | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-87493.stderr b/tests/ui/const-generics/issues/issue-87493.stderr index 73bd6ed73e674..42d32a0ee0502 100644 --- a/tests/ui/const-generics/issues/issue-87493.stderr +++ b/tests/ui/const-generics/issues/issue-87493.stderr @@ -6,8 +6,9 @@ LL | T: MyTrait, | help: if you meant to use an associated type binding, replace `==` with `=` | -LL | T: MyTrait, - | ~ +LL - T: MyTrait, +LL + T: MyTrait, + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-87493.rs:8:8 diff --git a/tests/ui/const-generics/issues/issue-97278.stderr b/tests/ui/const-generics/issues/issue-97278.stderr index 47e6bf1df4d16..4894ddb7b8db8 100644 --- a/tests/ui/const-generics/issues/issue-97278.stderr +++ b/tests/ui/const-generics/issues/issue-97278.stderr @@ -6,8 +6,8 @@ LL | fn test() {} | help: add `#[derive(ConstParamTy)]` to the struct | +LL - enum Bar { LL + #[derive(ConstParamTy)] -LL | enum Bar { | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/legacy-const-generics-bad.stderr b/tests/ui/const-generics/legacy-const-generics-bad.stderr index e9ea22e472c18..3a5fa417075ab 100644 --- a/tests/ui/const-generics/legacy-const-generics-bad.stderr +++ b/tests/ui/const-generics/legacy-const-generics-bad.stderr @@ -6,8 +6,9 @@ LL | legacy_const_generics::foo(0, a, 2); | help: consider using `const` instead of `let` | -LL | const a: /* Type */ = 1; - | ~~~~~ ++++++++++++ +LL - let a = 1; +LL + const a: /* Type */ = 1; + | error: generic parameters may not be used in const operations --> $DIR/legacy-const-generics-bad.rs:12:35 diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr index 78cddcc234c6e..d435af07db2ae 100644 --- a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr +++ b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr @@ -16,8 +16,9 @@ LL | impl Foo for Bar { | help: to use `3` as a generic argument specify it directly | -LL | impl Foo<3> for Bar { - | ~ +LL - impl Foo for Bar { +LL + impl Foo<3> for Bar { + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr b/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr index 387eb226e70ed..f852c14b17842 100644 --- a/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr +++ b/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr @@ -28,8 +28,9 @@ LL | impl Foo for Bar { | help: to use `3` as a generic argument specify it directly | -LL | impl Foo<3> for Bar { - | ~ +LL - impl Foo for Bar { +LL + impl Foo<3> for Bar { + | error: aborting due to 3 previous errors diff --git a/tests/ui/const-generics/type-dependent/type-mismatch.full.stderr b/tests/ui/const-generics/type-dependent/type-mismatch.full.stderr index 4fce1aede954f..95d20de1b432e 100644 --- a/tests/ui/const-generics/type-dependent/type-mismatch.full.stderr +++ b/tests/ui/const-generics/type-dependent/type-mismatch.full.stderr @@ -6,8 +6,9 @@ LL | assert_eq!(R.method::<1u16>(), 1); | help: change the type of the numeric literal from `u16` to `u8` | -LL | assert_eq!(R.method::<1u8>(), 1); - | ~~ +LL - assert_eq!(R.method::<1u16>(), 1); +LL + assert_eq!(R.method::<1u8>(), 1); + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/type-dependent/type-mismatch.min.stderr b/tests/ui/const-generics/type-dependent/type-mismatch.min.stderr index 4fce1aede954f..95d20de1b432e 100644 --- a/tests/ui/const-generics/type-dependent/type-mismatch.min.stderr +++ b/tests/ui/const-generics/type-dependent/type-mismatch.min.stderr @@ -6,8 +6,9 @@ LL | assert_eq!(R.method::<1u16>(), 1); | help: change the type of the numeric literal from `u16` to `u8` | -LL | assert_eq!(R.method::<1u8>(), 1); - | ~~ +LL - assert_eq!(R.method::<1u16>(), 1); +LL + assert_eq!(R.method::<1u8>(), 1); + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/assoc-const-elided-lifetime.stderr b/tests/ui/consts/assoc-const-elided-lifetime.stderr index 3e847298c356a..0c3e455eb2ded 100644 --- a/tests/ui/consts/assoc-const-elided-lifetime.stderr +++ b/tests/ui/consts/assoc-const-elided-lifetime.stderr @@ -18,8 +18,9 @@ LL | #![deny(elided_lifetimes_in_associated_constant)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the `'static` lifetime | -LL | const FOO: Foo<'static> = Foo { x: PhantomData::<&()> }; - | ~~~~~~~ +LL - const FOO: Foo<'_> = Foo { x: PhantomData::<&()> }; +LL + const FOO: Foo<'static> = Foo { x: PhantomData::<&()> }; + | error: `&` without an explicit lifetime name cannot be used here --> $DIR/assoc-const-elided-lifetime.rs:14:16 diff --git a/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr b/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr index 9dce29732ac80..ddc064389aef8 100644 --- a/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr +++ b/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr @@ -13,8 +13,9 @@ LL | struct Bar; | help: create an inline `const` block | -LL | let _: [Option; 2] = [const { no_copy() }; 2]; - | ~~~~~~~~~~~~~~~~~~~ +LL - let _: [Option; 2] = [no_copy(); 2]; +LL + let _: [Option; 2] = [const { no_copy() }; 2]; + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/const_let_assign2.stderr b/tests/ui/consts/const_let_assign2.stderr index 87b94a7be67e2..df08683118415 100644 --- a/tests/ui/consts/const_let_assign2.stderr +++ b/tests/ui/consts/const_let_assign2.stderr @@ -10,8 +10,9 @@ LL | let ptr = unsafe { &mut BB }; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of_mut!` instead to create a raw pointer | -LL | let ptr = unsafe { addr_of_mut!(BB) }; - | ~~~~~~~~~~~~~ + +LL - let ptr = unsafe { &mut BB }; +LL + let ptr = unsafe { addr_of_mut!(BB) }; + | warning: 1 warning emitted diff --git a/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr b/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr index 115f168852058..4fc5972051c23 100644 --- a/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr +++ b/tests/ui/consts/ice-bad-input-type-for-cast-83056.stderr @@ -8,8 +8,9 @@ LL | fn f() -> T {} | help: a struct with a similar name exists | -LL | fn f() -> S {} - | ~ +LL - fn f() -> T {} +LL + fn f() -> S {} + | help: you might be missing a type parameter | LL | fn f() -> T {} diff --git a/tests/ui/consts/issue-3521.stderr b/tests/ui/consts/issue-3521.stderr index c0e4cdc5a94ce..bddab2ebc05dc 100644 --- a/tests/ui/consts/issue-3521.stderr +++ b/tests/ui/consts/issue-3521.stderr @@ -6,8 +6,9 @@ LL | Bar = foo | help: consider using `const` instead of `let` | -LL | const foo: isize = 100; - | ~~~~~ +LL - let foo: isize = 100; +LL + const foo: isize = 100; + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-91560.stderr b/tests/ui/consts/issue-91560.stderr index 37c8f50d49434..9b06f3775d9fe 100644 --- a/tests/ui/consts/issue-91560.stderr +++ b/tests/ui/consts/issue-91560.stderr @@ -6,8 +6,9 @@ LL | let arr = [0; length]; | help: consider using `const` instead of `let` | -LL | const length: usize = 2; - | ~~~~~ +LL - let mut length: usize = 2; +LL + const length: usize = 2; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/issue-91560.rs:17:19 @@ -17,8 +18,9 @@ LL | let arr = [0; length]; | help: consider using `const` instead of `let` | -LL | const length: usize = 2; - | ~~~~~ +LL - let length: usize = 2; +LL + const length: usize = 2; + | error: aborting due to 2 previous errors diff --git a/tests/ui/consts/non-const-value-in-const.stderr b/tests/ui/consts/non-const-value-in-const.stderr index 654b573544c2e..201c310843b38 100644 --- a/tests/ui/consts/non-const-value-in-const.stderr +++ b/tests/ui/consts/non-const-value-in-const.stderr @@ -6,8 +6,9 @@ LL | const Y: i32 = x; | help: consider using `let` instead of `const` | -LL | let Y: i32 = x; - | ~~~ +LL - const Y: i32 = x; +LL + let Y: i32 = x; + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/non-const-value-in-const.rs:6:17 @@ -17,8 +18,9 @@ LL | let _ = [0; x]; | help: consider using `const` instead of `let` | -LL | const x: /* Type */ = 5; - | ~~~~~ ++++++++++++ +LL - let x = 5; +LL + const x: /* Type */ = 5; + | error: aborting due to 2 previous errors diff --git a/tests/ui/consts/refs_check_const_eq-issue-88384.stderr b/tests/ui/consts/refs_check_const_eq-issue-88384.stderr index 62c5c52764115..65e4dc22c2887 100644 --- a/tests/ui/consts/refs_check_const_eq-issue-88384.stderr +++ b/tests/ui/consts/refs_check_const_eq-issue-88384.stderr @@ -15,8 +15,8 @@ LL | struct Foo; | help: add `#[derive(ConstParamTy)]` to the struct | +LL - struct CompileTimeSettings { LL + #[derive(ConstParamTy)] -LL | struct CompileTimeSettings { | error[E0741]: `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter @@ -27,8 +27,8 @@ LL | impl Foo { | help: add `#[derive(ConstParamTy)]` to the struct | +LL - struct CompileTimeSettings { LL + #[derive(ConstParamTy)] -LL | struct CompileTimeSettings { | error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/coroutine/issue-102645.stderr b/tests/ui/coroutine/issue-102645.stderr index 1ef37d3f7d100..bec0518d8c602 100644 --- a/tests/ui/coroutine/issue-102645.stderr +++ b/tests/ui/coroutine/issue-102645.stderr @@ -8,8 +8,9 @@ note: method defined here --> $SRC_DIR/core/src/ops/coroutine.rs:LL:COL help: provide the argument | -LL | Pin::new(&mut b).resume(()); - | ~~~~ +LL - Pin::new(&mut b).resume(); +LL + Pin::new(&mut b).resume(()); + | error: aborting due to 1 previous error diff --git a/tests/ui/coverage-attr/bad-syntax.stderr b/tests/ui/coverage-attr/bad-syntax.stderr index 2bcf54860eb89..72cf09f1676ee 100644 --- a/tests/ui/coverage-attr/bad-syntax.stderr +++ b/tests/ui/coverage-attr/bad-syntax.stderr @@ -6,10 +6,12 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage] +LL + #[coverage(off)] + | +LL - #[coverage] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:18:1 @@ -19,10 +21,12 @@ LL | #[coverage = true] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage = true] +LL + #[coverage(off)] + | +LL - #[coverage = true] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:21:1 @@ -32,10 +36,12 @@ LL | #[coverage()] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage()] +LL + #[coverage(off)] + | +LL - #[coverage()] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:24:1 @@ -45,10 +51,12 @@ LL | #[coverage(off, off)] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(off, off)] +LL + #[coverage(off)] + | +LL - #[coverage(off, off)] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:27:1 @@ -58,10 +66,12 @@ LL | #[coverage(off, on)] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(off, on)] +LL + #[coverage(off)] + | +LL - #[coverage(off, on)] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:30:1 @@ -71,10 +81,12 @@ LL | #[coverage(bogus)] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(bogus)] +LL + #[coverage(off)] + | +LL - #[coverage(bogus)] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:33:1 @@ -84,10 +96,12 @@ LL | #[coverage(bogus, off)] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(bogus, off)] +LL + #[coverage(off)] + | +LL - #[coverage(bogus, off)] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:36:1 @@ -97,10 +111,12 @@ LL | #[coverage(off, bogus)] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(off, bogus)] +LL + #[coverage(off)] + | +LL - #[coverage(off, bogus)] +LL + #[coverage(on)] + | error: expected identifier, found `,` --> $DIR/bad-syntax.rs:42:12 diff --git a/tests/ui/coverage-attr/name-value.stderr b/tests/ui/coverage-attr/name-value.stderr index 986467dda698e..51691020a36ba 100644 --- a/tests/ui/coverage-attr/name-value.stderr +++ b/tests/ui/coverage-attr/name-value.stderr @@ -6,9 +6,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -19,9 +21,11 @@ LL | #![coverage = "off"] | help: the following are the possible correct uses | -LL | #![coverage(off)] +LL - #![coverage = "off"] +LL + #![coverage(off)] | -LL | #![coverage(on)] +LL - #![coverage = "off"] +LL + #![coverage(on)] | error: malformed `coverage` attribute input @@ -32,9 +36,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -45,9 +51,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -58,9 +66,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -71,9 +81,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -84,9 +96,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -97,9 +111,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -110,9 +126,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -123,9 +141,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -136,9 +156,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -149,9 +171,11 @@ LL | #[coverage = "off"] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage = "off"] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage = "off"] +LL + #[coverage(on)] | error[E0788]: attribute should be applied to a function definition or closure diff --git a/tests/ui/coverage-attr/subword.stderr b/tests/ui/coverage-attr/subword.stderr index 3a106898f8b9c..ea44547e99bee 100644 --- a/tests/ui/coverage-attr/subword.stderr +++ b/tests/ui/coverage-attr/subword.stderr @@ -6,10 +6,12 @@ LL | #[coverage(yes(milord))] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(yes(milord))] +LL + #[coverage(off)] + | +LL - #[coverage(yes(milord))] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/subword.rs:10:1 @@ -19,10 +21,12 @@ LL | #[coverage(no(milord))] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(no(milord))] +LL + #[coverage(off)] + | +LL - #[coverage(no(milord))] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/subword.rs:13:1 @@ -32,10 +36,12 @@ LL | #[coverage(yes = "milord")] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(yes = "milord")] +LL + #[coverage(off)] + | +LL - #[coverage(yes = "milord")] +LL + #[coverage(on)] + | error: malformed `coverage` attribute input --> $DIR/subword.rs:16:1 @@ -45,10 +51,12 @@ LL | #[coverage(no = "milord")] | help: the following are the possible correct uses | -LL | #[coverage(off)] - | ~~~~~~~~~~~~~~~~ -LL | #[coverage(on)] - | ~~~~~~~~~~~~~~~ +LL - #[coverage(no = "milord")] +LL + #[coverage(off)] + | +LL - #[coverage(no = "milord")] +LL + #[coverage(on)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr index 1ce149724c6f4..f8964d98a46c8 100644 --- a/tests/ui/coverage-attr/word-only.stderr +++ b/tests/ui/coverage-attr/word-only.stderr @@ -6,9 +6,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -19,9 +21,11 @@ LL | #![coverage] | help: the following are the possible correct uses | -LL | #![coverage(off)] +LL - #![coverage] +LL + #![coverage(off)] | -LL | #![coverage(on)] +LL - #![coverage] +LL + #![coverage(on)] | error: malformed `coverage` attribute input @@ -32,9 +36,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -45,9 +51,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -58,9 +66,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -71,9 +81,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -84,9 +96,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -97,9 +111,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -110,9 +126,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -123,9 +141,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -136,9 +156,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error: malformed `coverage` attribute input @@ -149,9 +171,11 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL | #[coverage(off)] +LL - #[coverage] +LL + #[coverage(off)] | -LL | #[coverage(on)] +LL - #[coverage] +LL + #[coverage(on)] | error[E0788]: attribute should be applied to a function definition or closure diff --git a/tests/ui/deprecation/atomic_initializers.stderr b/tests/ui/deprecation/atomic_initializers.stderr index 30fcc9de6181e..3a2e661381886 100644 --- a/tests/ui/deprecation/atomic_initializers.stderr +++ b/tests/ui/deprecation/atomic_initializers.stderr @@ -7,8 +7,9 @@ LL | static FOO: AtomicIsize = ATOMIC_ISIZE_INIT; = note: `#[warn(deprecated)]` on by default help: replace the use of the deprecated constant | -LL | static FOO: AtomicIsize = AtomicIsize::new(0); - | ~~~~~~~~~~~~~~~~~~~ +LL - static FOO: AtomicIsize = ATOMIC_ISIZE_INIT; +LL + static FOO: AtomicIsize = AtomicIsize::new(0); + | warning: 1 warning emitted diff --git a/tests/ui/deprecation/invalid-literal.stderr b/tests/ui/deprecation/invalid-literal.stderr index ca827beda0596..cbe1fcca0238b 100644 --- a/tests/ui/deprecation/invalid-literal.stderr +++ b/tests/ui/deprecation/invalid-literal.stderr @@ -6,12 +6,15 @@ LL | #[deprecated = b"test"] | help: the following are the possible correct uses | -LL | #[deprecated = "reason"] - | ~~~~~~~~~~~~~~~~~~~~~~~~ -LL | #[deprecated(/*opt*/ since = "version", /*opt*/ note = "reason")] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | #[deprecated] - | ~~~~~~~~~~~~~ +LL - #[deprecated = b"test"] +LL + #[deprecated = "reason"] + | +LL - #[deprecated = b"test"] +LL + #[deprecated(/*opt*/ since = "version", /*opt*/ note = "reason")] + | +LL - #[deprecated = b"test"] +LL + #[deprecated] + | error: aborting due to 1 previous error diff --git a/tests/ui/deprecation/issue-84637-deprecated-associated-function.stderr b/tests/ui/deprecation/issue-84637-deprecated-associated-function.stderr index d1f5ea3602a8f..a81143640a070 100644 --- a/tests/ui/deprecation/issue-84637-deprecated-associated-function.stderr +++ b/tests/ui/deprecation/issue-84637-deprecated-associated-function.stderr @@ -11,8 +11,9 @@ LL | #![deny(deprecated)] | ^^^^^^^^^^ help: replace the use of the deprecated method | -LL | let _foo = str::trim_start(" aoeu"); - | ~~~~~~~~~~ +LL - let _foo = str::trim_left(" aoeu"); +LL + let _foo = str::trim_start(" aoeu"); + | error: use of deprecated method `core::str::::trim_left`: superseded by `trim_start` --> $DIR/issue-84637-deprecated-associated-function.rs:8:26 @@ -22,8 +23,9 @@ LL | let _bar = " aoeu".trim_left(); | help: replace the use of the deprecated method | -LL | let _bar = " aoeu".trim_start(); - | ~~~~~~~~~~ +LL - let _bar = " aoeu".trim_left(); +LL + let _bar = " aoeu".trim_start(); + | error: use of deprecated method `std::slice::::connect`: renamed to join --> $DIR/issue-84637-deprecated-associated-function.rs:10:27 @@ -33,8 +35,9 @@ LL | let _baz = ["a", "b"].connect(" "); | help: replace the use of the deprecated method | -LL | let _baz = ["a", "b"].join(" "); - | ~~~~ +LL - let _baz = ["a", "b"].connect(" "); +LL + let _baz = ["a", "b"].join(" "); + | error: aborting due to 3 previous errors diff --git a/tests/ui/deprecation/suggestion.stderr b/tests/ui/deprecation/suggestion.stderr index 5584b6d2f8ffb..58e4219d37b98 100644 --- a/tests/ui/deprecation/suggestion.stderr +++ b/tests/ui/deprecation/suggestion.stderr @@ -11,8 +11,9 @@ LL | #![deny(deprecated)] | ^^^^^^^^^^ help: replace the use of the deprecated function | -LL | bar::replacement(); - | ~~~~~~~~~~~ +LL - bar::deprecated(); +LL + bar::replacement(); + | error: use of deprecated method `Foo::deprecated`: replaced by `replacement` --> $DIR/suggestion.rs:40:9 @@ -22,8 +23,9 @@ LL | foo.deprecated(); | help: replace the use of the deprecated method | -LL | foo.replacement(); - | ~~~~~~~~~~~ +LL - foo.deprecated(); +LL + foo.replacement(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/deref-patterns/issue-71676-1.stderr b/tests/ui/deref-patterns/issue-71676-1.stderr index 164641ff77512..348a2c12ec491 100644 --- a/tests/ui/deref-patterns/issue-71676-1.stderr +++ b/tests/ui/deref-patterns/issue-71676-1.stderr @@ -40,8 +40,9 @@ LL | let _: *const u8 = &mut a; found mutable reference `&mut Emm` help: consider dereferencing | -LL | let _: *const u8 = &***a; - | ~~~ +LL - let _: *const u8 = &mut a; +LL + let _: *const u8 = &***a; + | error[E0308]: mismatched types --> $DIR/issue-71676-1.rs:52:22 diff --git a/tests/ui/derived-errors/issue-30580.stderr b/tests/ui/derived-errors/issue-30580.stderr index 05b5559172994..e8659ea931ddc 100644 --- a/tests/ui/derived-errors/issue-30580.stderr +++ b/tests/ui/derived-errors/issue-30580.stderr @@ -6,8 +6,9 @@ LL | b.c; | help: a field with a similar name exists | -LL | b.a; - | ~ +LL - b.c; +LL + b.a; + | error: aborting due to 1 previous error diff --git a/tests/ui/destructuring-assignment/struct_destructure_fail.stderr b/tests/ui/destructuring-assignment/struct_destructure_fail.stderr index 57851ed417ea8..3c5079a344f12 100644 --- a/tests/ui/destructuring-assignment/struct_destructure_fail.stderr +++ b/tests/ui/destructuring-assignment/struct_destructure_fail.stderr @@ -37,12 +37,14 @@ LL | Struct { a, _ } = Struct { a: 1, b: 2 }; | help: include the missing field in the pattern | -LL | Struct { a, b } = Struct { a: 1, b: 2 }; - | ~~~~~ +LL - Struct { a, _ } = Struct { a: 1, b: 2 }; +LL + Struct { a, b } = Struct { a: 1, b: 2 }; + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Struct { a, .. } = Struct { a: 1, b: 2 }; - | ~~~~~~ +LL - Struct { a, _ } = Struct { a: 1, b: 2 }; +LL + Struct { a, .. } = Struct { a: 1, b: 2 }; + | error: aborting due to 5 previous errors diff --git a/tests/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr b/tests/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr index 5cc7acba3f334..515d4cc76215c 100644 --- a/tests/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr +++ b/tests/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr @@ -38,8 +38,9 @@ LL | TupleStruct(_, _) = TupleStruct(1, 2); | +++ help: use `..` to ignore all fields | -LL | TupleStruct(..) = TupleStruct(1, 2); - | ~~ +LL - TupleStruct(_) = TupleStruct(1, 2); +LL + TupleStruct(..) = TupleStruct(1, 2); + | error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields --> $DIR/tuple_struct_destructure_fail.rs:32:25 @@ -65,8 +66,9 @@ LL | Enum::SingleVariant(_, _) = Enum::SingleVariant(1, 2); | +++ help: use `..` to ignore all fields | -LL | Enum::SingleVariant(..) = Enum::SingleVariant(1, 2); - | ~~ +LL - Enum::SingleVariant(_) = Enum::SingleVariant(1, 2); +LL + Enum::SingleVariant(..) = Enum::SingleVariant(1, 2); + | error[E0070]: invalid left-hand side of assignment --> $DIR/tuple_struct_destructure_fail.rs:38:12 diff --git a/tests/ui/diagnostic_namespace/suggest_typos.stderr b/tests/ui/diagnostic_namespace/suggest_typos.stderr index 307311258f274..45d8434424474 100644 --- a/tests/ui/diagnostic_namespace/suggest_typos.stderr +++ b/tests/ui/diagnostic_namespace/suggest_typos.stderr @@ -11,8 +11,9 @@ LL | #![deny(unknown_or_malformed_diagnostic_attributes)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: an attribute with a similar name exists | -LL | #[diagnostic::on_unimplemented] - | ~~~~~~~~~~~~~~~~ +LL - #[diagnostic::onunimplemented] +LL + #[diagnostic::on_unimplemented] + | error: unknown diagnostic attribute --> $DIR/suggest_typos.rs:8:15 @@ -22,8 +23,9 @@ LL | #[diagnostic::un_onimplemented] | help: an attribute with a similar name exists | -LL | #[diagnostic::on_unimplemented] - | ~~~~~~~~~~~~~~~~ +LL - #[diagnostic::un_onimplemented] +LL + #[diagnostic::on_unimplemented] + | error: unknown diagnostic attribute --> $DIR/suggest_typos.rs:13:15 @@ -33,8 +35,9 @@ LL | #[diagnostic::on_implemented] | help: an attribute with a similar name exists | -LL | #[diagnostic::on_unimplemented] - | ~~~~~~~~~~~~~~~~ +LL - #[diagnostic::on_implemented] +LL + #[diagnostic::on_unimplemented] + | error: aborting due to 3 previous errors diff --git a/tests/ui/did_you_mean/bad-assoc-ty.stderr b/tests/ui/did_you_mean/bad-assoc-ty.stderr index b349332bcb9c3..9507c2f6da04c 100644 --- a/tests/ui/did_you_mean/bad-assoc-ty.stderr +++ b/tests/ui/did_you_mean/bad-assoc-ty.stderr @@ -109,8 +109,9 @@ LL | type A = [u8; 4]::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8; 4]`, you could use the fully-qualified path | -LL | type A = <[u8; 4] as Example>::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type A = [u8; 4]::AssocTy; +LL + type A = <[u8; 4] as Example>::AssocTy; + | error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:5:10 @@ -120,8 +121,9 @@ LL | type B = [u8]::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8]`, you could use the fully-qualified path | -LL | type B = <[u8] as Example>::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type B = [u8]::AssocTy; +LL + type B = <[u8] as Example>::AssocTy; + | error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:9:10 @@ -131,8 +133,9 @@ LL | type C = (u8)::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path | -LL | type C = ::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type C = (u8)::AssocTy; +LL + type C = ::AssocTy; + | error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:13:10 @@ -142,8 +145,9 @@ LL | type D = (u8, u8)::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(u8, u8)`, you could use the fully-qualified path | -LL | type D = <(u8, u8) as Example>::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type D = (u8, u8)::AssocTy; +LL + type D = <(u8, u8) as Example>::AssocTy; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases --> $DIR/bad-assoc-ty.rs:17:10 @@ -159,8 +163,9 @@ LL | type F = &'static (u8)::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path | -LL | type F = &'static ::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type F = &'static (u8)::AssocTy; +LL + type F = &'static ::AssocTy; + | error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:27:10 @@ -170,8 +175,9 @@ LL | type G = dyn 'static + (Send)::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(dyn Send + 'static)`, you could use the fully-qualified path | -LL | type G = <(dyn Send + 'static) as Example>::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type G = dyn 'static + (Send)::AssocTy; +LL + type G = <(dyn Send + 'static) as Example>::AssocTy; + | warning: trait objects without an explicit `dyn` are deprecated --> $DIR/bad-assoc-ty.rs:33:10 @@ -195,10 +201,12 @@ LL | type H = Fn(u8) -> (u8)::Output; | help: use fully-qualified syntax | -LL | type H = <(dyn Fn(u8) -> u8 + 'static) as BitOr>::Output; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | type H = <(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type H = Fn(u8) -> (u8)::Output; +LL + type H = <(dyn Fn(u8) -> u8 + 'static) as BitOr>::Output; + | +LL - type H = Fn(u8) -> (u8)::Output; +LL + type H = <(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output; + | error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:39:19 @@ -212,8 +220,9 @@ LL | type J = ty!(u8); = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info) help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path | -LL | ($ty: ty) => (::AssocTy); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - ($ty: ty) => ($ty::AssocTy); +LL + ($ty: ty) => (::AssocTy); + | error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:46:10 @@ -223,8 +232,9 @@ LL | type I = ty!()::AssocTy; | help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path | -LL | type I = ::AssocTy; - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type I = ty!()::AssocTy; +LL + type I = ::AssocTy; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/bad-assoc-ty.rs:51:13 @@ -236,8 +246,9 @@ LL | fn foo>(x: X) {} | help: use type parameters instead | -LL | fn foo, T>(x: X) {} - | ~ ~ +++ +LL - fn foo>(x: X) {} +LL + fn foo, T>(x: X) {} + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/bad-assoc-ty.rs:54:34 @@ -247,8 +258,9 @@ LL | fn bar(_: F) where F: Fn() -> _ {} | help: use type parameters instead | -LL | fn bar(_: F) where F: Fn() -> T {} - | +++ ~ +LL - fn bar(_: F) where F: Fn() -> _ {} +LL + fn bar(_: F) where F: Fn() -> T {} + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/bad-assoc-ty.rs:57:19 @@ -258,8 +270,9 @@ LL | fn baz _>(_: F) {} | help: use type parameters instead | -LL | fn baz T, T>(_: F) {} - | ~+++ +LL - fn baz _>(_: F) {} +LL + fn baz T, T>(_: F) {} + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs --> $DIR/bad-assoc-ty.rs:60:33 @@ -269,8 +282,9 @@ LL | struct L(F) where F: Fn() -> _; | help: use type parameters instead | -LL | struct L(F) where F: Fn() -> T; - | +++ ~ +LL - struct L(F) where F: Fn() -> _; +LL + struct L(F) where F: Fn() -> T; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/bad-assoc-ty.rs:82:38 @@ -280,8 +294,9 @@ LL | fn foo(_: F) where F: Fn() -> _ {} | help: use type parameters instead | -LL | fn foo(_: F) where F: Fn() -> T {} - | +++ ~ +LL - fn foo(_: F) where F: Fn() -> _ {} +LL + fn foo(_: F) where F: Fn() -> T {} + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs --> $DIR/bad-assoc-ty.rs:62:30 @@ -291,8 +306,9 @@ LL | struct M where F: Fn() -> _ { | help: use type parameters instead | -LL | struct M where F: Fn() -> T { - | +++ ~ +LL - struct M where F: Fn() -> _ { +LL + struct M where F: Fn() -> T { + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for enums --> $DIR/bad-assoc-ty.rs:66:28 @@ -302,8 +318,9 @@ LL | enum N where F: Fn() -> _ { | help: use type parameters instead | -LL | enum N where F: Fn() -> T { - | +++ ~ +LL - enum N where F: Fn() -> _ { +LL + enum N where F: Fn() -> T { + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for unions --> $DIR/bad-assoc-ty.rs:71:29 @@ -313,8 +330,9 @@ LL | union O where F: Fn() -> _ { | help: use type parameters instead | -LL | union O where F: Fn() -> T { - | +++ ~ +LL - union O where F: Fn() -> _ { +LL + union O where F: Fn() -> T { + | error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union --> $DIR/bad-assoc-ty.rs:73:5 @@ -336,8 +354,9 @@ LL | trait P where F: Fn() -> _ { | help: use type parameters instead | -LL | trait P where F: Fn() -> T { - | +++ ~ +LL - trait P where F: Fn() -> _ { +LL + trait P where F: Fn() -> T { + | error: aborting due to 29 previous errors; 1 warning emitted diff --git a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr index a7ec192592e0d..d4aeb1eee96a1 100644 --- a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr +++ b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr @@ -6,8 +6,9 @@ LL | const A: [&str; 1] = { "hello" }; | help: to create an array, use square brackets instead of curly braces | -LL | const A: [&str; 1] = [ "hello" ]; - | ~ ~ +LL - const A: [&str; 1] = { "hello" }; +LL + const A: [&str; 1] = [ "hello" ]; + | error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:4:19 @@ -19,8 +20,9 @@ LL | const B: &[u32] = &{ 1 }; found reference `&{integer}` help: to create an array, use square brackets instead of curly braces | -LL | const B: &[u32] = &[ 1 ]; - | ~ ~ +LL - const B: &[u32] = &{ 1 }; +LL + const B: &[u32] = &[ 1 ]; + | error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:7:27 @@ -30,8 +32,9 @@ LL | const C: &&[u32; 1] = &&{ 1 }; | help: to create an array, use square brackets instead of curly braces | -LL | const C: &&[u32; 1] = &&[ 1 ]; - | ~ ~ +LL - const C: &&[u32; 1] = &&{ 1 }; +LL + const C: &&[u32; 1] = &&[ 1 ]; + | error: aborting due to 3 previous errors diff --git a/tests/ui/did_you_mean/compatible-variants-in-pat.stderr b/tests/ui/did_you_mean/compatible-variants-in-pat.stderr index 5e48871bb01bb..09cf094e6bd72 100644 --- a/tests/ui/did_you_mean/compatible-variants-in-pat.stderr +++ b/tests/ui/did_you_mean/compatible-variants-in-pat.stderr @@ -33,8 +33,9 @@ LL | Some(S) => { | +++++ + help: introduce a new binding instead | -LL | other_s => { - | ~~~~~~~ +LL - S => { +LL + other_s => { + | error[E0308]: mismatched types --> $DIR/compatible-variants-in-pat.rs:32:9 @@ -60,8 +61,9 @@ LL | Err(S) => { | ++++ + help: introduce a new binding instead | -LL | other_s => { - | ~~~~~~~ +LL - S => { +LL + other_s => { + | error: aborting due to 3 previous errors diff --git a/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr b/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr index 473c9a339fc25..72b65006a3fb5 100644 --- a/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr +++ b/tests/ui/did_you_mean/dont-suggest-hygienic-fields.stderr @@ -10,8 +10,9 @@ LL | const CRATE: Crate = Crate { fiel: () }; = note: this error originates in the macro `environment` (in Nightly builds, run with -Z macro-backtrace for more info) help: a field with a similar name exists | -LL | const CRATE: Crate = Crate { field: () }; - | ~~~~~ +LL - const CRATE: Crate = Crate { fiel: () }; +LL + const CRATE: Crate = Crate { field: () }; + | error[E0609]: no field `field` on type `Compound` --> $DIR/dont-suggest-hygienic-fields.rs:24:16 diff --git a/tests/ui/did_you_mean/issue-36798.stderr b/tests/ui/did_you_mean/issue-36798.stderr index 70aa3c32bfbf4..233cb1e32486d 100644 --- a/tests/ui/did_you_mean/issue-36798.stderr +++ b/tests/ui/did_you_mean/issue-36798.stderr @@ -6,8 +6,9 @@ LL | f.baz; | help: a field with a similar name exists | -LL | f.bar; - | ~~~ +LL - f.baz; +LL + f.bar; + | error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/issue-38147-1.stderr b/tests/ui/did_you_mean/issue-38147-1.stderr index a0392113ab155..754884e854029 100644 --- a/tests/ui/did_you_mean/issue-38147-1.stderr +++ b/tests/ui/did_you_mean/issue-38147-1.stderr @@ -6,8 +6,9 @@ LL | self.s.push('x'); | help: consider changing this to be a mutable reference | -LL | fn f(&mut self) { - | ~~~~~~~~~ +LL - fn f(&self) { +LL + fn f(&mut self) { + | error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/issue-39544.stderr b/tests/ui/did_you_mean/issue-39544.stderr index 8ccb4cbb0c167..bd151a1e6f660 100644 --- a/tests/ui/did_you_mean/issue-39544.stderr +++ b/tests/ui/did_you_mean/issue-39544.stderr @@ -17,8 +17,9 @@ LL | let _ = &mut self.x; | help: consider changing this to be a mutable reference | -LL | fn foo<'z>(&'z mut self) { - | ~~~~~~~~~~~~ +LL - fn foo<'z>(&'z self) { +LL + fn foo<'z>(&'z mut self) { + | error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference --> $DIR/issue-39544.rs:20:17 @@ -28,8 +29,9 @@ LL | let _ = &mut self.x; | help: consider changing this to be a mutable reference | -LL | fn foo1(&mut self, other: &Z) { - | ~~~~~~~~~ +LL - fn foo1(&self, other: &Z) { +LL + fn foo1(&mut self, other: &Z) { + | error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference --> $DIR/issue-39544.rs:21:17 @@ -50,8 +52,9 @@ LL | let _ = &mut self.x; | help: consider changing this to be a mutable reference | -LL | fn foo2<'a>(&'a mut self, other: &Z) { - | ~~~~~~~~~~~~ +LL - fn foo2<'a>(&'a self, other: &Z) { +LL + fn foo2<'a>(&'a mut self, other: &Z) { + | error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference --> $DIR/issue-39544.rs:26:17 diff --git a/tests/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr b/tests/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr index 952ac76a003d6..9893aad7486b4 100644 --- a/tests/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr +++ b/tests/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr @@ -6,8 +6,9 @@ LL | let _x = ~1; | help: use `!` to perform bitwise not | -LL | let _x = !1; - | ~ +LL - let _x = ~1; +LL + let _x = !1; + | error: unexpected `1` after identifier --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18 @@ -17,8 +18,9 @@ LL | let _y = not 1; | help: use `!` to perform bitwise not | -LL | let _y = !1; - | ~ +LL - let _y = not 1; +LL + let _y = !1; + | error: unexpected keyword `false` after identifier --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:6:18 @@ -28,8 +30,9 @@ LL | let _z = not false; | help: use `!` to perform logical negation | -LL | let _z = !false; - | ~ +LL - let _z = not false; +LL + let _z = !false; + | error: unexpected keyword `true` after identifier --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:7:18 @@ -39,8 +42,9 @@ LL | let _a = not true; | help: use `!` to perform logical negation | -LL | let _a = !true; - | ~ +LL - let _a = not true; +LL + let _a = !true; + | error: unexpected `v` after identifier --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:9:18 @@ -50,8 +54,9 @@ LL | let _v = not v; | help: use `!` to perform logical negation or bitwise not | -LL | let _v = !v; - | ~ +LL - let _v = not v; +LL + let _v = !v; + | error: aborting due to 5 previous errors diff --git a/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr b/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr index d60db01a4653d..8fe46eb7ee184 100644 --- a/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr +++ b/tests/ui/did_you_mean/issue-42599_available_fields_note.stderr @@ -6,8 +6,9 @@ LL | Self { secret_integer: 2, inocently_mispellable: () } | help: a field with a similar name exists | -LL | Self { secret_integer: 2, innocently_misspellable: () } - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - Self { secret_integer: 2, inocently_mispellable: () } +LL + Self { secret_integer: 2, innocently_misspellable: () } + | error[E0560]: struct `Demo` has no field named `egregiously_nonexistent_field` --> $DIR/issue-42599_available_fields_note.rs:21:39 @@ -25,8 +26,9 @@ LL | let innocent_field_misaccess = demo.inocently_mispellable; | help: a field with a similar name exists | -LL | let innocent_field_misaccess = demo.innocently_misspellable; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - let innocent_field_misaccess = demo.inocently_mispellable; +LL + let innocent_field_misaccess = demo.innocently_misspellable; + | error[E0609]: no field `egregiously_nonexistent_field` on type `Demo` --> $DIR/issue-42599_available_fields_note.rs:35:42 diff --git a/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr b/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr index 92cbc03e0dd78..633f331a13a4a 100644 --- a/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr +++ b/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr @@ -6,8 +6,9 @@ LL | PersonalityInventory { expressivity: exp, ... } => exp | help: to omit remaining fields, use `..` | -LL | PersonalityInventory { expressivity: exp, .. } => exp - | ~~ +LL - PersonalityInventory { expressivity: exp, ... } => exp +LL + PersonalityInventory { expressivity: exp, .. } => exp + | error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr b/tests/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr index 6dea6a4fac8f2..3a25181d29ccc 100644 --- a/tests/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr +++ b/tests/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr @@ -6,8 +6,9 @@ LL | if not for_you { | help: use `!` to perform logical negation or bitwise not | -LL | if !for_you { - | ~ +LL - if not for_you { +LL + if !for_you { + | error: unexpected `the_worst` after identifier --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15 @@ -17,8 +18,9 @@ LL | while not the_worst { | help: use `!` to perform logical negation or bitwise not | -LL | while !the_worst { - | ~ +LL - while not the_worst { +LL + while !the_worst { + | error: unexpected `println` after identifier --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9 @@ -28,8 +30,9 @@ LL | println!("Then when?"); | help: use `!` to perform logical negation or bitwise not | -LL | if !// lack of braces is [sic] - | ~ +LL - if not // lack of braces is [sic] +LL + if !// lack of braces is [sic] + | error: expected `{`, found `;` --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:31 @@ -53,8 +56,9 @@ LL | let resource = not 2; | help: use `!` to perform bitwise not | -LL | let resource = !2; - | ~ +LL - let resource = not 2; +LL + let resource = !2; + | error: unexpected `be_smothered_out_before` after identifier --> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27 @@ -64,8 +68,9 @@ LL | let young_souls = not be_smothered_out_before; | help: use `!` to perform logical negation or bitwise not | -LL | let young_souls = !be_smothered_out_before; - | ~ +LL - let young_souls = not be_smothered_out_before; +LL + let young_souls = !be_smothered_out_before; + | error: aborting due to 6 previous errors diff --git a/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr b/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr index 6d92fa5e14e98..d4812d4831b03 100644 --- a/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr +++ b/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr @@ -34,8 +34,9 @@ LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true | + + help: ...or a vertical bar to match on multiple alternatives | -LL | Nucleotide::Adenine | Nucleotide::Cytosine | _ => true - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Nucleotide::Adenine, Nucleotide::Cytosine, _ => true +LL + Nucleotide::Adenine | Nucleotide::Cytosine | _ => true + | error: unexpected `,` in pattern --> $DIR/issue-48492-tuple-destructure-missing-parens.rs:67:10 diff --git a/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr b/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr index 4b3d429c7509a..664bf69b9ebc5 100644 --- a/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr +++ b/tests/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr @@ -12,8 +12,9 @@ LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹ | help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not | -LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻² - | ~ +LL - const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻² +LL + const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻² + | error: aborting due to 2 previous errors diff --git a/tests/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr b/tests/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr index c52102e2631d8..5dad6924dfd7f 100644 --- a/tests/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr +++ b/tests/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr @@ -7,8 +7,9 @@ LL | let _ = a and b; = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | let _ = a && b; - | ~~ +LL - let _ = a and b; +LL + let _ = a && b; + | error: `and` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10 @@ -19,8 +20,9 @@ LL | if a and b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | if a && b { - | ~~ +LL - if a and b { +LL + if a && b { + | error: `or` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15 @@ -31,8 +33,9 @@ LL | let _ = a or b; = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | let _ = a || b; - | ~~ +LL - let _ = a or b; +LL + let _ = a || b; + | error: `or` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10 @@ -43,8 +46,9 @@ LL | if a or b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | if a || b { - | ~~ +LL - if a or b { +LL + if a || b { + | error: `and` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11 @@ -55,8 +59,9 @@ LL | if (a and b) { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | if (a && b) { - | ~~ +LL - if (a and b) { +LL + if (a && b) { + | error: `or` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11 @@ -67,8 +72,9 @@ LL | if (a or b) { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | if (a || b) { - | ~~ +LL - if (a or b) { +LL + if (a || b) { + | error: `and` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13 @@ -79,8 +85,9 @@ LL | while a and b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | while a && b { - | ~~ +LL - while a and b { +LL + while a && b { + | error: `or` is not a logical operator --> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13 @@ -91,8 +98,9 @@ LL | while a or b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | while a || b { - | ~~ +LL - while a or b { +LL + while a || b { + | error[E0308]: mismatched types --> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33 diff --git a/tests/ui/did_you_mean/issue-54109-without-witness.stderr b/tests/ui/did_you_mean/issue-54109-without-witness.stderr index ee6d9901fcf60..1ad88f0084c89 100644 --- a/tests/ui/did_you_mean/issue-54109-without-witness.stderr +++ b/tests/ui/did_you_mean/issue-54109-without-witness.stderr @@ -7,8 +7,9 @@ LL | let _ = a and b; = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | let _ = a && b; - | ~~ +LL - let _ = a and b; +LL + let _ = a && b; + | error: `and` is not a logical operator --> $DIR/issue-54109-without-witness.rs:15:10 @@ -19,8 +20,9 @@ LL | if a and b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | if a && b { - | ~~ +LL - if a and b { +LL + if a && b { + | error: `or` is not a logical operator --> $DIR/issue-54109-without-witness.rs:24:15 @@ -31,8 +33,9 @@ LL | let _ = a or b; = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | let _ = a || b; - | ~~ +LL - let _ = a or b; +LL + let _ = a || b; + | error: `or` is not a logical operator --> $DIR/issue-54109-without-witness.rs:26:10 @@ -43,8 +46,9 @@ LL | if a or b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | if a || b { - | ~~ +LL - if a or b { +LL + if a || b { + | error: `and` is not a logical operator --> $DIR/issue-54109-without-witness.rs:34:11 @@ -55,8 +59,9 @@ LL | if (a and b) { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | if (a && b) { - | ~~ +LL - if (a and b) { +LL + if (a && b) { + | error: `or` is not a logical operator --> $DIR/issue-54109-without-witness.rs:42:11 @@ -67,8 +72,9 @@ LL | if (a or b) { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | if (a || b) { - | ~~ +LL - if (a or b) { +LL + if (a || b) { + | error: `and` is not a logical operator --> $DIR/issue-54109-without-witness.rs:50:13 @@ -79,8 +85,9 @@ LL | while a and b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `&&` to perform logical conjunction | -LL | while a && b { - | ~~ +LL - while a and b { +LL + while a && b { + | error: `or` is not a logical operator --> $DIR/issue-54109-without-witness.rs:58:13 @@ -91,8 +98,9 @@ LL | while a or b { = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators help: use `||` to perform logical disjunction | -LL | while a || b { - | ~~ +LL - while a or b { +LL + while a || b { + | error: aborting due to 8 previous errors diff --git a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr index b1a15b8594a0a..927f9e842e665 100644 --- a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr +++ b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr @@ -6,14 +6,18 @@ LL | fn setup() -> Set { Set } | help: there is an enum variant `AffixHeart::Set` and 7 others; try using the variant's enum | -LL | fn setup() -> AffixHeart { Set } - | ~~~~~~~~~~ -LL | fn setup() -> CauseToBe { Set } - | ~~~~~~~~~ -LL | fn setup() -> Determine { Set } - | ~~~~~~~~~ -LL | fn setup() -> PutDown { Set } - | ~~~~~~~ +LL - fn setup() -> Set { Set } +LL + fn setup() -> AffixHeart { Set } + | +LL - fn setup() -> Set { Set } +LL + fn setup() -> CauseToBe { Set } + | +LL - fn setup() -> Set { Set } +LL + fn setup() -> Determine { Set } + | +LL - fn setup() -> Set { Set } +LL + fn setup() -> PutDown { Set } + | and 3 other candidates error[E0425]: cannot find value `Set` in this scope diff --git a/tests/ui/did_you_mean/issue-87830-try-brackets-for-arrays.stderr b/tests/ui/did_you_mean/issue-87830-try-brackets-for-arrays.stderr index d5ad1a72b8250..58232e2307d8e 100644 --- a/tests/ui/did_you_mean/issue-87830-try-brackets-for-arrays.stderr +++ b/tests/ui/did_you_mean/issue-87830-try-brackets-for-arrays.stderr @@ -24,8 +24,9 @@ LL | const BAR: [&str; 3] = {"one", "two", "three"}; | help: to make an array, use square brackets instead of curly braces | -LL | const BAR: [&str; 3] = ["one", "two", "three"]; - | ~ ~ +LL - const BAR: [&str; 3] = {"one", "two", "three"}; +LL + const BAR: [&str; 3] = ["one", "two", "three"]; + | error: this is a block expression, not an array --> $DIR/issue-87830-try-brackets-for-arrays.rs:12:5 @@ -35,8 +36,9 @@ LL | {1, 2, 3}; | help: to make an array, use square brackets instead of curly braces | -LL | [1, 2, 3]; - | ~ ~ +LL - {1, 2, 3}; +LL + [1, 2, 3]; + | error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,` --> $DIR/issue-87830-try-brackets-for-arrays.rs:17:6 diff --git a/tests/ui/did_you_mean/pub-macro-rules.stderr b/tests/ui/did_you_mean/pub-macro-rules.stderr index fb9148748ca1e..a91d419d96bc4 100644 --- a/tests/ui/did_you_mean/pub-macro-rules.stderr +++ b/tests/ui/did_you_mean/pub-macro-rules.stderr @@ -6,8 +6,9 @@ LL | pub macro_rules! foo { | help: try exporting the macro | -LL | #[macro_export] macro_rules! foo { - | ~~~~~~~~~~~~~~~ +LL - pub macro_rules! foo { +LL + #[macro_export] macro_rules! foo { + | error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr b/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr index 6f38def69981f..d2ce34cadec92 100644 --- a/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr +++ b/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr @@ -10,8 +10,9 @@ LL | fn bar(i: _, t: _, s: _) -> _ { | help: try replacing `_` with the types in the corresponding trait method signature | -LL | fn bar(i: i32, t: usize, s: &()) -> (usize, i32) { - | ~~~ ~~~~~ ~~~ ~~~~~~~~~~~~ +LL - fn bar(i: _, t: _, s: _) -> _ { +LL + fn bar(i: i32, t: usize, s: &()) -> (usize, i32) { + | error[E0282]: type annotations needed --> $DIR/replace-impl-infer-ty-from-trait.rs:9:12 diff --git a/tests/ui/did_you_mean/use_instead_of_import.stderr b/tests/ui/did_you_mean/use_instead_of_import.stderr index f8d6de8a11768..aadd7524ec67f 100644 --- a/tests/ui/did_you_mean/use_instead_of_import.stderr +++ b/tests/ui/did_you_mean/use_instead_of_import.stderr @@ -6,8 +6,9 @@ LL | import std::{ | help: items are imported using the `use` keyword | -LL | use std::{ - | ~~~ +LL - import std::{ +LL + use std::{ + | error: expected item, found `require` --> $DIR/use_instead_of_import.rs:9:1 @@ -17,8 +18,9 @@ LL | require std::time::Duration; | help: items are imported using the `use` keyword | -LL | use std::time::Duration; - | ~~~ +LL - require std::time::Duration; +LL + use std::time::Duration; + | error: expected item, found `include` --> $DIR/use_instead_of_import.rs:12:1 @@ -28,8 +30,9 @@ LL | include std::time::Instant; | help: items are imported using the `use` keyword | -LL | use std::time::Instant; - | ~~~ +LL - include std::time::Instant; +LL + use std::time::Instant; + | error: expected item, found `using` --> $DIR/use_instead_of_import.rs:15:5 @@ -39,8 +42,9 @@ LL | pub using std::io; | help: items are imported using the `use` keyword | -LL | pub use std::io; - | ~~~ +LL - pub using std::io; +LL + pub use std::io; + | error: aborting due to 4 previous errors diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr index 9126e6023913d..98865a5d9d57c 100644 --- a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr +++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr @@ -10,8 +10,9 @@ LL | (mem::size_of_val(&trails) * 8) as u32 = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | (mem::size_of_val(addr_of!(trails)) * 8) as u32 - | ~~~~~~~~~ + +LL - (mem::size_of_val(&trails) * 8) as u32 +LL + (mem::size_of_val(addr_of!(trails)) * 8) as u32 + | warning: 1 warning emitted diff --git a/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr b/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr index 6da8741680274..c08ffd60778da 100644 --- a/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr +++ b/tests/ui/drop/issue-23611-enum-swap-in-drop.stderr @@ -10,8 +10,9 @@ LL | (mem::size_of_val(&trails) * 8) as u32 = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | (mem::size_of_val(addr_of!(trails)) * 8) as u32 - | ~~~~~~~~~ + +LL - (mem::size_of_val(&trails) * 8) as u32 +LL + (mem::size_of_val(addr_of!(trails)) * 8) as u32 + | warning: 1 warning emitted diff --git a/tests/ui/dropck/explicit-drop-bounds.bad1.stderr b/tests/ui/dropck/explicit-drop-bounds.bad1.stderr index 3ef11e2c0bbd1..f7f389e10489a 100644 --- a/tests/ui/dropck/explicit-drop-bounds.bad1.stderr +++ b/tests/ui/dropck/explicit-drop-bounds.bad1.stderr @@ -11,8 +11,9 @@ LL | struct DropMe(T); | ^^^^ required by this bound in `DropMe` help: consider further restricting type parameter `T` | -LL | [T; 1]: Copy, T: std::marker::Copy // But `[T; 1]: Copy` does not imply `T: Copy` - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - [T; 1]: Copy, // But `[T; 1]: Copy` does not imply `T: Copy` +LL + [T; 1]: Copy, T: std::marker::Copy // But `[T; 1]: Copy` does not imply `T: Copy` + | error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/explicit-drop-bounds.rs:32:18 @@ -27,8 +28,9 @@ LL | struct DropMe(T); | ^^^^ required by this bound in `DropMe` help: consider further restricting type parameter `T` | -LL | [T; 1]: Copy, T: std::marker::Copy // But `[T; 1]: Copy` does not imply `T: Copy` - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - [T; 1]: Copy, // But `[T; 1]: Copy` does not imply `T: Copy` +LL + [T; 1]: Copy, T: std::marker::Copy // But `[T; 1]: Copy` does not imply `T: Copy` + | error: aborting due to 2 previous errors diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr b/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr index 774d5ba3c892c..c54cc858129c3 100644 --- a/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr +++ b/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr @@ -67,8 +67,9 @@ LL | fn wants_write(_: impl Write) {} | ^^^^^ required by this bound in `wants_write` help: consider changing this borrow's mutability | -LL | wants_write(&mut [0u8][..]); - | ~~~~ +LL - wants_write(&[0u8][..]); +LL + wants_write(&mut [0u8][..]); + | error: aborting due to 4 previous errors diff --git a/tests/ui/empty/empty-struct-braces-expr.stderr b/tests/ui/empty/empty-struct-braces-expr.stderr index 28c701443de4e..3411702a12dfb 100644 --- a/tests/ui/empty/empty-struct-braces-expr.stderr +++ b/tests/ui/empty/empty-struct-braces-expr.stderr @@ -14,12 +14,14 @@ LL | pub struct XEmpty2; | help: use struct literal syntax instead | -LL | let e1 = Empty1 {}; - | ~~~~~~~~~ +LL - let e1 = Empty1; +LL + let e1 = Empty1 {}; + | help: a unit struct with a similar name exists | -LL | let e1 = XEmpty2; - | ~~~~~~~ +LL - let e1 = Empty1; +LL + let e1 = XEmpty2; + | error[E0423]: expected value, found struct `XEmpty1` --> $DIR/empty-struct-braces-expr.rs:22:15 @@ -36,12 +38,14 @@ LL | pub struct XEmpty2; | help: use struct literal syntax instead | -LL | let xe1 = XEmpty1 {}; - | ~~~~~~~~~~ +LL - let xe1 = XEmpty1; +LL + let xe1 = XEmpty1 {}; + | help: a unit struct with a similar name exists | -LL | let xe1 = XEmpty2; - | ~~~~~~~ +LL - let xe1 = XEmpty1; +LL + let xe1 = XEmpty2; + | error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1` --> $DIR/empty-struct-braces-expr.rs:16:14 @@ -59,12 +63,14 @@ LL | pub struct XEmpty2; | help: use struct literal syntax instead | -LL | let e1 = Empty1 {}; - | ~~~~~~~~~ +LL - let e1 = Empty1(); +LL + let e1 = Empty1 {}; + | help: a unit struct with a similar name exists | -LL | let e1 = XEmpty2(); - | ~~~~~~~ +LL - let e1 = Empty1(); +LL + let e1 = XEmpty2(); + | error[E0533]: expected value, found struct variant `E::Empty3` --> $DIR/empty-struct-braces-expr.rs:18:14 @@ -85,8 +91,9 @@ LL | let e3 = E::Empty3(); | help: you might have meant to create a new value of the struct | -LL | let e3 = E::Empty3 {}; - | ~~ +LL - let e3 = E::Empty3(); +LL + let e3 = E::Empty3 {}; + | error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-expr.rs:23:15 @@ -103,12 +110,14 @@ LL | pub struct XEmpty2; | help: use struct literal syntax instead | -LL | let xe1 = XEmpty1 {}; - | ~~~~~~~~~~ +LL - let xe1 = XEmpty1(); +LL + let xe1 = XEmpty1 {}; + | help: a unit struct with a similar name exists | -LL | let xe1 = XEmpty2(); - | ~~~~~~~ +LL - let xe1 = XEmpty1(); +LL + let xe1 = XEmpty2(); + | error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:25:19 @@ -118,8 +127,9 @@ LL | let xe3 = XE::Empty3; | help: there is a variant with a similar name | -LL | let xe3 = XE::XEmpty3; - | ~~~~~~~ +LL - let xe3 = XE::Empty3; +LL + let xe3 = XE::XEmpty3; + | error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:26:19 @@ -129,8 +139,9 @@ LL | let xe3 = XE::Empty3(); | help: there is a variant with a similar name | -LL | let xe3 = XE::XEmpty3 {}; - | ~~~~~~~~~~ +LL - let xe3 = XE::Empty3(); +LL + let xe3 = XE::XEmpty3 {}; + | error[E0599]: no variant named `Empty1` found for enum `empty_struct::XE` --> $DIR/empty-struct-braces-expr.rs:28:9 @@ -140,8 +151,9 @@ LL | XE::Empty1 {}; | help: there is a variant with a similar name | -LL | XE::XEmpty3 {}; - | ~~~~~~~~~~ +LL - XE::Empty1 {}; +LL + XE::XEmpty3 {}; + | error: aborting due to 9 previous errors diff --git a/tests/ui/empty/empty-struct-braces-pat-2.stderr b/tests/ui/empty/empty-struct-braces-pat-2.stderr index 7fb5cb2034a83..497dc9601a716 100644 --- a/tests/ui/empty/empty-struct-braces-pat-2.stderr +++ b/tests/ui/empty/empty-struct-braces-pat-2.stderr @@ -14,12 +14,14 @@ LL | pub struct XEmpty6(); | help: use struct pattern syntax instead | -LL | Empty1 {} => () - | ~~~~~~~~~ +LL - Empty1() => () +LL + Empty1 {} => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6() => () - | ~~~~~~~ +LL - Empty1() => () +LL + XEmpty6() => () + | error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-pat-2.rs:18:9 @@ -37,12 +39,14 @@ LL | pub struct XEmpty6(); | help: use struct pattern syntax instead | -LL | XEmpty1 {} => () - | ~~~~~~~~~~ +LL - XEmpty1() => () +LL + XEmpty1 {} => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6() => () - | ~~~~~~~ +LL - XEmpty1() => () +LL + XEmpty6() => () + | error[E0532]: expected tuple struct or tuple variant, found struct `Empty1` --> $DIR/empty-struct-braces-pat-2.rs:21:9 @@ -60,12 +64,14 @@ LL | pub struct XEmpty6(); | help: use struct pattern syntax instead | -LL | Empty1 {} => () - | ~~~~~~~~~ +LL - Empty1(..) => () +LL + Empty1 {} => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6(..) => () - | ~~~~~~~ +LL - Empty1(..) => () +LL + XEmpty6(..) => () + | error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-pat-2.rs:24:9 @@ -83,12 +89,14 @@ LL | pub struct XEmpty6(); | help: use struct pattern syntax instead | -LL | XEmpty1 {} => () - | ~~~~~~~~~~ +LL - XEmpty1(..) => () +LL + XEmpty1 {} => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6(..) => () - | ~~~~~~~ +LL - XEmpty1(..) => () +LL + XEmpty6(..) => () + | error: aborting due to 4 previous errors diff --git a/tests/ui/empty/empty-struct-tuple-pat.stderr b/tests/ui/empty/empty-struct-tuple-pat.stderr index 45001c7975324..3906a0e20608a 100644 --- a/tests/ui/empty/empty-struct-tuple-pat.stderr +++ b/tests/ui/empty/empty-struct-tuple-pat.stderr @@ -46,12 +46,14 @@ LL | XEmpty5(), | help: use the tuple variant pattern syntax instead | -LL | XE::XEmpty5() => (), - | ~~~~~~~~~~~~~ +LL - XE::XEmpty5 => (), +LL + XE::XEmpty5() => (), + | help: a unit variant with a similar name exists | -LL | XE::XEmpty4 => (), - | ~~~~~~~ +LL - XE::XEmpty5 => (), +LL + XE::XEmpty4 => (), + | error: aborting due to 4 previous errors diff --git a/tests/ui/empty/empty-struct-unit-pat.stderr b/tests/ui/empty/empty-struct-unit-pat.stderr index 5c0b4cffa9469..09a476423c8da 100644 --- a/tests/ui/empty/empty-struct-unit-pat.stderr +++ b/tests/ui/empty/empty-struct-unit-pat.stderr @@ -14,12 +14,14 @@ LL | pub struct XEmpty6(); | help: use this syntax instead | -LL | Empty2 => () - | ~~~~~~ +LL - Empty2() => () +LL + Empty2 => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6() => () - | ~~~~~~~ +LL - Empty2() => () +LL + XEmpty6() => () + | error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` --> $DIR/empty-struct-unit-pat.rs:24:9 @@ -36,12 +38,14 @@ LL | pub struct XEmpty6(); | help: use this syntax instead | -LL | XEmpty2 => () - | ~~~~~~~ +LL - XEmpty2() => () +LL + XEmpty2 => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6() => () - | ~~~~~~~ +LL - XEmpty2() => () +LL + XEmpty6() => () + | error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` --> $DIR/empty-struct-unit-pat.rs:28:9 @@ -59,12 +63,14 @@ LL | pub struct XEmpty6(); | help: use this syntax instead | -LL | Empty2 => () - | ~~~~~~ +LL - Empty2(..) => () +LL + Empty2 => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6(..) => () - | ~~~~~~~ +LL - Empty2(..) => () +LL + XEmpty6(..) => () + | error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` --> $DIR/empty-struct-unit-pat.rs:32:9 @@ -81,12 +87,14 @@ LL | pub struct XEmpty6(); | help: use this syntax instead | -LL | XEmpty2 => () - | ~~~~~~~ +LL - XEmpty2(..) => () +LL + XEmpty2 => () + | help: a tuple struct with a similar name exists | -LL | XEmpty6(..) => () - | ~~~~~~~ +LL - XEmpty2(..) => () +LL + XEmpty6(..) => () + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:37:9 @@ -112,12 +120,14 @@ LL | XEmpty5(), | help: use this syntax instead | -LL | XE::XEmpty4 => (), - | ~~~~~~~~~~~ +LL - XE::XEmpty4() => (), +LL + XE::XEmpty4 => (), + | help: a tuple variant with a similar name exists | -LL | XE::XEmpty5() => (), - | ~~~~~~~ +LL - XE::XEmpty4() => (), +LL + XE::XEmpty5() => (), + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:46:9 @@ -143,12 +153,14 @@ LL | XEmpty5(), | help: use this syntax instead | -LL | XE::XEmpty4 => (), - | ~~~~~~~~~~~ +LL - XE::XEmpty4(..) => (), +LL + XE::XEmpty4 => (), + | help: a tuple variant with a similar name exists | -LL | XE::XEmpty5(..) => (), - | ~~~~~~~ +LL - XE::XEmpty4(..) => (), +LL + XE::XEmpty5(..) => (), + | error: aborting due to 8 previous errors diff --git a/tests/ui/enum-discriminant/discriminant-ill-typed.stderr b/tests/ui/enum-discriminant/discriminant-ill-typed.stderr index 2757145285c79..e9508b7fe962d 100644 --- a/tests/ui/enum-discriminant/discriminant-ill-typed.stderr +++ b/tests/ui/enum-discriminant/discriminant-ill-typed.stderr @@ -6,8 +6,9 @@ LL | OhNo = 0_u8, | help: change the type of the numeric literal from `u8` to `i8` | -LL | OhNo = 0_i8, - | ~~ +LL - OhNo = 0_u8, +LL + OhNo = 0_i8, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:28:16 @@ -17,8 +18,9 @@ LL | OhNo = 0_i8, | help: change the type of the numeric literal from `i8` to `u8` | -LL | OhNo = 0_u8, - | ~~ +LL - OhNo = 0_i8, +LL + OhNo = 0_u8, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:41:16 @@ -28,8 +30,9 @@ LL | OhNo = 0_u16, | help: change the type of the numeric literal from `u16` to `i16` | -LL | OhNo = 0_i16, - | ~~~ +LL - OhNo = 0_u16, +LL + OhNo = 0_i16, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:54:16 @@ -39,8 +42,9 @@ LL | OhNo = 0_i16, | help: change the type of the numeric literal from `i16` to `u16` | -LL | OhNo = 0_u16, - | ~~~ +LL - OhNo = 0_i16, +LL + OhNo = 0_u16, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:67:16 @@ -50,8 +54,9 @@ LL | OhNo = 0_u32, | help: change the type of the numeric literal from `u32` to `i32` | -LL | OhNo = 0_i32, - | ~~~ +LL - OhNo = 0_u32, +LL + OhNo = 0_i32, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:80:16 @@ -61,8 +66,9 @@ LL | OhNo = 0_i32, | help: change the type of the numeric literal from `i32` to `u32` | -LL | OhNo = 0_u32, - | ~~~ +LL - OhNo = 0_i32, +LL + OhNo = 0_u32, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:93:16 @@ -72,8 +78,9 @@ LL | OhNo = 0_u64, | help: change the type of the numeric literal from `u64` to `i64` | -LL | OhNo = 0_i64, - | ~~~ +LL - OhNo = 0_u64, +LL + OhNo = 0_i64, + | error[E0308]: mismatched types --> $DIR/discriminant-ill-typed.rs:106:16 @@ -83,8 +90,9 @@ LL | OhNo = 0_i64, | help: change the type of the numeric literal from `i64` to `u64` | -LL | OhNo = 0_u64, - | ~~~ +LL - OhNo = 0_i64, +LL + OhNo = 0_u64, + | error: aborting due to 8 previous errors diff --git a/tests/ui/env-macro/error-recovery-issue-55897.stderr b/tests/ui/env-macro/error-recovery-issue-55897.stderr index 5a20bf8b16869..cda9aa330d221 100644 --- a/tests/ui/env-macro/error-recovery-issue-55897.stderr +++ b/tests/ui/env-macro/error-recovery-issue-55897.stderr @@ -30,8 +30,9 @@ LL | use env; | help: consider importing this module instead | -LL | use std::env; - | ~~~~~~~~ +LL - use env; +LL + use std::env; + | error: aborting due to 4 previous errors diff --git a/tests/ui/error-codes/E0027.stderr b/tests/ui/error-codes/E0027.stderr index 9ae97e4a994da..c8dd349bb8e06 100644 --- a/tests/ui/error-codes/E0027.stderr +++ b/tests/ui/error-codes/E0027.stderr @@ -6,12 +6,14 @@ LL | Dog { age: x } => {} | help: include the missing field in the pattern | -LL | Dog { age: x, name } => {} - | ~~~~~~~~ +LL - Dog { age: x } => {} +LL + Dog { age: x, name } => {} + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Dog { age: x, .. } => {} - | ~~~~~~ +LL - Dog { age: x } => {} +LL + Dog { age: x, .. } => {} + | error[E0027]: pattern does not mention field `age` --> $DIR/E0027.rs:15:9 @@ -21,12 +23,14 @@ LL | Dog { name: x, } => {} | help: include the missing field in the pattern | -LL | Dog { name: x, age } => {} - | ~~~~~~~ +LL - Dog { name: x, } => {} +LL + Dog { name: x, age } => {} + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Dog { name: x, .. } => {} - | ~~~~~~ +LL - Dog { name: x, } => {} +LL + Dog { name: x, .. } => {} + | error[E0027]: pattern does not mention field `age` --> $DIR/E0027.rs:19:9 @@ -36,12 +40,14 @@ LL | Dog { name: x , } => {} | help: include the missing field in the pattern | -LL | Dog { name: x, age } => {} - | ~~~~~~~ +LL - Dog { name: x , } => {} +LL + Dog { name: x, age } => {} + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Dog { name: x, .. } => {} - | ~~~~~~ +LL - Dog { name: x , } => {} +LL + Dog { name: x, .. } => {} + | error[E0027]: pattern does not mention fields `name`, `age` --> $DIR/E0027.rs:22:9 @@ -51,12 +57,14 @@ LL | Dog {} => {} | help: include the missing fields in the pattern | -LL | Dog { name, age } => {} - | ~~~~~~~~~~~~~ +LL - Dog {} => {} +LL + Dog { name, age } => {} + | help: if you don't care about these missing fields, you can explicitly ignore them | -LL | Dog { .. } => {} - | ~~~~~~ +LL - Dog {} => {} +LL + Dog { .. } => {} + | error: aborting due to 4 previous errors diff --git a/tests/ui/error-codes/E0034.stderr b/tests/ui/error-codes/E0034.stderr index 48b8efcf8a29b..434518741fc4e 100644 --- a/tests/ui/error-codes/E0034.stderr +++ b/tests/ui/error-codes/E0034.stderr @@ -16,10 +16,12 @@ LL | fn foo() {} | ^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | ::foo() - | ~~~~~~~~~~~~~~~~~~ -LL | ::foo() - | ~~~~~~~~~~~~~~~~~~ +LL - Test::foo() +LL + ::foo() + | +LL - Test::foo() +LL + ::foo() + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0040.stderr b/tests/ui/error-codes/E0040.stderr index 00cccb07c0f55..674c2b70b031e 100644 --- a/tests/ui/error-codes/E0040.stderr +++ b/tests/ui/error-codes/E0040.stderr @@ -6,8 +6,9 @@ LL | x.drop(); | help: consider using `drop` function | -LL | drop(x); - | +++++ ~ +LL - x.drop(); +LL + drop(x); + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0054.stderr b/tests/ui/error-codes/E0054.stderr index be35242ad7253..a2e618d9b06b2 100644 --- a/tests/ui/error-codes/E0054.stderr +++ b/tests/ui/error-codes/E0054.stderr @@ -6,8 +6,9 @@ LL | let x_is_nonzero = x as bool; | help: compare with zero instead | -LL | let x_is_nonzero = x != 0; - | ~~~~ +LL - let x_is_nonzero = x as bool; +LL + let x_is_nonzero = x != 0; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0057.stderr b/tests/ui/error-codes/E0057.stderr index ef6e2908b939f..35bd842b2cf4c 100644 --- a/tests/ui/error-codes/E0057.stderr +++ b/tests/ui/error-codes/E0057.stderr @@ -11,8 +11,9 @@ LL | let f = |x| x * 3; | ^^^ help: provide the argument | -LL | let a = f(/* x */); - | ~~~~~~~~~ +LL - let a = f(); +LL + let a = f(/* x */); + | error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/E0057.rs:5:13 diff --git a/tests/ui/error-codes/E0060.stderr b/tests/ui/error-codes/E0060.stderr index 8387b15b97087..922eae522a7fd 100644 --- a/tests/ui/error-codes/E0060.stderr +++ b/tests/ui/error-codes/E0060.stderr @@ -11,8 +11,9 @@ LL | fn printf(_: *const u8, ...) -> u32; | ^^^^^^ help: provide the argument | -LL | unsafe { printf(/* *const u8 */); } - | ~~~~~~~~~~~~~~~~~ +LL - unsafe { printf(); } +LL + unsafe { printf(/* *const u8 */); } + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0061.stderr b/tests/ui/error-codes/E0061.stderr index 7b180c0712084..ee368cba5b288 100644 --- a/tests/ui/error-codes/E0061.stderr +++ b/tests/ui/error-codes/E0061.stderr @@ -11,8 +11,9 @@ LL | fn f(a: u16, b: &str) {} | ^ ------ ------- help: provide the argument | -LL | f(0, /* &str */); - | ~~~~~~~~~~~~~~~ +LL - f(0); +LL + f(0, /* &str */); + | error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/E0061.rs:9:5 @@ -27,8 +28,9 @@ LL | fn f2(a: u16) {} | ^^ ------ help: provide the argument | -LL | f2(/* u16 */); - | ~~~~~~~~~~~ +LL - f2(); +LL + f2(/* u16 */); + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0214.stderr b/tests/ui/error-codes/E0214.stderr index 76b11f30996ea..71ae62d64e3bc 100644 --- a/tests/ui/error-codes/E0214.stderr +++ b/tests/ui/error-codes/E0214.stderr @@ -6,8 +6,9 @@ LL | let v: Vec(&str) = vec!["foo"]; | help: use angle brackets instead | -LL | let v: Vec<&str> = vec!["foo"]; - | ~ ~ +LL - let v: Vec(&str) = vec!["foo"]; +LL + let v: Vec<&str> = vec!["foo"]; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0221.stderr b/tests/ui/error-codes/E0221.stderr index 07e7485b67e03..a18e91806d7d9 100644 --- a/tests/ui/error-codes/E0221.stderr +++ b/tests/ui/error-codes/E0221.stderr @@ -12,12 +12,14 @@ LL | let _: Self::A; | help: use fully-qualified syntax to disambiguate | -LL | let _: ::A; - | ~~~~~~~~~~~~~~~ +LL - let _: Self::A; +LL + let _: ::A; + | help: use fully-qualified syntax to disambiguate | -LL | let _: ::A; - | ~~~~~~~~~~~~~~~ +LL - let _: Self::A; +LL + let _: ::A; + | error[E0221]: ambiguous associated type `Err` in bounds of `Self` --> $DIR/E0221.rs:21:16 @@ -31,8 +33,9 @@ LL | let _: Self::Err; = note: associated type `Err` could derive from `FromStr` help: use fully-qualified syntax to disambiguate | -LL | let _: ::Err; - | ~~~~~~~~~~~~~~ +LL - let _: Self::Err; +LL + let _: ::Err; + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0259.stderr b/tests/ui/error-codes/E0259.stderr index 975d1a161a014..08d3deb68d233 100644 --- a/tests/ui/error-codes/E0259.stderr +++ b/tests/ui/error-codes/E0259.stderr @@ -10,7 +10,8 @@ LL | extern crate test as alloc; = note: `alloc` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate test as other_alloc; +LL - extern crate test as alloc; +LL + extern crate test as other_alloc; | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0260.stderr b/tests/ui/error-codes/E0260.stderr index 35698c6535902..cb47b77904a38 100644 --- a/tests/ui/error-codes/E0260.stderr +++ b/tests/ui/error-codes/E0260.stderr @@ -10,7 +10,8 @@ LL | mod alloc { = note: `alloc` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate alloc as other_alloc; +LL - extern crate alloc; +LL + extern crate alloc as other_alloc; | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0283.stderr b/tests/ui/error-codes/E0283.stderr index 381eca5f2a44a..29baae5f133a2 100644 --- a/tests/ui/error-codes/E0283.stderr +++ b/tests/ui/error-codes/E0283.stderr @@ -30,8 +30,9 @@ LL | impl Into for Impl { where U: From; help: try using a fully qualified path to specify the expected types | -LL | let bar = >::into(foo_impl) * 1u32; - | ++++++++++++++++++++++++ ~ +LL - let bar = foo_impl.into() * 1u32; +LL + let bar = >::into(foo_impl) * 1u32; + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0423.stderr b/tests/ui/error-codes/E0423.stderr index dd7a5b034c587..e50b8bd820cf8 100644 --- a/tests/ui/error-codes/E0423.stderr +++ b/tests/ui/error-codes/E0423.stderr @@ -51,12 +51,14 @@ LL | fn foo() { | help: use struct literal syntax instead | -LL | let f = Foo { a: val }; - | ~~~~~~~~~~~~~~ +LL - let f = Foo(); +LL + let f = Foo { a: val }; + | help: a function with a similar name exists (notice the capitalization difference) | -LL | let f = foo(); - | ~~~ +LL - let f = Foo(); +LL + let f = foo(); + | error: aborting due to 5 previous errors diff --git a/tests/ui/error-codes/E0435.stderr b/tests/ui/error-codes/E0435.stderr index 1ebb997639447..13187472e60c7 100644 --- a/tests/ui/error-codes/E0435.stderr +++ b/tests/ui/error-codes/E0435.stderr @@ -6,8 +6,9 @@ LL | let _: [u8; foo]; | help: consider using `const` instead of `let` | -LL | const foo: usize = 42; - | ~~~~~ +LL - let foo: usize = 42; +LL + const foo: usize = 42; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0516.stderr b/tests/ui/error-codes/E0516.stderr index 62e70a4668d12..f4127678d5b99 100644 --- a/tests/ui/error-codes/E0516.stderr +++ b/tests/ui/error-codes/E0516.stderr @@ -6,8 +6,9 @@ LL | let x: typeof(92) = 92; | help: consider replacing `typeof(...)` with an actual type | -LL | let x: i32 = 92; - | ~~~ +LL - let x: typeof(92) = 92; +LL + let x: i32 = 92; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0617.stderr b/tests/ui/error-codes/E0617.stderr index ea91ad0829230..428f06c198ffd 100644 --- a/tests/ui/error-codes/E0617.stderr +++ b/tests/ui/error-codes/E0617.stderr @@ -36,8 +36,9 @@ LL | printf(::std::ptr::null(), printf); | help: cast the value to `unsafe extern "C" fn(*const i8, ...)` | -LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...)); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - printf(::std::ptr::null(), printf); +LL + printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...)); + | error: aborting due to 6 previous errors diff --git a/tests/ui/error-codes/E0637.stderr b/tests/ui/error-codes/E0637.stderr index d9db89ddb0c97..95a5a58ab8561 100644 --- a/tests/ui/error-codes/E0637.stderr +++ b/tests/ui/error-codes/E0637.stderr @@ -13,8 +13,9 @@ LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `str1` or `str2` help: consider introducing a named lifetime parameter | -LL | fn underscore_lifetime<'a, '_>(str1: &'a str, str2: &'a str) -> &'a str { - | +++ ~~ ~~ ~~ +LL - fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { +LL + fn underscore_lifetime<'a, '_>(str1: &'a str, str2: &'a str) -> &'a str { + | error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 diff --git a/tests/ui/error-codes/E0642.stderr b/tests/ui/error-codes/E0642.stderr index dd9e28ad49277..97309e95b6b49 100644 --- a/tests/ui/error-codes/E0642.stderr +++ b/tests/ui/error-codes/E0642.stderr @@ -6,8 +6,9 @@ LL | fn foo((x, y): (i32, i32)); | help: give this argument a name or use an underscore to ignore it | -LL | fn foo(_: (i32, i32)); - | ~ +LL - fn foo((x, y): (i32, i32)); +LL + fn foo(_: (i32, i32)); + | error[E0642]: patterns aren't allowed in methods without bodies --> $DIR/E0642.rs:11:12 @@ -17,8 +18,9 @@ LL | fn bar((x, y): (i32, i32)) {} | help: give this argument a name or use an underscore to ignore it | -LL | fn bar(_: (i32, i32)) {} - | ~ +LL - fn bar((x, y): (i32, i32)) {} +LL + fn bar(_: (i32, i32)) {} + | error[E0642]: patterns aren't allowed in methods without bodies --> $DIR/E0642.rs:13:15 @@ -28,8 +30,9 @@ LL | fn method(S { .. }: S) {} | help: give this argument a name or use an underscore to ignore it | -LL | fn method(_: S) {} - | ~ +LL - fn method(S { .. }: S) {} +LL + fn method(_: S) {} + | error: aborting due to 3 previous errors diff --git a/tests/ui/error-codes/E0746.stderr b/tests/ui/error-codes/E0746.stderr index cfc747cb1e2c4..393ddfb647354 100644 --- a/tests/ui/error-codes/E0746.stderr +++ b/tests/ui/error-codes/E0746.stderr @@ -6,8 +6,9 @@ LL | fn foo() -> dyn Trait { Struct } | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn foo() -> impl Trait { Struct } - | ~~~~ +LL - fn foo() -> dyn Trait { Struct } +LL + fn foo() -> impl Trait { Struct } + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL | fn foo() -> Box { Box::new(Struct) } diff --git a/tests/ui/error-codes/ex-E0612.stderr b/tests/ui/error-codes/ex-E0612.stderr index 23c1697b9b20f..54451d3d4526e 100644 --- a/tests/ui/error-codes/ex-E0612.stderr +++ b/tests/ui/error-codes/ex-E0612.stderr @@ -6,8 +6,9 @@ LL | y.1; | help: a field with a similar name exists | -LL | y.0; - | ~ +LL - y.1; +LL + y.0; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-festival.stderr b/tests/ui/error-festival.stderr index 9d75671c4e6b4..479016ab0a10e 100644 --- a/tests/ui/error-festival.stderr +++ b/tests/ui/error-festival.stderr @@ -67,8 +67,9 @@ LL | let x_is_nonzero = x as bool; | help: compare with zero instead | -LL | let x_is_nonzero = x != 0; - | ~~~~ +LL - let x_is_nonzero = x as bool; +LL + let x_is_nonzero = x != 0; + | error[E0606]: casting `&u8` as `u32` is invalid --> $DIR/error-festival.rs:37:18 diff --git a/tests/ui/explicit/explicit-call-to-dtor.stderr b/tests/ui/explicit/explicit-call-to-dtor.stderr index 6f40f3998a98c..47d2823c82d35 100644 --- a/tests/ui/explicit/explicit-call-to-dtor.stderr +++ b/tests/ui/explicit/explicit-call-to-dtor.stderr @@ -6,8 +6,9 @@ LL | x.drop(); | help: consider using `drop` function | -LL | drop(x); - | +++++ ~ +LL - x.drop(); +LL + drop(x); + | error: aborting due to 1 previous error diff --git a/tests/ui/explicit/explicit-call-to-supertrait-dtor.stderr b/tests/ui/explicit/explicit-call-to-supertrait-dtor.stderr index 13b6ee9987e88..9f98fb5f26c2a 100644 --- a/tests/ui/explicit/explicit-call-to-supertrait-dtor.stderr +++ b/tests/ui/explicit/explicit-call-to-supertrait-dtor.stderr @@ -6,8 +6,9 @@ LL | self.drop(); | help: consider using `drop` function | -LL | drop(self); - | +++++ ~ +LL - self.drop(); +LL + drop(self); + | error: aborting due to 1 previous error diff --git a/tests/ui/expr/if/if-branch-types.stderr b/tests/ui/expr/if/if-branch-types.stderr index 0e86a24f31b7d..587d2f10a8c09 100644 --- a/tests/ui/expr/if/if-branch-types.stderr +++ b/tests/ui/expr/if/if-branch-types.stderr @@ -8,8 +8,9 @@ LL | let x = if true { 10i32 } else { 10u32 }; | help: change the type of the numeric literal from `u32` to `i32` | -LL | let x = if true { 10i32 } else { 10i32 }; - | ~~~ +LL - let x = if true { 10i32 } else { 10u32 }; +LL + let x = if true { 10i32 } else { 10i32 }; + | error: aborting due to 1 previous error diff --git a/tests/ui/expr/if/if-else-type-mismatch.stderr b/tests/ui/expr/if/if-else-type-mismatch.stderr index f1fffdb1e7ef8..1cf94c98800bb 100644 --- a/tests/ui/expr/if/if-else-type-mismatch.stderr +++ b/tests/ui/expr/if/if-else-type-mismatch.stderr @@ -13,8 +13,9 @@ LL | | }; | help: change the type of the numeric literal from `u32` to `i32` | -LL | 2i32 - | ~~~ +LL - 2u32 +LL + 2i32 + | error[E0308]: `if` and `else` have incompatible types --> $DIR/if-else-type-mismatch.rs:8:38 @@ -26,8 +27,9 @@ LL | let _ = if true { 42i32 } else { 42u32 }; | help: change the type of the numeric literal from `u32` to `i32` | -LL | let _ = if true { 42i32 } else { 42i32 }; - | ~~~ +LL - let _ = if true { 42i32 } else { 42u32 }; +LL + let _ = if true { 42i32 } else { 42i32 }; + | error[E0308]: `if` and `else` have incompatible types --> $DIR/if-else-type-mismatch.rs:13:9 diff --git a/tests/ui/expr/issue-22933-2.stderr b/tests/ui/expr/issue-22933-2.stderr index dadc31213621c..07f095f643ee5 100644 --- a/tests/ui/expr/issue-22933-2.stderr +++ b/tests/ui/expr/issue-22933-2.stderr @@ -9,8 +9,9 @@ LL | ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, | help: there is a variant with a similar name | -LL | ApplePie = Delicious::Apple as isize | Delicious::Pie as isize, - | ~~~ +LL - ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, +LL + ApplePie = Delicious::Apple as isize | Delicious::Pie as isize, + | error: aborting due to 1 previous error diff --git a/tests/ui/extern/extern-const.stderr b/tests/ui/extern/extern-const.stderr index 441495866cd9b..c48eca8c36dff 100644 --- a/tests/ui/extern/extern-const.stderr +++ b/tests/ui/extern/extern-const.stderr @@ -7,8 +7,9 @@ LL | const rust_dbg_static_mut: c_int; = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html help: try using a static value | -LL | static rust_dbg_static_mut: c_int; - | ~~~~~~ +LL - const rust_dbg_static_mut: c_int; +LL + static rust_dbg_static_mut: c_int; + | error: aborting due to 1 previous error diff --git a/tests/ui/extern/extern-crate-rename.stderr b/tests/ui/extern/extern-crate-rename.stderr index 43f6e56ab0e70..4d4a585de60c1 100644 --- a/tests/ui/extern/extern-crate-rename.stderr +++ b/tests/ui/extern/extern-crate-rename.stderr @@ -9,8 +9,9 @@ LL | extern crate m2 as m1; = note: `m1` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate m2 as other_m1; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - extern crate m2 as m1; +LL + extern crate m2 as other_m1; + | error: aborting due to 1 previous error diff --git a/tests/ui/extern/extern-crate-visibility.stderr b/tests/ui/extern/extern-crate-visibility.stderr index b239727092ae1..c037da41b5eae 100644 --- a/tests/ui/extern/extern-crate-visibility.stderr +++ b/tests/ui/extern/extern-crate-visibility.stderr @@ -11,8 +11,9 @@ LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ help: consider importing this module instead | -LL | use std::cell; - | ~~~~~~~~~ +LL - use foo::core::cell; +LL + use std::cell; + | error[E0603]: crate import `core` is private --> $DIR/extern-crate-visibility.rs:9:10 @@ -27,8 +28,9 @@ LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ help: consider importing this struct instead | -LL | std::cell::Cell::new(0); - | ~~~~~~~~~~~~~~~ +LL - foo::core::cell::Cell::new(0); +LL + std::cell::Cell::new(0); + | error: aborting due to 2 previous errors diff --git a/tests/ui/extern/issue-18819.stderr b/tests/ui/extern/issue-18819.stderr index 6de0ebfe9aee7..566bf6a1f648f 100644 --- a/tests/ui/extern/issue-18819.stderr +++ b/tests/ui/extern/issue-18819.stderr @@ -22,8 +22,9 @@ LL | print_x(&X); | + help: provide the argument | -LL | print_x(/* &dyn Foo */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - print_x(X); +LL + print_x(/* &dyn Foo */, /* &str */); + | error: aborting due to 1 previous error diff --git a/tests/ui/extern/not-in-block.stderr b/tests/ui/extern/not-in-block.stderr index 2544949ab17a8..0640e94748573 100644 --- a/tests/ui/extern/not-in-block.stderr +++ b/tests/ui/extern/not-in-block.stderr @@ -6,12 +6,14 @@ LL | extern fn none_fn(x: bool) -> i32; | help: provide a definition for the function | -LL | extern fn none_fn(x: bool) -> i32 { } - | ~~~~~~~~~~ +LL - extern fn none_fn(x: bool) -> i32; +LL + extern fn none_fn(x: bool) -> i32 { } + | help: if you meant to declare an externally defined function, use an `extern` block | -LL | extern { fn none_fn(x: bool) -> i32; } - | ~~~~~~~~ + +LL - extern fn none_fn(x: bool) -> i32; +LL + extern { fn none_fn(x: bool) -> i32; } + | error: free function without a body --> $DIR/not-in-block.rs:5:1 @@ -21,12 +23,14 @@ LL | extern "C" fn c_fn(x: bool) -> i32; | help: provide a definition for the function | -LL | extern "C" fn c_fn(x: bool) -> i32 { } - | ~~~~~~~~~~ +LL - extern "C" fn c_fn(x: bool) -> i32; +LL + extern "C" fn c_fn(x: bool) -> i32 { } + | help: if you meant to declare an externally defined function, use an `extern` block | -LL | extern "C" { fn c_fn(x: bool) -> i32; } - | ~~~~~~~~~~~~ + +LL - extern "C" fn c_fn(x: bool) -> i32; +LL + extern "C" { fn c_fn(x: bool) -> i32; } + | error: aborting due to 2 previous errors diff --git a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr index 0234480ac5acb..2f5e3650734ec 100644 --- a/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr +++ b/tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr @@ -15,8 +15,9 @@ LL | let _: u8 = ::core::default::Default(); | help: try using `std` instead of `core` | -LL | let _: u8 = ::std::default::Default(); - | ~~~ +LL - let _: u8 = ::core::default::Default(); +LL + let _: u8 = ::std::default::Default(); + | help: consider importing this module | LL + use std::default; diff --git a/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr b/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr index 696326157ce29..a6e0e668261cb 100644 --- a/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr +++ b/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr @@ -7,8 +7,9 @@ LL | let _max: usize = -1; = note: unsigned values cannot be negated help: you may have meant the maximum value of `usize` | -LL | let _max: usize = usize::MAX; - | ~~~~~~~~~~ +LL - let _max: usize = -1; +LL + let _max: usize = usize::MAX; + | error[E0600]: cannot apply unary operator `-` to type `u8` --> $DIR/feature-gate-negate-unsigned.rs:14:14 diff --git a/tests/ui/feature-gates/feature-gate-never_patterns.stderr b/tests/ui/feature-gates/feature-gate-never_patterns.stderr index 9f94e96203518..dcd5db56da882 100644 --- a/tests/ui/feature-gates/feature-gate-never_patterns.stderr +++ b/tests/ui/feature-gates/feature-gate-never_patterns.stderr @@ -10,7 +10,8 @@ LL | (Some(_),) | + + help: ...or a vertical bar to match on multiple alternatives | -LL | Some(_) | +LL - Some(_), +LL + Some(_) | | error[E0658]: `!` patterns are experimental diff --git a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr index 584724dfe59cc..e427665fbc356 100644 --- a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr +++ b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr @@ -95,8 +95,9 @@ LL | extern "rust-call" fn call(self, args: ()) -> () {} found signature `extern "rust-call" fn(Foo, ()) -> ()` help: change the self-receiver type to match the trait | -LL | extern "rust-call" fn call(&self, args: ()) -> () {} - | ~~~~~ +LL - extern "rust-call" fn call(self, args: ()) -> () {} +LL + extern "rust-call" fn call(&self, args: ()) -> () {} + | error[E0183]: manual implementations of `FnOnce` are experimental --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:18:6 @@ -165,8 +166,9 @@ LL | extern "rust-call" fn call_mut(&self, args: ()) -> () {} found signature `extern "rust-call" fn(&Bar, ()) -> ()` help: change the self-receiver type to match the trait | -LL | extern "rust-call" fn call_mut(&mut self, args: ()) -> () {} - | ~~~~~~~~~ +LL - extern "rust-call" fn call_mut(&self, args: ()) -> () {} +LL + extern "rust-call" fn call_mut(&mut self, args: ()) -> () {} + | error[E0046]: not all trait items implemented, missing: `Output` --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:35:1 diff --git a/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr b/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr index b11c30eaad4b7..fc99e1c0495b7 100644 --- a/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr +++ b/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr @@ -8,8 +8,9 @@ LL | fn foo(x: dyn Foo) { = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | fn foo(x: impl Foo) { - | ~~~~ +LL - fn foo(x: dyn Foo) { +LL + fn foo(x: impl Foo) { + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | fn foo(x: &dyn Foo) { diff --git a/tests/ui/feature-gates/feature-gate-unsized_locals.stderr b/tests/ui/feature-gates/feature-gate-unsized_locals.stderr index f1595e034be55..ca14a0ca03917 100644 --- a/tests/ui/feature-gates/feature-gate-unsized_locals.stderr +++ b/tests/ui/feature-gates/feature-gate-unsized_locals.stderr @@ -8,8 +8,9 @@ LL | fn f(f: dyn FnOnce()) {} = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | fn f(f: impl FnOnce()) {} - | ~~~~ +LL - fn f(f: dyn FnOnce()) {} +LL + fn f(f: impl FnOnce()) {} + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | fn f(f: &dyn FnOnce()) {} diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr index 9a12851f20e5f..8987b87f84e9e 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr @@ -24,10 +24,12 @@ LL | #[macro_use = "2700"] struct S; | help: the following are the possible correct uses | -LL | #[macro_use(name1, name2, ...)] struct S; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | #[macro_use] struct S; - | ~~~~~~~~~~~~ +LL - #[macro_use = "2700"] struct S; +LL + #[macro_use(name1, name2, ...)] struct S; + | +LL - #[macro_use = "2700"] struct S; +LL + #[macro_use] struct S; + | error: aborting due to 4 previous errors diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr b/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr index 08abba2854ecc..af6bb58071fff 100644 --- a/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr @@ -6,8 +6,9 @@ LL | println!("{x.0}"); | help: consider using a positional formatting argument instead | -LL | println!("{0}", x.0); - | ~ +++++ +LL - println!("{x.0}"); +LL + println!("{0}", x.0); + | error: aborting due to 1 previous error diff --git a/tests/ui/fmt/format-string-error-2.stderr b/tests/ui/fmt/format-string-error-2.stderr index d5fe4081ac811..3c9524ee06ccc 100644 --- a/tests/ui/fmt/format-string-error-2.stderr +++ b/tests/ui/fmt/format-string-error-2.stderr @@ -6,8 +6,9 @@ LL | println!("\x7B}\u8 {", 1); | help: format of unicode escape sequences uses braces | -LL | println!("\x7B}\u{8} {", 1); - | ~~~~~ +LL - println!("\x7B}\u8 {", 1); +LL + println!("\x7B}\u{8} {", 1); + | error: invalid format string: expected `'}'`, found `'a'` --> $DIR/format-string-error-2.rs:5:5 diff --git a/tests/ui/fmt/no-inline-literals-out-of-range.stderr b/tests/ui/fmt/no-inline-literals-out-of-range.stderr index 78ec4888c27a3..78047eabf4993 100644 --- a/tests/ui/fmt/no-inline-literals-out-of-range.stderr +++ b/tests/ui/fmt/no-inline-literals-out-of-range.stderr @@ -8,12 +8,14 @@ LL | format_args!("{}", 0x8f_i8); // issue #115423 = note: `#[deny(overflowing_literals)]` on by default help: consider using the type `u8` instead | -LL | format_args!("{}", 0x8f_u8); // issue #115423 - | ~~~~~~~ +LL - format_args!("{}", 0x8f_i8); // issue #115423 +LL + format_args!("{}", 0x8f_u8); // issue #115423 + | help: to use as a negative number (decimal `-113`), consider using the type `u8` for the literal and cast it to `i8` | -LL | format_args!("{}", 0x8f_u8 as i8); // issue #115423 - | ~~~~~~~~~~~~~ +LL - format_args!("{}", 0x8f_i8); // issue #115423 +LL + format_args!("{}", 0x8f_u8 as i8); // issue #115423 + | error: literal out of range for `u8` --> $DIR/no-inline-literals-out-of-range.rs:6:24 @@ -49,8 +51,9 @@ LL | format_args!("{}", 0xffff_ffff); // treat unsuffixed literals as i32 = help: consider using the type `u32` instead help: to use as a negative number (decimal `-1`), consider using the type `u32` for the literal and cast it to `i32` | -LL | format_args!("{}", 0xffff_ffffu32 as i32); // treat unsuffixed literals as i32 - | ~~~~~~~~~~~~~~~~~~~~~ +LL - format_args!("{}", 0xffff_ffff); // treat unsuffixed literals as i32 +LL + format_args!("{}", 0xffff_ffffu32 as i32); // treat unsuffixed literals as i32 + | error: aborting due to 5 previous errors diff --git a/tests/ui/fmt/struct-field-as-captured-argument.stderr b/tests/ui/fmt/struct-field-as-captured-argument.stderr index 4ef022cecb042..388c14f932bbc 100644 --- a/tests/ui/fmt/struct-field-as-captured-argument.stderr +++ b/tests/ui/fmt/struct-field-as-captured-argument.stderr @@ -6,8 +6,9 @@ LL | let _ = format!("{foo.field}"); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{0}", foo.field); - | ~ +++++++++++ +LL - let _ = format!("{foo.field}"); +LL + let _ = format!("{0}", foo.field); + | error: invalid format string: field access isn't supported --> $DIR/struct-field-as-captured-argument.rs:12:23 @@ -17,8 +18,9 @@ LL | let _ = format!("{foo.field} {} {bar}", "aa"); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{1} {} {bar}", "aa", foo.field); - | ~ +++++++++++ +LL - let _ = format!("{foo.field} {} {bar}", "aa"); +LL + let _ = format!("{1} {} {bar}", "aa", foo.field); + | error: invalid format string: field access isn't supported --> $DIR/struct-field-as-captured-argument.rs:13:23 @@ -28,8 +30,9 @@ LL | let _ = format!("{foo.field} {} {1} {bar}", "aa", "bb"); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{2} {} {1} {bar}", "aa", "bb", foo.field); - | ~ +++++++++++ +LL - let _ = format!("{foo.field} {} {1} {bar}", "aa", "bb"); +LL + let _ = format!("{2} {} {1} {bar}", "aa", "bb", foo.field); + | error: invalid format string: field access isn't supported --> $DIR/struct-field-as-captured-argument.rs:14:23 @@ -39,8 +42,9 @@ LL | let _ = format!("{foo.field} {} {baz}", "aa", baz = 3); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{1} {} {baz}", "aa", foo.field, baz = 3); - | ~ +++++++++++ +LL - let _ = format!("{foo.field} {} {baz}", "aa", baz = 3); +LL + let _ = format!("{1} {} {baz}", "aa", foo.field, baz = 3); + | error: invalid format string: field access isn't supported --> $DIR/struct-field-as-captured-argument.rs:15:23 @@ -50,8 +54,9 @@ LL | let _ = format!("{foo.field:?} {} {baz}", "aa", baz = 3); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{1:?} {} {baz}", "aa", foo.field, baz = 3); - | ~ +++++++++++ +LL - let _ = format!("{foo.field:?} {} {baz}", "aa", baz = 3); +LL + let _ = format!("{1:?} {} {baz}", "aa", foo.field, baz = 3); + | error: invalid format string: field access isn't supported --> $DIR/struct-field-as-captured-argument.rs:16:23 @@ -61,8 +66,9 @@ LL | let _ = format!("{foo.field:#?} {} {baz}", "aa", baz = 3); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{1:#?} {} {baz}", "aa", foo.field, baz = 3); - | ~ +++++++++++ +LL - let _ = format!("{foo.field:#?} {} {baz}", "aa", baz = 3); +LL + let _ = format!("{1:#?} {} {baz}", "aa", foo.field, baz = 3); + | error: invalid format string: field access isn't supported --> $DIR/struct-field-as-captured-argument.rs:17:23 @@ -72,8 +78,9 @@ LL | let _ = format!("{foo.field:.3} {} {baz}", "aa", baz = 3); | help: consider using a positional formatting argument instead | -LL | let _ = format!("{1:.3} {} {baz}", "aa", foo.field, baz = 3); - | ~ +++++++++++ +LL - let _ = format!("{foo.field:.3} {} {baz}", "aa", baz = 3); +LL + let _ = format!("{1:.3} {} {baz}", "aa", foo.field, baz = 3); + | error: aborting due to 7 previous errors diff --git a/tests/ui/fn/fn-pointer-mismatch.stderr b/tests/ui/fn/fn-pointer-mismatch.stderr index 9cda11639d0f5..3b2d3c123d78a 100644 --- a/tests/ui/fn/fn-pointer-mismatch.stderr +++ b/tests/ui/fn/fn-pointer-mismatch.stderr @@ -51,8 +51,9 @@ LL | let c: fn(u32) -> u32 = &foo; found reference `&fn(_) -> _ {foo}` help: consider removing the reference | -LL | let c: fn(u32) -> u32 = foo; - | ~~~ +LL - let c: fn(u32) -> u32 = &foo; +LL + let c: fn(u32) -> u32 = foo; + | error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:42:30 @@ -66,8 +67,9 @@ LL | let d: &fn(u32) -> u32 = foo; found fn item `fn(_) -> _ {foo}` help: consider using a reference | -LL | let d: &fn(u32) -> u32 = &foo; - | ~~~~ +LL - let d: &fn(u32) -> u32 = foo; +LL + let d: &fn(u32) -> u32 = &foo; + | error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:48:30 @@ -82,8 +84,9 @@ LL | let e: &fn(u32) -> u32 = &foo; = note: fn items are distinct from fn pointers help: consider casting to a fn pointer | -LL | let e: &fn(u32) -> u32 = &(foo as fn(u32) -> u32); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let e: &fn(u32) -> u32 = &foo; +LL + let e: &fn(u32) -> u32 = &(foo as fn(u32) -> u32); + | error: aborting due to 6 previous errors diff --git a/tests/ui/fn/fn-recover-return-sign.stderr b/tests/ui/fn/fn-recover-return-sign.stderr index e6012f3f95024..96aa96f00adbf 100644 --- a/tests/ui/fn/fn-recover-return-sign.stderr +++ b/tests/ui/fn/fn-recover-return-sign.stderr @@ -6,8 +6,9 @@ LL | fn a() => usize { 0 } | help: use `->` instead | -LL | fn a() -> usize { 0 } - | ~~ +LL - fn a() => usize { 0 } +LL + fn a() -> usize { 0 } + | error: return types are denoted using `->` --> $DIR/fn-recover-return-sign.rs:6:7 @@ -17,8 +18,9 @@ LL | fn b(): usize { 0 } | help: use `->` instead | -LL | fn b() -> usize { 0 } - | ~~ +LL - fn b(): usize { 0 } +LL + fn b() -> usize { 0 } + | error: return types are denoted using `->` --> $DIR/fn-recover-return-sign.rs:21:25 @@ -28,8 +30,9 @@ LL | let foo = |a: bool| => bool { a }; | help: use `->` instead | -LL | let foo = |a: bool| -> bool { a }; - | ~~ +LL - let foo = |a: bool| => bool { a }; +LL + let foo = |a: bool| -> bool { a }; + | error: return types are denoted using `->` --> $DIR/fn-recover-return-sign.rs:25:24 @@ -39,8 +42,9 @@ LL | let bar = |a: bool|: bool { a }; | help: use `->` instead | -LL | let bar = |a: bool| -> bool { a }; - | ~~ +LL - let bar = |a: bool|: bool { a }; +LL + let bar = |a: bool| -> bool { a }; + | error: aborting due to 4 previous errors diff --git a/tests/ui/fn/fn-recover-return-sign2.stderr b/tests/ui/fn/fn-recover-return-sign2.stderr index fb88ff7b95045..ba6662b0d46d8 100644 --- a/tests/ui/fn/fn-recover-return-sign2.stderr +++ b/tests/ui/fn/fn-recover-return-sign2.stderr @@ -6,8 +6,9 @@ LL | fn foo() => impl Fn() => bool { | help: use `->` instead | -LL | fn foo() -> impl Fn() => bool { - | ~~ +LL - fn foo() => impl Fn() => bool { +LL + fn foo() -> impl Fn() => bool { + | error: expected one of `+`, `->`, `::`, `where`, or `{`, found `=>` --> $DIR/fn-recover-return-sign2.rs:4:23 diff --git a/tests/ui/functional-struct-update/functional-struct-update-noncopyable.stderr b/tests/ui/functional-struct-update/functional-struct-update-noncopyable.stderr index d167a60dad387..b09ffb10673e2 100644 --- a/tests/ui/functional-struct-update/functional-struct-update-noncopyable.stderr +++ b/tests/ui/functional-struct-update/functional-struct-update-noncopyable.stderr @@ -9,8 +9,9 @@ LL | let _b = A { y: Arc::new(3), ..a }; | help: clone the value from the field instead of using the functional record update syntax | -LL | let _b = A { y: Arc::new(3), x: a.x.clone() }; - | ~~~~~~~~~~~~~~~~ +LL - let _b = A { y: Arc::new(3), ..a }; +LL + let _b = A { y: Arc::new(3), x: a.x.clone() }; + | error: aborting due to 1 previous error diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index 9d8e91c02ca37..faed76fc8ec77 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr +++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr @@ -12,8 +12,9 @@ LL | fn foo<'a>(arg: Box>) {} | help: use angle brackets instead | -LL | fn foo<'a>(arg: Box = &'a ()>>) {} - | ~ ~ +LL - fn foo<'a>(arg: Box>) {} +LL + fn foo<'a>(arg: Box = &'a ()>>) {} + | error: parenthesized generic arguments cannot be used in associated type constraints --> $DIR/gat-trait-path-parenthesised-args.rs:18:27 diff --git a/tests/ui/generic-associated-types/impl_bounds.stderr b/tests/ui/generic-associated-types/impl_bounds.stderr index c3b119e21443d..168da64f83761 100644 --- a/tests/ui/generic-associated-types/impl_bounds.stderr +++ b/tests/ui/generic-associated-types/impl_bounds.stderr @@ -18,8 +18,9 @@ LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; | help: copy the `where` clause predicates from the trait | -LL | type B<'a, 'b> = (&'a(), &'b ()) where 'a: 'b; - | ~~~~~~~~~~~~ +LL - type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; +LL + type B<'a, 'b> = (&'a(), &'b ()) where 'a: 'b; + | error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/impl_bounds.rs:18:33 diff --git a/tests/ui/generic-associated-types/issue-70304.stderr b/tests/ui/generic-associated-types/issue-70304.stderr index 9b02c1b076837..a181b1035b7c3 100644 --- a/tests/ui/generic-associated-types/issue-70304.stderr +++ b/tests/ui/generic-associated-types/issue-70304.stderr @@ -13,8 +13,9 @@ LL | fn create_doc() -> impl Document = DocCursorImpl<'_>> { = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn create_doc() -> impl Document = DocCursorImpl<'static>> { - | ~~~~~~~ +LL - fn create_doc() -> impl Document = DocCursorImpl<'_>> { +LL + fn create_doc() -> impl Document = DocCursorImpl<'static>> { + | error: missing required bound on `Cursor` --> $DIR/issue-70304.rs:2:5 diff --git a/tests/ui/generic-associated-types/mismatched-where-clause-regions.stderr b/tests/ui/generic-associated-types/mismatched-where-clause-regions.stderr index ee90f61aabc74..9ff343c255b7a 100644 --- a/tests/ui/generic-associated-types/mismatched-where-clause-regions.stderr +++ b/tests/ui/generic-associated-types/mismatched-where-clause-regions.stderr @@ -9,8 +9,9 @@ LL | type T<'a2, 'b2> = () where 'b2: 'a2; | help: copy the `where` clause predicates from the trait | -LL | type T<'a2, 'b2> = () where 'a2: 'b2; - | ~~~~~~~~~~~~~~ +LL - type T<'a2, 'b2> = () where 'b2: 'a2; +LL + type T<'a2, 'b2> = () where 'a2: 'b2; + | error: aborting due to 1 previous error diff --git a/tests/ui/generic-associated-types/missing-bounds.stderr b/tests/ui/generic-associated-types/missing-bounds.stderr index 1d7d80d1b0768..d716e32c3aef1 100644 --- a/tests/ui/generic-associated-types/missing-bounds.stderr +++ b/tests/ui/generic-associated-types/missing-bounds.stderr @@ -7,8 +7,9 @@ LL | impl Add for E where ::Output = B { = note: see issue #20041 for more information help: if `Output` is an associated type you're trying to set, use the associated type binding syntax | -LL | impl Add for E where B: Add { - | ~~~~~~~~~~~~~~~~~~ +LL - impl Add for E where ::Output = B { +LL + impl Add for E where B: Add { + | error[E0308]: mismatched types --> $DIR/missing-bounds.rs:11:11 diff --git a/tests/ui/generic-const-items/duplicate-where-clause.stderr b/tests/ui/generic-const-items/duplicate-where-clause.stderr index 5fa61b01ee9db..6b742dfafedaa 100644 --- a/tests/ui/generic-const-items/duplicate-where-clause.stderr +++ b/tests/ui/generic-const-items/duplicate-where-clause.stderr @@ -9,8 +9,10 @@ LL | P: Eq; | help: consider joining the two `where` clauses into one | -LL | P: Copy, - | ~ +LL - P: Copy +LL - where +LL + P: Copy, + | error: where clauses are not allowed before const item bodies --> $DIR/duplicate-where-clause.rs:19:5 diff --git a/tests/ui/generics/issue-79605.stderr b/tests/ui/generics/issue-79605.stderr index 67fed200f9693..a672379badd27 100644 --- a/tests/ui/generics/issue-79605.stderr +++ b/tests/ui/generics/issue-79605.stderr @@ -6,8 +6,9 @@ LL | impl X<'_, _> {} | help: use type parameters instead | -LL | impl X<'_, T> {} - | +++ ~ +LL - impl X<'_, _> {} +LL + impl X<'_, T> {} + | error: aborting due to 1 previous error diff --git a/tests/ui/generics/issue-95208-ignore-qself.stderr b/tests/ui/generics/issue-95208-ignore-qself.stderr index 7d91fbc14a187..b9a5ffac274f7 100644 --- a/tests/ui/generics/issue-95208-ignore-qself.stderr +++ b/tests/ui/generics/issue-95208-ignore-qself.stderr @@ -6,8 +6,9 @@ LL | impl Struct where ::Item:: std:: | help: use single colon | -LL | impl Struct where ::Item: std::fmt::Display { - | ~ +LL - impl Struct where ::Item:: std::fmt::Display { +LL + impl Struct where ::Item: std::fmt::Display { + | error: aborting due to 1 previous error diff --git a/tests/ui/generics/issue-95208.stderr b/tests/ui/generics/issue-95208.stderr index e047f1265e2e9..0ff6c8be9fd10 100644 --- a/tests/ui/generics/issue-95208.stderr +++ b/tests/ui/generics/issue-95208.stderr @@ -6,8 +6,9 @@ LL | impl Struct where T:: std::fmt::Display { | help: use single colon | -LL | impl Struct where T: std::fmt::Display { - | ~ +LL - impl Struct where T:: std::fmt::Display { +LL + impl Struct where T: std::fmt::Display { + | error: aborting due to 1 previous error diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr index 0f60cd397b997..01ec633c80dde 100644 --- a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr +++ b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr @@ -6,8 +6,9 @@ LL | ...X => {} | help: use `..=` instead | -LL | ..=X => {} - | ~~~ +LL - ...X => {} +LL + ..=X => {} + | error: range-to patterns with `...` are not allowed --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9 @@ -17,8 +18,9 @@ LL | ...0 => {} | help: use `..=` instead | -LL | ..=0 => {} - | ~~~ +LL - ...0 => {} +LL + ..=0 => {} + | error: range-to patterns with `...` are not allowed --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9 @@ -28,8 +30,9 @@ LL | ...'a' => {} | help: use `..=` instead | -LL | ..='a' => {} - | ~~~ +LL - ...'a' => {} +LL + ..='a' => {} + | error: range-to patterns with `...` are not allowed --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9 @@ -39,8 +42,9 @@ LL | ...0.0f32 => {} | help: use `..=` instead | -LL | ..=0.0f32 => {} - | ~~~ +LL - ...0.0f32 => {} +LL + ..=0.0f32 => {} + | error: range-to patterns with `...` are not allowed --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17 @@ -54,8 +58,9 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) help: use `..=` instead | -LL | let ..=$e; - | ~~~ +LL - let ...$e; +LL + let ..=$e; + | error[E0005]: refutable pattern in local binding --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17 diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr b/tests/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr index 83a374c3d65db..2d70f75f2c6d0 100644 --- a/tests/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr +++ b/tests/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr @@ -76,8 +76,9 @@ LL | &...0 | _ => {} | help: use `..=` instead | -LL | &..=0 | _ => {} - | ~~~ +LL - &...0 | _ => {} +LL + &..=0 | _ => {} + | error: the range pattern here has ambiguous interpretation --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10 diff --git a/tests/ui/hashmap/hashmap-index-mut.stderr b/tests/ui/hashmap/hashmap-index-mut.stderr index 2381b8ecb9692..1f01f7d618cbf 100644 --- a/tests/ui/hashmap/hashmap-index-mut.stderr +++ b/tests/ui/hashmap/hashmap-index-mut.stderr @@ -7,12 +7,15 @@ LL | map[&0] = 1; = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap` help: to modify a `HashMap`, use `.get_mut()`, `.insert()` or the entry API | -LL | map.insert(&0, 1); - | ~~~~~~~~ ~ + -LL | map.get_mut(&0).map(|val| { *val = 1; }); - | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++ -LL | let val = map.entry(&0).or_insert(1); - | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ + +LL - map[&0] = 1; +LL + map.insert(&0, 1); + | +LL - map[&0] = 1; +LL + map.get_mut(&0).map(|val| { *val = 1; }); + | +LL - map[&0] = 1; +LL + let val = map.entry(&0).or_insert(1); + | error: aborting due to 1 previous error diff --git a/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr b/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr index 34d7db9b3cf86..4f9fc0ac6492c 100644 --- a/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr +++ b/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr @@ -11,8 +11,9 @@ LL | fn f(i: I) | ^ ---- help: provide the argument | -LL | f(&[f(/* i */)]); - | ~~~~~~~~~ +LL - f(&[f()]); +LL + f(&[f(/* i */)]); + | error: aborting due to 1 previous error diff --git a/tests/ui/hygiene/globs.stderr b/tests/ui/hygiene/globs.stderr index 180172644402b..3f7a0ae7efa1b 100644 --- a/tests/ui/hygiene/globs.stderr +++ b/tests/ui/hygiene/globs.stderr @@ -9,8 +9,9 @@ LL | f(); | help: a function with a similar name exists | -LL | g(); - | ~ +LL - f(); +LL + g(); + | help: consider importing this function | LL + use foo::f; @@ -35,8 +36,9 @@ LL | | } = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) help: a function with a similar name exists | -LL | f(); - | ~ +LL - g(); +LL + f(); + | help: consider importing this function | LL + use bar::g; diff --git a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr index 9c54665956451..24d6359040ba8 100644 --- a/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr +++ b/tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr @@ -65,8 +65,9 @@ LL | fn ban() -> dyn Trait { Struct } | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn ban() -> impl Trait { Struct } - | ~~~~ +LL - fn ban() -> dyn Trait { Struct } +LL + fn ban() -> impl Trait { Struct } + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL | fn ban() -> Box { Box::new(Struct) } @@ -80,8 +81,9 @@ LL | fn bak() -> dyn Trait { unimplemented!() } | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn bak() -> impl Trait { unimplemented!() } - | ~~~~ +LL - fn bak() -> dyn Trait { unimplemented!() } +LL + fn bak() -> impl Trait { unimplemented!() } + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL | fn bak() -> Box { Box::new(unimplemented!()) } diff --git a/tests/ui/impl-trait/equality.stderr b/tests/ui/impl-trait/equality.stderr index 12d886a002454..ac41fc9901c16 100644 --- a/tests/ui/impl-trait/equality.stderr +++ b/tests/ui/impl-trait/equality.stderr @@ -19,8 +19,9 @@ LL | 0_u32 | help: change the type of the numeric literal from `u32` to `i32` | -LL | 0_i32 - | ~~~ +LL - 0_u32 +LL + 0_i32 + | error[E0277]: cannot add `impl Foo` to `u32` --> $DIR/equality.rs:24:11 diff --git a/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr b/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr index 7d108b30b76ed..40cb6b647d1e9 100644 --- a/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr +++ b/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr @@ -7,8 +7,9 @@ LL | fn d() -> impl Fn() -> (impl Debug + '_) { = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn d() -> impl Fn() -> (impl Debug + 'static) { - | ~~~~~~~ +LL - fn d() -> impl Fn() -> (impl Debug + '_) { +LL + fn d() -> impl Fn() -> (impl Debug + 'static) { + | error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` --> $DIR/impl-fn-hrtb-bounds.rs:4:41 diff --git a/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr b/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr index 90c31c9e3fc19..9db996cf9ce65 100644 --- a/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr +++ b/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr @@ -17,8 +17,9 @@ LL | fn foo(&self, a: &A, b: &impl Debug); = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters help: change the parameter type to match the trait | -LL | fn foo(&self, a: &B, b: &B) { } - | ~~ +LL - fn foo(&self, a: &impl Debug, b: &B) { } +LL + fn foo(&self, a: &B, b: &B) { } + | error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/impl-generic-mismatch.stderr b/tests/ui/impl-trait/impl-generic-mismatch.stderr index 973b65bfd625a..18347bd0f978f 100644 --- a/tests/ui/impl-trait/impl-generic-mismatch.stderr +++ b/tests/ui/impl-trait/impl-generic-mismatch.stderr @@ -24,8 +24,9 @@ LL | fn bar(&self, _: &impl Debug) { } | help: try changing the `impl Trait` argument to a generic parameter | -LL | fn bar(&self, _: &U) { } - | ++++++++++ ~ +LL - fn bar(&self, _: &impl Debug) { } +LL + fn bar(&self, _: &U) { } + | error[E0643]: method `baz` has incompatible signature for trait --> $DIR/impl-generic-mismatch.rs:26:33 @@ -38,8 +39,9 @@ LL | fn baz(&self, _: &impl Debug, _: &T) { } | help: try changing the `impl Trait` argument to a generic parameter | -LL | fn baz(&self, _: &T, _: &T) { } - | ~~~~~~~~~~~~~~~~~~~~ ~ +LL - fn baz(&self, _: &impl Debug, _: &T) { } +LL + fn baz(&self, _: &T, _: &T) { } + | error[E0643]: method `hash` has incompatible signature for trait --> $DIR/impl-generic-mismatch.rs:37:33 diff --git a/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr b/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr index 75cbe43eeb4a1..8351175099c9a 100644 --- a/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr +++ b/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr @@ -43,8 +43,9 @@ LL | fn method() -> () {} | ^^^^^^ help: change the output type to match the trait | -LL | fn method() -> <() as compare_method::Trait>::Ty {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn method() -> () {} +LL + fn method() -> <() as compare_method::Trait>::Ty {} + | error: unconstrained opaque type --> $DIR/in-assoc-type-unconstrained.rs:20:19 diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr index 022df6f906cf4..d3729b6c97370 100644 --- a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr +++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr @@ -9,8 +9,10 @@ LL | 'b: 'a; | help: copy the `where` clause predicates from the trait | -LL | where Self: 'b; - | ~~~~~~~~~~~~~~ +LL - where +LL - 'b: 'a; +LL + where Self: 'b; + | warning: impl trait in impl method signature does not match trait method signature --> $DIR/bad-item-bound-within-rpitit.rs:18:28 @@ -26,8 +28,9 @@ LL | fn iter(&self) -> impl 'a + Iterator> { = note: `#[warn(refining_impl_trait_reachable)]` on by default help: replace the return type so that it matches the trait | -LL | fn iter(&self) -> impl Iterator::Item<'_>> + '_ { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn iter(&self) -> impl 'a + Iterator> { +LL + fn iter(&self) -> impl Iterator::Item<'_>> + '_ { + | error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr b/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr index 94f068cabaa82..b7797317ea68f 100644 --- a/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr +++ b/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr @@ -12,8 +12,9 @@ LL | fn bar(&self) -> impl Iterator + '_ { = note: `#[warn(refining_impl_trait_internal)]` on by default help: replace the return type so that it matches the trait | -LL | fn bar(&self) -> impl Iterator + '_ { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn bar(&self) -> impl Iterator + '_ { +LL + fn bar(&self) -> impl Iterator + '_ { + | warning: 1 warning emitted diff --git a/tests/ui/impl-trait/in-trait/foreign.stderr b/tests/ui/impl-trait/in-trait/foreign.stderr index 36114dcf02b6c..8801ccc68b3be 100644 --- a/tests/ui/impl-trait/in-trait/foreign.stderr +++ b/tests/ui/impl-trait/in-trait/foreign.stderr @@ -14,8 +14,9 @@ LL | #[warn(refining_impl_trait)] = note: `#[warn(refining_impl_trait_internal)]` implied by `#[warn(refining_impl_trait)]` help: replace the return type so that it matches the trait | -LL | fn bar(self) -> impl Deref { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn bar(self) -> Arc { +LL + fn bar(self) -> impl Deref { + | warning: impl trait in impl method signature does not match trait method signature --> $DIR/foreign.rs:31:21 @@ -32,8 +33,9 @@ LL | #[warn(refining_impl_trait)] | ^^^^^^^^^^^^^^^^^^^ help: replace the return type so that it matches the trait | -LL | fn bar(self) -> impl Deref { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn bar(self) -> Arc { +LL + fn bar(self) -> impl Deref { + | warning: 2 warnings emitted diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr index 6f6b787b6fe1b..b71771c9f5c7a 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr @@ -15,8 +15,9 @@ LL | fn early<'early, T>(x: &'early T) -> impl Sized; found signature `fn(&'late ())` help: change the parameter type to match the trait | -LL | fn early<'late, T>(_: &T) {} - | ~~ +LL - fn early<'late, T>(_: &'late ()) {} +LL + fn early<'late, T>(_: &T) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr index 9e18517e48c55..588b453761003 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr @@ -13,8 +13,9 @@ LL | fn owo(x: ()) -> impl Sized; found signature `fn(u8)` help: change the parameter type to match the trait | -LL | fn owo(_: ()) {} - | ~~ +LL - fn owo(_: u8) {} +LL + fn owo(_: ()) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr index c01d7322d117e..b0530045bea9a 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr @@ -13,8 +13,9 @@ LL | async fn owo(x: ()) {} found signature `fn(u8) -> _` help: change the parameter type to match the trait | -LL | async fn owo(_: ()) {} - | ~~ +LL - async fn owo(_: u8) {} +LL + async fn owo(_: ()) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr b/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr index 81570781b27da..d575fedbb58de 100644 --- a/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr +++ b/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr @@ -86,8 +86,9 @@ LL | fn bar() -> Wrapper; found signature `fn() -> i32` help: change the output type to match the trait | -LL | fn bar() -> Wrapper<'static> { - | ~~~~~~~~~~~~~~~~ +LL - fn bar() -> i32 { +LL + fn bar() -> Wrapper<'static> { + | error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/opaque-and-lifetime-mismatch.rs:24:17 diff --git a/tests/ui/impl-trait/in-trait/refine.stderr b/tests/ui/impl-trait/in-trait/refine.stderr index 8d30b03592166..e381ef8c3f711 100644 --- a/tests/ui/impl-trait/in-trait/refine.stderr +++ b/tests/ui/impl-trait/in-trait/refine.stderr @@ -17,8 +17,9 @@ LL | #![deny(refining_impl_trait)] = note: `#[deny(refining_impl_trait_reachable)]` implied by `#[deny(refining_impl_trait)]` help: replace the return type so that it matches the trait | -LL | fn bar() -> impl Sized {} - | ~~~~~~~~~~ +LL - fn bar() -> impl Copy {} +LL + fn bar() -> impl Sized {} + | error: impl trait in impl method signature does not match trait method signature --> $DIR/refine.rs:15:5 @@ -49,8 +50,9 @@ LL | fn bar() -> () {} = note: we are soliciting feedback, see issue #121718 for more information help: replace the return type so that it matches the trait | -LL | fn bar() -> impl Sized {} - | ~~~~~~~~~~ +LL - fn bar() -> () {} +LL + fn bar() -> impl Sized {} + | error: impl trait in impl method signature does not match trait method signature --> $DIR/refine.rs:27:17 @@ -66,8 +68,9 @@ LL | fn bar() -> () {} = note: `#[deny(refining_impl_trait_internal)]` implied by `#[deny(refining_impl_trait)]` help: replace the return type so that it matches the trait | -LL | fn bar() -> impl Sized {} - | ~~~~~~~~~~ +LL - fn bar() -> () {} +LL + fn bar() -> impl Sized {} + | error: impl trait in impl method signature does not match trait method signature --> $DIR/refine.rs:35:17 @@ -82,8 +85,9 @@ LL | fn bar() -> () {} = note: we are soliciting feedback, see issue #121718 for more information help: replace the return type so that it matches the trait | -LL | fn bar() -> impl Sized {} - | ~~~~~~~~~~ +LL - fn bar() -> () {} +LL + fn bar() -> impl Sized {} + | error: impl trait in impl method signature does not match trait method signature --> $DIR/refine.rs:45:27 @@ -98,8 +102,9 @@ LL | fn bar(&self) -> impl Copy + '_ {} = note: we are soliciting feedback, see issue #121718 for more information help: replace the return type so that it matches the trait | -LL | fn bar(&self) -> impl Sized + '_ {} - | ~~~~~~~~~~~~~~~ +LL - fn bar(&self) -> impl Copy + '_ {} +LL + fn bar(&self) -> impl Sized + '_ {} + | error: impl trait in impl method signature does not match trait method signature --> $DIR/refine.rs:56:9 diff --git a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr index 67c4df0f3a9eb..5da29485c9cc7 100644 --- a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr +++ b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr @@ -46,8 +46,9 @@ LL | fn iter(&self) -> impl for<'missing> Iterator impl Iterator {} - | ~~~~~~~~~~~~~ +LL - fn iter(&self) -> impl for<'missing> Iterator> {} +LL + fn iter(&self) -> impl Iterator {} + | error: aborting due to 4 previous errors; 1 warning emitted diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.stderr index 8c9f265601540..fbbe1ac40b9ef 100644 --- a/tests/ui/impl-trait/in-trait/specialization-broken.stderr +++ b/tests/ui/impl-trait/in-trait/specialization-broken.stderr @@ -16,8 +16,9 @@ LL | fn bar(&self) -> impl Sized; found signature `fn(&_) -> U` help: change the output type to match the trait | -LL | fn bar(&self) -> impl Sized { - | ~~~~~~~~~~ +LL - fn bar(&self) -> U { +LL + fn bar(&self) -> impl Sized { + | error: method with return-position `impl Trait` in trait cannot be specialized --> $DIR/specialization-broken.rs:15:5 diff --git a/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr index 273f51ddbe35c..128348da46ffd 100644 --- a/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr +++ b/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr @@ -36,12 +36,14 @@ LL | fn elided2(x: &i32) -> impl Copy + 'static { x } | help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x` | -LL | fn elided2(x: &i32) -> impl Copy + '_ { x } - | ~~ +LL - fn elided2(x: &i32) -> impl Copy + 'static { x } +LL + fn elided2(x: &i32) -> impl Copy + '_ { x } + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x } - | ~~~~~~~~~~~~ +LL - fn elided2(x: &i32) -> impl Copy + 'static { x } +LL + fn elided2(x: &'static i32) -> impl Copy + 'static { x } + | error: lifetime may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:12:55 @@ -51,12 +53,14 @@ LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } | help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x` | -LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x } - | ~~ +LL - fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } +LL + fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x } + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x } - | ~~~~~~~~~~~~ +LL - fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x } +LL + fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x } + | error[E0621]: explicit lifetime required in the type of `x` --> $DIR/must_outlive_least_region_or_bound.rs:15:41 @@ -91,12 +95,14 @@ LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } | help: consider changing `impl LifetimeTrait<'a> + 'static`'s explicit `'static` bound to the lifetime of argument `x` | -LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x } - | ~~ +LL - fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } +LL + fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x } + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x } - | ~~~~~~~~~~~~ +LL - fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } +LL + fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x } + | error[E0700]: hidden type for `impl Fn(&'a u32)` captures lifetime that does not appear in bounds --> $DIR/must_outlive_least_region_or_bound.rs:42:5 @@ -161,12 +167,14 @@ LL | fn elided4(x: &i32) -> Box { Box::new(x) } | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` | -LL | fn elided4(x: &i32) -> Box { Box::new(x) } - | ~~ +LL - fn elided4(x: &i32) -> Box { Box::new(x) } +LL + fn elided4(x: &i32) -> Box { Box::new(x) } + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn elided4(x: &'static i32) -> Box { Box::new(x) } - | ~~~~~~~~~~~~ +LL - fn elided4(x: &i32) -> Box { Box::new(x) } +LL + fn elided4(x: &'static i32) -> Box { Box::new(x) } + | error: lifetime may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:27:60 @@ -176,12 +184,14 @@ LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` | -LL | fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } - | ~~ +LL - fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } +LL + fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn explicit4<'a>(x: &'static i32) -> Box { Box::new(x) } - | ~~~~~~~~~~~~ +LL - fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } +LL + fn explicit4<'a>(x: &'static i32) -> Box { Box::new(x) } + | error: aborting due to 13 previous errors diff --git a/tests/ui/impl-trait/no-method-suggested-traits.stderr b/tests/ui/impl-trait/no-method-suggested-traits.stderr index 676247d1a423b..af6d492c74d16 100644 --- a/tests/ui/impl-trait/no-method-suggested-traits.stderr +++ b/tests/ui/impl-trait/no-method-suggested-traits.stderr @@ -17,8 +17,9 @@ LL + use no_method_suggested_traits::qux::PrivPub; | help: there is a method `method2` with a similar name | -LL | 1u32.method2(); - | ~~~~~~~ +LL - 1u32.method(); +LL + 1u32.method2(); + | error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope --> $DIR/no-method-suggested-traits.rs:26:44 @@ -39,8 +40,9 @@ LL + use no_method_suggested_traits::qux::PrivPub; | help: there is a method `method2` with a similar name | -LL | std::rc::Rc::new(&mut Box::new(&1u32)).method2(); - | ~~~~~~~ +LL - std::rc::Rc::new(&mut Box::new(&1u32)).method(); +LL + std::rc::Rc::new(&mut Box::new(&1u32)).method2(); + | error[E0599]: no method named `method` found for type `char` in the current scope --> $DIR/no-method-suggested-traits.rs:30:9 @@ -58,8 +60,9 @@ LL + use foo::Bar; | help: there is a method `method2` with a similar name | -LL | 'a'.method2(); - | ~~~~~~~ +LL - 'a'.method(); +LL + 'a'.method2(); + | error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope --> $DIR/no-method-suggested-traits.rs:32:43 @@ -74,8 +77,9 @@ LL + use foo::Bar; | help: there is a method `method2` with a similar name | -LL | std::rc::Rc::new(&mut Box::new(&'a')).method2(); - | ~~~~~~~ +LL - std::rc::Rc::new(&mut Box::new(&'a')).method(); +LL + std::rc::Rc::new(&mut Box::new(&'a')).method2(); + | error[E0599]: no method named `method` found for type `i32` in the current scope --> $DIR/no-method-suggested-traits.rs:35:10 @@ -95,8 +99,9 @@ LL + use no_method_suggested_traits::foo::PubPub; | help: there is a method `method3` with a similar name | -LL | 1i32.method3(); - | ~~~~~~~ +LL - 1i32.method(); +LL + 1i32.method3(); + | error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope --> $DIR/no-method-suggested-traits.rs:37:44 @@ -111,8 +116,9 @@ LL + use no_method_suggested_traits::foo::PubPub; | help: there is a method `method3` with a similar name | -LL | std::rc::Rc::new(&mut Box::new(&1i32)).method3(); - | ~~~~~~~ +LL - std::rc::Rc::new(&mut Box::new(&1i32)).method(); +LL + std::rc::Rc::new(&mut Box::new(&1i32)).method3(); + | error[E0599]: no method named `method` found for struct `Foo` in the current scope --> $DIR/no-method-suggested-traits.rs:40:9 diff --git a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr index caaac5434c56a..4c64581abdf5a 100644 --- a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr +++ b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr @@ -7,8 +7,9 @@ LL | fn frob() -> impl Fn + '_ {} = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn frob() -> impl Fn + 'static {} - | ~~~~~~~ +LL - fn frob() -> impl Fn + '_ {} +LL + fn frob() -> impl Fn + 'static {} + | error[E0412]: cannot find type `P` in this scope --> $DIR/opaque-used-in-extraneous-argument.rs:5:22 diff --git a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr index 54849c112f5a0..f59be2febeb3c 100644 --- a/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr +++ b/tests/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr @@ -9,8 +9,9 @@ LL | 1u32 | help: change the type of the numeric literal from `u32` to `i32` | -LL | 1i32 - | ~~~ +LL - 1u32 +LL + 1i32 + | error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:12:16 @@ -23,8 +24,9 @@ LL | return 1u32; | help: change the type of the numeric literal from `u32` to `i32` | -LL | return 1i32; - | ~~~ +LL - return 1u32; +LL + return 1i32; + | error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:20:9 @@ -54,8 +56,9 @@ LL | | } | help: you could change the return type to be a boxed trait object | -LL | fn qux() -> Box { - | ~~~~~~~ + +LL - fn qux() -> impl std::fmt::Display { +LL + fn qux() -> Box { + | help: if you change the return type to expect trait objects, box the returned expressions | LL ~ Box::new(0i32) @@ -64,8 +67,9 @@ LL ~ Box::new(1u32) | help: change the type of the numeric literal from `u32` to `i32` | -LL | 1i32 - | ~~~ +LL - 1u32 +LL + 1i32 + | error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:35:14 @@ -126,8 +130,9 @@ LL | | } | help: you could change the return type to be a boxed trait object | -LL | fn dog() -> Box { - | ~~~~~~~ + +LL - fn dog() -> impl std::fmt::Display { +LL + fn dog() -> Box { + | help: if you change the return type to expect trait objects, box the returned expressions | LL ~ 0 => Box::new(0i32), @@ -135,8 +140,9 @@ LL ~ 1 => Box::new(1u32), | help: change the type of the numeric literal from `u32` to `i32` | -LL | 1 => 1i32, - | ~~~ +LL - 1 => 1u32, +LL + 1 => 1i32, + | error[E0308]: `if` and `else` have incompatible types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:97:9 @@ -152,8 +158,9 @@ LL | | } | help: you could change the return type to be a boxed trait object | -LL | fn apt() -> Box { - | ~~~~~~~ + +LL - fn apt() -> impl std::fmt::Display { +LL + fn apt() -> Box { + | help: if you change the return type to expect trait objects, box the returned expressions | LL ~ Box::new(0i32) @@ -162,8 +169,9 @@ LL ~ Box::new(1u32) | help: change the type of the numeric literal from `u32` to `i32` | -LL | 1i32 - | ~~~ +LL - 1u32 +LL + 1i32 + | error[E0746]: return type cannot have an unboxed trait object --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:66:13 @@ -173,8 +181,9 @@ LL | fn hat() -> dyn std::fmt::Display { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn hat() -> impl std::fmt::Display { - | ~~~~ +LL - fn hat() -> dyn std::fmt::Display { +LL + fn hat() -> impl std::fmt::Display { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn hat() -> Box { @@ -194,8 +203,9 @@ LL | fn pug() -> dyn std::fmt::Display { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn pug() -> impl std::fmt::Display { - | ~~~~ +LL - fn pug() -> dyn std::fmt::Display { +LL + fn pug() -> impl std::fmt::Display { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn pug() -> Box { diff --git a/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr b/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr index 550996ab5e57c..dde019baa529a 100644 --- a/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr +++ b/tests/ui/impl-trait/precise-capturing/bad-lifetimes.stderr @@ -7,8 +7,9 @@ LL | fn no_elided_lt() -> impl Sized + use<'_> {} = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn no_elided_lt() -> impl Sized + use<'static> {} - | ~~~~~~~ +LL - fn no_elided_lt() -> impl Sized + use<'_> {} +LL + fn no_elided_lt() -> impl Sized + use<'static> {} + | error[E0261]: use of undeclared lifetime name `'missing` --> $DIR/bad-lifetimes.rs:10:37 diff --git a/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr b/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr index 1007a835894e1..1495773dfb03a 100644 --- a/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr +++ b/tests/ui/impl-trait/precise-capturing/hidden-type-suggestion.stderr @@ -80,8 +80,9 @@ LL | fn no_params_yet(_: impl Sized, y: &()) -> impl Sized { | ^^^^^^^^^^ help: add a `use<...>` bound to explicitly capture `'_` after turning all argument-position `impl Trait` into type parameters, noting that this possibly affects the API of this crate | -LL | fn no_params_yet(_: T, y: &()) -> impl Sized + use<'_, T> { - | ++++++++++ ~ ++++++++++++ +LL - fn no_params_yet(_: impl Sized, y: &()) -> impl Sized { +LL + fn no_params_yet(_: T, y: &()) -> impl Sized + use<'_, T> { + | error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds --> $DIR/hidden-type-suggestion.rs:38:5 @@ -101,8 +102,9 @@ LL | fn yes_params_yet<'a, T>(_: impl Sized, y: &'a ()) -> impl Sized { | ^^^^^^^^^^ help: add a `use<...>` bound to explicitly capture `'a` after turning all argument-position `impl Trait` into type parameters, noting that this possibly affects the API of this crate | -LL | fn yes_params_yet<'a, T, U: Sized>(_: U, y: &'a ()) -> impl Sized + use<'a, T, U> { - | ++++++++++ ~ +++++++++++++++ +LL - fn yes_params_yet<'a, T>(_: impl Sized, y: &'a ()) -> impl Sized { +LL + fn yes_params_yet<'a, T, U: Sized>(_: U, y: &'a ()) -> impl Sized + use<'a, T, U> { + | error: aborting due to 6 previous errors diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr index 3692cc77b0fb4..7293664cdcf5a 100644 --- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr @@ -32,8 +32,9 @@ LL | fn eq(&self, _other: &(Foo, i32)) -> bool { found signature `fn(&a::Bar, &(a::Foo, _)) -> _` help: change the parameter type to match the trait | -LL | fn eq(&self, _other: &(a::Bar, i32)) -> bool { - | ~~~~~~~~~~~~~~ +LL - fn eq(&self, _other: &(Foo, i32)) -> bool { +LL + fn eq(&self, _other: &(a::Bar, i32)) -> bool { + | error: unconstrained opaque type --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:19:16 @@ -61,8 +62,9 @@ LL | fn eq(&self, _other: &(Bar, i32)) -> bool { | ^^ help: change the parameter type to match the trait | -LL | fn eq(&self, _other: &(b::Foo, i32)) -> bool { - | ~~~~~~~~~~~~~~ +LL - fn eq(&self, _other: &(Bar, i32)) -> bool { +LL + fn eq(&self, _other: &(b::Foo, i32)) -> bool { + | error: aborting due to 5 previous errors diff --git a/tests/ui/impl-trait/trait_type.stderr b/tests/ui/impl-trait/trait_type.stderr index 989779a617835..ce5b2f1cca626 100644 --- a/tests/ui/impl-trait/trait_type.stderr +++ b/tests/ui/impl-trait/trait_type.stderr @@ -8,8 +8,9 @@ LL | fn fmt(&self, x: &str) -> () { } found signature `fn(&MyType, &str) -> ()` help: change the parameter type to match the trait | -LL | fn fmt(&self, x: &mut Formatter<'_>) -> () { } - | ~~~~~~~~~~~~~~~~~~ +LL - fn fmt(&self, x: &str) -> () { } +LL + fn fmt(&self, x: &mut Formatter<'_>) -> () { } + | error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2 --> $DIR/trait_type.rs:12:11 diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr index 1fb69db98c162..afdd3e801c1a3 100644 --- a/tests/ui/impl-trait/where-allowed.stderr +++ b/tests/ui/impl-trait/where-allowed.stderr @@ -409,8 +409,9 @@ LL | fn in_trait_impl_return() -> Self::Out; = note: distinct uses of `impl Trait` result in different opaque types help: change the output type to match the trait | -LL | fn in_trait_impl_return() -> <() as DummyTrait>::Out { () } - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn in_trait_impl_return() -> impl Debug { () } +LL + fn in_trait_impl_return() -> <() as DummyTrait>::Out { () } + | error: unconstrained opaque type --> $DIR/where-allowed.rs:122:16 diff --git a/tests/ui/imports/bad-import-with-rename.stderr b/tests/ui/imports/bad-import-with-rename.stderr index f9c5cf920e1f1..a8e97d13c55ad 100644 --- a/tests/ui/imports/bad-import-with-rename.stderr +++ b/tests/ui/imports/bad-import-with-rename.stderr @@ -6,8 +6,9 @@ LL | use crate::D::B as _; | help: consider importing this type alias instead | -LL | use A::B as _; - | ~~~~~~~~~ +LL - use crate::D::B as _; +LL + use A::B as _; + | error[E0432]: unresolved import `crate::D::B2` --> $DIR/bad-import-with-rename.rs:10:9 @@ -17,8 +18,9 @@ LL | use crate::D::B2; | help: consider importing this type alias instead | -LL | use A::B2; - | ~~~~~ +LL - use crate::D::B2; +LL + use A::B2; + | error: aborting due to 2 previous errors diff --git a/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr b/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr index 127765727b401..9a3ebfddc49c5 100644 --- a/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr +++ b/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr @@ -6,8 +6,9 @@ LL | extern crate self; | help: rename the `self` crate to be able to import it | -LL | extern crate self as name; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - extern crate self; +LL + extern crate self as name; + | error: `#[macro_use]` is not supported on `extern crate self` --> $DIR/extern-crate-self-fail.rs:3:1 diff --git a/tests/ui/imports/glob-resolve1.stderr b/tests/ui/imports/glob-resolve1.stderr index 4401ef58732e8..6a48e36d37894 100644 --- a/tests/ui/imports/glob-resolve1.stderr +++ b/tests/ui/imports/glob-resolve1.stderr @@ -37,8 +37,9 @@ LL | | } | |_____^ help: you might have meant to use the following enum variant | -LL | B::B1; - | ~~~~~ +LL - B; +LL + B::B1; + | error[E0425]: cannot find value `C` in this scope --> $DIR/glob-resolve1.rs:29:5 diff --git a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr index 80cea1a83d931..def0676a0f82c 100644 --- a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr +++ b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr @@ -7,7 +7,8 @@ LL | extern crate std; = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate std as other_std; +LL - extern crate std; +LL + extern crate std as other_std; | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/import-self.stderr b/tests/ui/imports/issue-45829/import-self.stderr index 3c9d4fe6ba6fb..62bc559b77866 100644 --- a/tests/ui/imports/issue-45829/import-self.stderr +++ b/tests/ui/imports/issue-45829/import-self.stderr @@ -32,8 +32,9 @@ LL | use foo::{self}; = note: `foo` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use foo::{self as other_foo}; - | ~~~~~~~~~~~~~~~~~ +LL - use foo::{self}; +LL + use foo::{self as other_foo}; + | error[E0255]: the name `foo` is defined multiple times --> $DIR/import-self.rs:12:5 @@ -47,8 +48,9 @@ LL | use foo::self; = note: `foo` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use foo as other_foo; - | ~~~~~~~~~~~~ +LL - use foo::self; +LL + use foo as other_foo; + | error[E0252]: the name `A` is defined multiple times --> $DIR/import-self.rs:16:11 @@ -61,8 +63,9 @@ LL | use foo::{self as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use foo::{self as OtherA}; - | ~~~~~~~~~~~~~~ +LL - use foo::{self as A}; +LL + use foo::{self as OtherA}; + | error: aborting due to 5 previous errors diff --git a/tests/ui/imports/issue-45829/issue-45829.stderr b/tests/ui/imports/issue-45829/issue-45829.stderr index c6835c3bd7aaa..9fd0e5a767295 100644 --- a/tests/ui/imports/issue-45829/issue-45829.stderr +++ b/tests/ui/imports/issue-45829/issue-45829.stderr @@ -9,8 +9,9 @@ LL | use foo::{A, B as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use foo::{A, B as OtherA}; - | ~~~~~~~~~ +LL - use foo::{A, B as A}; +LL + use foo::{A, B as OtherA}; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr b/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr index 8f2f7bbac0c9a..98fe16824ff76 100644 --- a/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr +++ b/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr @@ -9,7 +9,8 @@ LL | extern crate issue_45829_b as bar; = note: `bar` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate issue_45829_b as other_bar; +LL - extern crate issue_45829_b as bar; +LL + extern crate issue_45829_b as other_bar; | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-extern-with-tab.stderr b/tests/ui/imports/issue-45829/rename-extern-with-tab.stderr index ae26d1fd0bbc5..346f2481c213d 100644 --- a/tests/ui/imports/issue-45829/rename-extern-with-tab.stderr +++ b/tests/ui/imports/issue-45829/rename-extern-with-tab.stderr @@ -9,7 +9,8 @@ LL | extern crate issue_45829_b as issue_45829_a; = note: `issue_45829_a` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate issue_45829_b as other_issue_45829_a; +LL - extern crate issue_45829_b as issue_45829_a; +LL + extern crate issue_45829_b as other_issue_45829_a; | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-extern.stderr b/tests/ui/imports/issue-45829/rename-extern.stderr index 46560ef9244ea..f99f433c64241 100644 --- a/tests/ui/imports/issue-45829/rename-extern.stderr +++ b/tests/ui/imports/issue-45829/rename-extern.stderr @@ -9,7 +9,8 @@ LL | extern crate issue_45829_b as issue_45829_a; = note: `issue_45829_a` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate issue_45829_b as other_issue_45829_a; +LL - extern crate issue_45829_b as issue_45829_a; +LL + extern crate issue_45829_b as other_issue_45829_a; | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr b/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr index fd4fb9db0b6d7..e0647cd3ab68b 100644 --- a/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr +++ b/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr @@ -9,8 +9,9 @@ LL | use std as issue_45829_b; = note: `issue_45829_b` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use std as other_issue_45829_b; - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - use std as issue_45829_b; +LL + use std as other_issue_45829_b; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-use-with-tabs.stderr b/tests/ui/imports/issue-45829/rename-use-with-tabs.stderr index 178303bbc1d16..c2e63ffa91ea9 100644 --- a/tests/ui/imports/issue-45829/rename-use-with-tabs.stderr +++ b/tests/ui/imports/issue-45829/rename-use-with-tabs.stderr @@ -9,8 +9,9 @@ LL | use foo::{A, bar::B as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use foo::{A, bar::B as OtherA}; - | ~~~~~~~~~ +LL - use foo::{A, bar::B as A}; +LL + use foo::{A, bar::B as OtherA}; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-with-path.stderr b/tests/ui/imports/issue-45829/rename-with-path.stderr index a83fdb3732436..45fdd46850e04 100644 --- a/tests/ui/imports/issue-45829/rename-with-path.stderr +++ b/tests/ui/imports/issue-45829/rename-with-path.stderr @@ -9,8 +9,9 @@ LL | use std::{collections::HashMap as A, sync::Arc as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use std::{collections::HashMap as A, sync::Arc as OtherA}; - | ~~~~~~~~~ +LL - use std::{collections::HashMap as A, sync::Arc as A}; +LL + use std::{collections::HashMap as A, sync::Arc as OtherA}; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename.stderr b/tests/ui/imports/issue-45829/rename.stderr index 4977909487cfb..dc5775e3d56d2 100644 --- a/tests/ui/imports/issue-45829/rename.stderr +++ b/tests/ui/imports/issue-45829/rename.stderr @@ -9,8 +9,9 @@ LL | use std as core; = note: `core` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use std as other_core; - | ~~~~~~~~~~~~~ +LL - use std as core; +LL + use std as other_core; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-56125.stderr b/tests/ui/imports/issue-56125.stderr index 0c4a569c7ea71..81336d51df4c6 100644 --- a/tests/ui/imports/issue-56125.stderr +++ b/tests/ui/imports/issue-56125.stderr @@ -6,14 +6,18 @@ LL | use empty::issue_56125; | help: consider importing one of these modules instead | -LL | use crate::m3::last_segment::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | use crate::m3::non_last_segment::non_last_segment::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | use ::issue_56125::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | use ::issue_56125::last_segment::issue_56125; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - use empty::issue_56125; +LL + use crate::m3::last_segment::issue_56125; + | +LL - use empty::issue_56125; +LL + use crate::m3::non_last_segment::non_last_segment::issue_56125; + | +LL - use empty::issue_56125; +LL + use ::issue_56125::issue_56125; + | +LL - use empty::issue_56125; +LL + use ::issue_56125::last_segment::issue_56125; + | and 1 other candidate error[E0659]: `issue_56125` is ambiguous diff --git a/tests/ui/imports/issue-57015.stderr b/tests/ui/imports/issue-57015.stderr index f1ae784524170..d3b9cd21fba0f 100644 --- a/tests/ui/imports/issue-57015.stderr +++ b/tests/ui/imports/issue-57015.stderr @@ -6,8 +6,9 @@ LL | use single_err::something; | help: consider importing this module instead | -LL | use glob_ok::something; - | ~~~~~~~~~~~~~~~~~~ +LL - use single_err::something; +LL + use glob_ok::something; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-59764.stderr b/tests/ui/imports/issue-59764.stderr index 74525c9c88f5a..1d31e3bda0de4 100644 --- a/tests/ui/imports/issue-59764.stderr +++ b/tests/ui/imports/issue-59764.stderr @@ -182,8 +182,9 @@ LL | use issue_59764::foo::makro as baz; = note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined help: a macro with this name exists at the root of the crate | -LL | use issue_59764::makro as baz; - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - use issue_59764::foo::makro as baz; +LL + use issue_59764::makro as baz; + | error[E0432]: unresolved import `issue_59764::foo::makro` --> $DIR/issue-59764.rs:107:33 @@ -223,8 +224,9 @@ LL | use issue_59764::foo::makro; = note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined help: a macro with this name exists at the root of the crate | -LL | use issue_59764::makro; - | ~~~~~~~~~~~~~~~~~~ +LL - use issue_59764::foo::makro; +LL + use issue_59764::makro; + | error[E0425]: cannot find function `bar` in this scope --> $DIR/issue-59764.rs:133:5 diff --git a/tests/ui/imports/no-std-inject.stderr b/tests/ui/imports/no-std-inject.stderr index 597ecdce9eb99..d3952a50cd311 100644 --- a/tests/ui/imports/no-std-inject.stderr +++ b/tests/ui/imports/no-std-inject.stderr @@ -7,8 +7,9 @@ LL | extern crate core; = note: `core` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate core as other_core; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - extern crate core; +LL + extern crate core as other_core; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/private-std-reexport-suggest-public.stderr b/tests/ui/imports/private-std-reexport-suggest-public.stderr index 222553235aaac..90d84bb4f5b47 100644 --- a/tests/ui/imports/private-std-reexport-suggest-public.stderr +++ b/tests/ui/imports/private-std-reexport-suggest-public.stderr @@ -15,8 +15,9 @@ note: ...and refers to the module `mem` which is defined here = note: you could import this directly help: import `mem` through the re-export | -LL | use std::mem; - | ~~~~~~~~ +LL - use foo::mem; +LL + use std::mem; + | error: aborting due to 1 previous error diff --git a/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr b/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr index 414eeee0fedc8..c9cfe769aeb29 100644 --- a/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr +++ b/tests/ui/imports/suggest-import-issue-120074.edition2015.stderr @@ -6,8 +6,9 @@ LL | println!("Hello, {}!", crate::bar::do_the_thing); | help: a similar path exists | -LL | println!("Hello, {}!", crate::foo::bar::do_the_thing); - | ~~~~~~~~ +LL - println!("Hello, {}!", crate::bar::do_the_thing); +LL + println!("Hello, {}!", crate::foo::bar::do_the_thing); + | help: consider importing this module | LL + use foo::bar; diff --git a/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr b/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr index 414eeee0fedc8..c9cfe769aeb29 100644 --- a/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr +++ b/tests/ui/imports/suggest-import-issue-120074.edition2021.stderr @@ -6,8 +6,9 @@ LL | println!("Hello, {}!", crate::bar::do_the_thing); | help: a similar path exists | -LL | println!("Hello, {}!", crate::foo::bar::do_the_thing); - | ~~~~~~~~ +LL - println!("Hello, {}!", crate::bar::do_the_thing); +LL + println!("Hello, {}!", crate::foo::bar::do_the_thing); + | help: consider importing this module | LL + use foo::bar; diff --git a/tests/ui/include-macros/parent_dir.stderr b/tests/ui/include-macros/parent_dir.stderr index 0470d5b1f1e3c..23029e911203c 100644 --- a/tests/ui/include-macros/parent_dir.stderr +++ b/tests/ui/include-macros/parent_dir.stderr @@ -7,8 +7,9 @@ LL | let _ = include_str!("include-macros/file.txt"); = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info) help: there is a file with the same name in a different directory | -LL | let _ = include_str!("file.txt"); - | ~~~~~~~~~~ +LL - let _ = include_str!("include-macros/file.txt"); +LL + let _ = include_str!("file.txt"); + | error: couldn't read `$DIR/hello.rs`: $FILE_NOT_FOUND_MSG --> $DIR/parent_dir.rs:6:13 @@ -19,8 +20,9 @@ LL | let _ = include_str!("hello.rs"); = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info) help: there is a file with the same name in a different directory | -LL | let _ = include_str!("../hello.rs"); - | ~~~~~~~~~~~~~ +LL - let _ = include_str!("hello.rs"); +LL + let _ = include_str!("../hello.rs"); + | error: couldn't read `$DIR/../../data.bin`: $FILE_NOT_FOUND_MSG --> $DIR/parent_dir.rs:8:13 @@ -31,8 +33,9 @@ LL | let _ = include_bytes!("../../data.bin"); = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info) help: there is a file with the same name in a different directory | -LL | let _ = include_bytes!("data.bin"); - | ~~~~~~~~~~ +LL - let _ = include_bytes!("../../data.bin"); +LL + let _ = include_bytes!("data.bin"); + | error: couldn't read `$DIR/tests/ui/include-macros/file.txt`: $FILE_NOT_FOUND_MSG --> $DIR/parent_dir.rs:10:13 @@ -43,8 +46,9 @@ LL | let _ = include_str!("tests/ui/include-macros/file.txt"); = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info) help: there is a file with the same name in a different directory | -LL | let _ = include_str!("file.txt"); - | ~~~~~~~~~~ +LL - let _ = include_str!("tests/ui/include-macros/file.txt"); +LL + let _ = include_str!("file.txt"); + | error: aborting due to 4 previous errors diff --git a/tests/ui/inference/ambiguous_type_parameter.stderr b/tests/ui/inference/ambiguous_type_parameter.stderr index 0674deb63ba0c..835999121d611 100644 --- a/tests/ui/inference/ambiguous_type_parameter.stderr +++ b/tests/ui/inference/ambiguous_type_parameter.stderr @@ -6,8 +6,9 @@ LL | InMemoryStore.get_raw(&String::default()); | help: try using a fully qualified path to specify the expected types | -LL | >>::get_raw(&InMemoryStore, &String::default()); - | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ~ +LL - InMemoryStore.get_raw(&String::default()); +LL + >>::get_raw(&InMemoryStore, &String::default()); + | error: aborting due to 1 previous error diff --git a/tests/ui/inference/char-as-str-single.stderr b/tests/ui/inference/char-as-str-single.stderr index 9149efe324071..5455a0fd7ee34 100644 --- a/tests/ui/inference/char-as-str-single.stderr +++ b/tests/ui/inference/char-as-str-single.stderr @@ -8,8 +8,9 @@ LL | let _: char = "a"; | help: if you meant to write a `char` literal, use single quotes | -LL | let _: char = 'a'; - | ~~~ +LL - let _: char = "a"; +LL + let _: char = 'a'; + | error[E0308]: mismatched types --> $DIR/char-as-str-single.rs:10:19 @@ -21,8 +22,9 @@ LL | let _: char = "人"; | help: if you meant to write a `char` literal, use single quotes | -LL | let _: char = '人'; - | ~~~~ +LL - let _: char = "人"; +LL + let _: char = '人'; + | error[E0308]: mismatched types --> $DIR/char-as-str-single.rs:11:19 @@ -34,8 +36,9 @@ LL | let _: char = "'"; | help: if you meant to write a `char` literal, use single quotes | -LL | let _: char = '\''; - | ~~~~ +LL - let _: char = "'"; +LL + let _: char = '\''; + | error[E0308]: mismatched types --> $DIR/char-as-str-single.rs:18:9 @@ -47,8 +50,9 @@ LL | "A" => {} | help: if you meant to write a `char` literal, use single quotes | -LL | 'A' => {} - | ~~~ +LL - "A" => {} +LL + 'A' => {} + | error: aborting due to 4 previous errors diff --git a/tests/ui/inference/inference_unstable.stderr b/tests/ui/inference/inference_unstable.stderr index 51f086177dbab..395dcb2661f11 100644 --- a/tests/ui/inference/inference_unstable.stderr +++ b/tests/ui/inference/inference_unstable.stderr @@ -65,8 +65,9 @@ LL | assert_eq!(char::C, 1); = note: for more information, see issue #48919 help: use the fully qualified path to the associated const | -LL | assert_eq!(::C, 1); - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - assert_eq!(char::C, 1); +LL + assert_eq!(::C, 1); + | help: add `#![feature(assoc_const_ipu_iter)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::C` | LL + #![feature(assoc_const_ipu_iter)] diff --git a/tests/ui/inference/inference_unstable_featured.stderr b/tests/ui/inference/inference_unstable_featured.stderr index b908c7142d4b1..b267ca497de8a 100644 --- a/tests/ui/inference/inference_unstable_featured.stderr +++ b/tests/ui/inference/inference_unstable_featured.stderr @@ -8,12 +8,14 @@ LL | assert_eq!('x'.ipu_flatten(), 0); = note: candidate #2 is defined in an impl of the trait `IpuItertools` for the type `char` help: disambiguate the method for candidate #1 | -LL | assert_eq!(IpuIterator::ipu_flatten(&'x'), 0); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - assert_eq!('x'.ipu_flatten(), 0); +LL + assert_eq!(IpuIterator::ipu_flatten(&'x'), 0); + | help: disambiguate the method for candidate #2 | -LL | assert_eq!(IpuItertools::ipu_flatten(&'x'), 0); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - assert_eq!('x'.ipu_flatten(), 0); +LL + assert_eq!(IpuItertools::ipu_flatten(&'x'), 0); + | error: aborting due to 1 previous error diff --git a/tests/ui/inference/issue-103587.stderr b/tests/ui/inference/issue-103587.stderr index 589cb7ea7b130..bd6a9b71b86d6 100644 --- a/tests/ui/inference/issue-103587.stderr +++ b/tests/ui/inference/issue-103587.stderr @@ -6,8 +6,9 @@ LL | if let Some(_) == x {} | help: consider using `=` here | -LL | if let Some(_) = x {} - | ~ +LL - if let Some(_) == x {} +LL + if let Some(_) = x {} + | error[E0308]: mismatched types --> $DIR/issue-103587.rs:7:8 diff --git a/tests/ui/inference/issue-12028.stderr b/tests/ui/inference/issue-12028.stderr index 3d7fb13d44757..0d8ef1c938d4c 100644 --- a/tests/ui/inference/issue-12028.stderr +++ b/tests/ui/inference/issue-12028.stderr @@ -7,8 +7,9 @@ LL | self.input_stream(&mut stream); = note: cannot satisfy `<_ as StreamHasher>::S == ::S` help: try using a fully qualified path to specify the expected types | -LL | >::input_stream(self, &mut stream); - | ++++++++++++++++++++++++++++++++++++ ~ +LL - self.input_stream(&mut stream); +LL + >::input_stream(self, &mut stream); + | error: aborting due to 1 previous error diff --git a/tests/ui/inference/issue-70082.stderr b/tests/ui/inference/issue-70082.stderr index 442e7479a9eb4..926ecff4a4fb5 100644 --- a/tests/ui/inference/issue-70082.stderr +++ b/tests/ui/inference/issue-70082.stderr @@ -9,8 +9,9 @@ LL | let y: f64 = 0.01f64 * 1i16.into(); = note: cannot satisfy `>::Output == f64` help: try using a fully qualified path to specify the expected types | -LL | let y: f64 = 0.01f64 * >::into(1i16); - | +++++++++++++++++++++++ ~ +LL - let y: f64 = 0.01f64 * 1i16.into(); +LL + let y: f64 = 0.01f64 * >::into(1i16); + | error: aborting due to 1 previous error diff --git a/tests/ui/inference/issue-71584.stderr b/tests/ui/inference/issue-71584.stderr index 391d3e7613e03..4bbfef6c44afa 100644 --- a/tests/ui/inference/issue-71584.stderr +++ b/tests/ui/inference/issue-71584.stderr @@ -9,8 +9,9 @@ LL | d = d % n.into(); = note: cannot satisfy `>::Output == u64` help: try using a fully qualified path to specify the expected types | -LL | d = d % >::into(n); - | +++++++++++++++++++++++ ~ +LL - d = d % n.into(); +LL + d = d % >::into(n); + | error: aborting due to 1 previous error diff --git a/tests/ui/inference/issue-72616.stderr b/tests/ui/inference/issue-72616.stderr index 02c92c1c11d02..9eb7011972e3e 100644 --- a/tests/ui/inference/issue-72616.stderr +++ b/tests/ui/inference/issue-72616.stderr @@ -13,8 +13,9 @@ LL | if String::from("a") == "a".try_into().unwrap() {} - impl<'a, 'b> PartialEq for String; help: try using a fully qualified path to specify the expected types | -LL | if String::from("a") == <&str as TryInto>::try_into("a").unwrap() {} - | +++++++++++++++++++++++++++++++ ~ +LL - if String::from("a") == "a".try_into().unwrap() {} +LL + if String::from("a") == <&str as TryInto>::try_into("a").unwrap() {} + | error[E0283]: type annotations needed --> $DIR/issue-72616.rs:22:37 @@ -29,8 +30,9 @@ LL | if String::from("a") == "a".try_into().unwrap() {} = note: required for `&str` to implement `TryInto<_>` help: try using a fully qualified path to specify the expected types | -LL | if String::from("a") == <&str as TryInto>::try_into("a").unwrap() {} - | +++++++++++++++++++++++++++++++ ~ +LL - if String::from("a") == "a".try_into().unwrap() {} +LL + if String::from("a") == <&str as TryInto>::try_into("a").unwrap() {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/inference/issue-72690.stderr b/tests/ui/inference/issue-72690.stderr index 6391672f8617d..7e5805c1b257f 100644 --- a/tests/ui/inference/issue-72690.stderr +++ b/tests/ui/inference/issue-72690.stderr @@ -21,8 +21,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error[E0283]: type annotations needed --> $DIR/issue-72690.rs:12:9 @@ -47,8 +48,9 @@ LL | |x| String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | |x| String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - |x| String::from("x".as_ref()); +LL + |x| String::from(>::as_ref("x")); + | error[E0283]: type annotations needed for `&_` --> $DIR/issue-72690.rs:17:9 @@ -89,8 +91,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error[E0283]: type annotations needed --> $DIR/issue-72690.rs:28:5 @@ -115,8 +118,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error[E0283]: type annotations needed --> $DIR/issue-72690.rs:37:5 @@ -141,8 +145,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error[E0283]: type annotations needed --> $DIR/issue-72690.rs:46:5 @@ -167,8 +172,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error[E0283]: type annotations needed --> $DIR/issue-72690.rs:53:5 @@ -193,8 +199,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error[E0283]: type annotations needed --> $DIR/issue-72690.rs:62:5 @@ -219,8 +226,9 @@ LL | String::from("x".as_ref()); - impl AsRef for str; help: try using a fully qualified path to specify the expected types | -LL | String::from(>::as_ref("x")); - | ++++++++++++++++++++++++++ ~ +LL - String::from("x".as_ref()); +LL + String::from(>::as_ref("x")); + | error: aborting due to 17 previous errors diff --git a/tests/ui/inference/issue-80816.stderr b/tests/ui/inference/issue-80816.stderr index ab62db8e6af21..bca7cd4c3adbb 100644 --- a/tests/ui/inference/issue-80816.stderr +++ b/tests/ui/inference/issue-80816.stderr @@ -21,8 +21,9 @@ LL | impl, P: Deref> Access for P { | unsatisfied trait bound introduced here help: try using a fully qualified path to specify the expected types | -LL | let guard: Guard> = >> as Access>::load(&s); - | ++++++++++++++++++++++++++++++++++++++++++++++++++ ~ +LL - let guard: Guard> = s.load(); +LL + let guard: Guard> = >> as Access>::load(&s); + | error: aborting due to 1 previous error diff --git a/tests/ui/inference/str-as-char.stderr b/tests/ui/inference/str-as-char.stderr index 4ca71c5f067fd..2e70faa8cfac3 100644 --- a/tests/ui/inference/str-as-char.stderr +++ b/tests/ui/inference/str-as-char.stderr @@ -6,8 +6,9 @@ LL | let _: &str = '"""'; | help: if you meant to write a string literal, use double quotes | -LL | let _: &str = "\"\"\""; - | ~~~~~~~~ +LL - let _: &str = '"""'; +LL + let _: &str = "\"\"\""; + | error: character literal may only contain one codepoint --> $DIR/str-as-char.rs:9:19 @@ -17,8 +18,9 @@ LL | let _: &str = '\"\"\"'; | help: if you meant to write a string literal, use double quotes | -LL | let _: &str = "\"\"\""; - | ~ ~ +LL - let _: &str = '\"\"\"'; +LL + let _: &str = "\"\"\""; + | error: character literal may only contain one codepoint --> $DIR/str-as-char.rs:10:19 @@ -28,8 +30,9 @@ LL | let _: &str = '"\"\"\\"\\"'; | help: if you meant to write a string literal, use double quotes | -LL | let _: &str = "\"\"\\"\\"\\\""; - | ~~~~~~~~~~~~~~~~~~~~ +LL - let _: &str = '"\"\"\\"\\"'; +LL + let _: &str = "\"\"\\"\\"\\\""; + | error[E0308]: mismatched types --> $DIR/str-as-char.rs:7:19 @@ -41,8 +44,9 @@ LL | let _: &str = 'a'; | help: if you meant to write a string literal, use double quotes | -LL | let _: &str = "a"; - | ~ ~ +LL - let _: &str = 'a'; +LL + let _: &str = "a"; + | error: aborting due to 4 previous errors diff --git a/tests/ui/issues/issue-13497.stderr b/tests/ui/issues/issue-13497.stderr index 7630848f6a512..8016b55d6aadc 100644 --- a/tests/ui/issues/issue-13497.stderr +++ b/tests/ui/issues/issue-13497.stderr @@ -11,8 +11,9 @@ LL | &'static str | +++++++ help: instead, you are more likely to want to return an owned value | -LL | String - | ~~~~~~ +LL - &str +LL + String + | error[E0515]: cannot return value referencing local variable `rawLines` --> $DIR/issue-13497.rs:5:5 diff --git a/tests/ui/issues/issue-17546.stderr b/tests/ui/issues/issue-17546.stderr index cf7ed1bbd6682..25a94dd97232b 100644 --- a/tests/ui/issues/issue-17546.stderr +++ b/tests/ui/issues/issue-17546.stderr @@ -9,12 +9,14 @@ LL | fn new() -> NoResult { | help: try using the variant's enum | -LL | fn new() -> foo::MyEnum { - | ~~~~~~~~~~~ +LL - fn new() -> NoResult { +LL + fn new() -> foo::MyEnum { + | help: an enum with a similar name exists | -LL | fn new() -> Result { - | ~~~~~~ +LL - fn new() -> NoResult { +LL + fn new() -> Result { + | error[E0573]: expected type, found variant `Result` --> $DIR/issue-17546.rs:24:17 @@ -61,12 +63,14 @@ LL | fn newer() -> NoResult { | help: try using the variant's enum | -LL | fn newer() -> foo::MyEnum { - | ~~~~~~~~~~~ +LL - fn newer() -> NoResult { +LL + fn newer() -> foo::MyEnum { + | help: an enum with a similar name exists | -LL | fn newer() -> Result { - | ~~~~~~ +LL - fn newer() -> NoResult { +LL + fn newer() -> Result { + | error: aborting due to 4 previous errors diff --git a/tests/ui/issues/issue-17800.stderr b/tests/ui/issues/issue-17800.stderr index 2a15af50d02a0..322c77eaa1dc5 100644 --- a/tests/ui/issues/issue-17800.stderr +++ b/tests/ui/issues/issue-17800.stderr @@ -6,8 +6,9 @@ LL | MyOption::MySome { x: 42 } => (), | help: use the tuple variant pattern syntax instead | -LL | MyOption::MySome(42) => (), - | ~~~~ +LL - MyOption::MySome { x: 42 } => (), +LL + MyOption::MySome(42) => (), + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-18107.stderr b/tests/ui/issues/issue-18107.stderr index 705f7d0df12ae..dbf2889c22336 100644 --- a/tests/ui/issues/issue-18107.stderr +++ b/tests/ui/issues/issue-18107.stderr @@ -6,8 +6,9 @@ LL | dyn AbstractRenderer | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | impl AbstractRenderer - | ~~~~ +LL - dyn AbstractRenderer +LL + impl AbstractRenderer + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ Box diff --git a/tests/ui/issues/issue-18446.stderr b/tests/ui/issues/issue-18446.stderr index 08a9cfc644f45..25ae303e902b5 100644 --- a/tests/ui/issues/issue-18446.stderr +++ b/tests/ui/issues/issue-18446.stderr @@ -16,8 +16,9 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | T::foo(&x); - | ~~~~~~~~~~ +LL - x.foo(); +LL + T::foo(&x); + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr index 7d6b09cf7f893..6a3c4e2a836e0 100644 --- a/tests/ui/issues/issue-20225.stderr +++ b/tests/ui/issues/issue-20225.stderr @@ -10,8 +10,9 @@ LL | extern "rust-call" fn call(&self, (_,): (T,)) {} found signature `extern "rust-call" fn(&Foo, (_,))` help: change the parameter type to match the trait | -LL | extern "rust-call" fn call(&self, (_,): (&'a T,)) {} - | ~~~~~~~~ +LL - extern "rust-call" fn call(&self, (_,): (T,)) {} +LL + extern "rust-call" fn call(&self, (_,): (&'a T,)) {} + | error[E0053]: method `call_mut` has an incompatible type for trait --> $DIR/issue-20225.rs:11:51 @@ -25,8 +26,9 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} found signature `extern "rust-call" fn(&mut Foo, (_,))` help: change the parameter type to match the trait | -LL | extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {} - | ~~~~~~~~ +LL - extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} +LL + extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {} + | error[E0053]: method `call_once` has an incompatible type for trait --> $DIR/issue-20225.rs:18:47 @@ -41,8 +43,9 @@ LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} found signature `extern "rust-call" fn(Foo, (_,))` help: change the parameter type to match the trait | -LL | extern "rust-call" fn call_once(self, (_,): (&'a T,)) {} - | ~~~~~~~~ +LL - extern "rust-call" fn call_once(self, (_,): (T,)) {} +LL + extern "rust-call" fn call_once(self, (_,): (&'a T,)) {} + | error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-21332.stderr b/tests/ui/issues/issue-21332.stderr index 7c960f7646db7..237b3acc9b4df 100644 --- a/tests/ui/issues/issue-21332.stderr +++ b/tests/ui/issues/issue-21332.stderr @@ -8,8 +8,9 @@ LL | fn next(&mut self) -> Result { Ok(7) } found signature `fn(&mut S) -> Result` help: change the output type to match the trait | -LL | fn next(&mut self) -> Option { Ok(7) } - | ~~~~~~~~~~~ +LL - fn next(&mut self) -> Result { Ok(7) } +LL + fn next(&mut self) -> Option { Ok(7) } + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-23041.stderr b/tests/ui/issues/issue-23041.stderr index 0142926dd1562..bd0e457fa9da5 100644 --- a/tests/ui/issues/issue-23041.stderr +++ b/tests/ui/issues/issue-23041.stderr @@ -6,8 +6,9 @@ LL | b.downcast_ref::_>(); | help: consider specifying the generic argument | -LL | b.downcast_ref:: _>(); - | ~~~~~~~~~~~~~~ +LL - b.downcast_ref::_>(); +LL + b.downcast_ref:: _>(); + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-23073.stderr b/tests/ui/issues/issue-23073.stderr index 6a61df8d46b2c..8aa86887bcfc6 100644 --- a/tests/ui/issues/issue-23073.stderr +++ b/tests/ui/issues/issue-23073.stderr @@ -6,8 +6,9 @@ LL | type FooT = <::Foo>::T; | help: if there were a trait named `Example` with associated type `T` implemented for `::Foo`, you could use the fully-qualified path | -LL | type FooT = <::Foo as Example>::T; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type FooT = <::Foo>::T; +LL + type FooT = <::Foo as Example>::T; + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-23217.stderr b/tests/ui/issues/issue-23217.stderr index d14da75ab72e6..830d260f99d7d 100644 --- a/tests/ui/issues/issue-23217.stderr +++ b/tests/ui/issues/issue-23217.stderr @@ -8,8 +8,9 @@ LL | B = SomeEnum::A, | help: there is a variant with a similar name | -LL | B = SomeEnum::B, - | ~ +LL - B = SomeEnum::A, +LL + B = SomeEnum::B, + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-23589.stderr b/tests/ui/issues/issue-23589.stderr index 21d383b0e8ce2..726efea1d6f63 100644 --- a/tests/ui/issues/issue-23589.stderr +++ b/tests/ui/issues/issue-23589.stderr @@ -6,8 +6,9 @@ LL | let v: Vec(&str) = vec!['1', '2']; | help: use angle brackets instead | -LL | let v: Vec<&str> = vec!['1', '2']; - | ~ ~ +LL - let v: Vec(&str) = vec!['1', '2']; +LL + let v: Vec<&str> = vec!['1', '2']; + | error[E0308]: mismatched types --> $DIR/issue-23589.rs:2:29 @@ -17,8 +18,9 @@ LL | let v: Vec(&str) = vec!['1', '2']; | help: if you meant to write a string literal, use double quotes | -LL | let v: Vec(&str) = vec!["1", '2']; - | ~ ~ +LL - let v: Vec(&str) = vec!['1', '2']; +LL + let v: Vec(&str) = vec!["1", '2']; + | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-27433.stderr b/tests/ui/issues/issue-27433.stderr index f6d5fc2b768f5..d8fd3d84ecbbc 100644 --- a/tests/ui/issues/issue-27433.stderr +++ b/tests/ui/issues/issue-27433.stderr @@ -6,8 +6,9 @@ LL | const FOO : u32 = foo; | help: consider using `let` instead of `const` | -LL | let FOO : u32 = foo; - | ~~~ +LL - const FOO : u32 = foo; +LL + let FOO : u32 = foo; + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-28971.stderr b/tests/ui/issues/issue-28971.stderr index 7ca57d6b99817..fd689a2b36eeb 100644 --- a/tests/ui/issues/issue-28971.stderr +++ b/tests/ui/issues/issue-28971.stderr @@ -9,8 +9,9 @@ LL | Foo::Baz(..) => (), | help: there is a variant with a similar name | -LL | Foo::Bar(..) => (), - | ~~~ +LL - Foo::Baz(..) => (), +LL + Foo::Bar(..) => (), + | error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable --> $DIR/issue-28971.rs:15:5 diff --git a/tests/ui/issues/issue-32004.stderr b/tests/ui/issues/issue-32004.stderr index 2d2ed5a63015b..88395cd852092 100644 --- a/tests/ui/issues/issue-32004.stderr +++ b/tests/ui/issues/issue-32004.stderr @@ -11,12 +11,14 @@ LL | Foo::Bar => {} | help: use the tuple variant pattern syntax instead | -LL | Foo::Bar(_) => {} - | ~~~~~~~~~~~ +LL - Foo::Bar => {} +LL + Foo::Bar(_) => {} + | help: a unit variant with a similar name exists | -LL | Foo::Baz => {} - | ~~~ +LL - Foo::Bar => {} +LL + Foo::Baz => {} + | error[E0532]: expected tuple struct or tuple variant, found unit struct `S` --> $DIR/issue-32004.rs:16:9 diff --git a/tests/ui/issues/issue-34209.stderr b/tests/ui/issues/issue-34209.stderr index 4c61d250f52d1..83b40d0c08161 100644 --- a/tests/ui/issues/issue-34209.stderr +++ b/tests/ui/issues/issue-34209.stderr @@ -9,8 +9,9 @@ LL | S::B {} => {}, | help: there is a variant with a similar name | -LL | S::A {} => {}, - | ~ +LL - S::B {} => {}, +LL + S::A {} => {}, + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-3521-2.stderr b/tests/ui/issues/issue-3521-2.stderr index a12241cb1dfd5..ecf1ad0403d3e 100644 --- a/tests/ui/issues/issue-3521-2.stderr +++ b/tests/ui/issues/issue-3521-2.stderr @@ -6,8 +6,9 @@ LL | static y: isize = foo + 1; | help: consider using `let` instead of `static` | -LL | let y: isize = foo + 1; - | ~~~ +LL - static y: isize = foo + 1; +LL + let y: isize = foo + 1; + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668-2.stderr b/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668-2.stderr index 9661dbf2f62fa..f87514ba83b04 100644 --- a/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668-2.stderr +++ b/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668-2.stderr @@ -6,8 +6,9 @@ LL | static child: isize = x + 1; | help: consider using `let` instead of `static` | -LL | let child: isize = x + 1; - | ~~~ +LL - static child: isize = x + 1; +LL + let child: isize = x + 1; + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668.stderr b/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668.stderr index 7fad45f4b1a25..06e0192d9574c 100644 --- a/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668.stderr +++ b/tests/ui/issues/issue-3668-non-constant-value-in-constant/issue-3668.stderr @@ -6,8 +6,9 @@ LL | static childVal: Box

= self.child.get(); | help: consider using `let` instead of `static` | -LL | let childVal: Box

= self.child.get(); - | ~~~ +LL - static childVal: Box

= self.child.get(); +LL + let childVal: Box

= self.child.get(); + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-3702-2.stderr b/tests/ui/issues/issue-3702-2.stderr index 7ab6520a0cad2..448263aafd44e 100644 --- a/tests/ui/issues/issue-3702-2.stderr +++ b/tests/ui/issues/issue-3702-2.stderr @@ -16,12 +16,14 @@ LL | fn to_int(&self) -> isize { 0 } | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | Add::to_int(&self) + other.to_int() - | ~~~~~~~~~~~~~~~~~~ +LL - self.to_int() + other.to_int() +LL + Add::to_int(&self) + other.to_int() + | help: disambiguate the method for candidate #2 | -LL | ToPrimitive::to_int(&self) + other.to_int() - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - self.to_int() + other.to_int() +LL + ToPrimitive::to_int(&self) + other.to_int() + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-40782.stderr b/tests/ui/issues/issue-40782.stderr index 614980202385b..ca099a331c2ef 100644 --- a/tests/ui/issues/issue-40782.stderr +++ b/tests/ui/issues/issue-40782.stderr @@ -17,8 +17,9 @@ LL | for _i of 0..2 { | help: try using `in` here instead | -LL | for _i in 0..2 { - | ~~ +LL - for _i of 0..2 { +LL + for _i in 0..2 { + | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-41652/issue-41652.stderr b/tests/ui/issues/issue-41652/issue-41652.stderr index a5a2fab2ede03..c8299f28d3454 100644 --- a/tests/ui/issues/issue-41652/issue-41652.stderr +++ b/tests/ui/issues/issue-41652/issue-41652.stderr @@ -6,8 +6,9 @@ LL | 3.f() | help: you must specify a concrete type for this numeric value, like `i32` | -LL | 3_i32.f() - | ~~~~~ +LL - 3.f() +LL + 3_i32.f() + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-42312.stderr b/tests/ui/issues/issue-42312.stderr index 3ca6a2957e14b..b1f54be052cf2 100644 --- a/tests/ui/issues/issue-42312.stderr +++ b/tests/ui/issues/issue-42312.stderr @@ -25,8 +25,9 @@ LL | pub fn f(_: dyn ToString) {} = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | pub fn f(_: impl ToString) {} - | ~~~~ +LL - pub fn f(_: dyn ToString) {} +LL + pub fn f(_: impl ToString) {} + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | pub fn f(_: &dyn ToString) {} diff --git a/tests/ui/issues/issue-44239.stderr b/tests/ui/issues/issue-44239.stderr index 1a047d4c63b69..8048e32f149a9 100644 --- a/tests/ui/issues/issue-44239.stderr +++ b/tests/ui/issues/issue-44239.stderr @@ -6,8 +6,9 @@ LL | const N: usize = n; | help: consider using `const` instead of `let` | -LL | const n: usize = 0; - | ~~~~~ +LL - let n: usize = 0; +LL + const n: usize = 0; + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr b/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr index 0aa1ae7222f57..0a6fe24d5e349 100644 --- a/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr +++ b/tests/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr @@ -6,8 +6,9 @@ LL | let _condemned = justice.00; | help: a field with a similar name exists | -LL | let _condemned = justice.0; - | ~ +LL - let _condemned = justice.00; +LL + let _condemned = justice.0; + | error[E0609]: no field `001` on type `Verdict` --> $DIR/issue-47073-zero-padded-tuple-struct-indices.rs:10:31 diff --git a/tests/ui/issues/issue-4736.stderr b/tests/ui/issues/issue-4736.stderr index c1ae2c47b43a7..b099e528ca8a8 100644 --- a/tests/ui/issues/issue-4736.stderr +++ b/tests/ui/issues/issue-4736.stderr @@ -9,8 +9,9 @@ LL | let z = NonCopyable{ p: () }; | help: `NonCopyable` is a tuple struct, use the appropriate syntax | -LL | let z = NonCopyable(/* () */); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - let z = NonCopyable{ p: () }; +LL + let z = NonCopyable(/* () */); + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-50571.stderr b/tests/ui/issues/issue-50571.stderr index 12256ded1c0a8..86709410670c1 100644 --- a/tests/ui/issues/issue-50571.stderr +++ b/tests/ui/issues/issue-50571.stderr @@ -6,8 +6,9 @@ LL | fn foo([a, b]: [i32; 2]) {} | help: give this argument a name or use an underscore to ignore it | -LL | fn foo(_: [i32; 2]) {} - | ~ +LL - fn foo([a, b]: [i32; 2]) {} +LL + fn foo(_: [i32; 2]) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-51874.stderr b/tests/ui/issues/issue-51874.stderr index 5be3695dd4548..18328450145b2 100644 --- a/tests/ui/issues/issue-51874.stderr +++ b/tests/ui/issues/issue-51874.stderr @@ -6,8 +6,9 @@ LL | let a = (1.0).pow(1.0); | help: you must specify a concrete type for this numeric value, like `f32` | -LL | let a = (1.0_f32).pow(1.0); - | ~~~~~~~ +LL - let a = (1.0).pow(1.0); +LL + let a = (1.0_f32).pow(1.0); + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-5358-1.stderr b/tests/ui/issues/issue-5358-1.stderr index 1bb946ce4cb54..f598cf33911f3 100644 --- a/tests/ui/issues/issue-5358-1.stderr +++ b/tests/ui/issues/issue-5358-1.stderr @@ -14,8 +14,9 @@ LL | S(Either::Right(_)) => {} | ++ + help: you might have meant to use field `0` whose type is `Either` | -LL | match S(Either::Left(5)).0 { - | ~~~~~~~~~~~~~~~~~~~~ +LL - match S(Either::Left(5)) { +LL + match S(Either::Left(5)).0 { + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-54410.stderr b/tests/ui/issues/issue-54410.stderr index 6cc5cd95e2f7d..513e30a4c8e9a 100644 --- a/tests/ui/issues/issue-54410.stderr +++ b/tests/ui/issues/issue-54410.stderr @@ -18,8 +18,9 @@ LL | println!("{:p}", unsafe { &symbol }); = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | println!("{:p}", unsafe { addr_of!(symbol) }); - | ~~~~~~~~~ + +LL - println!("{:p}", unsafe { &symbol }); +LL + println!("{:p}", unsafe { addr_of!(symbol) }); + | error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/issues/issue-56175.stderr b/tests/ui/issues/issue-56175.stderr index 6ed35c3a3d3a4..695aa2ac79696 100644 --- a/tests/ui/issues/issue-56175.stderr +++ b/tests/ui/issues/issue-56175.stderr @@ -16,8 +16,9 @@ LL + use reexported_trait::Trait; | help: there is a method `trait_method_b` with a similar name | -LL | reexported_trait::FooStruct.trait_method_b(); - | ~~~~~~~~~~~~~~ +LL - reexported_trait::FooStruct.trait_method(); +LL + reexported_trait::FooStruct.trait_method_b(); + | error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in the current scope --> $DIR/issue-56175.rs:7:33 @@ -37,8 +38,9 @@ LL + use reexported_trait::TraitBRename; | help: there is a method `trait_method` with a similar name | -LL | reexported_trait::FooStruct.trait_method(); - | ~~~~~~~~~~~~ +LL - reexported_trait::FooStruct.trait_method_b(); +LL + reexported_trait::FooStruct.trait_method(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-5883.stderr b/tests/ui/issues/issue-5883.stderr index 51d9708e0fa40..c5abea3cf1d2d 100644 --- a/tests/ui/issues/issue-5883.stderr +++ b/tests/ui/issues/issue-5883.stderr @@ -8,8 +8,9 @@ LL | r: dyn A + 'static = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | r: impl A + 'static - | ~~~~ +LL - r: dyn A + 'static +LL + r: impl A + 'static + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | r: &dyn A + 'static diff --git a/tests/ui/issues/issue-69683.stderr b/tests/ui/issues/issue-69683.stderr index c428ea9ea2c5b..b8e9e89e56eb9 100644 --- a/tests/ui/issues/issue-69683.stderr +++ b/tests/ui/issues/issue-69683.stderr @@ -7,8 +7,9 @@ LL | 0u16.foo(b); = note: cannot satisfy `>::Array == [u8; 3]` help: try using a fully qualified path to specify the expected types | -LL | >::foo(0u16, b); - | +++++++++++++++++++++ ~ +LL - 0u16.foo(b); +LL + >::foo(0u16, b); + | error[E0283]: type annotations needed --> $DIR/issue-69683.rs:30:10 @@ -34,8 +35,9 @@ LL | fn foo(self, x: >::Array); | --- required by a bound in this associated function help: try using a fully qualified path to specify the expected types | -LL | >::foo(0u16, b); - | +++++++++++++++++++++ ~ +LL - 0u16.foo(b); +LL + >::foo(0u16, b); + | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr index 8e77662b4ba3f..eabb08421121e 100644 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr +++ b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr @@ -6,8 +6,9 @@ LL | let foo::Foo {} = foo::Foo::default(); | help: ignore the inaccessible and unused fields | -LL | let foo::Foo { .. } = foo::Foo::default(); - | ~~~~~~ +LL - let foo::Foo {} = foo::Foo::default(); +LL + let foo::Foo { .. } = foo::Foo::default(); + | error: pattern requires `..` due to inaccessible fields --> $DIR/issue-76077-1.rs:16:9 diff --git a/tests/ui/issues/issue-76191.stderr b/tests/ui/issues/issue-76191.stderr index 3702bfb776991..e181b0770dfd4 100644 --- a/tests/ui/issues/issue-76191.stderr +++ b/tests/ui/issues/issue-76191.stderr @@ -24,8 +24,9 @@ LL | RANGE => {} found struct `RangeInclusive` help: you may want to move the range into the match block | -LL | 0..=255 => {} - | ~~~~~~~ +LL - RANGE => {} +LL + 0..=255 => {} + | error[E0308]: mismatched types --> $DIR/issue-76191.rs:16:9 diff --git a/tests/ui/issues/issue-78622.stderr b/tests/ui/issues/issue-78622.stderr index 985d6dde9f2aa..432913a0fc9c1 100644 --- a/tests/ui/issues/issue-78622.stderr +++ b/tests/ui/issues/issue-78622.stderr @@ -6,8 +6,9 @@ LL | S::A:: {} | help: if there were a trait named `Example` with associated type `A` implemented for `S`, you could use the fully-qualified path | -LL | ::A:: {} - | ~~~~~~~~~~~~~~~~~ +LL - S::A:: {} +LL + ::A:: {} + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-80607.stderr b/tests/ui/issues/issue-80607.stderr index d096910297b79..8f9f494c8b7a4 100644 --- a/tests/ui/issues/issue-80607.stderr +++ b/tests/ui/issues/issue-80607.stderr @@ -9,8 +9,9 @@ LL | Enum::V1 { x } | help: `Enum::V1` is a tuple variant, use the appropriate syntax | -LL | Enum::V1(/* i32 */) - | ~~~~~~~~~~~ +LL - Enum::V1 { x } +LL + Enum::V1(/* i32 */) + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-8761.stderr b/tests/ui/issues/issue-8761.stderr index c70093bafb69b..4a9db56891386 100644 --- a/tests/ui/issues/issue-8761.stderr +++ b/tests/ui/issues/issue-8761.stderr @@ -6,8 +6,9 @@ LL | A = 1i64, | help: change the type of the numeric literal from `i64` to `isize` | -LL | A = 1isize, - | ~~~~~ +LL - A = 1i64, +LL + A = 1isize, + | error[E0308]: mismatched types --> $DIR/issue-8761.rs:5:9 @@ -17,8 +18,9 @@ LL | B = 2u8 | help: change the type of the numeric literal from `u8` to `isize` | -LL | B = 2isize - | ~~~~~ +LL - B = 2u8 +LL + B = 2isize + | error: aborting due to 2 previous errors diff --git a/tests/ui/iterators/into-iter-on-arrays-2018.stderr b/tests/ui/iterators/into-iter-on-arrays-2018.stderr index 9d6bbf06c36bb..d4055c74f7cef 100644 --- a/tests/ui/iterators/into-iter-on-arrays-2018.stderr +++ b/tests/ui/iterators/into-iter-on-arrays-2018.stderr @@ -9,12 +9,14 @@ LL | let _: Iter<'_, i32> = array.into_iter(); = note: `#[warn(array_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | let _: Iter<'_, i32> = array.iter(); - | ~~~~ +LL - let _: Iter<'_, i32> = array.into_iter(); +LL + let _: Iter<'_, i32> = array.iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | let _: Iter<'_, i32> = IntoIterator::into_iter(array); - | ++++++++++++++++++++++++ ~ +LL - let _: Iter<'_, i32> = array.into_iter(); +LL + let _: Iter<'_, i32> = IntoIterator::into_iter(array); + | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-2018.rs:18:44 @@ -53,8 +55,9 @@ LL | for _ in [1, 2, 3].into_iter() {} = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | for _ in [1, 2, 3].iter() {} - | ~~~~ +LL - for _ in [1, 2, 3].into_iter() {} +LL + for _ in [1, 2, 3].iter() {} + | help: or remove `.into_iter()` to iterate by value | LL - for _ in [1, 2, 3].into_iter() {} diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.stderr b/tests/ui/iterators/into-iter-on-arrays-lint.stderr index da388d6b848de..fb8fe79c7c966 100644 --- a/tests/ui/iterators/into-iter-on-arrays-lint.stderr +++ b/tests/ui/iterators/into-iter-on-arrays-lint.stderr @@ -9,12 +9,14 @@ LL | small.into_iter(); = note: `#[warn(array_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | small.iter(); - | ~~~~ +LL - small.into_iter(); +LL + small.iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | IntoIterator::into_iter(small); - | ++++++++++++++++++++++++ ~ +LL - small.into_iter(); +LL + IntoIterator::into_iter(small); + | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:14:12 @@ -26,12 +28,14 @@ LL | [1, 2].into_iter(); = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | [1, 2].iter(); - | ~~~~ +LL - [1, 2].into_iter(); +LL + [1, 2].iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | IntoIterator::into_iter([1, 2]); - | ++++++++++++++++++++++++ ~ +LL - [1, 2].into_iter(); +LL + IntoIterator::into_iter([1, 2]); + | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:17:9 @@ -43,12 +47,14 @@ LL | big.into_iter(); = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | big.iter(); - | ~~~~ +LL - big.into_iter(); +LL + big.iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | IntoIterator::into_iter(big); - | ++++++++++++++++++++++++ ~ +LL - big.into_iter(); +LL + IntoIterator::into_iter(big); + | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:20:15 @@ -60,12 +66,14 @@ LL | [0u8; 33].into_iter(); = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | [0u8; 33].iter(); - | ~~~~ +LL - [0u8; 33].into_iter(); +LL + [0u8; 33].iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | IntoIterator::into_iter([0u8; 33]); - | ++++++++++++++++++++++++ ~ +LL - [0u8; 33].into_iter(); +LL + IntoIterator::into_iter([0u8; 33]); + | warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 --> $DIR/into-iter-on-arrays-lint.rs:24:21 diff --git a/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr b/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr index d7f38a23725b0..d282eb512f11a 100644 --- a/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr +++ b/tests/ui/iterators/into-iter-on-boxed-slices-2021.stderr @@ -8,12 +8,14 @@ LL | let _: Iter<'_, i32> = boxed_slice.into_iter(); = note: `#[warn(boxed_slice_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | let _: Iter<'_, i32> = boxed_slice.iter(); - | ~~~~ +LL - let _: Iter<'_, i32> = boxed_slice.into_iter(); +LL + let _: Iter<'_, i32> = boxed_slice.iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | let _: Iter<'_, i32> = IntoIterator::into_iter(boxed_slice); - | ++++++++++++++++++++++++ ~ +LL - let _: Iter<'_, i32> = boxed_slice.into_iter(); +LL + let _: Iter<'_, i32> = IntoIterator::into_iter(boxed_slice); + | warning: this method call resolves to `<&Box<[T]> as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to ` as IntoIterator>::into_iter` in Rust 2024 --> $DIR/into-iter-on-boxed-slices-2021.rs:18:58 @@ -48,8 +50,9 @@ LL | for _ in (Box::new([1, 2, 3]) as Box<[_]>).into_iter() {} = warning: this changes meaning in Rust 2024 help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | for _ in (Box::new([1, 2, 3]) as Box<[_]>).iter() {} - | ~~~~ +LL - for _ in (Box::new([1, 2, 3]) as Box<[_]>).into_iter() {} +LL + for _ in (Box::new([1, 2, 3]) as Box<[_]>).iter() {} + | help: or remove `.into_iter()` to iterate by value | LL - for _ in (Box::new([1, 2, 3]) as Box<[_]>).into_iter() {} diff --git a/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr b/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr index b73faf0dbd3b6..855dee145feab 100644 --- a/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr +++ b/tests/ui/iterators/into-iter-on-boxed-slices-lint.stderr @@ -8,12 +8,14 @@ LL | boxed.into_iter(); = note: `#[warn(boxed_slice_into_iter)]` on by default help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | -LL | boxed.iter(); - | ~~~~ +LL - boxed.into_iter(); +LL + boxed.iter(); + | help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value | -LL | IntoIterator::into_iter(boxed); - | ++++++++++++++++++++++++ ~ +LL - boxed.into_iter(); +LL + IntoIterator::into_iter(boxed); + | warning: this method call resolves to `<&Box<[T]> as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to ` as IntoIterator>::into_iter` in Rust 2024 --> $DIR/into-iter-on-boxed-slices-lint.rs:13:29 diff --git a/tests/ui/label/label_misspelled.stderr b/tests/ui/label/label_misspelled.stderr index 4b5b9e92ca09a..3f4020e7be0ac 100644 --- a/tests/ui/label/label_misspelled.stderr +++ b/tests/ui/label/label_misspelled.stderr @@ -157,12 +157,14 @@ LL | break foo; | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break foo; +LL + break; + | help: alternatively, you might have meant to use the available loop label | -LL | break 'while_loop; - | ~~~~~~~~~~~ +LL - break foo; +LL + break 'while_loop; + | error[E0571]: `break` with value from a `while` loop --> $DIR/label_misspelled.rs:54:9 @@ -175,12 +177,14 @@ LL | break foo; | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break foo; +LL + break; + | help: alternatively, you might have meant to use the available loop label | -LL | break 'while_let; - | ~~~~~~~~~~ +LL - break foo; +LL + break 'while_let; + | error[E0571]: `break` with value from a `for` loop --> $DIR/label_misspelled.rs:59:9 @@ -193,12 +197,14 @@ LL | break foo; | help: use `break` on its own without a value inside this `for` loop | -LL | break; - | ~~~~~ +LL - break foo; +LL + break; + | help: alternatively, you might have meant to use the available loop label | -LL | break 'for_loop; - | ~~~~~~~~~ +LL - break foo; +LL + break 'for_loop; + | error: aborting due to 11 previous errors; 10 warnings emitted diff --git a/tests/ui/lexer/lex-bad-char-literals-1.stderr b/tests/ui/lexer/lex-bad-char-literals-1.stderr index 9dc0a3380631e..49683c10237b3 100644 --- a/tests/ui/lexer/lex-bad-char-literals-1.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-1.stderr @@ -19,8 +19,9 @@ LL | '\●' = help: for more information, visit help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal | -LL | r"\●" - | ~~~~~ +LL - '\●' +LL + r"\●" + | error: unknown character escape: `\u{25cf}` --> $DIR/lex-bad-char-literals-1.rs:14:7 @@ -31,8 +32,9 @@ LL | "\●" = help: for more information, visit help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal | -LL | r"\●" - | ~~~~~ +LL - "\●" +LL + r"\●" + | error: aborting due to 4 previous errors diff --git a/tests/ui/lexer/lex-bad-char-literals-2.stderr b/tests/ui/lexer/lex-bad-char-literals-2.stderr index 76cde00404a15..fa0630728656a 100644 --- a/tests/ui/lexer/lex-bad-char-literals-2.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-2.stderr @@ -6,8 +6,9 @@ LL | 'nope' | help: if you meant to write a string literal, use double quotes | -LL | "nope" - | ~ ~ +LL - 'nope' +LL + "nope" + | error: aborting due to 1 previous error diff --git a/tests/ui/lexer/lex-bad-char-literals-3.stderr b/tests/ui/lexer/lex-bad-char-literals-3.stderr index 3f339b2ef7d93..d8ce17d13a990 100644 --- a/tests/ui/lexer/lex-bad-char-literals-3.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-3.stderr @@ -6,8 +6,9 @@ LL | static c: char = '●●'; | help: if you meant to write a string literal, use double quotes | -LL | static c: char = "●●"; - | ~ ~ +LL - static c: char = '●●'; +LL + static c: char = "●●"; + | error: character literal may only contain one codepoint --> $DIR/lex-bad-char-literals-3.rs:5:20 @@ -17,8 +18,9 @@ LL | let ch: &str = '●●'; | help: if you meant to write a string literal, use double quotes | -LL | let ch: &str = "●●"; - | ~ ~ +LL - let ch: &str = '●●'; +LL + let ch: &str = "●●"; + | error: aborting due to 2 previous errors diff --git a/tests/ui/lexer/lex-bad-char-literals-5.stderr b/tests/ui/lexer/lex-bad-char-literals-5.stderr index 8004157e87f7a..0322783871e63 100644 --- a/tests/ui/lexer/lex-bad-char-literals-5.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-5.stderr @@ -6,8 +6,9 @@ LL | static c: char = '\x10\x10'; | help: if you meant to write a string literal, use double quotes | -LL | static c: char = "\x10\x10"; - | ~ ~ +LL - static c: char = '\x10\x10'; +LL + static c: char = "\x10\x10"; + | error: character literal may only contain one codepoint --> $DIR/lex-bad-char-literals-5.rs:5:20 @@ -17,8 +18,9 @@ LL | let ch: &str = '\x10\x10'; | help: if you meant to write a string literal, use double quotes | -LL | let ch: &str = "\x10\x10"; - | ~ ~ +LL - let ch: &str = '\x10\x10'; +LL + let ch: &str = "\x10\x10"; + | error: aborting due to 2 previous errors diff --git a/tests/ui/lexer/lex-bad-char-literals-6.stderr b/tests/ui/lexer/lex-bad-char-literals-6.stderr index 96d409d59bb25..e5fd62bc0a9ab 100644 --- a/tests/ui/lexer/lex-bad-char-literals-6.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-6.stderr @@ -6,8 +6,9 @@ LL | let x: &str = 'ab'; | help: if you meant to write a string literal, use double quotes | -LL | let x: &str = "ab"; - | ~ ~ +LL - let x: &str = 'ab'; +LL + let x: &str = "ab"; + | error: character literal may only contain one codepoint --> $DIR/lex-bad-char-literals-6.rs:4:19 @@ -17,8 +18,9 @@ LL | let y: char = 'cd'; | help: if you meant to write a string literal, use double quotes | -LL | let y: char = "cd"; - | ~ ~ +LL - let y: char = 'cd'; +LL + let y: char = "cd"; + | error: character literal may only contain one codepoint --> $DIR/lex-bad-char-literals-6.rs:6:13 @@ -28,8 +30,9 @@ LL | let z = 'ef'; | help: if you meant to write a string literal, use double quotes | -LL | let z = "ef"; - | ~ ~ +LL - let z = 'ef'; +LL + let z = "ef"; + | error[E0308]: mismatched types --> $DIR/lex-bad-char-literals-6.rs:13:20 diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-1.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-1.stderr index 57c5f82704ec7..81ee697802b9c 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-1.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-1.stderr @@ -6,8 +6,9 @@ LL | println!('1 + 1'); | help: if you meant to write a string literal, use double quotes | -LL | println!("1 + 1"); - | ~ ~ +LL - println!('1 + 1'); +LL + println!("1 + 1"); + | error: lifetimes cannot start with a number --> $DIR/lex-bad-str-literal-as-char-1.rs:3:14 diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-2.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-2.stderr index f64761af64193..ed1303cd42843 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-2.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-2.stderr @@ -6,8 +6,9 @@ LL | println!(' 1 + 1'); | help: if you meant to write a string literal, use double quotes | -LL | println!(" 1 + 1"); - | ~ ~ +LL - println!(' 1 + 1'); +LL + println!(" 1 + 1"); + | error: aborting due to 1 previous error diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2015.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2015.stderr index 06f127426679f..2f92225de1fba 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2015.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2015.stderr @@ -6,8 +6,9 @@ LL | println!('hello world'); | help: if you meant to write a string literal, use double quotes | -LL | println!("hello world"); - | ~ ~ +LL - println!('hello world'); +LL + println!("hello world"); + | error: aborting due to 1 previous error diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2018.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2018.stderr index 06f127426679f..2f92225de1fba 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2018.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2018.stderr @@ -6,8 +6,9 @@ LL | println!('hello world'); | help: if you meant to write a string literal, use double quotes | -LL | println!("hello world"); - | ~ ~ +LL - println!('hello world'); +LL + println!("hello world"); + | error: aborting due to 1 previous error diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr index 4170560cfcb04..e10046e58e451 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr @@ -7,8 +7,9 @@ LL | println!('hello world'); = note: prefixed identifiers and literals are reserved since Rust 2021 help: if you meant to write a string literal, use double quotes | -LL | println!("hello world"); - | ~ ~ +LL - println!('hello world'); +LL + println!("hello world"); + | error[E0762]: unterminated character literal --> $DIR/lex-bad-str-literal-as-char-3.rs:5:26 @@ -18,8 +19,9 @@ LL | println!('hello world'); | help: if you meant to write a string literal, use double quotes | -LL | println!("hello world"); - | ~ ~ +LL - println!('hello world'); +LL + println!("hello world"); + | error: aborting due to 2 previous errors diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr index af42b5b7f7b78..5633783e73828 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr @@ -7,8 +7,9 @@ LL | println!('hello world'); = note: prefixed identifiers and literals are reserved since Rust 2021 help: if you meant to write a string literal, use double quotes | -LL | println!("hello world"); - | ~ ~ +LL - println!('hello world'); +LL + println!("hello world"); + | error[E0762]: unterminated character literal --> $DIR/lex-bad-str-literal-as-char-4.rs:4:30 @@ -18,8 +19,9 @@ LL | println!('hello world'); | help: if you meant to write a string literal, use double quotes | -LL | println!("hello world"); - | ~ ~ +LL - println!('hello world'); +LL + println!("hello world"); + | error: aborting due to 2 previous errors diff --git a/tests/ui/lifetimes/borrowck-let-suggestion.stderr b/tests/ui/lifetimes/borrowck-let-suggestion.stderr index cca7f52957e4c..e0adb16414059 100644 --- a/tests/ui/lifetimes/borrowck-let-suggestion.stderr +++ b/tests/ui/lifetimes/borrowck-let-suggestion.stderr @@ -12,8 +12,9 @@ LL | x.use_mut(); = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider consuming the `Vec` when turning it into an `Iterator` | -LL | let mut x = vec![1].into_iter(); - | ~~~~~~~~~ +LL - let mut x = vec![1].iter(); +LL + let mut x = vec![1].into_iter(); + | help: consider using a `let` binding to create a longer lived value | LL ~ let binding = vec![1]; diff --git a/tests/ui/lifetimes/fullwidth-ampersand.stderr b/tests/ui/lifetimes/fullwidth-ampersand.stderr index 4645254f4b70d..7fa7343620b0b 100644 --- a/tests/ui/lifetimes/fullwidth-ampersand.stderr +++ b/tests/ui/lifetimes/fullwidth-ampersand.stderr @@ -6,8 +6,9 @@ LL | fn f(_: &&()) -> &() { todo!() } | help: Unicode character '&' (Fullwidth Ampersand) looks like '&' (Ampersand), but it is not | -LL | fn f(_: &&()) -> &() { todo!() } - | ~ +LL - fn f(_: &&()) -> &() { todo!() } +LL + fn f(_: &&()) -> &() { todo!() } + | error[E0106]: missing lifetime specifier --> $DIR/fullwidth-ampersand.rs:3:18 diff --git a/tests/ui/lifetimes/issue-26638.stderr b/tests/ui/lifetimes/issue-26638.stderr index dc18e0f1f7a1d..8aa94f66812f3 100644 --- a/tests/ui/lifetimes/issue-26638.stderr +++ b/tests/ui/lifetimes/issue-26638.stderr @@ -27,8 +27,9 @@ LL | fn parse_type_2(iter: &fn(&u8)->&u8) -> &str { iter() } | + help: ...or alternatively, you might want to return an owned value | -LL | fn parse_type_2(iter: fn(&u8)->&u8) -> String { iter() } - | ~~~~~~ +LL - fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } +LL + fn parse_type_2(iter: fn(&u8)->&u8) -> String { iter() } + | error[E0106]: missing lifetime specifier --> $DIR/issue-26638.rs:9:22 @@ -43,8 +44,9 @@ LL | fn parse_type_3() -> &'static str { unimplemented!() } | +++++++ help: instead, you are more likely to want to return an owned value | -LL | fn parse_type_3() -> String { unimplemented!() } - | ~~~~~~ +LL - fn parse_type_3() -> &str { unimplemented!() } +LL + fn parse_type_3() -> String { unimplemented!() } + | error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/issue-26638.rs:4:47 @@ -54,8 +56,9 @@ LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } | help: provide the argument | -LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) } - | ~~~~~~~~~~~ +LL - fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } +LL + fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) } + | error[E0308]: mismatched types --> $DIR/issue-26638.rs:4:47 diff --git a/tests/ui/lifetimes/issue-90170-elision-mismatch.stderr b/tests/ui/lifetimes/issue-90170-elision-mismatch.stderr index 82511d07b0efc..bff7b48305bdf 100644 --- a/tests/ui/lifetimes/issue-90170-elision-mismatch.stderr +++ b/tests/ui/lifetimes/issue-90170-elision-mismatch.stderr @@ -23,8 +23,9 @@ LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } | help: consider introducing a named lifetime parameter | -LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } - | ++++ ~~ ++ +LL - pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } +LL + pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } + | error: lifetime may not live long enough --> $DIR/issue-90170-elision-mismatch.rs:7:63 diff --git a/tests/ui/lint/ambiguous_wide_pointer_comparisons_suggestions.stderr b/tests/ui/lint/ambiguous_wide_pointer_comparisons_suggestions.stderr index d9190dbb81340..30d7683ef4b49 100644 --- a/tests/ui/lint/ambiguous_wide_pointer_comparisons_suggestions.stderr +++ b/tests/ui/lint/ambiguous_wide_pointer_comparisons_suggestions.stderr @@ -7,12 +7,14 @@ LL | let _ = a == b; = note: `#[warn(ambiguous_wide_pointer_comparisons)]` on by default help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ++++++++++++++++++ ~ + +LL - let _ = a == b; +LL + let _ = std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = std::ptr::eq(a, b); - | +++++++++++++ ~ + +LL - let _ = a == b; +LL + let _ = std::ptr::eq(a, b); + | warning: 1 warning emitted diff --git a/tests/ui/lint/dead-code/tuple-struct-field.stderr b/tests/ui/lint/dead-code/tuple-struct-field.stderr index 434554d7ae5ee..3e1d4e7727459 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.stderr +++ b/tests/ui/lint/dead-code/tuple-struct-field.stderr @@ -33,8 +33,9 @@ LL | struct UnusedInTheMiddle(i32, f32, String, u8, u32); | help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields | -LL | struct UnusedInTheMiddle(i32, (), (), u8, ()); - | ~~ ~~ ~~ +LL - struct UnusedInTheMiddle(i32, f32, String, u8, u32); +LL + struct UnusedInTheMiddle(i32, (), (), u8, ()); + | error: aborting due to 3 previous errors diff --git a/tests/ui/lint/for_loop_over_fallibles.stderr b/tests/ui/lint/for_loop_over_fallibles.stderr index f695de082572a..dae5e6428c8e2 100644 --- a/tests/ui/lint/for_loop_over_fallibles.stderr +++ b/tests/ui/lint/for_loop_over_fallibles.stderr @@ -7,12 +7,14 @@ LL | for _ in Some(1) {} = note: `#[warn(for_loops_over_fallibles)]` on by default help: to check pattern in a loop use `while let` | -LL | while let Some(_) = Some(1) {} - | ~~~~~~~~~~~~~~~ ~~~ +LL - for _ in Some(1) {} +LL + while let Some(_) = Some(1) {} + | help: consider using `if let` to clear intent | -LL | if let Some(_) = Some(1) {} - | ~~~~~~~~~~~~ ~~~ +LL - for _ in Some(1) {} +LL + if let Some(_) = Some(1) {} + | warning: for loop over a `Result`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:9:14 @@ -22,12 +24,14 @@ LL | for _ in Ok::<_, ()>(1) {} | help: to check pattern in a loop use `while let` | -LL | while let Ok(_) = Ok::<_, ()>(1) {} - | ~~~~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>(1) {} +LL + while let Ok(_) = Ok::<_, ()>(1) {} + | help: consider using `if let` to clear intent | -LL | if let Ok(_) = Ok::<_, ()>(1) {} - | ~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>(1) {} +LL + if let Ok(_) = Ok::<_, ()>(1) {} + | warning: for loop over an `Option`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:15:14 @@ -37,12 +41,14 @@ LL | for _ in [0; 0].iter().next() {} | help: to iterate over `[0; 0].iter()` remove the call to `next` | -LL | for _ in [0; 0].iter().by_ref() {} - | ~~~~~~~~~ +LL - for _ in [0; 0].iter().next() {} +LL + for _ in [0; 0].iter().by_ref() {} + | help: consider using `if let` to clear intent | -LL | if let Some(_) = [0; 0].iter().next() {} - | ~~~~~~~~~~~~ ~~~ +LL - for _ in [0; 0].iter().next() {} +LL + if let Some(_) = [0; 0].iter().next() {} + | warning: for loop over a `Result`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:21:14 @@ -52,12 +58,14 @@ LL | for _ in Ok::<_, ()>([0; 0].iter()) {} | help: to check pattern in a loop use `while let` | -LL | while let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} - | ~~~~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>([0; 0].iter()) {} +LL + while let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} + | help: consider using `if let` to clear intent | -LL | if let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} - | ~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>([0; 0].iter()) {} +LL + if let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} + | warning: for loop over a `Result`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:29:14 @@ -67,16 +75,18 @@ LL | for _ in Ok::<_, ()>([0; 0].iter()) {} | help: to check pattern in a loop use `while let` | -LL | while let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} - | ~~~~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>([0; 0].iter()) {} +LL + while let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} + | help: consider unwrapping the `Result` with `?` to iterate over its contents | LL | for _ in Ok::<_, ()>([0; 0].iter())? {} | + help: consider using `if let` to clear intent | -LL | if let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} - | ~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>([0; 0].iter()) {} +LL + if let Ok(_) = Ok::<_, ()>([0; 0].iter()) {} + | warning: for loop over a `Result`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:36:14 @@ -86,16 +96,18 @@ LL | for _ in Ok::<_, ()>([0; 0]) {} | help: to check pattern in a loop use `while let` | -LL | while let Ok(_) = Ok::<_, ()>([0; 0]) {} - | ~~~~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>([0; 0]) {} +LL + while let Ok(_) = Ok::<_, ()>([0; 0]) {} + | help: consider unwrapping the `Result` with `?` to iterate over its contents | LL | for _ in Ok::<_, ()>([0; 0])? {} | + help: consider using `if let` to clear intent | -LL | if let Ok(_) = Ok::<_, ()>([0; 0]) {} - | ~~~~~~~~~~ ~~~ +LL - for _ in Ok::<_, ()>([0; 0]) {} +LL + if let Ok(_) = Ok::<_, ()>([0; 0]) {} + | warning: for loop over a `&Option`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:47:14 @@ -105,12 +117,14 @@ LL | for _ in &Some(1) {} | help: to check pattern in a loop use `while let` | -LL | while let Some(_) = &Some(1) {} - | ~~~~~~~~~~~~~~~ ~~~ +LL - for _ in &Some(1) {} +LL + while let Some(_) = &Some(1) {} + | help: consider using `if let` to clear intent | -LL | if let Some(_) = &Some(1) {} - | ~~~~~~~~~~~~ ~~~ +LL - for _ in &Some(1) {} +LL + if let Some(_) = &Some(1) {} + | warning: for loop over a `&Result`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:51:14 @@ -120,12 +134,14 @@ LL | for _ in &Ok::<_, ()>(1) {} | help: to check pattern in a loop use `while let` | -LL | while let Ok(_) = &Ok::<_, ()>(1) {} - | ~~~~~~~~~~~~~ ~~~ +LL - for _ in &Ok::<_, ()>(1) {} +LL + while let Ok(_) = &Ok::<_, ()>(1) {} + | help: consider using `if let` to clear intent | -LL | if let Ok(_) = &Ok::<_, ()>(1) {} - | ~~~~~~~~~~ ~~~ +LL - for _ in &Ok::<_, ()>(1) {} +LL + if let Ok(_) = &Ok::<_, ()>(1) {} + | warning: for loop over a `&mut Option`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:57:14 @@ -135,12 +151,14 @@ LL | for _ in &mut Some(1) {} | help: to check pattern in a loop use `while let` | -LL | while let Some(_) = &mut Some(1) {} - | ~~~~~~~~~~~~~~~ ~~~ +LL - for _ in &mut Some(1) {} +LL + while let Some(_) = &mut Some(1) {} + | help: consider using `if let` to clear intent | -LL | if let Some(_) = &mut Some(1) {} - | ~~~~~~~~~~~~ ~~~ +LL - for _ in &mut Some(1) {} +LL + if let Some(_) = &mut Some(1) {} + | warning: for loop over a `&mut Result`. This is more readably written as an `if let` statement --> $DIR/for_loop_over_fallibles.rs:61:14 @@ -150,12 +168,14 @@ LL | for _ in &mut Ok::<_, ()>(1) {} | help: to check pattern in a loop use `while let` | -LL | while let Ok(_) = &mut Ok::<_, ()>(1) {} - | ~~~~~~~~~~~~~ ~~~ +LL - for _ in &mut Ok::<_, ()>(1) {} +LL + while let Ok(_) = &mut Ok::<_, ()>(1) {} + | help: consider using `if let` to clear intent | -LL | if let Ok(_) = &mut Ok::<_, ()>(1) {} - | ~~~~~~~~~~ ~~~ +LL - for _ in &mut Ok::<_, ()>(1) {} +LL + if let Ok(_) = &mut Ok::<_, ()>(1) {} + | warning: 10 warnings emitted diff --git a/tests/ui/lint/issue-109152.stderr b/tests/ui/lint/issue-109152.stderr index a175964ccf63f..01aa9068da567 100644 --- a/tests/ui/lint/issue-109152.stderr +++ b/tests/ui/lint/issue-109152.stderr @@ -16,8 +16,9 @@ LL | #![deny(map_unit_fn)] | ^^^^^^^^^^^ help: you might have meant to use `Iterator::for_each` | -LL | vec![42].iter().for_each(drop); - | ~~~~~~~~ +LL - vec![42].iter().map(drop); +LL + vec![42].iter().for_each(drop); + | error: aborting due to 1 previous error diff --git a/tests/ui/lint/issue-109529.stderr b/tests/ui/lint/issue-109529.stderr index 9e857d1b0ab5d..51b71cb1007e6 100644 --- a/tests/ui/lint/issue-109529.stderr +++ b/tests/ui/lint/issue-109529.stderr @@ -16,8 +16,9 @@ LL | for _ in 0..(256 as u8) {} | help: use an inclusive range instead | -LL | for _ in 0..=(255 as u8) {} - | + ~~~ +LL - for _ in 0..(256 as u8) {} +LL + for _ in 0..=(255 as u8) {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/lint/issue-35075.stderr b/tests/ui/lint/issue-35075.stderr index 08bdaa728583d..f02f9e678b469 100644 --- a/tests/ui/lint/issue-35075.stderr +++ b/tests/ui/lint/issue-35075.stderr @@ -6,8 +6,9 @@ LL | inner: Foo | help: there is an enum variant `Baz::Foo`; try using the variant's enum | -LL | inner: Baz - | ~~~ +LL - inner: Foo +LL + inner: Baz + | error[E0412]: cannot find type `Foo` in this scope --> $DIR/issue-35075.rs:6:9 @@ -17,8 +18,9 @@ LL | Foo(Foo) | help: there is an enum variant `Baz::Foo`; try using the variant's enum | -LL | Foo(Baz) - | ~~~ +LL - Foo(Foo) +LL + Foo(Baz) + | error: aborting due to 2 previous errors diff --git a/tests/ui/lint/let_underscore/issue-119696-err-on-fn.stderr b/tests/ui/lint/let_underscore/issue-119696-err-on-fn.stderr index 86e521580b87a..f8a89cda6bfd8 100644 --- a/tests/ui/lint/let_underscore/issue-119696-err-on-fn.stderr +++ b/tests/ui/lint/let_underscore/issue-119696-err-on-fn.stderr @@ -11,12 +11,14 @@ LL | #![deny(let_underscore_drop)] | ^^^^^^^^^^^^^^^^^^^ help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let _unused = foo(); - | ~~~~~~~ +LL - let _ = foo(); +LL + let _unused = foo(); + | help: consider immediately dropping the value | -LL | drop(foo()); - | ~~~~~ + +LL - let _ = foo(); +LL + drop(foo()); + | error: aborting due to 1 previous error diff --git a/tests/ui/lint/let_underscore/issue-119697-extra-let.stderr b/tests/ui/lint/let_underscore/issue-119697-extra-let.stderr index 16df2c720eaf2..970ba435b3dad 100644 --- a/tests/ui/lint/let_underscore/issue-119697-extra-let.stderr +++ b/tests/ui/lint/let_underscore/issue-119697-extra-let.stderr @@ -11,12 +11,14 @@ LL | #![deny(let_underscore_drop)] | ^^^^^^^^^^^^^^^^^^^ help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let _unused = field; - | ~~~~~~~~~~~ +LL - _ = field; +LL + let _unused = field; + | help: consider immediately dropping the value | -LL | drop(field); - | ~~~~~ + +LL - _ = field; +LL + drop(field); + | error: non-binding let on a type that implements `Drop` --> $DIR/issue-119697-extra-let.rs:17:5 @@ -26,12 +28,14 @@ LL | let _ = field; | help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let _unused = field; - | ~~~~~~~ +LL - let _ = field; +LL + let _unused = field; + | help: consider immediately dropping the value | -LL | drop(field); - | ~~~~~ + +LL - let _ = field; +LL + drop(field); + | error: aborting due to 2 previous errors diff --git a/tests/ui/lint/let_underscore/let_underscore_drop.stderr b/tests/ui/lint/let_underscore/let_underscore_drop.stderr index 7b7de202e4626..de719b27f1ae9 100644 --- a/tests/ui/lint/let_underscore/let_underscore_drop.stderr +++ b/tests/ui/lint/let_underscore/let_underscore_drop.stderr @@ -11,12 +11,14 @@ LL | #![warn(let_underscore_drop)] | ^^^^^^^^^^^^^^^^^^^ help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let _unused = NontrivialDrop; - | ~~~~~~~ +LL - let _ = NontrivialDrop; +LL + let _unused = NontrivialDrop; + | help: consider immediately dropping the value | -LL | drop(NontrivialDrop); - | ~~~~~ + +LL - let _ = NontrivialDrop; +LL + drop(NontrivialDrop); + | warning: 1 warning emitted diff --git a/tests/ui/lint/let_underscore/let_underscore_lock.stderr b/tests/ui/lint/let_underscore/let_underscore_lock.stderr index fb8b9ec220336..60d5ed649f5ee 100644 --- a/tests/ui/lint/let_underscore/let_underscore_lock.stderr +++ b/tests/ui/lint/let_underscore/let_underscore_lock.stderr @@ -7,12 +7,14 @@ LL | let _ = data.lock().unwrap(); = note: `#[deny(let_underscore_lock)]` on by default help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let _unused = data.lock().unwrap(); - | ~~~~~~~ +LL - let _ = data.lock().unwrap(); +LL + let _unused = data.lock().unwrap(); + | help: consider immediately dropping the value | -LL | drop(data.lock().unwrap()); - | ~~~~~ + +LL - let _ = data.lock().unwrap(); +LL + drop(data.lock().unwrap()); + | error: non-binding let on a synchronization lock --> $DIR/let_underscore_lock.rs:12:9 @@ -22,12 +24,14 @@ LL | let _ = data.lock(); | help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let _unused = data.lock(); - | ~~~~~~~ +LL - let _ = data.lock(); +LL + let _unused = data.lock(); + | help: consider immediately dropping the value | -LL | drop(data.lock()); - | ~~~~~ + +LL - let _ = data.lock(); +LL + drop(data.lock()); + | error: non-binding let on a synchronization lock --> $DIR/let_underscore_lock.rs:14:10 @@ -38,8 +42,9 @@ LL | let (_, _) = (data.lock(), 1); = help: consider immediately dropping the value using `drop(..)` after the `let` statement help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let (_unused, _) = (data.lock(), 1); - | ~~~~~~~ +LL - let (_, _) = (data.lock(), 1); +LL + let (_unused, _) = (data.lock(), 1); + | error: non-binding let on a synchronization lock --> $DIR/let_underscore_lock.rs:16:26 @@ -50,8 +55,9 @@ LL | let (_a, Struct { a: _ }) = (0, Struct { a: data.lock() }); = help: consider immediately dropping the value using `drop(..)` after the `let` statement help: consider binding to an unused variable to avoid immediately dropping the value | -LL | let (_a, Struct { a: _unused }) = (0, Struct { a: data.lock() }); - | ~~~~~~~ +LL - let (_a, Struct { a: _ }) = (0, Struct { a: data.lock() }); +LL + let (_a, Struct { a: _unused }) = (0, Struct { a: data.lock() }); + | error: non-binding let on a synchronization lock --> $DIR/let_underscore_lock.rs:18:6 diff --git a/tests/ui/lint/lint-strict-provenance-fuzzy-casts.stderr b/tests/ui/lint/lint-strict-provenance-fuzzy-casts.stderr index 24f2500abf82c..f5eec6fc65667 100644 --- a/tests/ui/lint/lint-strict-provenance-fuzzy-casts.stderr +++ b/tests/ui/lint/lint-strict-provenance-fuzzy-casts.stderr @@ -12,8 +12,9 @@ LL | #![deny(fuzzy_provenance_casts)] | ^^^^^^^^^^^^^^^^^^^^^^ help: use `.with_addr()` to adjust a valid pointer in the same allocation, to this address | -LL | let dangling = (...).with_addr(16_usize); - | ++++++++++++++++ ~ +LL - let dangling = 16_usize as *const u8; +LL + let dangling = (...).with_addr(16_usize); + | error: aborting due to 1 previous error diff --git a/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr b/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr index 390028b349e5f..aeee69ae7afa1 100644 --- a/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr +++ b/tests/ui/lint/lint-strict-provenance-lossy-casts.stderr @@ -12,8 +12,9 @@ LL | #![deny(lossy_provenance_casts)] | ^^^^^^^^^^^^^^^^^^^^^^ help: use `.addr()` to obtain the address of a pointer | -LL | let addr: usize = (&x as *const u8).addr(); - | + ~~~~~~~~ +LL - let addr: usize = &x as *const u8 as usize; +LL + let addr: usize = (&x as *const u8).addr(); + | error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `u32` --> $DIR/lint-strict-provenance-lossy-casts.rs:9:22 @@ -24,8 +25,9 @@ LL | let addr_32bit = &x as *const u8 as u32; = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead help: use `.addr()` to obtain the address of a pointer | -LL | let addr_32bit = (&x as *const u8).addr() as u32; - | + ~~~~~~~~~~~~~~~ +LL - let addr_32bit = &x as *const u8 as u32; +LL + let addr_32bit = (&x as *const u8).addr() as u32; + | error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `usize` --> $DIR/lint-strict-provenance-lossy-casts.rs:14:20 diff --git a/tests/ui/lint/lint_map_unit_fn.stderr b/tests/ui/lint/lint_map_unit_fn.stderr index fbf689c54219e..91542af0f6df8 100644 --- a/tests/ui/lint/lint_map_unit_fn.stderr +++ b/tests/ui/lint/lint_map_unit_fn.stderr @@ -18,8 +18,9 @@ LL | #![deny(map_unit_fn)] | ^^^^^^^^^^^ help: you might have meant to use `Iterator::for_each` | -LL | x.iter_mut().for_each(foo); - | ~~~~~~~~ +LL - x.iter_mut().map(foo); +LL + x.iter_mut().for_each(foo); + | error: `Iterator::map` call that discard the iterator's values --> $DIR/lint_map_unit_fn.rs:11:18 @@ -41,8 +42,9 @@ LL | | | }); = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated help: you might have meant to use `Iterator::for_each` | -LL | x.iter_mut().for_each(|items| { - | ~~~~~~~~ +LL - x.iter_mut().map(|items| { +LL + x.iter_mut().for_each(|items| { + | error: `Iterator::map` call that discard the iterator's values --> $DIR/lint_map_unit_fn.rs:18:18 @@ -59,8 +61,9 @@ LL | x.iter_mut().map(f); = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated help: you might have meant to use `Iterator::for_each` | -LL | x.iter_mut().for_each(f); - | ~~~~~~~~ +LL - x.iter_mut().map(f); +LL + x.iter_mut().for_each(f); + | error: aborting due to 3 previous errors diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr index 2841815ecf2b9..ae2a00d3f90a6 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr @@ -30,8 +30,9 @@ LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ help: rename the identifier or convert it to a snake case raw identifier | -LL | mod r#impl {} - | ~~~~~~ +LL - mod Impl {} +LL + mod r#impl {} + | error: function `While` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4 @@ -41,8 +42,9 @@ LL | fn While() {} | help: rename the identifier or convert it to a snake case raw identifier | -LL | fn r#while() {} - | ~~~~~~~ +LL - fn While() {} +LL + fn r#while() {} + | error: variable `Mod` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9 @@ -52,8 +54,9 @@ LL | let Mod: usize = 0; | help: rename the identifier or convert it to a snake case raw identifier | -LL | let r#mod: usize = 0; - | ~~~~~ +LL - let Mod: usize = 0; +LL + let r#mod: usize = 0; + | error: variable `Super` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 diff --git a/tests/ui/lint/recommend-literal.stderr b/tests/ui/lint/recommend-literal.stderr index 424ecadd4b8cc..263071ca9a754 100644 --- a/tests/ui/lint/recommend-literal.stderr +++ b/tests/ui/lint/recommend-literal.stderr @@ -33,12 +33,14 @@ LL | let v2: Bool = true; | help: a builtin type with a similar name exists | -LL | let v2: bool = true; - | ~~~~ +LL - let v2: Bool = true; +LL + let v2: bool = true; + | help: perhaps you intended to use this type | -LL | let v2: bool = true; - | ~~~~ +LL - let v2: Bool = true; +LL + let v2: bool = true; + | error[E0412]: cannot find type `boolean` in this scope --> $DIR/recommend-literal.rs:19:9 @@ -75,8 +77,9 @@ LL | depth: Option, | help: perhaps you intended to use this type | -LL | depth: Option, - | ~~~ +LL - depth: Option, +LL + depth: Option, + | help: you might be missing a type parameter | LL | struct Data { diff --git a/tests/ui/lint/type-overflow.stderr b/tests/ui/lint/type-overflow.stderr index e7c90dcc81bb2..d555a60536a2d 100644 --- a/tests/ui/lint/type-overflow.stderr +++ b/tests/ui/lint/type-overflow.stderr @@ -21,12 +21,14 @@ LL | let fail = 0b1000_0001i8; = note: the literal `0b1000_0001i8` (decimal `129`) does not fit into the type `i8` and will become `-127i8` help: consider using the type `u8` instead | -LL | let fail = 0b1000_0001u8; - | ~~~~~~~~~~~~~ +LL - let fail = 0b1000_0001i8; +LL + let fail = 0b1000_0001u8; + | help: to use as a negative number (decimal `-127`), consider using the type `u8` for the literal and cast it to `i8` | -LL | let fail = 0b1000_0001u8 as i8; - | ~~~~~~~~~~~~~~~~~~~ +LL - let fail = 0b1000_0001i8; +LL + let fail = 0b1000_0001u8 as i8; + | warning: literal out of range for `i64` --> $DIR/type-overflow.rs:12:16 @@ -37,12 +39,14 @@ LL | let fail = 0x8000_0000_0000_0000i64; = note: the literal `0x8000_0000_0000_0000i64` (decimal `9223372036854775808`) does not fit into the type `i64` and will become `-9223372036854775808i64` help: consider using the type `u64` instead | -LL | let fail = 0x8000_0000_0000_0000u64; - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let fail = 0x8000_0000_0000_0000i64; +LL + let fail = 0x8000_0000_0000_0000u64; + | help: to use as a negative number (decimal `-9223372036854775808`), consider using the type `u64` for the literal and cast it to `i64` | -LL | let fail = 0x8000_0000_0000_0000u64 as i64; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let fail = 0x8000_0000_0000_0000i64; +LL + let fail = 0x8000_0000_0000_0000u64 as i64; + | warning: literal out of range for `u32` --> $DIR/type-overflow.rs:14:16 @@ -62,8 +66,9 @@ LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000; = help: consider using the type `u128` instead help: to use as a negative number (decimal `-170141183460469231731687303715884105728`), consider using the type `u128` for the literal and cast it to `i128` | -LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128 as i128; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000; +LL + let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128 as i128; + | warning: literal out of range for `i32` --> $DIR/type-overflow.rs:19:16 @@ -75,8 +80,9 @@ LL | let fail = 0x8FFF_FFFF_FFFF_FFFE; = help: consider using the type `i128` instead help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32` | -LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let fail = 0x8FFF_FFFF_FFFF_FFFE; +LL + let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32; + | warning: literal out of range for `i8` --> $DIR/type-overflow.rs:21:17 diff --git a/tests/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr b/tests/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr index 8fc2d1bc88fdd..8922f484d3e92 100644 --- a/tests/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr +++ b/tests/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr @@ -12,8 +12,9 @@ LL | #![deny(unused)] = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` help: try ignoring the field | -LL | A { i, j: _ } | B { i, j: _ } => { - | ~~~~ ~~~~ +LL - A { i, j } | B { i, j } => { +LL + A { i, j: _ } | B { i, j: _ } => { + | error: unused variable: `j` --> $DIR/issue-67691-unused-field-in-or-pattern.rs:30:16 @@ -23,8 +24,9 @@ LL | A { i, ref j } | B { i, ref j } => { | help: try ignoring the field | -LL | A { i, j: _ } | B { i, j: _ } => { - | ~~~~ ~~~~ +LL - A { i, ref j } | B { i, ref j } => { +LL + A { i, j: _ } | B { i, j: _ } => { + | error: unused variable: `j` --> $DIR/issue-67691-unused-field-in-or-pattern.rs:40:21 @@ -34,8 +36,9 @@ LL | Some(A { i, j } | B { i, j }) => { | help: try ignoring the field | -LL | Some(A { i, j: _ } | B { i, j: _ }) => { - | ~~~~ ~~~~ +LL - Some(A { i, j } | B { i, j }) => { +LL + Some(A { i, j: _ } | B { i, j: _ }) => { + | error: unused variable: `j` --> $DIR/issue-67691-unused-field-in-or-pattern.rs:52:21 @@ -45,8 +48,9 @@ LL | Some(A { i, ref j } | B { i, ref j }) => { | help: try ignoring the field | -LL | Some(A { i, j: _ } | B { i, j: _ }) => { - | ~~~~ ~~~~ +LL - Some(A { i, ref j } | B { i, ref j }) => { +LL + Some(A { i, j: _ } | B { i, j: _ }) => { + | error: unused variable: `i` --> $DIR/issue-67691-unused-field-in-or-pattern.rs:62:24 @@ -56,8 +60,9 @@ LL | MixedEnum::A { i } | MixedEnum::B(i) => { | help: try ignoring the field | -LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => { - | ~~~~ ~ +LL - MixedEnum::A { i } | MixedEnum::B(i) => { +LL + MixedEnum::A { i: _ } | MixedEnum::B(_) => { + | error: unused variable: `i` --> $DIR/issue-67691-unused-field-in-or-pattern.rs:70:24 @@ -67,8 +72,9 @@ LL | MixedEnum::A { ref i } | MixedEnum::B(ref i) => { | help: try ignoring the field | -LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => { - | ~~~~ ~ +LL - MixedEnum::A { ref i } | MixedEnum::B(ref i) => { +LL + MixedEnum::A { i: _ } | MixedEnum::B(_) => { + | error: aborting due to 6 previous errors diff --git a/tests/ui/lint/wide_pointer_comparisons.stderr b/tests/ui/lint/wide_pointer_comparisons.stderr index 7fe382393d7e1..b2a21058225ab 100644 --- a/tests/ui/lint/wide_pointer_comparisons.stderr +++ b/tests/ui/lint/wide_pointer_comparisons.stderr @@ -7,8 +7,9 @@ LL | let _ = a == b; = note: `#[warn(ambiguous_wide_pointer_comparisons)]` on by default help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ++++++++++++++++++ ~ + +LL - let _ = a == b; +LL + let _ = std::ptr::addr_eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:22:13 @@ -18,8 +19,9 @@ LL | let _ = a != b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(a, b); - | +++++++++++++++++++ ~ + +LL - let _ = a != b; +LL + let _ = !std::ptr::addr_eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:24:13 @@ -73,8 +75,9 @@ LL | let _ = PartialEq::eq(&a, &b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ~~~~~~~~~~~~~~~~~~ ~ +LL - let _ = PartialEq::eq(&a, &b); +LL + let _ = std::ptr::addr_eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:35:13 @@ -84,8 +87,9 @@ LL | let _ = PartialEq::ne(&a, &b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(a, b); - | ~~~~~~~~~~~~~~~~~~~ ~ +LL - let _ = PartialEq::ne(&a, &b); +LL + let _ = !std::ptr::addr_eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:37:13 @@ -95,8 +99,9 @@ LL | let _ = a.eq(&b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ++++++++++++++++++ ~ +LL - let _ = a.eq(&b); +LL + let _ = std::ptr::addr_eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:39:13 @@ -106,8 +111,9 @@ LL | let _ = a.ne(&b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(a, b); - | +++++++++++++++++++ ~ +LL - let _ = a.ne(&b); +LL + let _ = !std::ptr::addr_eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:41:13 @@ -183,8 +189,9 @@ LL | let _ = a == b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a.as_ptr(), b.as_ptr()); - | ++++++++++++++++++ ~~~~~~~~~~ ++++++++++ +LL - let _ = a == b; +LL + let _ = std::ptr::addr_eq(a.as_ptr(), b.as_ptr()); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:59:17 @@ -205,8 +212,9 @@ LL | let _ = &a == &b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a.as_ptr(), b.as_ptr()); - | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ++++++++++ +LL - let _ = &a == &b; +LL + let _ = std::ptr::addr_eq(a.as_ptr(), b.as_ptr()); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:70:17 @@ -216,8 +224,9 @@ LL | let _ = a == b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(*a, *b); - | +++++++++++++++++++ ~~~ + +LL - let _ = a == b; +LL + let _ = std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:72:17 @@ -227,8 +236,9 @@ LL | let _ = a != b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(*a, *b); - | ++++++++++++++++++++ ~~~ + +LL - let _ = a != b; +LL + let _ = !std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:74:17 @@ -282,8 +292,9 @@ LL | let _ = PartialEq::eq(a, b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(*a, *b); - | ~~~~~~~~~~~~~~~~~~~ ~~~ +LL - let _ = PartialEq::eq(a, b); +LL + let _ = std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:85:17 @@ -293,8 +304,9 @@ LL | let _ = PartialEq::ne(a, b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(*a, *b); - | ~~~~~~~~~~~~~~~~~~~~ ~~~ +LL - let _ = PartialEq::ne(a, b); +LL + let _ = !std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:87:17 @@ -304,8 +316,9 @@ LL | let _ = PartialEq::eq(&a, &b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(*a, *b); - | ~~~~~~~~~~~~~~~~~~~ ~~~ +LL - let _ = PartialEq::eq(&a, &b); +LL + let _ = std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:89:17 @@ -315,8 +328,9 @@ LL | let _ = PartialEq::ne(&a, &b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(*a, *b); - | ~~~~~~~~~~~~~~~~~~~~ ~~~ +LL - let _ = PartialEq::ne(&a, &b); +LL + let _ = !std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:91:17 @@ -326,8 +340,9 @@ LL | let _ = a.eq(b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(*a, *b); - | +++++++++++++++++++ ~~~ +LL - let _ = a.eq(b); +LL + let _ = std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:93:17 @@ -337,8 +352,9 @@ LL | let _ = a.ne(b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(*a, *b); - | ++++++++++++++++++++ ~~~ +LL - let _ = a.ne(b); +LL + let _ = !std::ptr::addr_eq(*a, *b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:95:17 @@ -414,12 +430,14 @@ LL | let _ = s == s; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(s, s); - | ++++++++++++++++++ ~ + +LL - let _ = s == s; +LL + let _ = std::ptr::addr_eq(s, s); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = std::ptr::eq(s, s); - | +++++++++++++ ~ + +LL - let _ = s == s; +LL + let _ = std::ptr::eq(s, s); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:114:13 @@ -429,12 +447,14 @@ LL | let _ = s == s; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(s, s); - | ++++++++++++++++++ ~ + +LL - let _ = s == s; +LL + let _ = std::ptr::addr_eq(s, s); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = std::ptr::eq(s, s); - | +++++++++++++ ~ + +LL - let _ = s == s; +LL + let _ = std::ptr::eq(s, s); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:118:17 @@ -444,12 +464,14 @@ LL | let _ = a == b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ++++++++++++++++++ ~ + +LL - let _ = a == b; +LL + let _ = std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = std::ptr::eq(a, b); - | +++++++++++++ ~ + +LL - let _ = a == b; +LL + let _ = std::ptr::eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:120:17 @@ -459,12 +481,14 @@ LL | let _ = a != b; | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(a, b); - | +++++++++++++++++++ ~ + +LL - let _ = a != b; +LL + let _ = !std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = !std::ptr::eq(a, b); - | ++++++++++++++ ~ + +LL - let _ = a != b; +LL + let _ = !std::ptr::eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:122:17 @@ -518,12 +542,14 @@ LL | let _ = PartialEq::eq(&a, &b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ~~~~~~~~~~~~~~~~~~ ~ +LL - let _ = PartialEq::eq(&a, &b); +LL + let _ = std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = std::ptr::eq(a, b); - | ~~~~~~~~~~~~~ ~ +LL - let _ = PartialEq::eq(&a, &b); +LL + let _ = std::ptr::eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:133:17 @@ -533,12 +559,14 @@ LL | let _ = PartialEq::ne(&a, &b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(a, b); - | ~~~~~~~~~~~~~~~~~~~ ~ +LL - let _ = PartialEq::ne(&a, &b); +LL + let _ = !std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = !std::ptr::eq(a, b); - | ~~~~~~~~~~~~~~ ~ +LL - let _ = PartialEq::ne(&a, &b); +LL + let _ = !std::ptr::eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:135:17 @@ -548,12 +576,14 @@ LL | let _ = a.eq(&b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = std::ptr::addr_eq(a, b); - | ++++++++++++++++++ ~ +LL - let _ = a.eq(&b); +LL + let _ = std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = std::ptr::eq(a, b); - | +++++++++++++ ~ +LL - let _ = a.eq(&b); +LL + let _ = std::ptr::eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:137:17 @@ -563,12 +593,14 @@ LL | let _ = a.ne(&b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | let _ = !std::ptr::addr_eq(a, b); - | +++++++++++++++++++ ~ +LL - let _ = a.ne(&b); +LL + let _ = !std::ptr::addr_eq(a, b); + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | let _ = !std::ptr::eq(a, b); - | ++++++++++++++ ~ +LL - let _ = a.ne(&b); +LL + let _ = !std::ptr::eq(a, b); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:142:9 @@ -578,12 +610,14 @@ LL | &*a == &*b | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | std::ptr::addr_eq(*a, *b) - | ~~~~~~~~~~~~~~~~~~ ~ + +LL - &*a == &*b +LL + std::ptr::addr_eq(*a, *b) + | help: use explicit `std::ptr::eq` method to compare metadata and addresses | -LL | std::ptr::eq(*a, *b) - | ~~~~~~~~~~~~~ ~ + +LL - &*a == &*b +LL + std::ptr::eq(*a, *b) + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:153:14 @@ -593,8 +627,9 @@ LL | cmp!(a, b); | help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | cmp!(std::ptr::addr_eq(a, b)); - | ++++++++++++++++++ + +LL - cmp!(a, b); +LL + cmp!(std::ptr::addr_eq(a, b)); + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:159:39 @@ -608,8 +643,9 @@ LL | cmp!(a, b); = note: this warning originates in the macro `cmp` (in Nightly builds, run with -Z macro-backtrace for more info) help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses | -LL | ($a:ident, $b:ident) => { std::ptr::addr_eq($a, $b) } - | ++++++++++++++++++ ~ + +LL - ($a:ident, $b:ident) => { $a == $b } +LL + ($a:ident, $b:ident) => { std::ptr::addr_eq($a, $b) } + | warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected --> $DIR/wide_pointer_comparisons.rs:169:37 diff --git a/tests/ui/loops/loop-break-value-no-repeat.stderr b/tests/ui/loops/loop-break-value-no-repeat.stderr index 946057d054398..918ea81a2ed57 100644 --- a/tests/ui/loops/loop-break-value-no-repeat.stderr +++ b/tests/ui/loops/loop-break-value-no-repeat.stderr @@ -8,8 +8,9 @@ LL | break 22 | help: use `break` on its own without a value inside this `for` loop | -LL | break - | ~~~~~ +LL - break 22 +LL + break + | error: aborting due to 1 previous error diff --git a/tests/ui/loops/loop-break-value.stderr b/tests/ui/loops/loop-break-value.stderr index 0912bdbb221ec..3b9735510bd7e 100644 --- a/tests/ui/loops/loop-break-value.stderr +++ b/tests/ui/loops/loop-break-value.stderr @@ -46,12 +46,14 @@ LL | break (); | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break (); +LL + break; + | help: alternatively, you might have meant to use the available loop label | -LL | break 'while_loop; - | ~~~~~~~~~~~ +LL - break (); +LL + break 'while_loop; + | error[E0571]: `break` with value from a `while` loop --> $DIR/loop-break-value.rs:34:13 @@ -64,8 +66,9 @@ LL | break 'while_loop 123; | help: use `break` on its own without a value inside this `while` loop | -LL | break 'while_loop; - | ~~~~~~~~~~~~~~~~~ +LL - break 'while_loop 123; +LL + break 'while_loop; + | error[E0571]: `break` with value from a `while` loop --> $DIR/loop-break-value.rs:42:12 @@ -77,8 +80,9 @@ LL | if break () { | help: use `break` on its own without a value inside this `while` loop | -LL | if break { - | ~~~~~ +LL - if break () { +LL + if break { + | error[E0571]: `break` with value from a `while` loop --> $DIR/loop-break-value.rs:47:9 @@ -90,8 +94,9 @@ LL | break None; | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break None; +LL + break; + | error[E0571]: `break` with value from a `while` loop --> $DIR/loop-break-value.rs:53:13 @@ -104,8 +109,9 @@ LL | break 'while_let_loop "nope"; | help: use `break` on its own without a value inside this `while` loop | -LL | break 'while_let_loop; - | ~~~~~~~~~~~~~~~~~~~~~ +LL - break 'while_let_loop "nope"; +LL + break 'while_let_loop; + | error[E0571]: `break` with value from a `for` loop --> $DIR/loop-break-value.rs:60:9 @@ -117,8 +123,9 @@ LL | break (); | help: use `break` on its own without a value inside this `for` loop | -LL | break; - | ~~~~~ +LL - break (); +LL + break; + | error[E0571]: `break` with value from a `for` loop --> $DIR/loop-break-value.rs:61:9 @@ -131,8 +138,9 @@ LL | break [()]; | help: use `break` on its own without a value inside this `for` loop | -LL | break; - | ~~~~~ +LL - break [()]; +LL + break; + | error[E0571]: `break` with value from a `for` loop --> $DIR/loop-break-value.rs:68:13 @@ -145,8 +153,9 @@ LL | break 'for_loop Some(17); | help: use `break` on its own without a value inside this `for` loop | -LL | break 'for_loop; - | ~~~~~~~~~~~~~~~ +LL - break 'for_loop Some(17); +LL + break 'for_loop; + | error[E0308]: mismatched types --> $DIR/loop-break-value.rs:4:31 diff --git a/tests/ui/macros/expand-full-no-resolution.stderr b/tests/ui/macros/expand-full-no-resolution.stderr index df6f20332bfd8..b836ac51ad9e0 100644 --- a/tests/ui/macros/expand-full-no-resolution.stderr +++ b/tests/ui/macros/expand-full-no-resolution.stderr @@ -9,8 +9,9 @@ LL | format_args!(a!()); | help: the leading underscore in `_a` marks it as unused, consider renaming it to `a` | -LL | macro_rules! a { - | ~ +LL - macro_rules! _a { +LL + macro_rules! a { + | error: cannot find macro `a` in this scope --> $DIR/expand-full-no-resolution.rs:19:10 @@ -23,8 +24,9 @@ LL | env!(a!()); | help: the leading underscore in `_a` marks it as unused, consider renaming it to `a` | -LL | macro_rules! a { - | ~ +LL - macro_rules! _a { +LL + macro_rules! a { + | error: aborting due to 2 previous errors diff --git a/tests/ui/macros/expr_2021_cargo_fix_edition.stderr b/tests/ui/macros/expr_2021_cargo_fix_edition.stderr index e8a44fed322f9..1b3b4e99c54c0 100644 --- a/tests/ui/macros/expr_2021_cargo_fix_edition.stderr +++ b/tests/ui/macros/expr_2021_cargo_fix_edition.stderr @@ -13,8 +13,9 @@ LL | #![warn(edition_2024_expr_fragment_specifier)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to keep the existing behavior, use the `expr_2021` fragment specifier | -LL | ($e:expr_2021) => { - | ~~~~~~~~~ +LL - ($e:expr) => { +LL + ($e:expr_2021) => { + | warning: the `expr` fragment specifier will accept more expressions in the 2024 edition --> $DIR/expr_2021_cargo_fix_edition.rs:13:11 @@ -26,8 +27,9 @@ LL | ($($i:expr)*) => { }; = note: for more information, see Migration Guide help: to keep the existing behavior, use the `expr_2021` fragment specifier | -LL | ($($i:expr_2021)*) => { }; - | ~~~~~~~~~ +LL - ($($i:expr)*) => { }; +LL + ($($i:expr_2021)*) => { }; + | warning: 2 warnings emitted diff --git a/tests/ui/macros/format-foreign.stderr b/tests/ui/macros/format-foreign.stderr index 7971c2ab2b9b2..ccb6583615cf7 100644 --- a/tests/ui/macros/format-foreign.stderr +++ b/tests/ui/macros/format-foreign.stderr @@ -11,8 +11,9 @@ LL | println!("%.*3$s %s!\n", "Hello,", "World", 4); = note: printf formatting is not supported; see the documentation for `std::fmt` help: format specifiers use curly braces | -LL | println!("{:.2$} {}!\n", "Hello,", "World", 4); - | ~~~~~~ ~~ +LL - println!("%.*3$s %s!\n", "Hello,", "World", 4); +LL + println!("{:.2$} {}!\n", "Hello,", "World", 4); + | error: argument never used --> $DIR/format-foreign.rs:3:29 @@ -75,8 +76,9 @@ LL | println!("$1 $0 $$ $NAME", 1, 2, NAME=3); = note: shell formatting is not supported; see the documentation for `std::fmt` help: format specifiers use curly braces | -LL | println!("{1} {0} $$ {NAME}", 1, 2, NAME=3); - | ~~~ ~~~ ~~~~~~ +LL - println!("$1 $0 $$ $NAME", 1, 2, NAME=3); +LL + println!("{1} {0} $$ {NAME}", 1, 2, NAME=3); + | error: aborting due to 6 previous errors diff --git a/tests/ui/macros/issue-103529.stderr b/tests/ui/macros/issue-103529.stderr index 61e322afc7709..985d9ace8186c 100644 --- a/tests/ui/macros/issue-103529.stderr +++ b/tests/ui/macros/issue-103529.stderr @@ -21,8 +21,9 @@ LL | m! { auto x } | help: write `let` instead of `auto` to introduce a new variable | -LL | m! { let x } - | ~~~ +LL - m! { auto x } +LL + m! { let x } + | error: invalid variable declaration --> $DIR/issue-103529.rs:10:6 @@ -32,8 +33,9 @@ LL | m! { var x } | help: write `let` instead of `var` to introduce a new variable | -LL | m! { let x } - | ~~~ +LL - m! { var x } +LL + m! { let x } + | error: aborting due to 4 previous errors diff --git a/tests/ui/macros/issue-109237.stderr b/tests/ui/macros/issue-109237.stderr index a335786df8642..9d25420af2561 100644 --- a/tests/ui/macros/issue-109237.stderr +++ b/tests/ui/macros/issue-109237.stderr @@ -11,8 +11,9 @@ LL | let _ = statement!(); = note: this error originates in the macro `statement` (in Nightly builds, run with -Z macro-backtrace for more info) help: surround the macro invocation with `{}` to interpret the expansion as a statement | -LL | let _ = { statement!(); }; - | ~~~~~~~~~~~~~~~~~ +LL - let _ = statement!(); +LL + let _ = { statement!(); }; + | error: aborting due to 1 previous error diff --git a/tests/ui/macros/issue-118786.stderr b/tests/ui/macros/issue-118786.stderr index 256b742ee160b..5b7e161cf2fbf 100644 --- a/tests/ui/macros/issue-118786.stderr +++ b/tests/ui/macros/issue-118786.stderr @@ -6,8 +6,9 @@ LL | make_macro!((meow)); | help: change the delimiters to curly braces | -LL | make_macro!({meow}); - | ~ ~ +LL - make_macro!((meow)); +LL + make_macro!({meow}); + | help: add a semicolon | LL | macro_rules! $macro_name; { diff --git a/tests/ui/macros/issue-99265.stderr b/tests/ui/macros/issue-99265.stderr index 9185dbff61ee0..a4200bf02cfe5 100644 --- a/tests/ui/macros/issue-99265.stderr +++ b/tests/ui/macros/issue-99265.stderr @@ -74,8 +74,9 @@ LL | println!("Hello {:1$}!", "x", width = 5); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {:width$}!", "x", width = 5); - | ~~~~~~ +LL - println!("Hello {:1$}!", "x", width = 5); +LL + println!("Hello {:width$}!", "x", width = 5); + | warning: named argument `f` is not used by name --> $DIR/issue-99265.rs:23:33 @@ -100,8 +101,9 @@ LL | println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {:1$.precision$}!", f = 0.02f32, width = 5, precision = 2); - | ~~~~~~~~~~ +LL - println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2); +LL + println!("Hello {:1$.precision$}!", f = 0.02f32, width = 5, precision = 2); + | warning: named argument `width` is not used by name --> $DIR/issue-99265.rs:23:46 @@ -113,8 +115,9 @@ LL | println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {:width$.2$}!", f = 0.02f32, width = 5, precision = 2); - | ~~~~~~ +LL - println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2); +LL + println!("Hello {:width$.2$}!", f = 0.02f32, width = 5, precision = 2); + | warning: named argument `f` is not used by name --> $DIR/issue-99265.rs:31:34 @@ -126,8 +129,9 @@ LL | println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {f:1$.2$}!", f = 0.02f32, width = 5, precision = 2); - | ~ +LL - println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2); +LL + println!("Hello {f:1$.2$}!", f = 0.02f32, width = 5, precision = 2); + | warning: named argument `precision` is not used by name --> $DIR/issue-99265.rs:31:58 @@ -139,8 +143,9 @@ LL | println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {0:1$.precision$}!", f = 0.02f32, width = 5, precision = 2); - | ~~~~~~~~~~ +LL - println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2); +LL + println!("Hello {0:1$.precision$}!", f = 0.02f32, width = 5, precision = 2); + | warning: named argument `width` is not used by name --> $DIR/issue-99265.rs:31:47 @@ -152,8 +157,9 @@ LL | println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {0:width$.2$}!", f = 0.02f32, width = 5, precision = 2); - | ~~~~~~ +LL - println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2); +LL + println!("Hello {0:width$.2$}!", f = 0.02f32, width = 5, precision = 2); + | warning: named argument `f` is not used by name --> $DIR/issue-99265.rs:49:9 @@ -166,8 +172,9 @@ LL | f = 0.02f32, | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {f:2$.3$} {4:5$.6$}! {1}", - | ~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {f:2$.3$} {4:5$.6$}! {1}", + | warning: named argument `precision` is not used by name --> $DIR/issue-99265.rs:54:9 @@ -180,8 +187,9 @@ LL | precision = 2, | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {1:2$.precision$} {4:5$.6$}! {1}", - | ~~~~~~~~~~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {1:2$.precision$} {4:5$.6$}! {1}", + | warning: named argument `width` is not used by name --> $DIR/issue-99265.rs:52:9 @@ -194,8 +202,9 @@ LL | width = 5, | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {1:width$.3$} {4:5$.6$}! {1}", - | ~~~~~~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {1:width$.3$} {4:5$.6$}! {1}", + | warning: named argument `g` is not used by name --> $DIR/issue-99265.rs:56:9 @@ -208,8 +217,9 @@ LL | g = 0.02f32, | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {1:2$.3$} {g:5$.6$}! {1}", - | ~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {1:2$.3$} {g:5$.6$}! {1}", + | warning: named argument `precision2` is not used by name --> $DIR/issue-99265.rs:60:9 @@ -222,8 +232,9 @@ LL | precision2 = 2 | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {1:2$.3$} {4:5$.precision2$}! {1}", - | ~~~~~~~~~~~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {1:2$.3$} {4:5$.precision2$}! {1}", + | warning: named argument `width2` is not used by name --> $DIR/issue-99265.rs:58:9 @@ -236,8 +247,9 @@ LL | width2 = 5, | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {1:2$.3$} {4:width2$.6$}! {1}", - | ~~~~~~~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {1:2$.3$} {4:width2$.6$}! {1}", + | warning: named argument `f` is not used by name --> $DIR/issue-99265.rs:49:9 @@ -250,8 +262,9 @@ LL | f = 0.02f32, | help: use the named argument by name to avoid ambiguity | -LL | "{}, Hello {1:2$.3$} {4:5$.6$}! {f}", - | ~ +LL - "{}, Hello {1:2$.3$} {4:5$.6$}! {1}", +LL + "{}, Hello {1:2$.3$} {4:5$.6$}! {f}", + | warning: named argument `f` is not used by name --> $DIR/issue-99265.rs:64:31 @@ -276,8 +289,9 @@ LL | println!("Hello {0:0.1}!", f = 0.02f32); | help: use the named argument by name to avoid ambiguity | -LL | println!("Hello {f:0.1}!", f = 0.02f32); - | ~ +LL - println!("Hello {0:0.1}!", f = 0.02f32); +LL + println!("Hello {f:0.1}!", f = 0.02f32); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:79:23 @@ -302,8 +316,9 @@ LL | println!("{:0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{:v$}", v = val); - | ~~ +LL - println!("{:0$}", v = val); +LL + println!("{:v$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:84:24 @@ -315,8 +330,9 @@ LL | println!("{0:0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{v:0$}", v = val); - | ~ +LL - println!("{0:0$}", v = val); +LL + println!("{v:0$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:84:24 @@ -328,8 +344,9 @@ LL | println!("{0:0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{0:v$}", v = val); - | ~~ +LL - println!("{0:0$}", v = val); +LL + println!("{0:v$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:89:26 @@ -354,8 +371,9 @@ LL | println!("{:0$.0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{:0$.v$}", v = val); - | ~~ +LL - println!("{:0$.0$}", v = val); +LL + println!("{:0$.v$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:89:26 @@ -367,8 +385,9 @@ LL | println!("{:0$.0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{:v$.0$}", v = val); - | ~~ +LL - println!("{:0$.0$}", v = val); +LL + println!("{:v$.0$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:96:27 @@ -380,8 +399,9 @@ LL | println!("{0:0$.0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{v:0$.0$}", v = val); - | ~ +LL - println!("{0:0$.0$}", v = val); +LL + println!("{v:0$.0$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:96:27 @@ -393,8 +413,9 @@ LL | println!("{0:0$.0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{0:0$.v$}", v = val); - | ~~ +LL - println!("{0:0$.0$}", v = val); +LL + println!("{0:0$.v$}", v = val); + | warning: named argument `v` is not used by name --> $DIR/issue-99265.rs:96:27 @@ -406,8 +427,9 @@ LL | println!("{0:0$.0$}", v = val); | help: use the named argument by name to avoid ambiguity | -LL | println!("{0:v$.0$}", v = val); - | ~~ +LL - println!("{0:0$.0$}", v = val); +LL + println!("{0:v$.0$}", v = val); + | warning: named argument `a` is not used by name --> $DIR/issue-99265.rs:104:28 @@ -432,8 +454,9 @@ LL | println!("{} {a} {0}", a = 1); | help: use the named argument by name to avoid ambiguity | -LL | println!("{} {a} {a}", a = 1); - | ~ +LL - println!("{} {a} {0}", a = 1); +LL + println!("{} {a} {a}", a = 1); + | warning: named argument `a` is not used by name --> $DIR/issue-99265.rs:115:14 @@ -460,8 +483,9 @@ LL | a = 1.0, b = 1, c = 2, | help: use the named argument by name to avoid ambiguity | -LL | {:1$.c$}", - | ~~ +LL - {:1$.2$}", +LL + {:1$.c$}", + | warning: named argument `b` is not used by name --> $DIR/issue-99265.rs:115:23 @@ -474,8 +498,9 @@ LL | a = 1.0, b = 1, c = 2, | help: use the named argument by name to avoid ambiguity | -LL | {:b$.2$}", - | ~~ +LL - {:1$.2$}", +LL + {:b$.2$}", + | warning: named argument `a` is not used by name --> $DIR/issue-99265.rs:126:14 @@ -488,8 +513,9 @@ LL | a = 1.0, b = 1, c = 2, | help: use the named argument by name to avoid ambiguity | -LL | {a:1$.2$}", - | ~ +LL - {0:1$.2$}", +LL + {a:1$.2$}", + | warning: named argument `c` is not used by name --> $DIR/issue-99265.rs:126:30 @@ -502,8 +528,9 @@ LL | a = 1.0, b = 1, c = 2, | help: use the named argument by name to avoid ambiguity | -LL | {0:1$.c$}", - | ~~ +LL - {0:1$.2$}", +LL + {0:1$.c$}", + | warning: named argument `b` is not used by name --> $DIR/issue-99265.rs:126:23 @@ -516,8 +543,9 @@ LL | a = 1.0, b = 1, c = 2, | help: use the named argument by name to avoid ambiguity | -LL | {0:b$.2$}", - | ~~ +LL - {0:1$.2$}", +LL + {0:b$.2$}", + | warning: named argument `x` is not used by name --> $DIR/issue-99265.rs:132:30 @@ -542,8 +570,9 @@ LL | println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("{{{:1$.precision$}}}", x = 1.0, width = 3, precision = 2); - | ~~~~~~~~~~ +LL - println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2); +LL + println!("{{{:1$.precision$}}}", x = 1.0, width = 3, precision = 2); + | warning: named argument `width` is not used by name --> $DIR/issue-99265.rs:132:39 @@ -555,8 +584,9 @@ LL | println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2); | help: use the named argument by name to avoid ambiguity | -LL | println!("{{{:width$.2$}}}", x = 1.0, width = 3, precision = 2); - | ~~~~~~ +LL - println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2); +LL + println!("{{{:width$.2$}}}", x = 1.0, width = 3, precision = 2); + | warning: 42 warnings emitted diff --git a/tests/ui/macros/macro-backtrace-invalid-internals.stderr b/tests/ui/macros/macro-backtrace-invalid-internals.stderr index aa8f06a0df13b..bb8250d58b06c 100644 --- a/tests/ui/macros/macro-backtrace-invalid-internals.stderr +++ b/tests/ui/macros/macro-backtrace-invalid-internals.stderr @@ -43,8 +43,9 @@ LL | real_method_stmt!(); = note: this error originates in the macro `real_method_stmt` (in Nightly builds, run with -Z macro-backtrace for more info) help: you must specify a concrete type for this numeric value, like `f32` | -LL | 2.0_f32.neg() - | ~~~~~~~ +LL - 2.0.neg() +LL + 2.0_f32.neg() + | error[E0599]: no method named `fake` found for type `{integer}` in the current scope --> $DIR/macro-backtrace-invalid-internals.rs:23:13 @@ -91,8 +92,9 @@ LL | let _ = real_method_expr!(); = note: this error originates in the macro `real_method_expr` (in Nightly builds, run with -Z macro-backtrace for more info) help: you must specify a concrete type for this numeric value, like `f32` | -LL | 2.0_f32.neg() - | ~~~~~~~ +LL - 2.0.neg() +LL + 2.0_f32.neg() + | error: aborting due to 8 previous errors diff --git a/tests/ui/macros/macro-inner-attributes.stderr b/tests/ui/macros/macro-inner-attributes.stderr index b6e10f45e3810..3b049fe0d1d36 100644 --- a/tests/ui/macros/macro-inner-attributes.stderr +++ b/tests/ui/macros/macro-inner-attributes.stderr @@ -6,8 +6,9 @@ LL | a::bar(); | help: there is a crate or module with a similar name | -LL | b::bar(); - | ~ +LL - a::bar(); +LL + b::bar(); + | error: aborting due to 1 previous error diff --git a/tests/ui/macros/macro-use-wrong-name.stderr b/tests/ui/macros/macro-use-wrong-name.stderr index 89345866be804..c7f214db225b6 100644 --- a/tests/ui/macros/macro-use-wrong-name.stderr +++ b/tests/ui/macros/macro-use-wrong-name.stderr @@ -11,8 +11,9 @@ LL | macro_rules! macro_one { () => ("one") } | help: a macro with a similar name exists | -LL | macro_one!(); - | ~~~~~~~~~ +LL - macro_two!(); +LL + macro_one!(); + | help: consider importing this macro | LL + use two_macros::macro_two; diff --git a/tests/ui/macros/recovery-allowed.stderr b/tests/ui/macros/recovery-allowed.stderr index 825f7a8faf8e7..00bc65ed9148c 100644 --- a/tests/ui/macros/recovery-allowed.stderr +++ b/tests/ui/macros/recovery-allowed.stderr @@ -6,8 +6,9 @@ LL | please_recover! { not 1 } | help: use `!` to perform bitwise not | -LL | please_recover! { !1 } - | ~ +LL - please_recover! { not 1 } +LL + please_recover! { !1 } + | error: aborting due to 1 previous error diff --git a/tests/ui/malformed/malformed-meta-delim.stderr b/tests/ui/malformed/malformed-meta-delim.stderr index 27636c3d546fd..3f2357c435f0c 100644 --- a/tests/ui/malformed/malformed-meta-delim.stderr +++ b/tests/ui/malformed/malformed-meta-delim.stderr @@ -6,8 +6,9 @@ LL | #[allow { foo_lint } ] | help: the delimiters should be `(` and `)` | -LL | #[allow ( foo_lint ) ] - | ~ ~ +LL - #[allow { foo_lint } ] +LL + #[allow ( foo_lint ) ] + | error: wrong meta list delimiters --> $DIR/malformed-meta-delim.rs:8:9 @@ -17,8 +18,9 @@ LL | #[allow [ foo_lint ] ] | help: the delimiters should be `(` and `)` | -LL | #[allow ( foo_lint ) ] - | ~ ~ +LL - #[allow [ foo_lint ] ] +LL + #[allow ( foo_lint ) ] + | error: aborting due to 2 previous errors diff --git a/tests/ui/malformed/malformed-special-attrs.stderr b/tests/ui/malformed/malformed-special-attrs.stderr index 8f2ce20593f56..a6220710cf912 100644 --- a/tests/ui/malformed/malformed-special-attrs.stderr +++ b/tests/ui/malformed/malformed-special-attrs.stderr @@ -7,8 +7,9 @@ LL | #[cfg_attr] = note: for more information, visit help: missing condition and attribute | -LL | #[cfg_attr(condition, attribute, other_attribute, ...)] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - #[cfg_attr] +LL + #[cfg_attr(condition, attribute, other_attribute, ...)] + | error: malformed `cfg_attr` attribute input --> $DIR/malformed-special-attrs.rs:4:1 @@ -19,8 +20,9 @@ LL | #[cfg_attr = ""] = note: for more information, visit help: missing condition and attribute | -LL | #[cfg_attr(condition, attribute, other_attribute, ...)] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - #[cfg_attr = ""] +LL + #[cfg_attr(condition, attribute, other_attribute, ...)] + | error: malformed `derive` attribute input --> $DIR/malformed-special-attrs.rs:7:1 diff --git a/tests/ui/match/issue-56685.stderr b/tests/ui/match/issue-56685.stderr index ccf357d4aa00e..9655a38081165 100644 --- a/tests/ui/match/issue-56685.stderr +++ b/tests/ui/match/issue-56685.stderr @@ -11,8 +11,9 @@ LL | #![deny(unused_variables)] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore | -LL | E::A(_x) | E::B(_x) => {} - | ~~ ~~ +LL - E::A(x) | E::B(x) => {} +LL + E::A(_x) | E::B(_x) => {} + | error: unused variable: `x` --> $DIR/issue-56685.rs:25:14 @@ -22,8 +23,9 @@ LL | F::A(x, y) | F::B(x, y) => { y }, | help: if this is intentional, prefix it with an underscore | -LL | F::A(_x, y) | F::B(_x, y) => { y }, - | ~~ ~~ +LL - F::A(x, y) | F::B(x, y) => { y }, +LL + F::A(_x, y) | F::B(_x, y) => { y }, + | error: unused variable: `a` --> $DIR/issue-56685.rs:27:14 @@ -45,8 +47,9 @@ LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) { | help: if this is intentional, prefix it with an underscore | -LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { - | ~~ ~~ +LL - let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) { +LL + let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { + | error: unused variable: `x` --> $DIR/issue-56685.rs:39:20 @@ -56,8 +59,9 @@ LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) { | help: if this is intentional, prefix it with an underscore | -LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { - | ~~ ~~ +LL - while let F::A(x, y) | F::B(x, y) = F::A(1, 2) { +LL + while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { + | error: aborting due to 6 previous errors diff --git a/tests/ui/match/match-pattern-field-mismatch.stderr b/tests/ui/match/match-pattern-field-mismatch.stderr index cde7ac972ca88..ea5f6f0f22bb9 100644 --- a/tests/ui/match/match-pattern-field-mismatch.stderr +++ b/tests/ui/match/match-pattern-field-mismatch.stderr @@ -13,8 +13,9 @@ LL | Color::Rgb(_, _, _) => { } | +++ help: use `..` to ignore all fields | -LL | Color::Rgb(..) => { } - | ~~ +LL - Color::Rgb(_, _) => { } +LL + Color::Rgb(..) => { } + | error: aborting due to 1 previous error diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr index b3ea60252ac47..cdb678796a1a7 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.stderr @@ -10,8 +10,9 @@ LL | if let Some(Some(&x)) = &Some(&Some(0)) { found reference `&_` help: consider removing `&` from the pattern | -LL | if let Some(Some(x)) = &Some(&Some(0)) { - | ~ +LL - if let Some(Some(&x)) = &Some(&Some(0)) { +LL + if let Some(Some(x)) = &Some(&Some(0)) { + | error[E0308]: mismatched types --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:11:23 @@ -70,8 +71,9 @@ LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ^^^^^^ help: consider removing `&mut` from the pattern | -LL | if let Some(Some(x)) = &mut Some(&mut Some(0)) { - | ~ +LL - if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { +LL + if let Some(Some(x)) = &mut Some(&mut Some(0)) { + | error[E0308]: mismatched types --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:26:22 @@ -85,8 +87,9 @@ LL | if let Some(Some(&x)) = &Some(&Some(0)) { found reference `&_` help: consider removing `&` from the pattern | -LL | if let Some(Some(x)) = &Some(&Some(0)) { - | ~ +LL - if let Some(Some(&x)) = &Some(&Some(0)) { +LL + if let Some(Some(x)) = &Some(&Some(0)) { + | error[E0308]: mismatched types --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:30:27 @@ -100,8 +103,9 @@ LL | if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { found reference `&_` help: consider removing `&` from the pattern | -LL | if let Some(&mut Some(x)) = &Some(&mut Some(0)) { - | ~ +LL - if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { +LL + if let Some(&mut Some(x)) = &Some(&mut Some(0)) { + | error[E0308]: mismatched types --> $DIR/feature-gate-ref_pat_eat_one_layer_2024.rs:34:23 @@ -120,8 +124,9 @@ LL | if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { | ^^^^^^ help: consider removing `&mut` from the pattern | -LL | if let Some(&Some(x)) = &mut Some(&Some(0)) { - | ~ +LL - if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { +LL + if let Some(&Some(x)) = &mut Some(&Some(0)) { + | error: aborting due to 8 previous errors diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2021_fail.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2021_fail.stderr index 1a921234ea069..0158ed0f42357 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2021_fail.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2021_fail.stderr @@ -10,8 +10,9 @@ LL | if let Some(Some(&x)) = &Some(&Some(0)) { found reference `&_` help: consider removing `&` from the pattern | -LL | if let Some(Some(x)) = &Some(&Some(0)) { - | ~ +LL - if let Some(Some(&x)) = &Some(&Some(0)) { +LL + if let Some(Some(x)) = &Some(&Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2021_fail.rs:10:23 @@ -70,8 +71,9 @@ LL | if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ^^^^^^ help: consider removing `&mut` from the pattern | -LL | if let Some(Some(x)) = &mut Some(&mut Some(0)) { - | ~ +LL - if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { +LL + if let Some(Some(x)) = &mut Some(&mut Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2021_fail.rs:25:22 @@ -85,8 +87,9 @@ LL | if let Some(Some(&x)) = &Some(&Some(0)) { found reference `&_` help: consider removing `&` from the pattern | -LL | if let Some(Some(x)) = &Some(&Some(0)) { - | ~ +LL - if let Some(Some(&x)) = &Some(&Some(0)) { +LL + if let Some(Some(x)) = &Some(&Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2021_fail.rs:29:27 @@ -100,8 +103,9 @@ LL | if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { found reference `&_` help: consider removing `&` from the pattern | -LL | if let Some(&mut Some(x)) = &Some(&mut Some(0)) { - | ~ +LL - if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { +LL + if let Some(&mut Some(x)) = &Some(&mut Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2021_fail.rs:33:23 @@ -120,8 +124,9 @@ LL | if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { | ^^^^^^ help: consider removing `&mut` from the pattern | -LL | if let Some(&Some(x)) = &mut Some(&Some(0)) { - | ~ +LL - if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { +LL + if let Some(&Some(x)) = &mut Some(&Some(0)) { + | error: aborting due to 8 previous errors diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr index 9428b32c4affd..93dc23bffbae5 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_fail.classic.stderr @@ -7,8 +7,9 @@ LL | if let Some(&mut Some(&_)) = &Some(&Some(0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(&_)) = &Some(&Some(0)) { - | ~ +LL - if let Some(&mut Some(&_)) = &Some(&Some(0)) { +LL + if let Some(&Some(&_)) = &Some(&Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:12:23 @@ -19,8 +20,9 @@ LL | if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(&_)) = &Some(&mut Some(0)) { - | ~ +LL - if let Some(&Some(&mut _)) = &Some(&mut Some(0)) { +LL + if let Some(&Some(&_)) = &Some(&mut Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:16:27 @@ -42,8 +44,9 @@ LL | if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(&_)) = &mut Some(&Some(0)) { - | ~ +LL - if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { +LL + if let Some(&Some(&_)) = &mut Some(&Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:22:29 @@ -54,8 +57,9 @@ LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(Some((&_)))) = &Some(Some(&mut Some(0))) { - | ~ +LL - if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { +LL + if let Some(&Some(Some((&_)))) = &Some(Some(&mut Some(0))) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:25:17 @@ -66,8 +70,9 @@ LL | if let Some(&mut Some(x)) = &Some(Some(0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(x)) = &Some(Some(0)) { - | ~ +LL - if let Some(&mut Some(x)) = &Some(Some(0)) { +LL + if let Some(&Some(x)) = &Some(Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:28:17 @@ -78,8 +83,9 @@ LL | if let Some(&mut Some(x)) = &Some(Some(0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(x)) = &Some(Some(0)) { - | ~ +LL - if let Some(&mut Some(x)) = &Some(Some(0)) { +LL + if let Some(&Some(x)) = &Some(Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:32:9 @@ -112,8 +118,9 @@ LL | if let Some(&mut Some(&_)) = &Some(&mut Some(0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(&_)) = &Some(&mut Some(0)) { - | ~ +LL - if let Some(&mut Some(&_)) = &Some(&mut Some(0)) { +LL + if let Some(&Some(&_)) = &Some(&mut Some(0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:42:22 @@ -124,8 +131,9 @@ LL | if let Some(Some(&mut x)) = &Some(Some(&mut 0)) { = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(Some(&x)) = &Some(Some(&mut 0)) { - | ~ +LL - if let Some(Some(&mut x)) = &Some(Some(&mut 0)) { +LL + if let Some(Some(&x)) = &Some(Some(&mut 0)) { + | error[E0308]: mismatched types --> $DIR/ref_pat_eat_one_layer_2024_fail.rs:46:9 diff --git a/tests/ui/meta/expected-error-correct-rev.a.stderr b/tests/ui/meta/expected-error-correct-rev.a.stderr index d5b7603d346d5..ae8dd86d36002 100644 --- a/tests/ui/meta/expected-error-correct-rev.a.stderr +++ b/tests/ui/meta/expected-error-correct-rev.a.stderr @@ -8,8 +8,9 @@ LL | let x: u32 = 22_usize; | help: change the type of the numeric literal from `usize` to `u32` | -LL | let x: u32 = 22_u32; - | ~~~ +LL - let x: u32 = 22_usize; +LL + let x: u32 = 22_u32; + | error: aborting due to 1 previous error diff --git a/tests/ui/meta/meta-expected-error-wrong-rev.a.stderr b/tests/ui/meta/meta-expected-error-wrong-rev.a.stderr index a489040f32df6..48fea28024f30 100644 --- a/tests/ui/meta/meta-expected-error-wrong-rev.a.stderr +++ b/tests/ui/meta/meta-expected-error-wrong-rev.a.stderr @@ -8,8 +8,9 @@ LL | let x: u32 = 22_usize; | help: change the type of the numeric literal from `usize` to `u32` | -LL | let x: u32 = 22_u32; - | ~~~ +LL - let x: u32 = 22_usize; +LL + let x: u32 = 22_u32; + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/disambiguate-associated-function-first-arg.stderr b/tests/ui/methods/disambiguate-associated-function-first-arg.stderr index 341b7a9100329..381e29667c824 100644 --- a/tests/ui/methods/disambiguate-associated-function-first-arg.stderr +++ b/tests/ui/methods/disambiguate-associated-function-first-arg.stderr @@ -25,16 +25,19 @@ LL | fn new(_a: Self, _b: i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function for candidate #1 | -LL | ::new(1); - | ~~~~~~~~~~~~~~~~ +LL - _a.new(1); +LL + ::new(1); + | help: disambiguate the associated function for candidate #2 | -LL | ::new(_a, 1); - | ~~~~~~~~~~~~~~~~~~~~ +LL - _a.new(1); +LL + ::new(_a, 1); + | help: disambiguate the associated function for candidate #3 | -LL | ::new(_a, 1); - | ~~~~~~~~~~~~~~~~~~~~ +LL - _a.new(1); +LL + ::new(_a, 1); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-associated-function-first-arg.rs:47:7 @@ -54,12 +57,14 @@ LL | fn f(self) {} | ^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | TraitA::f(S); - | ~~~~~~~~~~~~ +LL - S.f(); +LL + TraitA::f(S); + | help: disambiguate the method for candidate #2 | -LL | TraitB::f(S); - | ~~~~~~~~~~~~ +LL - S.f(); +LL + TraitB::f(S); + | error: aborting due to 2 previous errors diff --git a/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr b/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr index ccdd9a95451b6..1b81dc5aafb7f 100644 --- a/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr +++ b/tests/ui/methods/disambiguate-multiple-blanket-impl.stderr @@ -6,10 +6,12 @@ LL | let _: S::Type; | help: use fully-qualified syntax | -LL | let _: ::Type; - | ~~~~~~~~~~~~~~ -LL | let _: ::Type; - | ~~~~~~~~~~~~~~ +LL - let _: S::Type; +LL + let _: ::Type; + | +LL - let _: S::Type; +LL + let _: ::Type; + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-blanket-impl.rs:30:8 @@ -29,10 +31,12 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | A::foo(&s); - | ~~~ -LL | B::foo(&s); - | ~~~ +LL - S::foo(&s); +LL + A::foo(&s); + | +LL - S::foo(&s); +LL + B::foo(&s); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-blanket-impl.rs:33:8 @@ -52,10 +56,12 @@ LL | const CONST: usize = 2; | ^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | ::CONST; - | ~~~~~~~~~~ -LL | ::CONST; - | ~~~~~~~~~~ +LL - S::CONST; +LL + ::CONST; + | +LL - S::CONST; +LL + ::CONST; + | error: aborting due to 3 previous errors diff --git a/tests/ui/methods/disambiguate-multiple-impl.stderr b/tests/ui/methods/disambiguate-multiple-impl.stderr index 4172120770c6d..2563c2327b7a5 100644 --- a/tests/ui/methods/disambiguate-multiple-impl.stderr +++ b/tests/ui/methods/disambiguate-multiple-impl.stderr @@ -6,10 +6,12 @@ LL | let _: S::Type = (); | help: use fully-qualified syntax | -LL | let _: ::Type = (); - | ~~~~~~~~~~~~~~ -LL | let _: ::Type = (); - | ~~~~~~~~~~~~~~ +LL - let _: S::Type = (); +LL + let _: ::Type = (); + | +LL - let _: S::Type = (); +LL + let _: ::Type = (); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-impl.rs:29:8 @@ -29,10 +31,12 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | A::foo(&s); - | ~~~ -LL | B::foo(&s); - | ~~~ +LL - S::foo(&s); +LL + A::foo(&s); + | +LL - S::foo(&s); +LL + B::foo(&s); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-impl.rs:34:16 @@ -52,10 +56,12 @@ LL | const CONST: usize = 2; | ^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | let _ = ::CONST; - | ~~~~~~~~~~ -LL | let _ = ::CONST; - | ~~~~~~~~~~ +LL - let _ = S::CONST; +LL + let _ = ::CONST; + | +LL - let _ = S::CONST; +LL + let _ = ::CONST; + | error: aborting due to 3 previous errors diff --git a/tests/ui/methods/disambiguate-multiple-trait-2.stderr b/tests/ui/methods/disambiguate-multiple-trait-2.stderr index 2778f254a5619..08e264c20c893 100644 --- a/tests/ui/methods/disambiguate-multiple-trait-2.stderr +++ b/tests/ui/methods/disambiguate-multiple-trait-2.stderr @@ -12,12 +12,14 @@ LL | let _: T::Type; | help: use fully-qualified syntax to disambiguate | -LL | let _: ::Type; - | ~~~~~~~~~~ +LL - let _: T::Type; +LL + let _: ::Type; + | help: use fully-qualified syntax to disambiguate | -LL | let _: ::Type; - | ~~~~~~~~~~ +LL - let _: T::Type; +LL + let _: ::Type; + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-trait-2.rs:16:7 @@ -37,12 +39,14 @@ LL | fn foo(&self); | ^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | A::foo(&t); - | ~~~~~~~~~~ +LL - t.foo(); +LL + A::foo(&t); + | help: disambiguate the method for candidate #2 | -LL | B::foo(&t); - | ~~~~~~~~~~ +LL - t.foo(); +LL + B::foo(&t); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-trait-2.rs:20:16 @@ -62,10 +66,12 @@ LL | const CONST: usize; | ^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | let _ = ::CONST; - | ~~~~~~~~~~ -LL | let _ = ::CONST; - | ~~~~~~~~~~ +LL - let _ = T::CONST; +LL + let _ = ::CONST; + | +LL - let _ = T::CONST; +LL + let _ = ::CONST; + | error[E0223]: ambiguous associated type --> $DIR/disambiguate-multiple-trait-2.rs:52:12 @@ -75,10 +81,12 @@ LL | let _: S::Type; | help: use fully-qualified syntax | -LL | let _: ::Type; - | ~~~~~~~~~~~~~~ -LL | let _: ::Type; - | ~~~~~~~~~~~~~~ +LL - let _: S::Type; +LL + let _: ::Type; + | +LL - let _: S::Type; +LL + let _: ::Type; + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-trait-2.rs:46:8 @@ -98,10 +106,12 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | A::foo(&s); - | ~~~ -LL | B::foo(&s); - | ~~~ +LL - S::foo(&s); +LL + A::foo(&s); + | +LL - S::foo(&s); +LL + B::foo(&s); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-trait-2.rs:49:16 @@ -121,10 +131,12 @@ LL | const CONST: usize = 1; | ^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | let _ = ::CONST; - | ~~~~~~~~~~ -LL | let _ = ::CONST; - | ~~~~~~~~~~ +LL - let _ = S::CONST; +LL + let _ = ::CONST; + | +LL - let _ = S::CONST; +LL + let _ = ::CONST; + | error: aborting due to 6 previous errors diff --git a/tests/ui/methods/disambiguate-multiple-trait.stderr b/tests/ui/methods/disambiguate-multiple-trait.stderr index e00498ca62b43..a977fe2cd033d 100644 --- a/tests/ui/methods/disambiguate-multiple-trait.stderr +++ b/tests/ui/methods/disambiguate-multiple-trait.stderr @@ -6,10 +6,12 @@ LL | let _: S::Type; | help: use fully-qualified syntax | -LL | let _: ::Type; - | ~~~~~~~~~~~~~~ -LL | let _: ::Type; - | ~~~~~~~~~~~~~~ +LL - let _: S::Type; +LL + let _: ::Type; + | +LL - let _: S::Type; +LL + let _: ::Type; + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-trait.rs:24:8 @@ -29,10 +31,12 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | A::foo(&s); - | ~~~ -LL | B::foo(&s); - | ~~~ +LL - S::foo(&s); +LL + A::foo(&s); + | +LL - S::foo(&s); +LL + B::foo(&s); + | error[E0034]: multiple applicable items in scope --> $DIR/disambiguate-multiple-trait.rs:27:16 @@ -52,10 +56,12 @@ LL | const CONST: usize = 2; | ^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | let _ = ::CONST; - | ~~~~~~~~~~ -LL | let _ = ::CONST; - | ~~~~~~~~~~ +LL - let _ = S::CONST; +LL + let _ = ::CONST; + | +LL - let _ = S::CONST; +LL + let _ = ::CONST; + | error: aborting due to 3 previous errors diff --git a/tests/ui/methods/issues/issue-105732.stderr b/tests/ui/methods/issues/issue-105732.stderr index a4924b3e663b7..6244f983550ee 100644 --- a/tests/ui/methods/issues/issue-105732.stderr +++ b/tests/ui/methods/issues/issue-105732.stderr @@ -14,8 +14,9 @@ LL | self.g(); | help: there is a method `f` with a similar name | -LL | self.f(); - | ~ +LL - self.g(); +LL + self.f(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/methods/issues/issue-90315.stderr b/tests/ui/methods/issues/issue-90315.stderr index 0466bb0a0c997..e194a9188342f 100644 --- a/tests/ui/methods/issues/issue-90315.stderr +++ b/tests/ui/methods/issues/issue-90315.stderr @@ -181,8 +181,9 @@ LL | let _res: i32 = ..6.take(2).sum(); | help: you must specify a concrete type for this numeric value, like `i32` | -LL | let _res: i32 = ..6_i32.take(2).sum(); - | ~~~~~ +LL - let _res: i32 = ..6.take(2).sum(); +LL + let _res: i32 = ..6_i32.take(2).sum(); + | error: aborting due to 18 previous errors diff --git a/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr index b2d2d039ff6a2..a5f1b76702f57 100644 --- a/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr +++ b/tests/ui/methods/method-ambig-one-trait-unknown-int-type.stderr @@ -25,8 +25,9 @@ LL | impl Foo for Vec { | ^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | as Foo>::foo(&x); - | ++++++++++++++++++++++ ~ +LL - x.foo(); +LL + as Foo>::foo(&x); + | error[E0308]: mismatched types --> $DIR/method-ambig-one-trait-unknown-int-type.rs:33:20 diff --git a/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr b/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr index 0fc0c909ea8f8..707c33c3d9488 100644 --- a/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr +++ b/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr @@ -12,12 +12,14 @@ LL | impl Me2 for usize { fn me(&self) -> usize { *self } } = note: candidate #2 is defined in an impl of the trait `Me` for the type `usize` help: disambiguate the method for candidate #1 | -LL | fn main() { Me2::me(&1_usize); } - | ~~~~~~~~~~~~~~~~~ +LL - fn main() { 1_usize.me(); } +LL + fn main() { Me2::me(&1_usize); } + | help: disambiguate the method for candidate #2 | -LL | fn main() { Me::me(&1_usize); } - | ~~~~~~~~~~~~~~~~ +LL - fn main() { 1_usize.me(); } +LL + fn main() { Me::me(&1_usize); } + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr b/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr index 690f979fa37de..f3aa158239840 100644 --- a/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr +++ b/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr @@ -16,12 +16,14 @@ LL | trait B { fn foo(&self); } | ^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | A::foo(&t); - | ~~~~~~~~~~ +LL - t.foo(); +LL + A::foo(&t); + | help: disambiguate the method for candidate #2 | -LL | B::foo(&t); - | ~~~~~~~~~~ +LL - t.foo(); +LL + B::foo(&t); + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls.stderr b/tests/ui/methods/method-ambig-two-traits-from-impls.stderr index 8be6d6d64f7e5..d1c50e8b3d017 100644 --- a/tests/ui/methods/method-ambig-two-traits-from-impls.stderr +++ b/tests/ui/methods/method-ambig-two-traits-from-impls.stderr @@ -16,12 +16,14 @@ LL | fn foo(self) {} | ^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | A::foo(AB {}); - | ~~~~~~~~~~~~~ +LL - AB {}.foo(); +LL + A::foo(AB {}); + | help: disambiguate the method for candidate #2 | -LL | B::foo(AB {}); - | ~~~~~~~~~~~~~ +LL - AB {}.foo(); +LL + B::foo(AB {}); + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr b/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr index 333520847f835..788f1a4c4b3b1 100644 --- a/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr +++ b/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr @@ -16,10 +16,12 @@ LL | fn foo() {} | ^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | ::foo(); - | ~~~~~~~~~~~ -LL | ::foo(); - | ~~~~~~~~~~~ +LL - AB::foo(); +LL + ::foo(); + | +LL - AB::foo(); +LL + ::foo(); + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr b/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr index b36ef77fb7ea9..605c2a85b070c 100644 --- a/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr +++ b/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr @@ -16,12 +16,14 @@ LL | trait Foo { fn method(&self) {} } | ^^^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | Bar::method(&1_usize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1_usize.method(); +LL + Bar::method(&1_usize); + | help: disambiguate the method for candidate #2 | -LL | Foo::method(&1_usize); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - 1_usize.method(); +LL + Foo::method(&1_usize); + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-ambiguity-no-rcvr.stderr b/tests/ui/methods/method-ambiguity-no-rcvr.stderr index 3b6eb07393ac8..c1a77a9973987 100644 --- a/tests/ui/methods/method-ambiguity-no-rcvr.stderr +++ b/tests/ui/methods/method-ambiguity-no-rcvr.stderr @@ -20,12 +20,14 @@ LL | fn foo() {} | ^^^^^^^^ help: disambiguate the associated function for candidate #1 | -LL | ::foo(); - | ~~~~~~~~~~~~~~~~~~~ +LL - Qux.foo(); +LL + ::foo(); + | help: disambiguate the associated function for candidate #2 | -LL | ::foo(); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - Qux.foo(); +LL + ::foo(); + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-call-err-msg.stderr b/tests/ui/methods/method-call-err-msg.stderr index 84005119a8780..c9d94e2200d21 100644 --- a/tests/ui/methods/method-call-err-msg.stderr +++ b/tests/ui/methods/method-call-err-msg.stderr @@ -28,8 +28,9 @@ LL | fn one(self, _: isize) -> Foo { self } | ^^^ -------- help: provide the argument | -LL | .one(/* isize */) - | ~~~~~~~~~~~~~ +LL - .one() +LL + .one(/* isize */) + | error[E0061]: this method takes 2 arguments but 1 argument was supplied --> $DIR/method-call-err-msg.rs:15:7 @@ -44,8 +45,9 @@ LL | fn two(self, _: isize, _: isize) -> Foo { self } | ^^^ -------- -------- help: provide the argument | -LL | .two(0, /* isize */); - | ~~~~~~~~~~~~~~~~ +LL - .two(0); +LL + .two(0, /* isize */); + | error[E0599]: `Foo` is not an iterator --> $DIR/method-call-err-msg.rs:19:7 @@ -82,8 +84,9 @@ LL | fn three(self, _: T, _: T, _: T) -> Foo { self } | ^^^^^ ---- ---- ---- help: provide the arguments | -LL | y.three::(/* usize */, /* usize */, /* usize */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - y.three::(); +LL + y.three::(/* usize */, /* usize */, /* usize */); + | error: aborting due to 5 previous errors diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr index 6159d87c73e7a..d6da3f2cc3988 100644 --- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr +++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr @@ -46,16 +46,19 @@ LL | fn foo(self: Smaht) -> u64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | let z = FinalFoo::foo(&x); - | ~~~~~~~~~~~~~~~~~ +LL - let z = x.foo(); +LL + let z = FinalFoo::foo(&x); + | help: disambiguate the method for candidate #2 | -LL | let z = NuisanceFoo::foo(x); - | ~~~~~~~~~~~~~~~~~~~ +LL - let z = x.foo(); +LL + let z = NuisanceFoo::foo(x); + | help: disambiguate the method for candidate #3 | -LL | let z = X::foo(x); - | ~~~~~~~~~ +LL - let z = x.foo(); +LL + let z = X::foo(x); + | error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24 diff --git a/tests/ui/methods/method-not-found-but-doc-alias.stderr b/tests/ui/methods/method-not-found-but-doc-alias.stderr index c49ffa8971f75..2164b7cbbf811 100644 --- a/tests/ui/methods/method-not-found-but-doc-alias.stderr +++ b/tests/ui/methods/method-not-found-but-doc-alias.stderr @@ -9,8 +9,9 @@ LL | Foo.quux(); | help: there is a method `bar` with a similar name | -LL | Foo.bar(); - | ~~~ +LL - Foo.quux(); +LL + Foo.bar(); + | error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-on-ambiguous-numeric-type.stderr b/tests/ui/methods/method-on-ambiguous-numeric-type.stderr index 124270402727d..d688bcc90c8d3 100644 --- a/tests/ui/methods/method-on-ambiguous-numeric-type.stderr +++ b/tests/ui/methods/method-on-ambiguous-numeric-type.stderr @@ -6,8 +6,9 @@ LL | let x = 2.0.neg(); | help: you must specify a concrete type for this numeric value, like `f32` | -LL | let x = 2.0_f32.neg(); - | ~~~~~~~ +LL - let x = 2.0.neg(); +LL + let x = 2.0_f32.neg(); + | error[E0689]: can't call method `neg` on ambiguous numeric type `{float}` --> $DIR/method-on-ambiguous-numeric-type.rs:17:15 diff --git a/tests/ui/methods/suggest-convert-ptr-to-ref.stderr b/tests/ui/methods/suggest-convert-ptr-to-ref.stderr index 69b20d57be829..90ac4ec4d6eb3 100644 --- a/tests/ui/methods/suggest-convert-ptr-to-ref.stderr +++ b/tests/ui/methods/suggest-convert-ptr-to-ref.stderr @@ -45,8 +45,9 @@ LL | let _ = t.as_mut_ref(); | help: there is a method `as_mut` with a similar name | -LL | let _ = t.as_mut(); - | ~~~~~~ +LL - let _ = t.as_mut_ref(); +LL + let _ = t.as_mut(); + | error[E0599]: no method named `as_ref_mut` found for raw pointer `*mut u8` in the current scope --> $DIR/suggest-convert-ptr-to-ref.rs:13:15 @@ -56,8 +57,9 @@ LL | let _ = t.as_ref_mut(); | help: there is a method `as_mut` with a similar name | -LL | let _ = t.as_mut(); - | ~~~~~~ +LL - let _ = t.as_ref_mut(); +LL + let _ = t.as_mut(); + | error[E0599]: no method named `make_ascii_lowercase` found for raw pointer `*const u8` in the current scope --> $DIR/suggest-convert-ptr-to-ref.rs:16:7 diff --git a/tests/ui/mir/issue-106062.stderr b/tests/ui/mir/issue-106062.stderr index 30635148dae64..19a1d06e0be09 100644 --- a/tests/ui/mir/issue-106062.stderr +++ b/tests/ui/mir/issue-106062.stderr @@ -6,10 +6,12 @@ LL | async fn connection_handler(handler: impl Sized) -> Result Result { - | ~~~~~~~~~~~~~~~~~~~~ -LL | async fn connection_handler(handler: impl Sized) -> Result { - | ~~~~~~~~~~~~~~~~~~~ +LL - async fn connection_handler(handler: impl Sized) -> Result { +LL + async fn connection_handler(handler: impl Sized) -> Result { + | +LL - async fn connection_handler(handler: impl Sized) -> Result { +LL + async fn connection_handler(handler: impl Sized) -> Result { + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/E0053.stderr b/tests/ui/mismatched_types/E0053.stderr index 2559d4487491e..32452af5ceda7 100644 --- a/tests/ui/mismatched_types/E0053.stderr +++ b/tests/ui/mismatched_types/E0053.stderr @@ -13,8 +13,9 @@ LL | fn foo(x: u16); found signature `fn(i16)` help: change the parameter type to match the trait | -LL | fn foo(x: u16) { } - | ~~~ +LL - fn foo(x: i16) { } +LL + fn foo(x: u16) { } + | error[E0053]: method `bar` has an incompatible type for trait --> $DIR/E0053.rs:11:12 @@ -31,8 +32,9 @@ LL | fn bar(&self); found signature `fn(&mut Bar)` help: change the self-receiver type to match the trait | -LL | fn bar(&self) { } - | ~~~~~ +LL - fn bar(&mut self) { } +LL + fn bar(&self) { } + | error: aborting due to 2 previous errors diff --git a/tests/ui/mismatched_types/cast-rfc0401.stderr b/tests/ui/mismatched_types/cast-rfc0401.stderr index 142a52aef13d0..b62140cb57d44 100644 --- a/tests/ui/mismatched_types/cast-rfc0401.stderr +++ b/tests/ui/mismatched_types/cast-rfc0401.stderr @@ -90,8 +90,9 @@ LL | let _ = 3_i32 as bool; | help: compare with zero instead | -LL | let _ = 3_i32 != 0; - | ~~~~ +LL - let _ = 3_i32 as bool; +LL + let _ = 3_i32 != 0; + | error[E0054]: cannot cast `E` as `bool` --> $DIR/cast-rfc0401.rs:40:13 diff --git a/tests/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr b/tests/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr index 801e8a0ff1d02..b29abfe59c510 100644 --- a/tests/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr +++ b/tests/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr @@ -8,8 +8,9 @@ LL | let _n = m.iter().map(|_, b| { | help: change the closure to accept a tuple instead of individual arguments | -LL | let _n = m.iter().map(|(_, b)| { - | ~~~~~~~~ +LL - let _n = m.iter().map(|_, b| { +LL + let _n = m.iter().map(|(_, b)| { + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/closure-arg-count.stderr b/tests/ui/mismatched_types/closure-arg-count.stderr index 0e2ca8feec545..8704d0f661be2 100644 --- a/tests/ui/mismatched_types/closure-arg-count.stderr +++ b/tests/ui/mismatched_types/closure-arg-count.stderr @@ -8,8 +8,9 @@ LL | [1, 2, 3].sort_by(|| panic!()); | help: consider changing the closure to take and ignore the expected arguments | -LL | [1, 2, 3].sort_by(|_, _| panic!()); - | ~~~~~~ +LL - [1, 2, 3].sort_by(|| panic!()); +LL + [1, 2, 3].sort_by(|_, _| panic!()); + | error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument --> $DIR/closure-arg-count.rs:7:15 @@ -29,8 +30,9 @@ LL | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!()); | help: change the closure to take multiple arguments instead of a single tuple | -LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!()); - | ~~~~~~~~~~~~~~~ +LL - [1, 2, 3].sort_by(|(tuple, tuple2)| panic!()); +LL + [1, 2, 3].sort_by(|tuple, tuple2| panic!()); + | error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument --> $DIR/closure-arg-count.rs:11:15 @@ -42,8 +44,9 @@ LL | [1, 2, 3].sort_by(|(tuple, tuple2): (usize, _)| panic!()); | help: change the closure to take multiple arguments instead of a single tuple | -LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!()); - | ~~~~~~~~~~~~~~~ +LL - [1, 2, 3].sort_by(|(tuple, tuple2): (usize, _)| panic!()); +LL + [1, 2, 3].sort_by(|tuple, tuple2| panic!()); + | error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:13:5 @@ -61,8 +64,9 @@ LL | fn f>(_: F) {} | ^^^^^^^^^^^^ required by this bound in `f` help: consider changing the closure to take and ignore the expected argument | -LL | f(|_| panic!()); - | ~~~ +LL - f(|| panic!()); +LL + f(|_| panic!()); + | error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:15:5 @@ -80,8 +84,9 @@ LL | fn f>(_: F) {} | ^^^^^^^^^^^^ required by this bound in `f` help: consider changing the closure to take and ignore the expected argument | -LL | f( move |_| panic!()); - | ~~~ +LL - f( move || panic!()); +LL + f( move |_| panic!()); + | error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments --> $DIR/closure-arg-count.rs:18:53 @@ -93,8 +98,9 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i); | help: change the closure to accept a tuple instead of individual arguments | -LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i); - | ~~~~~~~~ +LL - let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i); +LL + let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i); + | error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments --> $DIR/closure-arg-count.rs:20:53 @@ -106,8 +112,9 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i); | help: change the closure to accept a tuple instead of individual arguments | -LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i); - | ~~~~~~~~ +LL - let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i); +LL + let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i); + | error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments --> $DIR/closure-arg-count.rs:22:53 diff --git a/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr b/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr index 6b3e0cb505fe8..b345d5e049e4a 100644 --- a/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr +++ b/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr @@ -21,8 +21,9 @@ LL | let y: f32 = 1f64; | help: change the type of the numeric literal from `f64` to `f32` | -LL | let y: f32 = 1f32; - | ~~~ +LL - let y: f32 = 1f64; +LL + let y: f32 = 1f32; + | error: aborting due to 2 previous errors diff --git a/tests/ui/mismatched_types/issue-106182.stderr b/tests/ui/mismatched_types/issue-106182.stderr index 2f33628a49164..647a731334421 100644 --- a/tests/ui/mismatched_types/issue-106182.stderr +++ b/tests/ui/mismatched_types/issue-106182.stderr @@ -10,8 +10,9 @@ LL | _S(& (mut _y), _v) => { found reference `&_` help: consider removing `&` from the pattern | -LL | _S(mut _y, _v) => { - | ~~~~~~ +LL - _S(& (mut _y), _v) => { +LL + _S(mut _y, _v) => { + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/issue-112036.stderr b/tests/ui/mismatched_types/issue-112036.stderr index bd446b3d78cb2..29559980cb45e 100644 --- a/tests/ui/mismatched_types/issue-112036.stderr +++ b/tests/ui/mismatched_types/issue-112036.stderr @@ -8,8 +8,9 @@ LL | fn drop(self) {} found signature `fn(Foo)` help: change the self-receiver type to match the trait | -LL | fn drop(&mut self) {} - | ~~~~~~~~~ +LL - fn drop(self) {} +LL + fn drop(&mut self) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/issue-13033.stderr b/tests/ui/mismatched_types/issue-13033.stderr index 2a266d40e7717..7756217b56000 100644 --- a/tests/ui/mismatched_types/issue-13033.stderr +++ b/tests/ui/mismatched_types/issue-13033.stderr @@ -13,8 +13,9 @@ LL | fn bar(&mut self, other: &mut dyn Foo); found signature `fn(&mut Baz, &dyn Foo)` help: change the parameter type to match the trait | -LL | fn bar(&mut self, other: &mut dyn Foo) {} - | ~~~~~~~~~~~~ +LL - fn bar(&mut self, other: &dyn Foo) {} +LL + fn bar(&mut self, other: &mut dyn Foo) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/issue-1362.stderr b/tests/ui/mismatched_types/issue-1362.stderr index 6f6fdff66788c..4a2d4c1b45918 100644 --- a/tests/ui/mismatched_types/issue-1362.stderr +++ b/tests/ui/mismatched_types/issue-1362.stderr @@ -8,8 +8,9 @@ LL | let x: u32 = 20i32; | help: change the type of the numeric literal from `i32` to `u32` | -LL | let x: u32 = 20u32; - | ~~~ +LL - let x: u32 = 20i32; +LL + let x: u32 = 20u32; + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/issue-1448-2.stderr b/tests/ui/mismatched_types/issue-1448-2.stderr index a6f1daefe636b..85730a18d9d28 100644 --- a/tests/ui/mismatched_types/issue-1448-2.stderr +++ b/tests/ui/mismatched_types/issue-1448-2.stderr @@ -13,8 +13,9 @@ LL | fn foo(a: u32) -> u32 { a } | ^^^ ------ help: change the type of the numeric literal from `i32` to `u32` | -LL | println!("{}", foo(10u32)); - | ~~~ +LL - println!("{}", foo(10i32)); +LL + println!("{}", foo(10u32)); + | error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/numeric-literal-cast.stderr b/tests/ui/mismatched_types/numeric-literal-cast.stderr index fcf3eccbcba2b..8ddadcc5a9471 100644 --- a/tests/ui/mismatched_types/numeric-literal-cast.stderr +++ b/tests/ui/mismatched_types/numeric-literal-cast.stderr @@ -13,8 +13,9 @@ LL | fn foo(_: u16) {} | ^^^ ------ help: change the type of the numeric literal from `u8` to `u16` | -LL | foo(1u16); - | ~~~ +LL - foo(1u8); +LL + foo(1u16); + | error[E0308]: mismatched types --> $DIR/numeric-literal-cast.rs:8:10 @@ -31,8 +32,9 @@ LL | fn foo1(_: f64) {} | ^^^^ ------ help: change the type of the numeric literal from `f32` to `f64` | -LL | foo1(2f64); - | ~~~ +LL - foo1(2f32); +LL + foo1(2f64); + | error[E0308]: mismatched types --> $DIR/numeric-literal-cast.rs:10:10 @@ -49,8 +51,9 @@ LL | fn foo2(_: i32) {} | ^^^^ ------ help: change the type of the numeric literal from `i16` to `i32` | -LL | foo2(3i32); - | ~~~ +LL - foo2(3i16); +LL + foo2(3i32); + | error: aborting due to 3 previous errors diff --git a/tests/ui/mismatched_types/overloaded-calls-bad.stderr b/tests/ui/mismatched_types/overloaded-calls-bad.stderr index c52fa71361539..9f5c35a30097d 100644 --- a/tests/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/tests/ui/mismatched_types/overloaded-calls-bad.stderr @@ -25,8 +25,9 @@ LL | impl FnMut<(isize,)> for S { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: provide the argument | -LL | let ans = s(/* isize */); - | ~~~~~~~~~~~~~ +LL - let ans = s(); +LL + let ans = s(/* isize */); + | error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/overloaded-calls-bad.rs:37:15 diff --git a/tests/ui/mismatched_types/ref-pat-suggestions.stderr b/tests/ui/mismatched_types/ref-pat-suggestions.stderr index 148ed00b01d14..d3b605fabf5c5 100644 --- a/tests/ui/mismatched_types/ref-pat-suggestions.stderr +++ b/tests/ui/mismatched_types/ref-pat-suggestions.stderr @@ -336,8 +336,9 @@ LL | let S(&mut _b) = S(0); | ^^^^^^^ help: consider removing `&mut` from the pattern | -LL | let S(_b) = S(0); - | ~~ +LL - let S(&mut _b) = S(0); +LL + let S(_b) = S(0); + | error[E0308]: mismatched types --> $DIR/ref-pat-suggestions.rs:31:14 diff --git a/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr b/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr index 40182a75a989a..3f58efe19f5b0 100644 --- a/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr +++ b/tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr @@ -12,8 +12,9 @@ LL | | } | help: you could change the return type to be a boxed trait object | -LL | fn foo() -> Box { - | ~~~~~~~ + +LL - fn foo() -> impl Trait { +LL + fn foo() -> Box { + | help: if you change the return type to expect trait objects, box the returned expressions | LL ~ Box::new(S) @@ -34,8 +35,9 @@ LL | | } | help: you could change the return type to be a boxed trait object | -LL | fn bar() -> Box { - | ~~~~~~~ + +LL - fn bar() -> impl Trait { +LL + fn bar() -> Box { + | help: if you change the return type to expect trait objects, box the returned expressions | LL ~ true => Box::new(S), diff --git a/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index 2e544a62223a0..d232cc50e5230 100644 --- a/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -13,8 +13,9 @@ LL | fn foo(x: u16); found signature `fn(i16)` help: change the parameter type to match the trait | -LL | fn foo(x: u16) { } - | ~~~ +LL - fn foo(x: i16) { } +LL + fn foo(x: u16) { } + | error[E0053]: method `bar` has an incompatible type for trait --> $DIR/trait-impl-fn-incompatibility.rs:10:28 @@ -31,8 +32,9 @@ LL | fn bar(&mut self, bar: &mut Bar); found signature `fn(&mut Bar, &Bar)` help: change the parameter type to match the trait | -LL | fn bar(&mut self, bar: &mut Bar) { } - | ~~~~~~~~ +LL - fn bar(&mut self, bar: &Bar) { } +LL + fn bar(&mut self, bar: &mut Bar) { } + | error: aborting due to 2 previous errors diff --git a/tests/ui/mismatched_types/transforming-option-ref-issue-127545.stderr b/tests/ui/mismatched_types/transforming-option-ref-issue-127545.stderr index ad423f86ef9e3..9a18798db2139 100644 --- a/tests/ui/mismatched_types/transforming-option-ref-issue-127545.stderr +++ b/tests/ui/mismatched_types/transforming-option-ref-issue-127545.stderr @@ -34,8 +34,9 @@ note: method defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: use `Option::map_or` to deref inner value of `Option` | -LL | arg.map_or(&[], |v| v) - | ~~~~~~ +++++++ +LL - arg.unwrap_or(&[]) +LL + arg.map_or(&[], |v| v) + | error[E0308]: mismatched types --> $DIR/transforming-option-ref-issue-127545.rs:13:19 @@ -58,8 +59,9 @@ note: method defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: use `Option::map_or` to deref inner value of `Option` | -LL | arg.map_or(v, |v| v) - | ~~~~~~ +++++++ +LL - arg.unwrap_or(v) +LL + arg.map_or(v, |v| v) + | error[E0308]: mismatched types --> $DIR/transforming-option-ref-issue-127545.rs:17:19 @@ -82,8 +84,9 @@ note: method defined here --> $SRC_DIR/core/src/result.rs:LL:COL help: use `Result::map_or` to deref inner value of `Result` | -LL | arg.map_or(&[], |v| v) - | ~~~~~~ +++++++ +LL - arg.unwrap_or(&[]) +LL + arg.map_or(&[], |v| v) + | error: aborting due to 4 previous errors diff --git a/tests/ui/missing/missing-block-hint.stderr b/tests/ui/missing/missing-block-hint.stderr index 18719289abdc8..d045cdef536f8 100644 --- a/tests/ui/missing/missing-block-hint.stderr +++ b/tests/ui/missing/missing-block-hint.stderr @@ -11,8 +11,9 @@ LL | if (foo) => {} | ^^^^^ help: you might have meant to write a "greater than or equal to" comparison | -LL | if (foo) >= {} - | ~~ +LL - if (foo) => {} +LL + if (foo) >= {} + | error: expected `{`, found `bar` --> $DIR/missing-block-hint.rs:7:13 diff --git a/tests/ui/missing/missing-fields-in-struct-pattern.stderr b/tests/ui/missing/missing-fields-in-struct-pattern.stderr index 91a7bd3540e38..1c69592985f24 100644 --- a/tests/ui/missing/missing-fields-in-struct-pattern.stderr +++ b/tests/ui/missing/missing-fields-in-struct-pattern.stderr @@ -6,8 +6,9 @@ LL | if let S { a, b, c, d } = S(1, 2, 3, 4) { | help: use the tuple variant pattern syntax instead | -LL | if let S(a, b, c, d) = S(1, 2, 3, 4) { - | ~~~~~~~~~~~~ +LL - if let S { a, b, c, d } = S(1, 2, 3, 4) { +LL + if let S(a, b, c, d) = S(1, 2, 3, 4) { + | error: aborting due to 1 previous error diff --git a/tests/ui/missing/missing-items/missing-const-parameter.stderr b/tests/ui/missing/missing-items/missing-const-parameter.stderr index d9fea1306514c..c873e24481587 100644 --- a/tests/ui/missing/missing-items/missing-const-parameter.stderr +++ b/tests/ui/missing/missing-items/missing-const-parameter.stderr @@ -52,8 +52,9 @@ LL | struct Image([[u32; C]; R]); | help: a const parameter with a similar name exists | -LL | struct Image([[u32; R]; R]); - | ~ +LL - struct Image([[u32; C]; R]); +LL + struct Image([[u32; R]; R]); + | help: you might be missing a const parameter | LL | struct Image([[u32; C]; R]); diff --git a/tests/ui/missing/missing-items/missing-type-parameter2.stderr b/tests/ui/missing/missing-items/missing-type-parameter2.stderr index f33951c98bfb3..f6418de20b6a4 100644 --- a/tests/ui/missing/missing-items/missing-type-parameter2.stderr +++ b/tests/ui/missing/missing-items/missing-type-parameter2.stderr @@ -9,8 +9,9 @@ LL | impl X {} | help: a struct with a similar name exists | -LL | impl X {} - | ~ +LL - impl X {} +LL + impl X {} + | help: you might be missing a type parameter | LL | impl X {} @@ -26,8 +27,9 @@ LL | impl X {} | help: a type parameter with a similar name exists | -LL | impl X {} - | ~ +LL - impl X {} +LL + impl X {} + | help: you might be missing a type parameter | LL | impl X {} @@ -44,8 +46,9 @@ LL | fn foo(_: T) where T: Send {} | help: a struct with a similar name exists | -LL | fn foo(_: T) where X: Send {} - | ~ +LL - fn foo(_: T) where T: Send {} +LL + fn foo(_: T) where X: Send {} + | help: you might be missing a type parameter | LL | fn foo(_: T) where T: Send {} @@ -62,8 +65,9 @@ LL | fn foo(_: T) where T: Send {} | help: a struct with a similar name exists | -LL | fn foo(_: X) where T: Send {} - | ~ +LL - fn foo(_: T) where T: Send {} +LL + fn foo(_: X) where T: Send {} + | help: you might be missing a type parameter | LL | fn foo(_: T) where T: Send {} @@ -80,8 +84,9 @@ LL | fn bar(_: A) {} | help: a struct with a similar name exists | -LL | fn bar(_: X) {} - | ~ +LL - fn bar(_: A) {} +LL + fn bar(_: X) {} + | help: you might be missing a type parameter | LL | fn bar(_: A) {} diff --git a/tests/ui/moves/needs-clone-through-deref.stderr b/tests/ui/moves/needs-clone-through-deref.stderr index 1f9aefeb4dd7a..9890ad480a6f0 100644 --- a/tests/ui/moves/needs-clone-through-deref.stderr +++ b/tests/ui/moves/needs-clone-through-deref.stderr @@ -10,8 +10,9 @@ note: `into_iter` takes ownership of the receiver `self`, which moves value --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: you can `clone` the value and consume it, but this might not be your desired behavior | -LL | for _ in as Clone>::clone(&self).into_iter() {} - | ++++++++++++++++++++++++++++++ ~ +LL - for _ in self.clone().into_iter() {} +LL + for _ in as Clone>::clone(&self).into_iter() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr b/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr index 755bbc5c21bdb..c626796e01d25 100644 --- a/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr +++ b/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.stderr @@ -10,8 +10,9 @@ note: `HashMap::::into_values` takes ownership of the receiver `self`, --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL help: you could `clone` the value and consume it, if the `Hash128_1: Clone` trait bound could be satisfied | -LL | let mut copy: Vec = as Clone>::clone(&map).into_values().collect(); - | ++++++++++++++++++++++++++++++++++++++++++++ ~ +LL - let mut copy: Vec = map.clone().into_values().collect(); +LL + let mut copy: Vec = as Clone>::clone(&map).into_values().collect(); + | help: consider annotating `Hash128_1` with `#[derive(Clone)]` | LL + #[derive(Clone)] diff --git a/tests/ui/moves/use_of_moved_value_copy_suggestions.stderr b/tests/ui/moves/use_of_moved_value_copy_suggestions.stderr index c03204c7b9f10..5a2ee4dabc4bc 100644 --- a/tests/ui/moves/use_of_moved_value_copy_suggestions.stderr +++ b/tests/ui/moves/use_of_moved_value_copy_suggestions.stderr @@ -195,8 +195,9 @@ LL | [t, t]; | - you could clone this value help: consider further restricting type parameter `T` | -LL | T:, T: Copy - | ~~~~~~~~~ +LL - T:, +LL + T:, T: Copy + | error: aborting due to 11 previous errors diff --git a/tests/ui/mut/mutable-class-fields-2.stderr b/tests/ui/mut/mutable-class-fields-2.stderr index eb0c54f885ba8..5a262d3fb90aa 100644 --- a/tests/ui/mut/mutable-class-fields-2.stderr +++ b/tests/ui/mut/mutable-class-fields-2.stderr @@ -6,8 +6,9 @@ LL | self.how_hungry -= 5; | help: consider changing this to be a mutable reference | -LL | pub fn eat(&mut self) { - | ~~~~~~~~~ +LL - pub fn eat(&self) { +LL + pub fn eat(&mut self) { + | error: aborting due to 1 previous error diff --git a/tests/ui/namespace/namespace-mix.stderr b/tests/ui/namespace/namespace-mix.stderr index b80363fe8f848..41891c5144ba7 100644 --- a/tests/ui/namespace/namespace-mix.stderr +++ b/tests/ui/namespace/namespace-mix.stderr @@ -10,8 +10,9 @@ LL | check(m1::S); = note: can't use a type alias as a constructor help: a tuple struct with a similar name exists | -LL | check(m1::TS); - | ~~ +LL - check(m1::S); +LL + check(m1::TS); + | help: consider importing one of these constants instead | LL + use m2::S; @@ -38,8 +39,9 @@ LL | pub struct TS(); = note: can't use a type alias as a constructor help: a tuple struct with a similar name exists | -LL | check(xm1::TS); - | ~~ +LL - check(xm1::S); +LL + check(xm1::TS); + | help: consider importing one of these constants instead | LL + use m2::S; @@ -64,8 +66,9 @@ LL | check(m7::V); = note: can't use a type alias as a constructor help: a tuple variant with a similar name exists | -LL | check(m7::TV); - | ~~ +LL - check(m7::V); +LL + check(m7::TV); + | help: consider importing one of these constants instead | LL + use m8::V; @@ -92,8 +95,9 @@ LL | TV(), = note: can't use a type alias as a constructor help: a tuple variant with a similar name exists | -LL | check(xm7::TV); - | ~~ +LL - check(xm7::V); +LL + check(xm7::TV); + | help: consider importing one of these constants instead | LL + use m8::V; diff --git a/tests/ui/never_type/issue-96335.stderr b/tests/ui/never_type/issue-96335.stderr index c3d80a425e057..1193973d5ee8c 100644 --- a/tests/ui/never_type/issue-96335.stderr +++ b/tests/ui/never_type/issue-96335.stderr @@ -6,12 +6,14 @@ LL | 0.....{loop{}1}; | help: use `..` for an exclusive range | -LL | 0....{loop{}1}; - | ~~ +LL - 0.....{loop{}1}; +LL + 0....{loop{}1}; + | help: or `..=` for an inclusive range | -LL | 0..=..{loop{}1}; - | ~~~ +LL - 0.....{loop{}1}; +LL + 0..=..{loop{}1}; + | error[E0308]: mismatched types --> $DIR/issue-96335.rs:2:9 diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr index a6d4f9a2a5cb1..0d05b96478f84 100644 --- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr +++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr @@ -10,8 +10,9 @@ LL | S1 { a: unsafe { &mut X1 } } = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of_mut!` instead to create a raw pointer | -LL | S1 { a: unsafe { addr_of_mut!(X1) } } - | ~~~~~~~~~~~~~ + +LL - S1 { a: unsafe { &mut X1 } } +LL + S1 { a: unsafe { addr_of_mut!(X1) } } + | warning: 1 warning emitted diff --git a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 4f93fb4eaea34..980670fee6973 100644 --- a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -33,8 +33,9 @@ LL | with_signature(x, |mut y| Box::new(y.next())) | help: consider adding an explicit lifetime bound | -LL | T: Iterator, ::Item: 'a - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T: Iterator, +LL + T: Iterator, ::Item: 'a + | note: external requirements --> $DIR/projection-no-regions-closure.rs:34:23 @@ -95,8 +96,9 @@ LL | with_signature(x, |mut y| Box::new(y.next())) | help: consider adding an explicit lifetime bound | -LL | T: 'b + Iterator, ::Item: 'a - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T: 'b + Iterator, +LL + T: 'b + Iterator, ::Item: 'a + | note: external requirements --> $DIR/projection-no-regions-closure.rs:52:23 diff --git a/tests/ui/nll/ty-outlives/projection-no-regions-fn.stderr b/tests/ui/nll/ty-outlives/projection-no-regions-fn.stderr index da76ac1c474a3..53da981d70298 100644 --- a/tests/ui/nll/ty-outlives/projection-no-regions-fn.stderr +++ b/tests/ui/nll/ty-outlives/projection-no-regions-fn.stderr @@ -9,8 +9,9 @@ LL | Box::new(x.next()) | help: consider adding an explicit lifetime bound | -LL | T: Iterator, ::Item: 'a - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T: Iterator, +LL + T: Iterator, ::Item: 'a + | error[E0309]: the associated type `::Item` may not live long enough --> $DIR/projection-no-regions-fn.rs:28:5 @@ -23,8 +24,9 @@ LL | Box::new(x.next()) | help: consider adding an explicit lifetime bound | -LL | T: 'b + Iterator, ::Item: 'a - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T: 'b + Iterator, +LL + T: 'b + Iterator, ::Item: 'a + | error: aborting due to 2 previous errors diff --git a/tests/ui/non-fmt-panic.stderr b/tests/ui/non-fmt-panic.stderr index 162802b7f610a..0134a8ddf2924 100644 --- a/tests/ui/non-fmt-panic.stderr +++ b/tests/ui/non-fmt-panic.stderr @@ -184,8 +184,9 @@ LL | std::panic!("{}", 123); | +++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(123); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - std::panic!(123); +LL + std::panic::panic_any(123); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:31:18 @@ -214,8 +215,9 @@ LL | panic!("{:?}", Some(123)); | +++++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(Some(123)); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - panic!(Some(123)); +LL + std::panic::panic_any(Some(123)); + | warning: panic message contains an unused formatting placeholder --> $DIR/non-fmt-panic.rs:33:12 @@ -267,8 +269,9 @@ LL | panic!("{}", a!()); | +++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(a!()); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - panic!(a!()); +LL + std::panic::panic_any(a!()); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:47:18 @@ -357,8 +360,9 @@ LL | panic!["{}", 123]; | +++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(123); - | ~~~~~~~~~~~~~~~~~~~~~~ ~ +LL - panic![123]; +LL + std::panic::panic_any(123); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:55:12 @@ -374,8 +378,9 @@ LL | panic!{"{}", 123}; | +++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(123); - | ~~~~~~~~~~~~~~~~~~~~~~ ~ +LL - panic!{123}; +LL + std::panic::panic_any(123); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:72:12 @@ -411,8 +416,9 @@ LL | panic!("{:?}", v); | +++++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(v); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - panic!(v); +LL + std::panic::panic_any(v); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:78:20 @@ -441,8 +447,9 @@ LL | panic!("{}", v); | +++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(v); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - panic!(v); +LL + std::panic::panic_any(v); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:83:20 @@ -471,8 +478,9 @@ LL | panic!("{}", v); | +++++ help: or use std::panic::panic_any instead | -LL | std::panic::panic_any(v); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - panic!(v); +LL + std::panic::panic_any(v); + | warning: panic message is not a string literal --> $DIR/non-fmt-panic.rs:88:20 diff --git a/tests/ui/not-enough-arguments.stderr b/tests/ui/not-enough-arguments.stderr index 89e9886666745..3f9ed0678f37d 100644 --- a/tests/ui/not-enough-arguments.stderr +++ b/tests/ui/not-enough-arguments.stderr @@ -11,8 +11,9 @@ LL | fn foo(a: isize, b: isize, c: isize, d:isize) { | ^^^ -------- -------- -------- ------- help: provide the argument | -LL | foo(1, 2, 3, /* isize */); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - foo(1, 2, 3); +LL + foo(1, 2, 3, /* isize */); + | error[E0061]: this function takes 6 arguments but 3 arguments were supplied --> $DIR/not-enough-arguments.rs:29:3 @@ -39,8 +40,9 @@ LL | f: i32, | ------ help: provide the arguments | -LL | bar(1, 2, 3, /* i32 */, /* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - bar(1, 2, 3); +LL + bar(1, 2, 3, /* i32 */, /* i32 */, /* i32 */); + | error: aborting due to 2 previous errors diff --git a/tests/ui/numeric/const-scope.stderr b/tests/ui/numeric/const-scope.stderr index 4e4bcdf234dcf..2c8d4da9d2182 100644 --- a/tests/ui/numeric/const-scope.stderr +++ b/tests/ui/numeric/const-scope.stderr @@ -6,8 +6,9 @@ LL | const C: i32 = 1i8; | help: change the type of the numeric literal from `i8` to `i32` | -LL | const C: i32 = 1i32; - | ~~~ +LL - const C: i32 = 1i8; +LL + const C: i32 = 1i32; + | error[E0308]: mismatched types --> $DIR/const-scope.rs:2:15 @@ -25,8 +26,9 @@ LL | let c: i32 = 1i8; | help: change the type of the numeric literal from `i8` to `i32` | -LL | let c: i32 = 1i32; - | ~~~ +LL - let c: i32 = 1i8; +LL + let c: i32 = 1i32; + | error[E0308]: mismatched types --> $DIR/const-scope.rs:6:17 @@ -46,8 +48,9 @@ LL | let c: i32 = 1i8; | help: change the type of the numeric literal from `i8` to `i32` | -LL | let c: i32 = 1i32; - | ~~~ +LL - let c: i32 = 1i8; +LL + let c: i32 = 1i32; + | error[E0308]: mismatched types --> $DIR/const-scope.rs:11:17 diff --git a/tests/ui/numeric/numeric-fields.stderr b/tests/ui/numeric/numeric-fields.stderr index 8ab1718ff5e8f..6877bb3bef4e5 100644 --- a/tests/ui/numeric/numeric-fields.stderr +++ b/tests/ui/numeric/numeric-fields.stderr @@ -9,8 +9,9 @@ LL | let s = S{0b1: 10, 0: 11}; | help: `S` is a tuple struct, use the appropriate syntax | -LL | let s = S(/* u8 */, /* u16 */); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - let s = S{0b1: 10, 0: 11}; +LL + let s = S(/* u8 */, /* u16 */); + | error[E0026]: struct `S` does not have a field named `0x1` --> $DIR/numeric-fields.rs:7:17 diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr index f4fb14e79923c..6c6b8b51c226d 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:32:16 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:36:16 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_u32); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:40:16 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_u16); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:44:16 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_u8); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:48:16 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:52:16 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:57:16 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_i16); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:61:16 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `i32` | -LL | foo::(42_i32); - | ~~~ +LL - foo::(42_i8); +LL + foo::(42_i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:65:16 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `i32` | -LL | foo::(42i32); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42i32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i32.rs:69:16 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `i32` | -LL | foo::(42i32); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42i32); + | error: aborting due to 11 previous errors diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr index 47efe9f08bbd2..7c26dd7be1c64 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:32:16 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:36:16 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_u32); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:40:16 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_u16); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:44:16 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_u8); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:48:16 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:53:16 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_i32); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:57:16 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_i16); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:61:16 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `i64` | -LL | foo::(42_i64); - | ~~~ +LL - foo::(42_i8); +LL + foo::(42_i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:65:16 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `i64` | -LL | foo::(42i64); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42i64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-i64.rs:69:16 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `i64` | -LL | foo::(42i64); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42i64); + | error: aborting due to 11 previous errors diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr index 28b79413f68d0..8365350f2bfec 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_usize); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:32:18 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_u64); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:36:18 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_u32); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:40:18 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_u16); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:44:18 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_u8); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:49:18 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_i64); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:53:18 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_i32); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:57:18 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_i16); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:61:18 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `isize` | -LL | foo::(42_isize); - | ~~~~~ +LL - foo::(42_i8); +LL + foo::(42_isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:65:18 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `isize` | -LL | foo::(42isize); - | ~~~~~ +LL - foo::(42.0_f64); +LL + foo::(42isize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-isize.rs:69:18 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `isize` | -LL | foo::(42isize); - | ~~~~~ +LL - foo::(42.0_f32); +LL + foo::(42isize); + | error: aborting due to 11 previous errors diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr index d966893a83b48..610e6ece27691 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:32:16 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:37:16 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_u16); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:41:16 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_u8); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:45:16 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:49:16 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:53:16 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_i32); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:57:16 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_i16); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:61:16 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `u32` | -LL | foo::(42_u32); - | ~~~ +LL - foo::(42_i8); +LL + foo::(42_u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:65:16 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `u32` | -LL | foo::(42u32); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42u32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u32.rs:69:16 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `u32` | -LL | foo::(42u32); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42u32); + | error: aborting due to 11 previous errors diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr index ff332fa914dd0..112dddccd6f47 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:33:16 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_u32); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:37:16 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_u16); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:41:16 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_u8); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:45:16 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:49:16 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:53:16 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_i32); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:57:16 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_i16); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:61:16 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `u64` | -LL | foo::(42_u64); - | ~~~ +LL - foo::(42_i8); +LL + foo::(42_u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:65:16 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `u64` | -LL | foo::(42u64); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42u64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-u64.rs:69:16 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `u64` | -LL | foo::(42u64); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42u64); + | error: aborting due to 11 previous errors diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr index 4889abee69c2a..e7d6a04f18ef3 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_u64); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:33:18 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_u32); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:37:18 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_u16); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:41:18 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_u8); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:45:18 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_isize); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:49:18 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_i64); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:53:18 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_i32); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:57:18 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_i16); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:61:18 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `usize` | -LL | foo::(42_usize); - | ~~~~~ +LL - foo::(42_i8); +LL + foo::(42_usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:65:18 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `usize` | -LL | foo::(42usize); - | ~~~~~ +LL - foo::(42.0_f64); +LL + foo::(42usize); + | error[E0308]: mismatched types --> $DIR/numeric-suffix-usize.rs:69:18 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `usize` | -LL | foo::(42usize); - | ~~~~~ +LL - foo::(42.0_f32); +LL + foo::(42usize); + | error: aborting due to 11 previous errors diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr index e05913b9c621c..d26639a76f0ff 100644 --- a/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr @@ -13,8 +13,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:147:16 @@ -31,8 +32,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:151:16 @@ -49,8 +51,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_u32); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:156:16 @@ -67,8 +70,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_u8); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:160:16 @@ -85,8 +89,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:164:16 @@ -103,8 +108,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:168:16 @@ -121,8 +127,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_i32); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:172:16 @@ -139,8 +146,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_i16); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:176:16 @@ -157,8 +165,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `u16` | -LL | foo::(42_u16); - | ~~~ +LL - foo::(42_i8); +LL + foo::(42_u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:180:16 @@ -175,8 +184,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `u16` | -LL | foo::(42u16); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:184:16 @@ -193,8 +203,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `u16` | -LL | foo::(42u16); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42u16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:189:16 @@ -211,8 +222,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:193:16 @@ -229,8 +241,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:197:16 @@ -247,8 +260,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_u32); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:201:16 @@ -265,8 +279,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_u16); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:205:16 @@ -283,8 +298,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_u8); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:209:16 @@ -301,8 +317,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:213:16 @@ -319,8 +336,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:217:16 @@ -337,8 +355,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_i32); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:222:16 @@ -355,8 +374,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `i16` | -LL | foo::(42_i16); - | ~~~ +LL - foo::(42_i8); +LL + foo::(42_i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:226:16 @@ -373,8 +393,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `i16` | -LL | foo::(42i16); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:230:16 @@ -391,8 +412,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `i16` | -LL | foo::(42i16); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42i16); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:235:15 @@ -409,8 +431,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_usize); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:239:15 @@ -427,8 +450,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_u64); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:243:15 @@ -445,8 +469,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_u32); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:247:15 @@ -463,8 +488,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_u16); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:252:15 @@ -481,8 +507,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_isize); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:256:15 @@ -499,8 +526,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_i64); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:260:15 @@ -517,8 +545,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_i32); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:264:15 @@ -535,8 +564,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_i16); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:268:15 @@ -553,8 +583,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i8` to `u8` | -LL | foo::(42_u8); - | ~~ +LL - foo::(42_i8); +LL + foo::(42_u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:272:15 @@ -571,8 +602,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `u8` | -LL | foo::(42u8); - | ~~ +LL - foo::(42.0_f64); +LL + foo::(42u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:276:15 @@ -589,8 +621,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `u8` | -LL | foo::(42u8); - | ~~ +LL - foo::(42.0_f32); +LL + foo::(42u8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:281:15 @@ -607,8 +640,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_usize); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:285:15 @@ -625,8 +659,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_u64); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:289:15 @@ -643,8 +678,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_u32); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:293:15 @@ -661,8 +697,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u16` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_u16); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:297:15 @@ -679,8 +716,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u8` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_u8); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:301:15 @@ -697,8 +735,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_isize); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:305:15 @@ -715,8 +754,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_i64); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:309:15 @@ -733,8 +773,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_i32); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:313:15 @@ -751,8 +792,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i16` to `i8` | -LL | foo::(42_i8); - | ~~ +LL - foo::(42_i16); +LL + foo::(42_i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:318:15 @@ -769,8 +811,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `i8` | -LL | foo::(42i8); - | ~~ +LL - foo::(42.0_f64); +LL + foo::(42i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:322:15 @@ -787,8 +830,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `i8` | -LL | foo::(42i8); - | ~~ +LL - foo::(42.0_f32); +LL + foo::(42i8); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:327:16 @@ -805,8 +849,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `f64` | -LL | foo::(42_f64); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_f64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:331:16 @@ -823,8 +868,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `f64` | -LL | foo::(42_f64); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_f64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:335:16 @@ -895,8 +941,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `f64` | -LL | foo::(42_f64); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_f64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:351:16 @@ -913,8 +960,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `f64` | -LL | foo::(42_f64); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_f64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:355:16 @@ -985,8 +1033,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f32` to `f64` | -LL | foo::(42.0_f64); - | ~~~ +LL - foo::(42.0_f32); +LL + foo::(42.0_f64); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:373:16 @@ -1003,8 +1052,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `usize` to `f32` | -LL | foo::(42_f32); - | ~~~ +LL - foo::(42_usize); +LL + foo::(42_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:377:16 @@ -1021,8 +1071,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u64` to `f32` | -LL | foo::(42_f32); - | ~~~ +LL - foo::(42_u64); +LL + foo::(42_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:381:16 @@ -1039,8 +1090,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `u32` to `f32` | -LL | foo::(42_f32); - | ~~~ +LL - foo::(42_u32); +LL + foo::(42_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:385:16 @@ -1093,8 +1145,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `isize` to `f32` | -LL | foo::(42_f32); - | ~~~ +LL - foo::(42_isize); +LL + foo::(42_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:397:16 @@ -1111,8 +1164,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i64` to `f32` | -LL | foo::(42_f32); - | ~~~ +LL - foo::(42_i64); +LL + foo::(42_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:401:16 @@ -1129,8 +1183,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `i32` to `f32` | -LL | foo::(42_f32); - | ~~~ +LL - foo::(42_i32); +LL + foo::(42_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:405:16 @@ -1183,8 +1238,9 @@ LL | fn foo(_x: N) {} | ^^^ ----- help: change the type of the numeric literal from `f64` to `f32` | -LL | foo::(42.0_f32); - | ~~~ +LL - foo::(42.0_f64); +LL + foo::(42.0_f32); + | error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:419:16 diff --git a/tests/ui/object-pointer-types.stderr b/tests/ui/object-pointer-types.stderr index 7d915ebdab657..7e3a13dd90bef 100644 --- a/tests/ui/object-pointer-types.stderr +++ b/tests/ui/object-pointer-types.stderr @@ -9,8 +9,9 @@ LL | x.owned(); | help: there is a method `to_owned` with a similar name | -LL | x.to_owned(); - | ~~~~~~~~ +LL - x.owned(); +LL + x.to_owned(); + | error[E0599]: no method named `owned` found for mutable reference `&mut dyn Foo` in the current scope --> $DIR/object-pointer-types.rs:17:7 diff --git a/tests/ui/object-safety/avoid-ice-on-warning.new.stderr b/tests/ui/object-safety/avoid-ice-on-warning.new.stderr index 4ff45d7a84858..a0e3743393c78 100644 --- a/tests/ui/object-safety/avoid-ice-on-warning.new.stderr +++ b/tests/ui/object-safety/avoid-ice-on-warning.new.stderr @@ -6,8 +6,9 @@ LL | fn call_this(f: F) : Fn(&str) + call_that {} | help: use `->` instead | -LL | fn call_this(f: F) -> Fn(&str) + call_that {} - | ~~ +LL - fn call_this(f: F) : Fn(&str) + call_that {} +LL + fn call_this(f: F) -> Fn(&str) + call_that {} + | error[E0405]: cannot find trait `call_that` in this scope --> $DIR/avoid-ice-on-warning.rs:4:36 diff --git a/tests/ui/object-safety/avoid-ice-on-warning.old.stderr b/tests/ui/object-safety/avoid-ice-on-warning.old.stderr index de45ec8c405a3..f0a1b0e2b5976 100644 --- a/tests/ui/object-safety/avoid-ice-on-warning.old.stderr +++ b/tests/ui/object-safety/avoid-ice-on-warning.old.stderr @@ -6,8 +6,9 @@ LL | fn call_this(f: F) : Fn(&str) + call_that {} | help: use `->` instead | -LL | fn call_this(f: F) -> Fn(&str) + call_that {} - | ~~ +LL - fn call_this(f: F) : Fn(&str) + call_that {} +LL + fn call_this(f: F) -> Fn(&str) + call_that {} + | error[E0405]: cannot find trait `call_that` in this scope --> $DIR/avoid-ice-on-warning.rs:4:36 diff --git a/tests/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr b/tests/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr index 2d2bb27b8f39a..4f5d8afbef3b2 100644 --- a/tests/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr +++ b/tests/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr @@ -17,8 +17,9 @@ LL | fn c(&self) -> dyn SuperTrait; | help: you might have meant to use `Self` to refer to the implementing type | -LL | fn c(&self) -> Self; - | ~~~~ +LL - fn c(&self) -> dyn SuperTrait; +LL + fn c(&self) -> Self; + | error[E0038]: the trait `SuperTrait` cannot be made into an object --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20 diff --git a/tests/ui/object-safety/object-safety-supertrait-mentions-Self.stderr b/tests/ui/object-safety/object-safety-supertrait-mentions-Self.stderr index 6beb04e5b9372..9a10c2988353d 100644 --- a/tests/ui/object-safety/object-safety-supertrait-mentions-Self.stderr +++ b/tests/ui/object-safety/object-safety-supertrait-mentions-Self.stderr @@ -33,8 +33,9 @@ LL | trait Baz : Bar { | this trait cannot be made into an object... help: consider using an opaque type instead | -LL | fn make_baz(t: &T) -> &impl Baz { - | ~~~~ +LL - fn make_baz(t: &T) -> &dyn Baz { +LL + fn make_baz(t: &T) -> &impl Baz { + | error: aborting due to 2 previous errors diff --git a/tests/ui/obsolete-in-place/bad.stderr b/tests/ui/obsolete-in-place/bad.stderr index 363dfb77628c4..1409a6637890f 100644 --- a/tests/ui/obsolete-in-place/bad.stderr +++ b/tests/ui/obsolete-in-place/bad.stderr @@ -6,8 +6,9 @@ LL | x <- y; | help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` | -LL | x < - y; - | ~~~ +LL - x <- y; +LL + x < - y; + | error: expected expression, found keyword `in` --> $DIR/bad.rs:10:5 diff --git a/tests/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr index 9bb9423788c20..0482a5c58559e 100644 --- a/tests/ui/on-unimplemented/bad-annotation.stderr +++ b/tests/ui/on-unimplemented/bad-annotation.stderr @@ -6,9 +6,11 @@ LL | #[rustc_on_unimplemented] | help: the following are the possible correct uses | -LL | #[rustc_on_unimplemented = "message"] +LL - #[rustc_on_unimplemented] +LL + #[rustc_on_unimplemented = "message"] | -LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] +LL - #[rustc_on_unimplemented] +LL + #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] | error[E0230]: there is no parameter `C` on trait `BadAnnotation2` diff --git a/tests/ui/on-unimplemented/issue-104140.stderr b/tests/ui/on-unimplemented/issue-104140.stderr index 4ba5475d9ecaf..5c9d5e8d55398 100644 --- a/tests/ui/on-unimplemented/issue-104140.stderr +++ b/tests/ui/on-unimplemented/issue-104140.stderr @@ -6,10 +6,12 @@ LL | #[rustc_on_unimplemented] | help: the following are the possible correct uses | -LL | #[rustc_on_unimplemented = "message"] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - #[rustc_on_unimplemented] +LL + #[rustc_on_unimplemented = "message"] + | +LL - #[rustc_on_unimplemented] +LL + #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] + | error: aborting due to 1 previous error diff --git a/tests/ui/operator-recovery/less-than-greater-than.stderr b/tests/ui/operator-recovery/less-than-greater-than.stderr index 36a4a81035f1e..429bda9cefcd5 100644 --- a/tests/ui/operator-recovery/less-than-greater-than.stderr +++ b/tests/ui/operator-recovery/less-than-greater-than.stderr @@ -6,8 +6,9 @@ LL | println!("{}", 1 <> 2); | help: `<>` is not a valid comparison operator, use `!=` | -LL | println!("{}", 1 != 2); - | ~~ +LL - println!("{}", 1 <> 2); +LL + println!("{}", 1 != 2); + | error: aborting due to 1 previous error diff --git a/tests/ui/or-patterns/multiple-pattern-typo.stderr b/tests/ui/or-patterns/multiple-pattern-typo.stderr index 2e66f54979b03..fea3ed7669194 100644 --- a/tests/ui/or-patterns/multiple-pattern-typo.stderr +++ b/tests/ui/or-patterns/multiple-pattern-typo.stderr @@ -8,8 +8,9 @@ LL | 1 | 2 || 3 => (), | help: use a single `|` to separate multiple alternative patterns | -LL | 1 | 2 | 3 => (), - | ~ +LL - 1 | 2 || 3 => (), +LL + 1 | 2 | 3 => (), + | error: unexpected token `||` in pattern --> $DIR/multiple-pattern-typo.rs:12:16 @@ -21,8 +22,9 @@ LL | (1 | 2 || 3) => (), | help: use a single `|` to separate multiple alternative patterns | -LL | (1 | 2 | 3) => (), - | ~ +LL - (1 | 2 || 3) => (), +LL + (1 | 2 | 3) => (), + | error: unexpected token `||` in pattern --> $DIR/multiple-pattern-typo.rs:17:16 @@ -34,8 +36,9 @@ LL | (1 | 2 || 3,) => (), | help: use a single `|` to separate multiple alternative patterns | -LL | (1 | 2 | 3,) => (), - | ~ +LL - (1 | 2 || 3,) => (), +LL + (1 | 2 | 3,) => (), + | error: unexpected token `||` in pattern --> $DIR/multiple-pattern-typo.rs:24:18 @@ -47,8 +50,9 @@ LL | TS(1 | 2 || 3) => (), | help: use a single `|` to separate multiple alternative patterns | -LL | TS(1 | 2 | 3) => (), - | ~ +LL - TS(1 | 2 || 3) => (), +LL + TS(1 | 2 | 3) => (), + | error: unexpected token `||` in pattern --> $DIR/multiple-pattern-typo.rs:31:23 @@ -60,8 +64,9 @@ LL | NS { f: 1 | 2 || 3 } => (), | help: use a single `|` to separate multiple alternative patterns | -LL | NS { f: 1 | 2 | 3 } => (), - | ~ +LL - NS { f: 1 | 2 || 3 } => (), +LL + NS { f: 1 | 2 | 3 } => (), + | error: unexpected token `||` in pattern --> $DIR/multiple-pattern-typo.rs:36:16 @@ -73,8 +78,9 @@ LL | [1 | 2 || 3] => (), | help: use a single `|` to separate multiple alternative patterns | -LL | [1 | 2 | 3] => (), - | ~ +LL - [1 | 2 || 3] => (), +LL + [1 | 2 | 3] => (), + | error: unexpected token `||` in pattern --> $DIR/multiple-pattern-typo.rs:41:9 @@ -84,8 +90,9 @@ LL | || 1 | 2 | 3 => (), | help: use a single `|` to separate multiple alternative patterns | -LL | | 1 | 2 | 3 => (), - | ~ +LL - || 1 | 2 | 3 => (), +LL + | 1 | 2 | 3 => (), + | error: aborting due to 7 previous errors diff --git a/tests/ui/or-patterns/remove-leading-vert.stderr b/tests/ui/or-patterns/remove-leading-vert.stderr index 5177e98f0d90a..b92fcb89a404e 100644 --- a/tests/ui/or-patterns/remove-leading-vert.stderr +++ b/tests/ui/or-patterns/remove-leading-vert.stderr @@ -31,8 +31,9 @@ LL | let ( || A): (E); | help: use a single `|` to separate multiple alternative patterns | -LL | let ( | A): (E); - | ~ +LL - let ( || A): (E); +LL + let ( | A): (E); + | error: unexpected token `||` in pattern --> $DIR/remove-leading-vert.rs:17:11 @@ -42,8 +43,9 @@ LL | let [ || A ]: [E; 1]; | help: use a single `|` to separate multiple alternative patterns | -LL | let [ | A ]: [E; 1]; - | ~ +LL - let [ || A ]: [E; 1]; +LL + let [ | A ]: [E; 1]; + | error: unexpected token `||` in pattern --> $DIR/remove-leading-vert.rs:19:13 @@ -53,8 +55,9 @@ LL | let TS( || A ): TS; | help: use a single `|` to separate multiple alternative patterns | -LL | let TS( | A ): TS; - | ~ +LL - let TS( || A ): TS; +LL + let TS( | A ): TS; + | error: unexpected token `||` in pattern --> $DIR/remove-leading-vert.rs:21:17 @@ -64,8 +67,9 @@ LL | let NS { f: || A }: NS; | help: use a single `|` to separate multiple alternative patterns | -LL | let NS { f: | A }: NS; - | ~ +LL - let NS { f: || A }: NS; +LL + let NS { f: | A }: NS; + | error: a trailing `|` is not allowed in an or-pattern --> $DIR/remove-leading-vert.rs:26:13 @@ -147,8 +151,9 @@ LL | let ( A || B | ): E; | help: use a single `|` to separate multiple alternative patterns | -LL | let ( A | B | ): E; - | ~ +LL - let ( A || B | ): E; +LL + let ( A | B | ): E; + | error: a trailing `|` is not allowed in an or-pattern --> $DIR/remove-leading-vert.rs:31:18 @@ -203,8 +208,9 @@ LL | A || B | => {} | help: use a single `|` to separate multiple alternative patterns | -LL | A | B | => {} - | ~ +LL - A || B | => {} +LL + A | B | => {} + | error: a trailing `|` is not allowed in an or-pattern --> $DIR/remove-leading-vert.rs:36:16 diff --git a/tests/ui/panic-handler/weak-lang-item.stderr b/tests/ui/panic-handler/weak-lang-item.stderr index de351d2c3e4aa..e9d444c1c4d8c 100644 --- a/tests/ui/panic-handler/weak-lang-item.stderr +++ b/tests/ui/panic-handler/weak-lang-item.stderr @@ -7,7 +7,8 @@ LL | extern crate core; = note: `core` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate core as other_core; +LL - extern crate core; +LL + extern crate core as other_core; | error: `#[panic_handler]` function required, but not found diff --git a/tests/ui/parser/bad-char-literals.stderr b/tests/ui/parser/bad-char-literals.stderr index 1fb324a1b7e84..ccf4006137298 100644 --- a/tests/ui/parser/bad-char-literals.stderr +++ b/tests/ui/parser/bad-char-literals.stderr @@ -6,8 +6,9 @@ LL | '''; | help: escape the character | -LL | '\''; - | ~~ +LL - '''; +LL + '\''; + | error: character constant must be escaped: `\n` --> $DIR/bad-char-literals.rs:10:6 @@ -41,8 +42,9 @@ LL | '-␀-'; | help: if you meant to write a string literal, use double quotes | -LL | "-␀-"; - | ~ ~ +LL - '-␀-'; +LL + "-␀-"; + | error: character constant must be escaped: `\t` --> $DIR/bad-char-literals.rs:21:6 diff --git a/tests/ui/parser/bad-crate-name.stderr b/tests/ui/parser/bad-crate-name.stderr index c98a620f12371..2218062fa28ef 100644 --- a/tests/ui/parser/bad-crate-name.stderr +++ b/tests/ui/parser/bad-crate-name.stderr @@ -6,8 +6,9 @@ LL | extern crate krate-name-here; | help: if the original crate name uses dashes you need to use underscores in the code | -LL | extern crate krate_name_here; - | ~ ~ +LL - extern crate krate-name-here; +LL + extern crate krate_name_here; + | error[E0463]: can't find crate for `krate_name_here` --> $DIR/bad-crate-name.rs:1:1 diff --git a/tests/ui/parser/bad-escape-suggest-raw-string.stderr b/tests/ui/parser/bad-escape-suggest-raw-string.stderr index 6dd4ad512a8e3..5afa1f4a7f800 100644 --- a/tests/ui/parser/bad-escape-suggest-raw-string.stderr +++ b/tests/ui/parser/bad-escape-suggest-raw-string.stderr @@ -7,8 +7,9 @@ LL | let bad = "ab\[c"; = help: for more information, visit help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal | -LL | let bad = r"ab\[c"; - | ~~~~~~~~ +LL - let bad = "ab\[c"; +LL + let bad = r"ab\[c"; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/bad-let-else-statement.stderr b/tests/ui/parser/bad-let-else-statement.stderr index 79d722bb7ac44..ba56452998312 100644 --- a/tests/ui/parser/bad-let-else-statement.stderr +++ b/tests/ui/parser/bad-let-else-statement.stderr @@ -225,8 +225,9 @@ LL | let bad = format_args! {""} else { return; }; | help: use parentheses instead of braces for this macro | -LL | let bad = format_args! ("") else { return; }; - | ~ ~ +LL - let bad = format_args! {""} else { return; }; +LL + let bad = format_args! ("") else { return; }; + | error: right curly brace `}` before `else` in a `let...else` statement not allowed --> $DIR/bad-let-else-statement.rs:207:5 @@ -254,8 +255,9 @@ LL | b!(2); = note: this error originates in the macro `b` (in Nightly builds, run with -Z macro-backtrace for more info) help: use parentheses instead of braces for this macro | -LL | let 0 = a! () else { return; }; - | ~~ +LL - let 0 = a! {} else { return; }; +LL + let 0 = a! () else { return; }; + | warning: irrefutable `let...else` pattern --> $DIR/bad-let-else-statement.rs:95:5 diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr index b5dacdf7d0d3d..a68035bb29ca2 100644 --- a/tests/ui/parser/bad-lit-suffixes.stderr +++ b/tests/ui/parser/bad-lit-suffixes.stderr @@ -30,9 +30,11 @@ LL | #[must_use = "string"suffix] | help: the following are the possible correct uses | -LL | #[must_use = "reason"] +LL - #[must_use = "string"suffix] +LL + #[must_use = "reason"] | -LL | #[must_use] +LL - #[must_use = "string"suffix] +LL + #[must_use] | error: suffixes on string literals are invalid diff --git a/tests/ui/parser/byte-literals.stderr b/tests/ui/parser/byte-literals.stderr index 25e319954418d..fe3cfb23de85b 100644 --- a/tests/ui/parser/byte-literals.stderr +++ b/tests/ui/parser/byte-literals.stderr @@ -39,8 +39,9 @@ LL | b'''; | help: escape the character | -LL | b'\''; - | ~~ +LL - b'''; +LL + b'\''; + | error: non-ASCII character in byte literal --> $DIR/byte-literals.rs:10:7 @@ -50,8 +51,9 @@ LL | b'é'; | help: if you meant to use the unicode code point for 'é', use a \xHH escape | -LL | b'\xE9'; - | ~~~~ +LL - b'é'; +LL + b'\xE9'; + | error[E0763]: unterminated byte constant --> $DIR/byte-literals.rs:11:6 diff --git a/tests/ui/parser/byte-string-literals.stderr b/tests/ui/parser/byte-string-literals.stderr index 24e0eaac8fa91..086337425577f 100644 --- a/tests/ui/parser/byte-string-literals.stderr +++ b/tests/ui/parser/byte-string-literals.stderr @@ -28,8 +28,9 @@ LL | b"é"; | help: if you meant to use the unicode code point for 'é', use a \xHH escape | -LL | b"\xE9"; - | ~~~~ +LL - b"é"; +LL + b"\xE9"; + | error: non-ASCII character in raw byte string literal --> $DIR/byte-string-literals.rs:7:10 diff --git a/tests/ui/parser/char/whitespace-character-literal.stderr b/tests/ui/parser/char/whitespace-character-literal.stderr index f273b5d61d57f..53f2eb3ecbab2 100644 --- a/tests/ui/parser/char/whitespace-character-literal.stderr +++ b/tests/ui/parser/char/whitespace-character-literal.stderr @@ -11,8 +11,9 @@ LL | let _hair_space_around = ' x​'; | ^^ help: consider removing the non-printing characters | -LL | let _hair_space_around = 'x​'; - | ~ +LL - let _hair_space_around = ' x​'; +LL + let _hair_space_around = 'x​'; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr index 96885d11ee07f..ac13bab25c934 100644 --- a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr +++ b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr @@ -6,8 +6,9 @@ LL | impl NInts {} | help: `const` parameters must be declared for the `impl` | -LL | impl NInts {} - | ++++++++++++++++ ~ +LL - impl NInts {} +LL + impl NInts {} + | error: unexpected `const` parameter declaration --> $DIR/const-param-decl-on-type-instead-of-impl.rs:8:17 diff --git a/tests/ui/parser/default-on-wrong-item-kind.stderr b/tests/ui/parser/default-on-wrong-item-kind.stderr index 392c85e0c43d7..56641565b1668 100644 --- a/tests/ui/parser/default-on-wrong-item-kind.stderr +++ b/tests/ui/parser/default-on-wrong-item-kind.stderr @@ -159,8 +159,9 @@ LL | default const foo: u8; = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html help: try using a static value | -LL | static foo: u8; - | ~~~~~~ +LL - default const foo: u8; +LL + static foo: u8; + | error: a module cannot be `default` --> $DIR/default-on-wrong-item-kind.rs:41:5 diff --git a/tests/ui/parser/do-catch-suggests-try.stderr b/tests/ui/parser/do-catch-suggests-try.stderr index fd3406ae29f89..2eaab8360759b 100644 --- a/tests/ui/parser/do-catch-suggests-try.stderr +++ b/tests/ui/parser/do-catch-suggests-try.stderr @@ -7,8 +7,9 @@ LL | let _: Option<()> = do catch {}; = note: following RFC #2388, the new non-placeholder syntax is `try` help: replace with the new syntax | -LL | let _: Option<()> = try {}; - | ~~~ +LL - let _: Option<()> = do catch {}; +LL + let _: Option<()> = try {}; + | error[E0308]: mismatched types --> $DIR/do-catch-suggests-try.rs:9:33 diff --git a/tests/ui/parser/dotdotdot-expr.stderr b/tests/ui/parser/dotdotdot-expr.stderr index 208c04bd3df50..f0bc57264a607 100644 --- a/tests/ui/parser/dotdotdot-expr.stderr +++ b/tests/ui/parser/dotdotdot-expr.stderr @@ -6,12 +6,14 @@ LL | let _redemptive = 1...21; | help: use `..` for an exclusive range | -LL | let _redemptive = 1..21; - | ~~ +LL - let _redemptive = 1...21; +LL + let _redemptive = 1..21; + | help: or `..=` for an inclusive range | -LL | let _redemptive = 1..=21; - | ~~~ +LL - let _redemptive = 1...21; +LL + let _redemptive = 1..=21; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/duplicate-where-clauses.stderr b/tests/ui/parser/duplicate-where-clauses.stderr index 8250d4f1e0568..298cdab0c68c3 100644 --- a/tests/ui/parser/duplicate-where-clauses.stderr +++ b/tests/ui/parser/duplicate-where-clauses.stderr @@ -8,8 +8,9 @@ LL | struct A where (): Sized where (): Sized {} | help: consider joining the two `where` clauses into one | -LL | struct A where (): Sized, (): Sized {} - | ~ +LL - struct A where (): Sized where (): Sized {} +LL + struct A where (): Sized, (): Sized {} + | error: cannot define duplicate `where` clauses on an item --> $DIR/duplicate-where-clauses.rs:4:30 @@ -21,8 +22,9 @@ LL | fn b() where (): Sized where (): Sized {} | help: consider joining the two `where` clauses into one | -LL | fn b() where (): Sized, (): Sized {} - | ~ +LL - fn b() where (): Sized where (): Sized {} +LL + fn b() where (): Sized, (): Sized {} + | error: cannot define duplicate `where` clauses on an item --> $DIR/duplicate-where-clauses.rs:7:30 @@ -34,8 +36,9 @@ LL | enum C where (): Sized where (): Sized {} | help: consider joining the two `where` clauses into one | -LL | enum C where (): Sized, (): Sized {} - | ~ +LL - enum C where (): Sized where (): Sized {} +LL + enum C where (): Sized, (): Sized {} + | error: cannot define duplicate `where` clauses on an item --> $DIR/duplicate-where-clauses.rs:10:33 @@ -47,8 +50,9 @@ LL | struct D where (): Sized, where (): Sized {} | help: consider joining the two `where` clauses into one | -LL | struct D where (): Sized, (): Sized {} - | ~ +LL - struct D where (): Sized, where (): Sized {} +LL + struct D where (): Sized, (): Sized {} + | error: cannot define duplicate `where` clauses on an item --> $DIR/duplicate-where-clauses.rs:13:31 @@ -60,8 +64,9 @@ LL | fn e() where (): Sized, where (): Sized {} | help: consider joining the two `where` clauses into one | -LL | fn e() where (): Sized, (): Sized {} - | ~ +LL - fn e() where (): Sized, where (): Sized {} +LL + fn e() where (): Sized, (): Sized {} + | error: cannot define duplicate `where` clauses on an item --> $DIR/duplicate-where-clauses.rs:16:31 @@ -73,8 +78,9 @@ LL | enum F where (): Sized, where (): Sized {} | help: consider joining the two `where` clauses into one | -LL | enum F where (): Sized, (): Sized {} - | ~ +LL - enum F where (): Sized, where (): Sized {} +LL + enum F where (): Sized, (): Sized {} + | error: aborting due to 6 previous errors diff --git a/tests/ui/parser/emoji-identifiers.stderr b/tests/ui/parser/emoji-identifiers.stderr index 536afc53f0ceb..f0e90082bff9d 100644 --- a/tests/ui/parser/emoji-identifiers.stderr +++ b/tests/ui/parser/emoji-identifiers.stderr @@ -6,8 +6,9 @@ LL | let _ = i_like_to_😄_a_lot() ➖ 4; | help: Unicode character '➖' (Heavy Minus Sign) looks like '-' (Minus/Hyphen), but it is not | -LL | let _ = i_like_to_😄_a_lot() - 4; - | ~ +LL - let _ = i_like_to_😄_a_lot() ➖ 4; +LL + let _ = i_like_to_😄_a_lot() - 4; + | error: identifiers cannot contain emoji: `ABig👩👩👧👧Family` --> $DIR/emoji-identifiers.rs:1:8 @@ -80,8 +81,9 @@ LL | fn full_of_✨() -> 👀 { | ^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function `full_of_✨` with a similar name | -LL | 👀::full_of_✨() - | ~~~~~~~~~~ +LL - 👀::full_of✨() +LL + 👀::full_of_✨() + | error[E0425]: cannot find function `i_like_to_😄_a_lot` in this scope --> $DIR/emoji-identifiers.rs:13:13 diff --git a/tests/ui/parser/eq-gt-to-gt-eq.stderr b/tests/ui/parser/eq-gt-to-gt-eq.stderr index 73f465f7b9b28..aa47ddecce9ef 100644 --- a/tests/ui/parser/eq-gt-to-gt-eq.stderr +++ b/tests/ui/parser/eq-gt-to-gt-eq.stderr @@ -11,8 +11,9 @@ LL | if a => b {} | ^ help: you might have meant to write a "greater than or equal to" comparison | -LL | if a >= b {} - | ~~ +LL - if a => b {} +LL + if a >= b {} + | error: expected `{`, found `=>` --> $DIR/eq-gt-to-gt-eq.rs:13:10 @@ -27,8 +28,9 @@ LL | if a => 1 {} | ^ help: you might have meant to write a "greater than or equal to" comparison | -LL | if a >= 1 {} - | ~~ +LL - if a => 1 {} +LL + if a >= 1 {} + | error: expected `{`, found `=>` --> $DIR/eq-gt-to-gt-eq.rs:18:10 @@ -43,8 +45,9 @@ LL | if 1 => a {} | ^ help: you might have meant to write a "greater than or equal to" comparison | -LL | if 1 >= a {} - | ~~ +LL - if 1 => a {} +LL + if 1 >= a {} + | error: expected `{`, found `=>` --> $DIR/eq-gt-to-gt-eq.rs:24:10 @@ -59,8 +62,9 @@ LL | if a => b && a != b {} | ^ help: you might have meant to write a "greater than or equal to" comparison | -LL | if a >= b && a != b {} - | ~~ +LL - if a => b && a != b {} +LL + if a >= b && a != b {} + | error: expected `{`, found `=>` --> $DIR/eq-gt-to-gt-eq.rs:30:20 @@ -75,8 +79,9 @@ LL | if a != b && a => b {} | ^^^^^^^^^^^ help: you might have meant to write a "greater than or equal to" comparison | -LL | if a != b && a >= b {} - | ~~ +LL - if a != b && a => b {} +LL + if a != b && a >= b {} + | error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `=>` --> $DIR/eq-gt-to-gt-eq.rs:36:15 @@ -86,8 +91,9 @@ LL | let _ = a => b; | help: you might have meant to write a "greater than or equal to" comparison | -LL | let _ = a >= b; - | ~~ +LL - let _ = a => b; +LL + let _ = a >= b; + | error: expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `=>` --> $DIR/eq-gt-to-gt-eq.rs:42:13 @@ -99,8 +105,9 @@ LL | match a => b { | help: you might have meant to write a "greater than or equal to" comparison | -LL | match a >= b { - | ~~ +LL - match a => b { +LL + match a >= b { + | error: aborting due to 7 previous errors diff --git a/tests/ui/parser/expr-rarrow-call.stderr b/tests/ui/parser/expr-rarrow-call.stderr index 221e3a74d79f9..2e168ca26fecc 100644 --- a/tests/ui/parser/expr-rarrow-call.stderr +++ b/tests/ui/parser/expr-rarrow-call.stderr @@ -7,8 +7,9 @@ LL | named->foo; = help: the `.` operator will dereference the value if needed help: try using `.` instead | -LL | named.foo; - | ~ +LL - named->foo; +LL + named.foo; + | error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:18:12 @@ -19,8 +20,9 @@ LL | unnamed->0; = help: the `.` operator will dereference the value if needed help: try using `.` instead | -LL | unnamed.0; - | ~ +LL - unnamed->0; +LL + unnamed.0; + | error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:22:6 @@ -31,8 +33,9 @@ LL | t->0; = help: the `.` operator will dereference the value if needed help: try using `.` instead | -LL | t.0; - | ~ +LL - t->0; +LL + t.0; + | error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:23:6 @@ -43,8 +46,9 @@ LL | t->1; = help: the `.` operator will dereference the value if needed help: try using `.` instead | -LL | t.1; - | ~ +LL - t->1; +LL + t.1; + | error: `->` used for field access or method call --> $DIR/expr-rarrow-call.rs:30:8 @@ -55,8 +59,9 @@ LL | foo->clone(); = help: the `.` operator will dereference the value if needed help: try using `.` instead | -LL | foo.clone(); - | ~ +LL - foo->clone(); +LL + foo.clone(); + | error: aborting due to 5 previous errors diff --git a/tests/ui/parser/extern-no-fn.stderr b/tests/ui/parser/extern-no-fn.stderr index 03826e4a93b7a..2ee905429c4ab 100644 --- a/tests/ui/parser/extern-no-fn.stderr +++ b/tests/ui/parser/extern-no-fn.stderr @@ -11,8 +11,9 @@ LL | } | help: if you meant to call a macro, try | -LL | f!(); - | ~~ +LL - f(); +LL + f!(); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/fn-body-eq-expr-semi.stderr b/tests/ui/parser/fn-body-eq-expr-semi.stderr index f1255d8642a60..adcb4fef0a376 100644 --- a/tests/ui/parser/fn-body-eq-expr-semi.stderr +++ b/tests/ui/parser/fn-body-eq-expr-semi.stderr @@ -6,8 +6,9 @@ LL | fn foo() = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn foo() { 42 } - | ~ ~ +LL - fn foo() = 42; +LL + fn foo() { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:5:20 @@ -17,8 +18,9 @@ LL | fn bar() -> u8 = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn bar() -> u8 { 42 } - | ~ ~ +LL - fn bar() -> u8 = 42; +LL + fn bar() -> u8 { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:9:14 @@ -28,8 +30,9 @@ LL | fn foo() = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn foo() { 42 } - | ~ ~ +LL - fn foo() = 42; +LL + fn foo() { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:11:20 @@ -39,8 +42,9 @@ LL | fn bar() -> u8 = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn bar() -> u8 { 42 } - | ~ ~ +LL - fn bar() -> u8 = 42; +LL + fn bar() -> u8 { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:16:14 @@ -50,8 +54,9 @@ LL | fn foo() = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn foo() { 42 } - | ~ ~ +LL - fn foo() = 42; +LL + fn foo() { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:17:20 @@ -61,8 +66,9 @@ LL | fn bar() -> u8 = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn bar() -> u8 { 42 } - | ~ ~ +LL - fn bar() -> u8 = 42; +LL + fn bar() -> u8 { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:21:14 @@ -72,8 +78,9 @@ LL | fn foo() = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn foo() { 42 } - | ~ ~ +LL - fn foo() = 42; +LL + fn foo() { 42 } + | error: function body cannot be `= expression;` --> $DIR/fn-body-eq-expr-semi.rs:22:20 @@ -83,8 +90,9 @@ LL | fn bar() -> u8 = 42; | help: surround the expression with `{` and `}` instead of `=` and `;` | -LL | fn bar() -> u8 { 42 } - | ~ ~ +LL - fn bar() -> u8 = 42; +LL + fn bar() -> u8 { 42 } + | error: incorrect function inside `extern` block --> $DIR/fn-body-eq-expr-semi.rs:9:8 diff --git a/tests/ui/parser/fn-colon-return-type.stderr b/tests/ui/parser/fn-colon-return-type.stderr index c1cdf4d4975a6..d6d30c5fd0748 100644 --- a/tests/ui/parser/fn-colon-return-type.stderr +++ b/tests/ui/parser/fn-colon-return-type.stderr @@ -6,8 +6,9 @@ LL | fn foo(x: i32): i32 { | help: use `->` instead | -LL | fn foo(x: i32) -> i32 { - | ~~ +LL - fn foo(x: i32): i32 { +LL + fn foo(x: i32) -> i32 { + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/foreign-const-semantic-fail.stderr b/tests/ui/parser/foreign-const-semantic-fail.stderr index d317847f98ad7..b2240738c4974 100644 --- a/tests/ui/parser/foreign-const-semantic-fail.stderr +++ b/tests/ui/parser/foreign-const-semantic-fail.stderr @@ -7,8 +7,9 @@ LL | const A: isize; = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html help: try using a static value | -LL | static A: isize; - | ~~~~~~ +LL - const A: isize; +LL + static A: isize; + | error: extern items cannot be `const` --> $DIR/foreign-const-semantic-fail.rs:6:11 @@ -19,8 +20,9 @@ LL | const B: isize = 42; = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html help: try using a static value | -LL | static B: isize = 42; - | ~~~~~~ +LL - const B: isize = 42; +LL + static B: isize = 42; + | error: incorrect `static` inside `extern` block --> $DIR/foreign-const-semantic-fail.rs:6:11 diff --git a/tests/ui/parser/foreign-const-syntactic-fail.stderr b/tests/ui/parser/foreign-const-syntactic-fail.stderr index 7da2c0190228d..f7466d5d6cd23 100644 --- a/tests/ui/parser/foreign-const-syntactic-fail.stderr +++ b/tests/ui/parser/foreign-const-syntactic-fail.stderr @@ -7,8 +7,9 @@ LL | const A: isize; = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html help: try using a static value | -LL | static A: isize; - | ~~~~~~ +LL - const A: isize; +LL + static A: isize; + | error: extern items cannot be `const` --> $DIR/foreign-const-syntactic-fail.rs:8:11 @@ -19,8 +20,9 @@ LL | const B: isize = 42; = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html help: try using a static value | -LL | static B: isize = 42; - | ~~~~~~ +LL - const B: isize = 42; +LL + static B: isize = 42; + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/increment-autofix-2.stderr b/tests/ui/parser/increment-autofix-2.stderr index 11e985480d697..3fee967279626 100644 --- a/tests/ui/parser/increment-autofix-2.stderr +++ b/tests/ui/parser/increment-autofix-2.stderr @@ -6,8 +6,9 @@ LL | i++; | help: use `+= 1` instead | -LL | i += 1; - | ~~~~ +LL - i++; +LL + i += 1; + | error: Rust has no postfix increment operator --> $DIR/increment-autofix-2.rs:19:12 @@ -19,8 +20,9 @@ LL | while i++ < 5 { | help: use `+= 1` instead | -LL | while { let tmp = i; i += 1; tmp } < 5 { - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - while i++ < 5 { +LL + while { let tmp = i; i += 1; tmp } < 5 { + | error: Rust has no postfix increment operator --> $DIR/increment-autofix-2.rs:27:8 @@ -30,8 +32,9 @@ LL | tmp++; | help: use `+= 1` instead | -LL | tmp += 1; - | ~~~~ +LL - tmp++; +LL + tmp += 1; + | error: Rust has no postfix increment operator --> $DIR/increment-autofix-2.rs:33:14 @@ -43,8 +46,9 @@ LL | while tmp++ < 5 { | help: use `+= 1` instead | -LL | while { let tmp_ = tmp; tmp += 1; tmp_ } < 5 { - | ++++++++++++ ~~~~~~~~~~~~~~~~~~ +LL - while tmp++ < 5 { +LL + while { let tmp_ = tmp; tmp += 1; tmp_ } < 5 { + | error: Rust has no postfix increment operator --> $DIR/increment-autofix-2.rs:41:16 @@ -54,8 +58,9 @@ LL | foo.bar.qux++; | help: use `+= 1` instead | -LL | foo.bar.qux += 1; - | ~~~~ +LL - foo.bar.qux++; +LL + foo.bar.qux += 1; + | error: Rust has no postfix increment operator --> $DIR/increment-autofix-2.rs:51:10 @@ -65,8 +70,9 @@ LL | s.tmp++; | help: use `+= 1` instead | -LL | s.tmp += 1; - | ~~~~ +LL - s.tmp++; +LL + s.tmp += 1; + | error: Rust has no prefix increment operator --> $DIR/increment-autofix-2.rs:58:5 diff --git a/tests/ui/parser/increment-autofix.stderr b/tests/ui/parser/increment-autofix.stderr index 1dc69fd9f4659..ffff91abee954 100644 --- a/tests/ui/parser/increment-autofix.stderr +++ b/tests/ui/parser/increment-autofix.stderr @@ -20,8 +20,9 @@ LL | while ++i < 5 { | help: use `+= 1` instead | -LL | while { i += 1; i } < 5 { - | ~ +++++++++ +LL - while ++i < 5 { +LL + while { i += 1; i } < 5 { + | error: Rust has no prefix increment operator --> $DIR/increment-autofix.rs:19:5 @@ -45,8 +46,9 @@ LL | while ++tmp < 5 { | help: use `+= 1` instead | -LL | while { tmp += 1; tmp } < 5 { - | ~ +++++++++++ +LL - while ++tmp < 5 { +LL + while { tmp += 1; tmp } < 5 { + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/intersection-patterns-1.stderr b/tests/ui/parser/intersection-patterns-1.stderr index ed2466b21a751..c191b46fa45db 100644 --- a/tests/ui/parser/intersection-patterns-1.stderr +++ b/tests/ui/parser/intersection-patterns-1.stderr @@ -9,8 +9,9 @@ LL | Some(x) @ y => {} | help: switch the order | -LL | y @ Some(x) => {} - | ~~~~~~~~~~~ +LL - Some(x) @ y => {} +LL + y @ Some(x) => {} + | error: pattern on wrong side of `@` --> $DIR/intersection-patterns-1.rs:27:9 @@ -23,8 +24,9 @@ LL | 1 ..= 5 @ e => {} | help: switch the order | -LL | e @ 1..=5 => {} - | ~~~~~~~~~ +LL - 1 ..= 5 @ e => {} +LL + e @ 1..=5 => {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-100197-mut-let.stderr b/tests/ui/parser/issues/issue-100197-mut-let.stderr index 252ed7d0715d4..e43d5f68607de 100644 --- a/tests/ui/parser/issues/issue-100197-mut-let.stderr +++ b/tests/ui/parser/issues/issue-100197-mut-let.stderr @@ -6,8 +6,9 @@ LL | mut let _x = 123; | help: switch the order of `mut` and `let` | -LL | let mut _x = 123; - | ~~~~~~~ +LL - mut let _x = 123; +LL + let mut _x = 123; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-101477-enum.stderr b/tests/ui/parser/issues/issue-101477-enum.stderr index 8d4efdd17f7b2..c6dadeab8b33f 100644 --- a/tests/ui/parser/issues/issue-101477-enum.stderr +++ b/tests/ui/parser/issues/issue-101477-enum.stderr @@ -7,8 +7,9 @@ LL | B == 2 = help: enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` help: try using `=` instead | -LL | B = 2 - | ~ +LL - B == 2 +LL + B = 2 + | error: expected item, found `==` --> $DIR/issue-101477-enum.rs:6:7 diff --git a/tests/ui/parser/issues/issue-101477-let.stderr b/tests/ui/parser/issues/issue-101477-let.stderr index d2671abbdea9e..59e90c8102f75 100644 --- a/tests/ui/parser/issues/issue-101477-let.stderr +++ b/tests/ui/parser/issues/issue-101477-let.stderr @@ -6,8 +6,9 @@ LL | let x == 2; | help: try using `=` instead | -LL | let x = 2; - | ~ +LL - let x == 2; +LL + let x = 2; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-102806.stderr b/tests/ui/parser/issues/issue-102806.stderr index ba8174a823b2a..cd447c6dec0d2 100644 --- a/tests/ui/parser/issues/issue-102806.stderr +++ b/tests/ui/parser/issues/issue-102806.stderr @@ -6,8 +6,9 @@ LL | let _ = V3 { z: 0.0, ...v}; | help: use `..` to fill in the rest of the fields | -LL | let _ = V3 { z: 0.0, ..v}; - | ~~ +LL - let _ = V3 { z: 0.0, ...v}; +LL + let _ = V3 { z: 0.0, ..v}; + | error: expected `..`, found `...` --> $DIR/issue-102806.rs:14:26 @@ -17,8 +18,9 @@ LL | let _ = V3 { z: 0.0, ...Default::default() }; | help: use `..` to fill in the rest of the fields | -LL | let _ = V3 { z: 0.0, ..Default::default() }; - | ~~ +LL - let _ = V3 { z: 0.0, ...Default::default() }; +LL + let _ = V3 { z: 0.0, ..Default::default() }; + | error: expected identifier, found `...` --> $DIR/issue-102806.rs:17:26 @@ -36,8 +38,9 @@ LL | let V3 { z: val, ... } = v; | help: to omit remaining fields, use `..` | -LL | let V3 { z: val, .. } = v; - | ~~ +LL - let V3 { z: val, ... } = v; +LL + let V3 { z: val, .. } = v; + | error[E0063]: missing fields `x` and `y` in initializer of `V3` --> $DIR/issue-102806.rs:17:13 diff --git a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr index b0d8b03ae08c3..97a73b4fd5ed3 100644 --- a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr +++ b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr @@ -6,8 +6,9 @@ LL | struct Apple((Apple, Option(Banana ? Citron))); | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | -LL | struct Apple((Apple, Option(Option Citron))); - | +++++++ ~ +LL - struct Apple((Apple, Option(Banana ? Citron))); +LL + struct Apple((Apple, Option(Option Citron))); + | error: expected one of `)` or `,`, found `Citron` --> $DIR/issue-103748-ICE-wrong-braces.rs:3:38 @@ -31,8 +32,9 @@ LL | struct Apple((Apple, Option(Banana ? Citron))); | help: use angle brackets instead | -LL | struct Apple((Apple, Option)); - | ~ ~ +LL - struct Apple((Apple, Option(Banana ? Citron))); +LL + struct Apple((Apple, Option)); + | error[E0072]: recursive type `Apple` has infinite size --> $DIR/issue-103748-ICE-wrong-braces.rs:3:1 diff --git a/tests/ui/parser/issues/issue-104867-inc-dec-2.stderr b/tests/ui/parser/issues/issue-104867-inc-dec-2.stderr index 4e2d0546851e3..f2412dda050cf 100644 --- a/tests/ui/parser/issues/issue-104867-inc-dec-2.stderr +++ b/tests/ui/parser/issues/issue-104867-inc-dec-2.stderr @@ -6,8 +6,9 @@ LL | let _ = i + ++i; | help: use `+= 1` instead | -LL | let _ = i + { i += 1; i }; - | ~ +++++++++ +LL - let _ = i + ++i; +LL + let _ = i + { i += 1; i }; + | error: Rust has no prefix increment operator --> $DIR/issue-104867-inc-dec-2.rs:8:13 @@ -17,8 +18,9 @@ LL | let _ = ++i + i; | help: use `+= 1` instead | -LL | let _ = { i += 1; i } + i; - | ~ +++++++++ +LL - let _ = ++i + i; +LL + let _ = { i += 1; i } + i; + | error: Rust has no prefix increment operator --> $DIR/issue-104867-inc-dec-2.rs:13:13 @@ -28,8 +30,9 @@ LL | let _ = ++i + ++i; | help: use `+= 1` instead | -LL | let _ = { i += 1; i } + ++i; - | ~ +++++++++ +LL - let _ = ++i + ++i; +LL + let _ = { i += 1; i } + ++i; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec-2.rs:18:18 @@ -45,8 +48,9 @@ LL | let _ = i++ + i; | help: use `+= 1` instead | -LL | let _ = { let tmp = i; i += 1; tmp } + i; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = i++ + i; +LL + let _ = { let tmp = i; i += 1; tmp } + i; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec-2.rs:29:14 @@ -56,8 +60,9 @@ LL | let _ = i++ + i++; | help: use `+= 1` instead | -LL | let _ = { let tmp = i; i += 1; tmp } + i++; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = i++ + i++; +LL + let _ = { let tmp = i; i += 1; tmp } + i++; + | error: Rust has no prefix increment operator --> $DIR/issue-104867-inc-dec-2.rs:34:13 @@ -67,8 +72,9 @@ LL | let _ = ++i + i++; | help: use `+= 1` instead | -LL | let _ = { i += 1; i } + i++; - | ~ +++++++++ +LL - let _ = ++i + i++; +LL + let _ = { i += 1; i } + i++; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec-2.rs:39:14 @@ -78,8 +84,9 @@ LL | let _ = i++ + ++i; | help: use `+= 1` instead | -LL | let _ = { let tmp = i; i += 1; tmp } + ++i; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = i++ + ++i; +LL + let _ = { let tmp = i; i += 1; tmp } + ++i; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec-2.rs:44:24 @@ -89,8 +96,9 @@ LL | let _ = (1 + 2 + i)++; | help: use `+= 1` instead | -LL | let _ = { let tmp = (1 + 2 + i); (1 + 2 + i) += 1; tmp }; - | +++++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = (1 + 2 + i)++; +LL + let _ = { let tmp = (1 + 2 + i); (1 + 2 + i) += 1; tmp }; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec-2.rs:49:15 @@ -100,8 +108,9 @@ LL | let _ = (i++ + 1) + 2; | help: use `+= 1` instead | -LL | let _ = ({ let tmp = i; i += 1; tmp } + 1) + 2; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = (i++ + 1) + 2; +LL + let _ = ({ let tmp = i; i += 1; tmp } + 1) + 2; + | error: aborting due to 10 previous errors diff --git a/tests/ui/parser/issues/issue-104867-inc-dec.stderr b/tests/ui/parser/issues/issue-104867-inc-dec.stderr index 78bfd3e82f0de..309f8b5693374 100644 --- a/tests/ui/parser/issues/issue-104867-inc-dec.stderr +++ b/tests/ui/parser/issues/issue-104867-inc-dec.stderr @@ -6,8 +6,9 @@ LL | i++; | help: use `+= 1` instead | -LL | i += 1; - | ~~~~ +LL - i++; +LL + i += 1; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec.rs:12:8 @@ -17,8 +18,9 @@ LL | s.x++; | help: use `+= 1` instead | -LL | s.x += 1; - | ~~~~ +LL - s.x++; +LL + s.x += 1; + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec.rs:17:9 @@ -28,8 +30,9 @@ LL | if i++ == 1 {} | help: use `+= 1` instead | -LL | if { let tmp = i; i += 1; tmp } == 1 {} - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - if i++ == 1 {} +LL + if { let tmp = i; i += 1; tmp } == 1 {} + | error: Rust has no prefix increment operator --> $DIR/issue-104867-inc-dec.rs:22:5 @@ -51,8 +54,9 @@ LL | if ++i == 1 { } | help: use `+= 1` instead | -LL | if { i += 1; i } == 1 { } - | ~ +++++++++ +LL - if ++i == 1 { } +LL + if { i += 1; i } == 1 { } + | error: Rust has no postfix increment operator --> $DIR/issue-104867-inc-dec.rs:33:6 @@ -62,8 +66,9 @@ LL | i++; | help: use `+= 1` instead | -LL | i += 1; - | ~~~~ +LL - i++; +LL + i += 1; + | error: Rust has no prefix increment operator --> $DIR/issue-104867-inc-dec.rs:41:5 diff --git a/tests/ui/parser/issues/issue-105366.stderr b/tests/ui/parser/issues/issue-105366.stderr index 18c04dfaf2088..d8c79a0e0eaf6 100644 --- a/tests/ui/parser/issues/issue-105366.stderr +++ b/tests/ui/parser/issues/issue-105366.stderr @@ -6,8 +6,9 @@ LL | fn From for Foo { | help: replace `fn` with `impl` here | -LL | impl From for Foo { - | ~~~~ +LL - fn From for Foo { +LL + impl From for Foo { + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-108495-dec.stderr b/tests/ui/parser/issues/issue-108495-dec.stderr index 85b29038f7c78..b058dae4a6fdd 100644 --- a/tests/ui/parser/issues/issue-108495-dec.stderr +++ b/tests/ui/parser/issues/issue-108495-dec.stderr @@ -12,8 +12,9 @@ LL | let _ = i-- + i--; | help: use `-= 1` instead | -LL | let _ = { let tmp = i; i -= 1; tmp } + i--; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = i-- + i--; +LL + let _ = { let tmp = i; i -= 1; tmp } + i--; + | error: Rust has no postfix decrement operator --> $DIR/issue-108495-dec.rs:14:20 @@ -29,8 +30,9 @@ LL | let _ = i-- + --i; | help: use `-= 1` instead | -LL | let _ = { let tmp = i; i -= 1; tmp } + --i; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = i-- + --i; +LL + let _ = { let tmp = i; i -= 1; tmp } + --i; + | error: Rust has no postfix decrement operator --> $DIR/issue-108495-dec.rs:24:24 @@ -40,8 +42,9 @@ LL | let _ = (1 + 2 + i)--; | help: use `-= 1` instead | -LL | let _ = { let tmp = (1 + 2 + i); (1 + 2 + i) -= 1; tmp }; - | +++++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = (1 + 2 + i)--; +LL + let _ = { let tmp = (1 + 2 + i); (1 + 2 + i) -= 1; tmp }; + | error: Rust has no postfix decrement operator --> $DIR/issue-108495-dec.rs:29:15 @@ -51,8 +54,9 @@ LL | let _ = (i-- + 1) + 2; | help: use `-= 1` instead | -LL | let _ = ({ let tmp = i; i -= 1; tmp } + 1) + 2; - | +++++++++++ ~~~~~~~~~~~~~~~ +LL - let _ = (i-- + 1) + 2; +LL + let _ = ({ let tmp = i; i -= 1; tmp } + 1) + 2; + | error: Rust has no postfix decrement operator --> $DIR/issue-108495-dec.rs:35:10 @@ -62,8 +66,9 @@ LL | i--; | help: use `-= 1` instead | -LL | i -= 1; - | ~~~~ +LL - i--; +LL + i -= 1; + | error: aborting due to 7 previous errors diff --git a/tests/ui/parser/issues/issue-110014.stderr b/tests/ui/parser/issues/issue-110014.stderr index 7f1dd592e1238..57420bb349605 100644 --- a/tests/ui/parser/issues/issue-110014.stderr +++ b/tests/ui/parser/issues/issue-110014.stderr @@ -6,8 +6,9 @@ LL | fn`2222222222222222222222222222222222222222() {} | help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not | -LL | fn'2222222222222222222222222222222222222222() {} - | ~ +LL - fn`2222222222222222222222222222222222222222() {} +LL + fn'2222222222222222222222222222222222222222() {} + | error: expected identifier, found `2222222222222222222222222222222222222222` --> $DIR/issue-110014.rs:1:4 diff --git a/tests/ui/parser/issues/issue-111416.stderr b/tests/ui/parser/issues/issue-111416.stderr index 36f6c5b018fe8..50ff209afffd3 100644 --- a/tests/ui/parser/issues/issue-111416.stderr +++ b/tests/ui/parser/issues/issue-111416.stderr @@ -6,8 +6,9 @@ LL | let my = monad_bind(mx, T: Try); | help: if `monad_bind` is a struct, use braces as delimiters | -LL | let my = monad_bind { mx, T: Try }; - | ~ ~ +LL - let my = monad_bind(mx, T: Try); +LL + let my = monad_bind { mx, T: Try }; + | help: if `monad_bind` is a function, use the arguments directly | LL - let my = monad_bind(mx, T: Try); diff --git a/tests/ui/parser/issues/issue-118530-ice.stderr b/tests/ui/parser/issues/issue-118530-ice.stderr index 3519fb8777f4d..72c0397e9c95b 100644 --- a/tests/ui/parser/issues/issue-118530-ice.stderr +++ b/tests/ui/parser/issues/issue-118530-ice.stderr @@ -42,8 +42,9 @@ LL | attr::fn bar() -> String { = help: the `.` operator will dereference the value if needed help: try using `.` instead | -LL | attr::fn bar() . String { - | ~ +LL - attr::fn bar() -> String { +LL + attr::fn bar() . String { + | error: expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `{` --> $DIR/issue-118530-ice.rs:5:30 diff --git a/tests/ui/parser/issues/issue-17718-const-mut.stderr b/tests/ui/parser/issues/issue-17718-const-mut.stderr index 54b819c3cfb84..16eb773e7f6e3 100644 --- a/tests/ui/parser/issues/issue-17718-const-mut.stderr +++ b/tests/ui/parser/issues/issue-17718-const-mut.stderr @@ -6,7 +6,8 @@ LL | mut | help: you might want to declare a static instead | -LL | static +LL - const +LL + static | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr b/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr index 4a3743579e7a6..0cedc178001c6 100644 --- a/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr +++ b/tests/ui/parser/issues/issue-23620-invalid-escapes.stderr @@ -90,8 +90,9 @@ LL | let _ = "\u8f"; | help: format of unicode escape sequences uses braces | -LL | let _ = "\u{8f}"; - | ~~~~~~ +LL - let _ = "\u8f"; +LL + let _ = "\u{8f}"; + | error: aborting due to 13 previous errors diff --git a/tests/ui/parser/issues/issue-30318.stderr b/tests/ui/parser/issues/issue-30318.stderr index c441a92abad92..70780a37b7788 100644 --- a/tests/ui/parser/issues/issue-30318.stderr +++ b/tests/ui/parser/issues/issue-30318.stderr @@ -9,8 +9,9 @@ LL | fn bar() { } | help: to annotate the function, change the doc comment from inner to outer style | -LL | /// Misplaced comment... - | ~ +LL - //! Misplaced comment... +LL + /// Misplaced comment... + | error: an inner attribute is not permitted in this context --> $DIR/issue-30318.rs:9:1 @@ -38,8 +39,9 @@ LL | fn bat() { } | help: to annotate the function, change the doc comment from inner to outer style | -LL | /** Misplaced comment... */ - | ~ +LL - /*! Misplaced comment... */ +LL + /** Misplaced comment... */ + | error[E0753]: expected outer doc comment --> $DIR/issue-30318.rs:19:1 diff --git a/tests/ui/parser/issues/issue-32214.stderr b/tests/ui/parser/issues/issue-32214.stderr index 2ef4305dfd0e8..5ccd651bb96ae 100644 --- a/tests/ui/parser/issues/issue-32214.stderr +++ b/tests/ui/parser/issues/issue-32214.stderr @@ -8,8 +8,9 @@ LL | pub fn test >() {} | help: move the constraint after the generic argument | -LL | pub fn test >() {} - | ~~~~~~~~~~~~~~ +LL - pub fn test >() {} +LL + pub fn test >() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-34255-1.stderr b/tests/ui/parser/issues/issue-34255-1.stderr index 1e72f040b0366..cd2baaee408c8 100644 --- a/tests/ui/parser/issues/issue-34255-1.stderr +++ b/tests/ui/parser/issues/issue-34255-1.stderr @@ -6,8 +6,9 @@ LL | Test::Drill(field: 42); | help: if `Test::Drill` is a struct, use braces as delimiters | -LL | Test::Drill { field: 42 }; - | ~ ~ +LL - Test::Drill(field: 42); +LL + Test::Drill { field: 42 }; + | help: if `Test::Drill` is a function, use the arguments directly | LL - Test::Drill(field: 42); diff --git a/tests/ui/parser/issues/issue-44406.stderr b/tests/ui/parser/issues/issue-44406.stderr index 78cde9b6dcacc..b2367ce15ea8a 100644 --- a/tests/ui/parser/issues/issue-44406.stderr +++ b/tests/ui/parser/issues/issue-44406.stderr @@ -10,8 +10,9 @@ LL | foo!(true); = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) help: if `bar` is a struct, use braces as delimiters | -LL | bar { baz: $rest } - | ~ ~ +LL - bar(baz: $rest) +LL + bar { baz: $rest } + | help: if `bar` is a function, use the arguments directly | LL - bar(baz: $rest) diff --git a/tests/ui/parser/issues/issue-57684.stderr b/tests/ui/parser/issues/issue-57684.stderr index 39e1c8cd7cc74..5fc55efff0a30 100644 --- a/tests/ui/parser/issues/issue-57684.stderr +++ b/tests/ui/parser/issues/issue-57684.stderr @@ -6,8 +6,9 @@ LL | let _ = X { f1 = 5 }; | help: replace equals symbol with a colon | -LL | let _ = X { f1: 5 }; - | ~ +LL - let _ = X { f1 = 5 }; +LL + let _ = X { f1: 5 }; + | error: expected `:`, found `=` --> $DIR/issue-57684.rs:32:12 @@ -17,8 +18,9 @@ LL | f1 = 5, | help: replace equals symbol with a colon | -LL | f1: 5, - | ~ +LL - f1 = 5, +LL + f1: 5, + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-64732.stderr b/tests/ui/parser/issues/issue-64732.stderr index 7ec2df6d3bf7e..d9f8091d2df41 100644 --- a/tests/ui/parser/issues/issue-64732.stderr +++ b/tests/ui/parser/issues/issue-64732.stderr @@ -6,8 +6,9 @@ LL | let _foo = b'hello\0'; | help: if you meant to write a byte string literal, use double quotes | -LL | let _foo = b"hello\0"; - | ~~ ~ +LL - let _foo = b'hello\0'; +LL + let _foo = b"hello\0"; + | error: character literal may only contain one codepoint --> $DIR/issue-64732.rs:6:16 @@ -17,8 +18,9 @@ LL | let _bar = 'hello'; | help: if you meant to write a string literal, use double quotes | -LL | let _bar = "hello"; - | ~ ~ +LL - let _bar = 'hello'; +LL + let _bar = "hello"; + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr b/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr index 49d091cf3914c..767f63d69582f 100644 --- a/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr +++ b/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.stderr @@ -6,8 +6,9 @@ LL | auto n = 0; | help: write `let` instead of `auto` to introduce a new variable | -LL | let n = 0; - | ~~~ +LL - auto n = 0; +LL + let n = 0; + | error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:4:5 @@ -17,8 +18,9 @@ LL | auto m; | help: write `let` instead of `auto` to introduce a new variable | -LL | let m; - | ~~~ +LL - auto m; +LL + let m; + | error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:8:5 @@ -28,8 +30,9 @@ LL | var n = 0; | help: write `let` instead of `var` to introduce a new variable | -LL | let n = 0; - | ~~~ +LL - var n = 0; +LL + let n = 0; + | error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:10:5 @@ -39,8 +42,9 @@ LL | var m; | help: write `let` instead of `var` to introduce a new variable | -LL | let m; - | ~~~ +LL - var m; +LL + let m; + | error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5 @@ -50,8 +54,9 @@ LL | mut n = 0; | help: missing keyword | -LL | let mut n = 0; - | ~~~~~~~ +LL - mut n = 0; +LL + let mut n = 0; + | error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5 @@ -61,8 +66,9 @@ LL | mut var; | help: missing keyword | -LL | let mut var; - | ~~~~~~~ +LL - mut var; +LL + let mut var; + | error[E0308]: mismatched types --> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33 diff --git a/tests/ui/parser/issues/issue-68730.stderr b/tests/ui/parser/issues/issue-68730.stderr index 9bd98287db34a..838a6569bdc3f 100644 --- a/tests/ui/parser/issues/issue-68730.stderr +++ b/tests/ui/parser/issues/issue-68730.stderr @@ -23,8 +23,9 @@ LL | enum␀em␀˂˂ = note: character appears once more help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not | -LL | enum␀em␀<< - | ~~ +LL - enum␀em␀˂˂ +LL + enum␀em␀<< + | error: unknown start of token: \u{2c2} --> $DIR/issue-68730.rs:5:10 @@ -34,8 +35,9 @@ LL | enum␀em␀˂˂ | help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not | -LL | enum␀em␀˂< - | ~ +LL - enum␀em␀˂˂ +LL + enum␀em␀˂< + | error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `<` --> $DIR/issue-68730.rs:5:10 diff --git a/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr b/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr index 2f8728bd78b4f..6b8f8e4fe4ee3 100644 --- a/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr +++ b/tests/ui/parser/issues/issue-73568-lifetime-after-mut.stderr @@ -6,8 +6,9 @@ LL | fn x<'a>(x: &mut 'a i32){} | help: place the lifetime before `mut` | -LL | fn x<'a>(x: &'a mut i32){} - | ~~~~~~~ +LL - fn x<'a>(x: &mut 'a i32){} +LL + fn x<'a>(x: &'a mut i32){} + | error[E0178]: expected a path on the left-hand side of `+`, not `&mut 'a` --> $DIR/issue-73568-lifetime-after-mut.rs:14:13 @@ -32,8 +33,9 @@ LL | mac!('a); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) help: place the lifetime before `mut` | -LL | fn w<$lt>(w: &$lt mut i32) {} - | ~~~~~~~~ +LL - fn w<$lt>(w: &mut $lt i32) {} +LL + fn w<$lt>(w: &$lt mut i32) {} + | error[E0423]: expected value, found trait `Send` --> $DIR/issue-73568-lifetime-after-mut.rs:17:28 diff --git a/tests/ui/parser/issues/issue-84117.stderr b/tests/ui/parser/issues/issue-84117.stderr index 9f603b84434bb..e358bc4a2fb97 100644 --- a/tests/ui/parser/issues/issue-84117.stderr +++ b/tests/ui/parser/issues/issue-84117.stderr @@ -12,8 +12,9 @@ LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str>, } | + help: use `=` if you meant to assign | -LL | let outer_local:e_outer<&str, { let inner_local =e_inner<&str, } - | ~ +LL - let outer_local:e_outer<&str, { let inner_local:e_inner<&str, } +LL + let outer_local:e_outer<&str, { let inner_local =e_inner<&str, } + | error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,` --> $DIR/issue-84117.rs:2:65 @@ -36,8 +37,9 @@ LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }> | + help: use `=` if you meant to assign | -LL | let outer_local =e_outer<&str, { let inner_local:e_inner<&str, } - | ~ +LL - let outer_local:e_outer<&str, { let inner_local:e_inner<&str, } +LL + let outer_local =e_outer<&str, { let inner_local:e_inner<&str, } + | error: expected one of `>`, a const expression, lifetime, or type, found `}` --> $DIR/issue-84117.rs:2:67 @@ -54,8 +56,9 @@ LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str>, } | + help: use `=` if you meant to assign | -LL | let outer_local:e_outer<&str, { let inner_local =e_inner<&str, } - | ~ +LL - let outer_local:e_outer<&str, { let inner_local:e_inner<&str, } +LL + let outer_local:e_outer<&str, { let inner_local =e_inner<&str, } + | error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,` --> $DIR/issue-84117.rs:2:65 diff --git a/tests/ui/parser/issues/issue-84148-1.stderr b/tests/ui/parser/issues/issue-84148-1.stderr index 9261067c22158..ebe9807dfe362 100644 --- a/tests/ui/parser/issues/issue-84148-1.stderr +++ b/tests/ui/parser/issues/issue-84148-1.stderr @@ -6,8 +6,9 @@ LL | fn f(t:for<>t?) | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | -LL | fn f(t:Optiont>) - | +++++++ ~ +LL - fn f(t:for<>t?) +LL + fn f(t:Optiont>) + | error: expected one of `->`, `where`, or `{`, found `` --> $DIR/issue-84148-1.rs:1:15 diff --git a/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr b/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr index b6e24faf5dabb..fa84836894599 100644 --- a/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr +++ b/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr @@ -8,8 +8,9 @@ LL | Foo:Bar => {} | help: maybe write a path separator here | -LL | Foo::Bar => {} - | ~~ +LL - Foo:Bar => {} +LL + Foo::Bar => {} + | error: expected one of `!`, `(`, `...`, `..=`, `..`, `::`, `{`, or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:23:17 @@ -21,8 +22,9 @@ LL | qux::Foo:Bar => {} | help: maybe write a path separator here | -LL | qux::Foo::Bar => {} - | ~~ +LL - qux::Foo:Bar => {} +LL + qux::Foo::Bar => {} + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:29:12 @@ -34,8 +36,9 @@ LL | qux:Foo::Baz => {} | help: maybe write a path separator here | -LL | qux::Foo::Baz => {} - | ~~ +LL - qux:Foo::Baz => {} +LL + qux::Foo::Baz => {} + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:35:12 @@ -47,8 +50,9 @@ LL | qux: Foo::Baz if true => {} | help: maybe write a path separator here | -LL | qux::Foo::Baz if true => {} - | ~~ +LL - qux: Foo::Baz if true => {} +LL + qux::Foo::Baz if true => {} + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:40:15 @@ -60,8 +64,9 @@ LL | if let Foo:Bar = f() { | help: maybe write a path separator here | -LL | if let Foo::Bar = f() { - | ~~ +LL - if let Foo:Bar = f() { +LL + if let Foo::Bar = f() { + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:49:16 @@ -73,8 +78,9 @@ LL | ref qux: Foo::Baz => {} | help: maybe write a path separator here | -LL | ref qux::Foo::Baz => {} - | ~~ +LL - ref qux: Foo::Baz => {} +LL + ref qux::Foo::Baz => {} + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:58:16 @@ -86,8 +92,9 @@ LL | mut qux: Foo::Baz => {} | help: maybe write a path separator here | -LL | mut qux::Foo::Baz => {} - | ~~ +LL - mut qux: Foo::Baz => {} +LL + mut qux::Foo::Baz => {} + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:69:12 @@ -99,8 +106,9 @@ LL | Foo:Bar::Baz => {} | help: maybe write a path separator here | -LL | Foo::Bar::Baz => {} - | ~~ +LL - Foo:Bar::Baz => {} +LL + Foo::Bar::Baz => {} + | error: expected one of `@` or `|`, found `:` --> $DIR/issue-87086-colon-path-sep.rs:75:12 @@ -112,8 +120,9 @@ LL | Foo:Bar => {} | help: maybe write a path separator here | -LL | Foo::Bar => {} - | ~~ +LL - Foo:Bar => {} +LL + Foo::Bar => {} + | warning: irrefutable `if let` pattern --> $DIR/issue-87086-colon-path-sep.rs:40:8 diff --git a/tests/ui/parser/issues/issue-90993.stderr b/tests/ui/parser/issues/issue-90993.stderr index a18e93f1f1a98..e9ecc59ec4935 100644 --- a/tests/ui/parser/issues/issue-90993.stderr +++ b/tests/ui/parser/issues/issue-90993.stderr @@ -6,12 +6,14 @@ LL | ...=. | help: use `..` for an exclusive range | -LL | ..=. - | ~~ +LL - ...=. +LL + ..=. + | help: or `..=` for an inclusive range | -LL | ..==. - | ~~~ +LL - ...=. +LL + ..==. + | error: unexpected `=` after inclusive range --> $DIR/issue-90993.rs:2:5 @@ -22,8 +24,9 @@ LL | ...=. = note: inclusive ranges end with a single equals sign (`..=`) help: use `..=` instead | -LL | ..=. - | ~~~ +LL - ...=. +LL + ..=. + | error: expected one of `-`, `;`, `}`, or path, found `.` --> $DIR/issue-90993.rs:2:9 diff --git a/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr index c98b8fa1f1eeb..a4e0efcaeb0db 100644 --- a/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr +++ b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr @@ -6,8 +6,9 @@ LL | pub enum struct Range { | help: replace `enum struct` with | -LL | pub enum Range { - | ~~~~ +LL - pub enum struct Range { +LL + pub enum Range { + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr index 1ccf44a350d9e..73043de529029 100644 --- a/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr +++ b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr @@ -6,8 +6,9 @@ LL | const let _FOO: i32 = 123; | help: remove `let` | -LL | const _FOO: i32 = 123; - | ~~~~~ +LL - const let _FOO: i32 = 123; +LL + const _FOO: i32 = 123; + | error: `const` and `let` are mutually exclusive --> $DIR/issue-99910-const-let-mutually-exclusive.rs:6:5 @@ -17,8 +18,9 @@ LL | let const _BAR: i32 = 123; | help: remove `let` | -LL | const _BAR: i32 = 123; - | ~~~~~ +LL - let const _BAR: i32 = 123; +LL + const _BAR: i32 = 123; + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr b/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr index 2df5cca24f06c..997d080f1deed 100644 --- a/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr +++ b/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr @@ -17,8 +17,9 @@ LL | _ => { let _: u16 = 2u8; } | help: change the type of the numeric literal from `u8` to `u16` | -LL | _ => { let _: u16 = 2u16; } - | ~~~ +LL - _ => { let _: u16 = 2u8; } +LL + _ => { let _: u16 = 2u16; } + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/item-kw-case-mismatch.stderr b/tests/ui/parser/item-kw-case-mismatch.stderr index 0abc59e064a00..992e1f42d9862 100644 --- a/tests/ui/parser/item-kw-case-mismatch.stderr +++ b/tests/ui/parser/item-kw-case-mismatch.stderr @@ -6,8 +6,9 @@ LL | Use std::ptr::read; | help: write it in the correct case (notice the capitalization difference) | -LL | use std::ptr::read; - | ~~~ +LL - Use std::ptr::read; +LL + use std::ptr::read; + | error: keyword `use` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:8:1 @@ -17,8 +18,9 @@ LL | USE std::ptr::write; | help: write it in the correct case | -LL | use std::ptr::write; - | ~~~ +LL - USE std::ptr::write; +LL + use std::ptr::write; + | error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:10:7 @@ -28,8 +30,9 @@ LL | async Fn _a() {} | help: write it in the correct case (notice the capitalization difference) | -LL | async fn _a() {} - | ~~ +LL - async Fn _a() {} +LL + async fn _a() {} + | error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:13:1 @@ -39,8 +42,9 @@ LL | Fn _b() {} | help: write it in the correct case (notice the capitalization difference) | -LL | fn _b() {} - | ~~ +LL - Fn _b() {} +LL + fn _b() {} + | error: keyword `async` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:16:1 @@ -50,8 +54,9 @@ LL | aSYNC fN _c() {} | help: write it in the correct case | -LL | async fN _c() {} - | ~~~~~ +LL - aSYNC fN _c() {} +LL + async fN _c() {} + | error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:16:7 @@ -61,8 +66,9 @@ LL | aSYNC fN _c() {} | help: write it in the correct case | -LL | aSYNC fn _c() {} - | ~~ +LL - aSYNC fN _c() {} +LL + aSYNC fn _c() {} + | error: keyword `async` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:20:1 @@ -72,8 +78,9 @@ LL | Async fn _d() {} | help: write it in the correct case | -LL | async fn _d() {} - | ~~~~~ +LL - Async fn _d() {} +LL + async fn _d() {} + | error: keyword `const` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:23:1 @@ -83,8 +90,9 @@ LL | CONST UNSAFE FN _e() {} | help: write it in the correct case | -LL | const UNSAFE FN _e() {} - | ~~~~~ +LL - CONST UNSAFE FN _e() {} +LL + const UNSAFE FN _e() {} + | error: keyword `unsafe` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:23:7 @@ -94,8 +102,9 @@ LL | CONST UNSAFE FN _e() {} | help: write it in the correct case | -LL | CONST unsafe FN _e() {} - | ~~~~~~ +LL - CONST UNSAFE FN _e() {} +LL + CONST unsafe FN _e() {} + | error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:23:14 @@ -105,8 +114,9 @@ LL | CONST UNSAFE FN _e() {} | help: write it in the correct case | -LL | CONST UNSAFE fn _e() {} - | ~~ +LL - CONST UNSAFE FN _e() {} +LL + CONST UNSAFE fn _e() {} + | error: keyword `unsafe` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:28:1 @@ -116,8 +126,9 @@ LL | unSAFE EXTern fn _f() {} | help: write it in the correct case | -LL | unsafe EXTern fn _f() {} - | ~~~~~~ +LL - unSAFE EXTern fn _f() {} +LL + unsafe EXTern fn _f() {} + | error: keyword `extern` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:28:8 @@ -127,8 +138,9 @@ LL | unSAFE EXTern fn _f() {} | help: write it in the correct case | -LL | unSAFE extern fn _f() {} - | ~~~~~~ +LL - unSAFE EXTern fn _f() {} +LL + unSAFE extern fn _f() {} + | error: keyword `extern` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:32:1 @@ -138,8 +150,9 @@ LL | EXTERN "C" FN _g() {} | help: write it in the correct case | -LL | extern "C" FN _g() {} - | ~~~~~~ +LL - EXTERN "C" FN _g() {} +LL + extern "C" FN _g() {} + | error: keyword `fn` is written in the wrong case --> $DIR/item-kw-case-mismatch.rs:32:12 @@ -149,8 +162,9 @@ LL | EXTERN "C" FN _g() {} | help: write it in the correct case | -LL | EXTERN "C" fn _g() {} - | ~~ +LL - EXTERN "C" FN _g() {} +LL + EXTERN "C" fn _g() {} + | error: aborting due to 14 previous errors diff --git a/tests/ui/parser/kw-in-trait-bounds.stderr b/tests/ui/parser/kw-in-trait-bounds.stderr index 3c54e03195031..1892d0b62265a 100644 --- a/tests/ui/parser/kw-in-trait-bounds.stderr +++ b/tests/ui/parser/kw-in-trait-bounds.stderr @@ -6,8 +6,9 @@ LL | fn _f(_: impl fn(), _: &dyn fn()) | help: use `Fn` to refer to the trait (notice the capitalization difference) | -LL | fn _f(_: impl fn(), _: &dyn fn()) - | ~~ +LL - fn _f(_: impl fn(), _: &dyn fn()) +LL + fn _f(_: impl fn(), _: &dyn fn()) + | error: expected identifier, found keyword `fn` --> $DIR/kw-in-trait-bounds.rs:3:27 @@ -17,8 +18,9 @@ LL | fn _f(_: impl fn(), _: &dyn fn()) | help: use `Fn` to refer to the trait (notice the capitalization difference) | -LL | fn _f(_: impl Fn(), _: &dyn fn()) - | ~~ +LL - fn _f(_: impl fn(), _: &dyn fn()) +LL + fn _f(_: impl Fn(), _: &dyn fn()) + | error: expected identifier, found keyword `fn` --> $DIR/kw-in-trait-bounds.rs:3:41 @@ -28,8 +30,9 @@ LL | fn _f(_: impl fn(), _: &dyn fn()) | help: use `Fn` to refer to the trait (notice the capitalization difference) | -LL | fn _f(_: impl fn(), _: &dyn Fn()) - | ~~ +LL - fn _f(_: impl fn(), _: &dyn fn()) +LL + fn _f(_: impl fn(), _: &dyn Fn()) + | error: expected identifier, found keyword `fn` --> $DIR/kw-in-trait-bounds.rs:11:4 @@ -39,8 +42,9 @@ LL | G: fn(), | help: use `Fn` to refer to the trait (notice the capitalization difference) | -LL | G: Fn(), - | ~~ +LL - G: fn(), +LL + G: Fn(), + | error: expected identifier, found keyword `struct` --> $DIR/kw-in-trait-bounds.rs:16:10 diff --git a/tests/ui/parser/lifetime-in-pattern.stderr b/tests/ui/parser/lifetime-in-pattern.stderr index 55f9e56a42923..ffda28b202bda 100644 --- a/tests/ui/parser/lifetime-in-pattern.stderr +++ b/tests/ui/parser/lifetime-in-pattern.stderr @@ -23,8 +23,9 @@ LL | fn test(self: &'a str) { | +++++ help: if this is a parameter name, give it a type | -LL | fn test(str: &TypeName) { - | ~~~~~~~~~~~~~~ +LL - fn test(&'a str) { +LL + fn test(str: &TypeName) { + | help: if this is a type, explicitly ignore the parameter name | LL | fn test(_: &'a str) { diff --git a/tests/ui/parser/lifetime-semicolon.stderr b/tests/ui/parser/lifetime-semicolon.stderr index 4f8e2835e085b..f0e42c36c5a6a 100644 --- a/tests/ui/parser/lifetime-semicolon.stderr +++ b/tests/ui/parser/lifetime-semicolon.stderr @@ -6,8 +6,9 @@ LL | fn foo<'a, 'b>(_x: &mut Foo<'a; 'b>) {} | help: use a comma to separate type parameters | -LL | fn foo<'a, 'b>(_x: &mut Foo<'a, 'b>) {} - | ~ +LL - fn foo<'a, 'b>(_x: &mut Foo<'a; 'b>) {} +LL + fn foo<'a, 'b>(_x: &mut Foo<'a, 'b>) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/macros-no-semicolon-items.stderr b/tests/ui/parser/macros-no-semicolon-items.stderr index 6d2431c4aec47..07fa2439df504 100644 --- a/tests/ui/parser/macros-no-semicolon-items.stderr +++ b/tests/ui/parser/macros-no-semicolon-items.stderr @@ -6,8 +6,9 @@ LL | macro_rules! foo() | help: change the delimiters to curly braces | -LL | macro_rules! foo{} - | ~~ +LL - macro_rules! foo() +LL + macro_rules! foo{} + | help: add a semicolon | LL | macro_rules! foo(); diff --git a/tests/ui/parser/match-arm-without-body.stderr b/tests/ui/parser/match-arm-without-body.stderr index 53cf3480dbf94..9df8485972f33 100644 --- a/tests/ui/parser/match-arm-without-body.stderr +++ b/tests/ui/parser/match-arm-without-body.stderr @@ -18,7 +18,8 @@ LL | (Some(_),) | + + help: ...or a vertical bar to match on multiple alternatives | -LL | Some(_) | +LL - Some(_), +LL + Some(_) | | error: unexpected `,` in pattern diff --git a/tests/ui/parser/match-arm-without-braces.stderr b/tests/ui/parser/match-arm-without-braces.stderr index 4a4a154d86091..70cbdcfde0b5f 100644 --- a/tests/ui/parser/match-arm-without-braces.stderr +++ b/tests/ui/parser/match-arm-without-braces.stderr @@ -8,8 +8,9 @@ LL | Some(Val::Foo) => 3; | help: replace `;` with `,` to end a `match` arm expression | -LL | Some(Val::Foo) => 3, - | ~ +LL - Some(Val::Foo) => 3; +LL + Some(Val::Foo) => 3, + | error: `match` arm body without braces --> $DIR/match-arm-without-braces.rs:31:11 diff --git a/tests/ui/parser/missing-fn-issue-65381-2.stderr b/tests/ui/parser/missing-fn-issue-65381-2.stderr index e13d395d70d7f..ba2cf497df23e 100644 --- a/tests/ui/parser/missing-fn-issue-65381-2.stderr +++ b/tests/ui/parser/missing-fn-issue-65381-2.stderr @@ -6,8 +6,9 @@ LL | main(); | help: if you meant to call a macro, try | -LL | main!(); - | ~~~~~ +LL - main(); +LL + main!(); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/mut-patterns.stderr b/tests/ui/parser/mut-patterns.stderr index f4f11b88d3615..7979b7c2dcdc5 100644 --- a/tests/ui/parser/mut-patterns.stderr +++ b/tests/ui/parser/mut-patterns.stderr @@ -33,8 +33,9 @@ LL | let mut (x @ y) = 0; = note: `mut` may be followed by `variable` and `variable @ pattern` help: add `mut` to each binding | -LL | let (mut x @ mut y) = 0; - | ~~~~~~~~~~~~~~~ +LL - let mut (x @ y) = 0; +LL + let (mut x @ mut y) = 0; + | error: `mut` on a binding may not be repeated --> $DIR/mut-patterns.rs:14:13 @@ -57,8 +58,9 @@ LL | let mut Foo { x: x } = Foo { x: 3 }; = note: `mut` may be followed by `variable` and `variable @ pattern` help: add `mut` to each binding | -LL | let Foo { x: mut x } = Foo { x: 3 }; - | ~~~~~~~~~~~~~~~~ +LL - let mut Foo { x: x } = Foo { x: 3 }; +LL + let Foo { x: mut x } = Foo { x: 3 }; + | error: `mut` must be attached to each individual binding --> $DIR/mut-patterns.rs:23:9 @@ -69,8 +71,9 @@ LL | let mut Foo { x } = Foo { x: 3 }; = note: `mut` may be followed by `variable` and `variable @ pattern` help: add `mut` to each binding | -LL | let Foo { mut x } = Foo { x: 3 }; - | ~~~~~~~~~~~~~ +LL - let mut Foo { x } = Foo { x: 3 }; +LL + let Foo { mut x } = Foo { x: 3 }; + | error: `mut` on a binding may not be repeated --> $DIR/mut-patterns.rs:28:13 @@ -139,8 +142,9 @@ LL | let mut W(mut a, W(b, W(ref c, W(d, B { box f })))) = note: `mut` may be followed by `variable` and `variable @ pattern` help: add `mut` to each binding | -LL | let W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f })))) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let mut W(mut a, W(b, W(ref c, W(d, B { box f })))) +LL + let W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f })))) + | error: expected identifier, found `x` --> $DIR/mut-patterns.rs:44:21 diff --git a/tests/ui/parser/not-a-pred.stderr b/tests/ui/parser/not-a-pred.stderr index 6f6a332cb8155..9fedd208e1afe 100644 --- a/tests/ui/parser/not-a-pred.stderr +++ b/tests/ui/parser/not-a-pred.stderr @@ -6,8 +6,9 @@ LL | fn f(a: isize, b: isize) : lt(a, b) { } | help: use `->` instead | -LL | fn f(a: isize, b: isize) -> lt(a, b) { } - | ~~ +LL - fn f(a: isize, b: isize) : lt(a, b) { } +LL + fn f(a: isize, b: isize) -> lt(a, b) { } + | error[E0573]: expected type, found function `lt` --> $DIR/not-a-pred.rs:1:28 diff --git a/tests/ui/parser/public-instead-of-pub-1.stderr b/tests/ui/parser/public-instead-of-pub-1.stderr index 3fbe8d0b164e8..5695624d3b6aa 100644 --- a/tests/ui/parser/public-instead-of-pub-1.stderr +++ b/tests/ui/parser/public-instead-of-pub-1.stderr @@ -6,8 +6,9 @@ LL | public enum Test { | help: write `pub` instead of `public` to make the item public | -LL | pub enum Test { - | ~~~ +LL - public enum Test { +LL + pub enum Test { + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/public-instead-of-pub-3.stderr b/tests/ui/parser/public-instead-of-pub-3.stderr index b9b924e670a46..856bdf185704d 100644 --- a/tests/ui/parser/public-instead-of-pub-3.stderr +++ b/tests/ui/parser/public-instead-of-pub-3.stderr @@ -6,8 +6,9 @@ LL | public const X: i32 = 123; | help: write `pub` instead of `public` to make the item public | -LL | pub const X: i32 = 123; - | ~~~ +LL - public const X: i32 = 123; +LL + pub const X: i32 = 123; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/public-instead-of-pub.stderr b/tests/ui/parser/public-instead-of-pub.stderr index c98f8a9914e62..29a208cd4847f 100644 --- a/tests/ui/parser/public-instead-of-pub.stderr +++ b/tests/ui/parser/public-instead-of-pub.stderr @@ -6,8 +6,9 @@ LL | public struct X; | help: write `pub` instead of `public` to make the item public | -LL | pub struct X; - | ~~~ +LL - public struct X; +LL + pub struct X; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/range-inclusive-extra-equals.stderr b/tests/ui/parser/range-inclusive-extra-equals.stderr index a573cdf950cdd..db18cef81b17e 100644 --- a/tests/ui/parser/range-inclusive-extra-equals.stderr +++ b/tests/ui/parser/range-inclusive-extra-equals.stderr @@ -7,8 +7,9 @@ LL | if let 1..==3 = 1 {} = note: inclusive ranges end with a single equals sign (`..=`) help: use `..=` instead | -LL | if let 1..=3 = 1 {} - | ~~~ +LL - if let 1..==3 = 1 {} +LL + if let 1..=3 = 1 {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/range_inclusive_dotdotdot.stderr b/tests/ui/parser/range_inclusive_dotdotdot.stderr index 2dc2c87eb7baa..069133a43a382 100644 --- a/tests/ui/parser/range_inclusive_dotdotdot.stderr +++ b/tests/ui/parser/range_inclusive_dotdotdot.stderr @@ -6,12 +6,14 @@ LL | return ...1; | help: use `..` for an exclusive range | -LL | return ..1; - | ~~ +LL - return ...1; +LL + return ..1; + | help: or `..=` for an inclusive range | -LL | return ..=1; - | ~~~ +LL - return ...1; +LL + return ..=1; + | error: unexpected token: `...` --> $DIR/range_inclusive_dotdotdot.rs:12:13 @@ -21,12 +23,14 @@ LL | let x = ...0; | help: use `..` for an exclusive range | -LL | let x = ..0; - | ~~ +LL - let x = ...0; +LL + let x = ..0; + | help: or `..=` for an inclusive range | -LL | let x = ..=0; - | ~~~ +LL - let x = ...0; +LL + let x = ..=0; + | error: unexpected token: `...` --> $DIR/range_inclusive_dotdotdot.rs:16:14 @@ -36,12 +40,14 @@ LL | let x = 5...5; | help: use `..` for an exclusive range | -LL | let x = 5..5; - | ~~ +LL - let x = 5...5; +LL + let x = 5..5; + | help: or `..=` for an inclusive range | -LL | let x = 5..=5; - | ~~~ +LL - let x = 5...5; +LL + let x = 5..=5; + | error: unexpected token: `...` --> $DIR/range_inclusive_dotdotdot.rs:20:15 @@ -51,12 +57,14 @@ LL | for _ in 0...1 {} | help: use `..` for an exclusive range | -LL | for _ in 0..1 {} - | ~~ +LL - for _ in 0...1 {} +LL + for _ in 0..1 {} + | help: or `..=` for an inclusive range | -LL | for _ in 0..=1 {} - | ~~~ +LL - for _ in 0...1 {} +LL + for _ in 0..=1 {} + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/recover/recover-assoc-lifetime-constraint.stderr b/tests/ui/parser/recover/recover-assoc-lifetime-constraint.stderr index 606b737e72314..d1c803863a2aa 100644 --- a/tests/ui/parser/recover/recover-assoc-lifetime-constraint.stderr +++ b/tests/ui/parser/recover/recover-assoc-lifetime-constraint.stderr @@ -10,8 +10,9 @@ LL | bar::(); = help: if you meant to specify a trait object, write `dyn /* Trait */ + 'a` help: you might have meant to write a bound here | -LL | bar::(); - | ~ +LL - bar::(); +LL + bar::(); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr b/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr index aee31d08fe0ec..4e1fcaf49368e 100644 --- a/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr +++ b/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr @@ -6,8 +6,9 @@ LL | fn foo(_: impl fn() -> i32) {} | help: use `Fn` to refer to the trait (notice the capitalization difference) | -LL | fn foo(_: impl Fn() -> i32) {} - | ~~ +LL - fn foo(_: impl fn() -> i32) {} +LL + fn foo(_: impl Fn() -> i32) {} + | error: expected identifier, found keyword `fn` --> $DIR/recover-fn-trait-from-fn-kw.rs:4:12 @@ -17,8 +18,9 @@ LL | fn foo2(_: T) {} | help: use `Fn` to refer to the trait (notice the capitalization difference) | -LL | fn foo2(_: T) {} - | ~~ +LL - fn foo2(_: T) {} +LL + fn foo2(_: T) {} + | error[E0308]: mismatched types --> $DIR/recover-fn-trait-from-fn-kw.rs:8:12 diff --git a/tests/ui/parser/recover/recover-for-loop-parens-around-head.stderr b/tests/ui/parser/recover/recover-for-loop-parens-around-head.stderr index beaa346e76c50..2bc7952def79b 100644 --- a/tests/ui/parser/recover/recover-for-loop-parens-around-head.stderr +++ b/tests/ui/parser/recover/recover-for-loop-parens-around-head.stderr @@ -18,8 +18,9 @@ LL | const _RECOVERY_WITNESS: u32 = 0u8; | help: change the type of the numeric literal from `u8` to `u32` | -LL | const _RECOVERY_WITNESS: u32 = 0u32; - | ~~~ +LL - const _RECOVERY_WITNESS: u32 = 0u8; +LL + const _RECOVERY_WITNESS: u32 = 0u32; + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/recover/recover-from-bad-variant.stderr b/tests/ui/parser/recover/recover-from-bad-variant.stderr index 04968bbdf999d..c637e02694e85 100644 --- a/tests/ui/parser/recover/recover-from-bad-variant.stderr +++ b/tests/ui/parser/recover/recover-from-bad-variant.stderr @@ -6,8 +6,9 @@ LL | let x = Enum::Foo(a: 3, b: 4); | help: if `Enum::Foo` is a struct, use braces as delimiters | -LL | let x = Enum::Foo { a: 3, b: 4 }; - | ~ ~ +LL - let x = Enum::Foo(a: 3, b: 4); +LL + let x = Enum::Foo { a: 3, b: 4 }; + | help: if `Enum::Foo` is a function, use the arguments directly | LL - let x = Enum::Foo(a: 3, b: 4); @@ -28,8 +29,9 @@ LL | Enum::Bar { a, b } => {} | help: use the tuple variant pattern syntax instead | -LL | Enum::Bar(a, b) => {} - | ~~~~~~ +LL - Enum::Bar { a, b } => {} +LL + Enum::Bar(a, b) => {} + | error: aborting due to 3 previous errors diff --git a/tests/ui/parser/recover/recover-from-homoglyph.stderr b/tests/ui/parser/recover/recover-from-homoglyph.stderr index f11ca9fd58407..38ca0259366c3 100644 --- a/tests/ui/parser/recover/recover-from-homoglyph.stderr +++ b/tests/ui/parser/recover/recover-from-homoglyph.stderr @@ -6,8 +6,9 @@ LL | println!(""); | help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not | -LL | println!(""); - | ~ +LL - println!(""); +LL + println!(""); + | error[E0308]: mismatched types --> $DIR/recover-from-homoglyph.rs:3:20 diff --git a/tests/ui/parser/recover/recover-range-pats.stderr b/tests/ui/parser/recover/recover-range-pats.stderr index b8e91c2344aff..057c04a76a863 100644 --- a/tests/ui/parser/recover/recover-range-pats.stderr +++ b/tests/ui/parser/recover/recover-range-pats.stderr @@ -231,8 +231,9 @@ LL | if let ...3 = 0 {} | help: use `..=` instead | -LL | if let ..=3 = 0 {} - | ~~~ +LL - if let ...3 = 0 {} +LL + if let ..=3 = 0 {} + | error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:121:12 @@ -242,8 +243,9 @@ LL | if let ...Y = 0 {} | help: use `..=` instead | -LL | if let ..=Y = 0 {} - | ~~~ +LL - if let ...Y = 0 {} +LL + if let ..=Y = 0 {} + | error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:123:12 @@ -253,8 +255,9 @@ LL | if let ...true = 0 {} | help: use `..=` instead | -LL | if let ..=true = 0 {} - | ~~~ +LL - if let ...true = 0 {} +LL + if let ..=true = 0 {} + | error: float literals must have an integer part --> $DIR/recover-range-pats.rs:126:15 @@ -275,8 +278,9 @@ LL | if let ....3 = 0 {} | help: use `..=` instead | -LL | if let ..=.3 = 0 {} - | ~~~ +LL - if let ....3 = 0 {} +LL + if let ..=.3 = 0 {} + | error: range-to patterns with `...` are not allowed --> $DIR/recover-range-pats.rs:152:17 @@ -290,8 +294,9 @@ LL | mac!(0); = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) help: use `..=` instead | -LL | let ..=$e; - | ~~~ +LL - let ...$e; +LL + let ..=$e; + | error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:159:19 diff --git a/tests/ui/parser/recover/recover-ref-dyn-mut.stderr b/tests/ui/parser/recover/recover-ref-dyn-mut.stderr index bb0f0b0214c46..2f1649f01c9e3 100644 --- a/tests/ui/parser/recover/recover-ref-dyn-mut.stderr +++ b/tests/ui/parser/recover/recover-ref-dyn-mut.stderr @@ -6,8 +6,9 @@ LL | let r: &dyn mut Trait; | help: place `mut` before `dyn` | -LL | let r: &mut dyn Trait; - | ~~~~~~~~ +LL - let r: &dyn mut Trait; +LL + let r: &mut dyn Trait; + | error[E0405]: cannot find trait `Trait` in this scope --> $DIR/recover-ref-dyn-mut.rs:5:21 diff --git a/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr b/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr index 551b2e3ff09b0..15866211954bf 100644 --- a/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr +++ b/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr @@ -7,8 +7,9 @@ LL | let x = Tr; = note: type ascription syntax has been removed, see issue #101728 help: maybe write a path separator here | -LL | let x = Tr; - | ~~ +LL - let x = Tr; +LL + let x = Tr; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/recover/unicode-double-equals-recovery.stderr b/tests/ui/parser/recover/unicode-double-equals-recovery.stderr index 6e10dcce04a32..1931fd4ee45fc 100644 --- a/tests/ui/parser/recover/unicode-double-equals-recovery.stderr +++ b/tests/ui/parser/recover/unicode-double-equals-recovery.stderr @@ -6,8 +6,9 @@ LL | const A: usize ⩵ 2; | help: Unicode character '⩵' (Two Consecutive Equals Signs) looks like '==' (Double Equals Sign), but it is not | -LL | const A: usize == 2; - | ~~ +LL - const A: usize ⩵ 2; +LL + const A: usize == 2; + | error: unexpected `==` --> $DIR/unicode-double-equals-recovery.rs:1:16 @@ -17,8 +18,9 @@ LL | const A: usize ⩵ 2; | help: try using `=` instead | -LL | const A: usize = 2; - | ~ +LL - const A: usize ⩵ 2; +LL + const A: usize = 2; + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/removed-syntax/removed-syntax-box.stderr b/tests/ui/parser/removed-syntax/removed-syntax-box.stderr index 60c39fd37c434..04e84a10fad68 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-box.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-box.stderr @@ -6,8 +6,9 @@ LL | let _ = box (); | help: use `Box::new()` instead | -LL | let _ = Box::new(()); - | ~~~~~~~~~ + +LL - let _ = box (); +LL + let _ = Box::new(()); + | error: `box_syntax` has been removed --> $DIR/removed-syntax-box.rs:10:13 @@ -17,8 +18,9 @@ LL | let _ = box 1; | help: use `Box::new()` instead | -LL | let _ = Box::new(1); - | ~~~~~~~~~ + +LL - let _ = box 1; +LL + let _ = Box::new(1); + | error: `box_syntax` has been removed --> $DIR/removed-syntax-box.rs:11:13 @@ -28,8 +30,9 @@ LL | let _ = box T { a: 12, b: 18 }; | help: use `Box::new()` instead | -LL | let _ = Box::new(T { a: 12, b: 18 }); - | ~~~~~~~~~ + +LL - let _ = box T { a: 12, b: 18 }; +LL + let _ = Box::new(T { a: 12, b: 18 }); + | error: `box_syntax` has been removed --> $DIR/removed-syntax-box.rs:12:13 @@ -39,8 +42,9 @@ LL | let _ = box [5; 30]; | help: use `Box::new()` instead | -LL | let _ = Box::new([5; 30]); - | ~~~~~~~~~ + +LL - let _ = box [5; 30]; +LL + let _ = Box::new([5; 30]); + | error: `box_syntax` has been removed --> $DIR/removed-syntax-box.rs:13:22 @@ -50,8 +54,9 @@ LL | let _: Box<()> = box (); | help: use `Box::new()` instead | -LL | let _: Box<()> = Box::new(()); - | ~~~~~~~~~ + +LL - let _: Box<()> = box (); +LL + let _: Box<()> = Box::new(()); + | error: aborting due to 5 previous errors diff --git a/tests/ui/parser/suggest-assoc-const.stderr b/tests/ui/parser/suggest-assoc-const.stderr index 70ebeded31374..8cb304ced372f 100644 --- a/tests/ui/parser/suggest-assoc-const.stderr +++ b/tests/ui/parser/suggest-assoc-const.stderr @@ -6,8 +6,9 @@ LL | let _X: i32; | help: consider using `const` instead of `let` for associated const | -LL | const _X: i32; - | ~~~~~ +LL - let _X: i32; +LL + const _X: i32; + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr b/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr index 59716d69b50f9..477ec516d665a 100644 --- a/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr +++ b/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr @@ -6,8 +6,9 @@ LL | let x ➖= 1; | help: Unicode character '➖' (Heavy Minus Sign) looks like '-' (Minus/Hyphen), but it is not | -LL | let x -= 1; - | ~ +LL - let x ➖= 1; +LL + let x -= 1; + | error: can't reassign to an uninitialized variable --> $DIR/suggest-remove-compount-assign-let-ice.rs:13:11 diff --git a/tests/ui/parser/trailing-question-in-type.stderr b/tests/ui/parser/trailing-question-in-type.stderr index a3cd419c0c718..066c38d4c4fa4 100644 --- a/tests/ui/parser/trailing-question-in-type.stderr +++ b/tests/ui/parser/trailing-question-in-type.stderr @@ -6,8 +6,9 @@ LL | fn foo() -> i32? { | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | -LL | fn foo() -> Option { - | +++++++ ~ +LL - fn foo() -> i32? { +LL + fn foo() -> Option { + | error: invalid `?` in type --> $DIR/trailing-question-in-type.rs:4:15 @@ -17,8 +18,9 @@ LL | let x: i32? = Some(1); | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | -LL | let x: Option = Some(1); - | +++++++ ~ +LL - let x: i32? = Some(1); +LL + let x: Option = Some(1); + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/type-ascription-in-pattern.stderr b/tests/ui/parser/type-ascription-in-pattern.stderr index 0919075499368..d29c76baa7b53 100644 --- a/tests/ui/parser/type-ascription-in-pattern.stderr +++ b/tests/ui/parser/type-ascription-in-pattern.stderr @@ -8,8 +8,9 @@ LL | x: i32 => x, | help: maybe write a path separator here | -LL | x::i32 => x, - | ~~ +LL - x: i32 => x, +LL + x::i32 => x, + | error: expected one of `...`, `..=`, `..`, or `|`, found `:` --> $DIR/type-ascription-in-pattern.rs:12:11 @@ -37,8 +38,9 @@ LL | x: i32 => (), | help: maybe write a path separator here | -LL | x::i32 => (), - | ~~ +LL - x: i32 => (), +LL + x::i32 => (), + | error[E0308]: mismatched types --> $DIR/type-ascription-in-pattern.rs:3:19 diff --git a/tests/ui/parser/typod-const-in-const-param-def.stderr b/tests/ui/parser/typod-const-in-const-param-def.stderr index 80c0f1deae6fe..bf7168a015738 100644 --- a/tests/ui/parser/typod-const-in-const-param-def.stderr +++ b/tests/ui/parser/typod-const-in-const-param-def.stderr @@ -6,8 +6,9 @@ LL | pub fn foo() {} | help: use the `const` keyword (notice the capitalization difference) | -LL | pub fn foo() {} - | ~~~~~ +LL - pub fn foo() {} +LL + pub fn foo() {} + | error: `const` keyword was mistyped as `Const` --> $DIR/typod-const-in-const-param-def.rs:7:12 @@ -17,8 +18,9 @@ LL | pub fn baz() {} | help: use the `const` keyword (notice the capitalization difference) | -LL | pub fn baz() {} - | ~~~~~ +LL - pub fn baz() {} +LL + pub fn baz() {} + | error: `const` keyword was mistyped as `Const` --> $DIR/typod-const-in-const-param-def.rs:10:15 @@ -28,8 +30,9 @@ LL | pub fn qux() {} | help: use the `const` keyword (notice the capitalization difference) | -LL | pub fn qux() {} - | ~~~~~ +LL - pub fn qux() {} +LL + pub fn qux() {} + | error: `const` keyword was mistyped as `Const` --> $DIR/typod-const-in-const-param-def.rs:13:16 @@ -39,8 +42,9 @@ LL | pub fn quux() {} | help: use the `const` keyword (notice the capitalization difference) | -LL | pub fn quux() {} - | ~~~~~ +LL - pub fn quux() {} +LL + pub fn quux() {} + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/unicode-character-literal.stderr b/tests/ui/parser/unicode-character-literal.stderr index a1561e7f04b06..8ce2354f0b9c2 100644 --- a/tests/ui/parser/unicode-character-literal.stderr +++ b/tests/ui/parser/unicode-character-literal.stderr @@ -11,8 +11,9 @@ LL | let _spade = '♠️'; | ^ help: if you meant to write a string literal, use double quotes | -LL | let _spade = "♠️"; - | ~ ~ +LL - let _spade = '♠️'; +LL + let _spade = "♠️"; + | error: character literal may only contain one codepoint --> $DIR/unicode-character-literal.rs:12:14 @@ -27,8 +28,9 @@ LL | let _s = 'ṩ̂̊'; | ^ help: if you meant to write a string literal, use double quotes | -LL | let _s = "ṩ̂̊"; - | ~ ~ +LL - let _s = 'ṩ̂̊'; +LL + let _s = "ṩ̂̊"; + | error: character literal may only contain one codepoint --> $DIR/unicode-character-literal.rs:17:14 @@ -43,8 +45,9 @@ LL | let _a = 'Å'; | ^ help: consider using the normalized form `\u{c5}` of this character | -LL | let _a = 'Å'; - | ~ +LL - let _a = 'Å'; +LL + let _a = 'Å'; + | error: aborting due to 3 previous errors diff --git a/tests/ui/parser/unicode-chars.stderr b/tests/ui/parser/unicode-chars.stderr index 086de5ec0997e..a18a6ad10dd6d 100644 --- a/tests/ui/parser/unicode-chars.stderr +++ b/tests/ui/parser/unicode-chars.stderr @@ -6,8 +6,9 @@ LL | let y = 0; | help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not | -LL | let y = 0; - | ~ +LL - let y = 0; +LL + let y = 0; + | error: unknown start of token: \u{a0} --> $DIR/unicode-chars.rs:5:5 @@ -29,8 +30,9 @@ LL | let _ = 1 ⩵ 2; | help: Unicode character '⩵' (Two Consecutive Equals Signs) looks like '==' (Double Equals Sign), but it is not | -LL | let _ = 1 == 2; - | ~~ +LL - let _ = 1 ⩵ 2; +LL + let _ = 1 == 2; + | error: aborting due to 3 previous errors diff --git a/tests/ui/parser/unicode-control-codepoints.stderr b/tests/ui/parser/unicode-control-codepoints.stderr index 28de4ae72abbd..97a877ed0185f 100644 --- a/tests/ui/parser/unicode-control-codepoints.stderr +++ b/tests/ui/parser/unicode-control-codepoints.stderr @@ -22,8 +22,9 @@ LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | help: if you meant to use the UTF-8 encoding of '\u{202e}', use \xHH escapes | -LL | println!("{:?}", b"/*\xE2\x80\xAE } �if isAdmin� � begin admins only "); - | ~~~~~~~~~~~~ +LL - println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); +LL + println!("{:?}", b"/*\xE2\x80\xAE } �if isAdmin� � begin admins only "); + | error: non-ASCII character in byte string literal --> $DIR/unicode-control-codepoints.rs:16:30 @@ -33,8 +34,9 @@ LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | help: if you meant to use the UTF-8 encoding of '\u{2066}', use \xHH escapes | -LL | println!("{:?}", b"/*� } \xE2\x81\xA6if isAdmin� � begin admins only "); - | ~~~~~~~~~~~~ +LL - println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); +LL + println!("{:?}", b"/*� } \xE2\x81\xA6if isAdmin� � begin admins only "); + | error: non-ASCII character in byte string literal --> $DIR/unicode-control-codepoints.rs:16:41 @@ -44,8 +46,9 @@ LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | help: if you meant to use the UTF-8 encoding of '\u{2069}', use \xHH escapes | -LL | println!("{:?}", b"/*� } �if isAdmin\xE2\x81\xA9 � begin admins only "); - | ~~~~~~~~~~~~ +LL - println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); +LL + println!("{:?}", b"/*� } �if isAdmin\xE2\x81\xA9 � begin admins only "); + | error: non-ASCII character in byte string literal --> $DIR/unicode-control-codepoints.rs:16:43 @@ -55,8 +58,9 @@ LL | println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); | help: if you meant to use the UTF-8 encoding of '\u{2066}', use \xHH escapes | -LL | println!("{:?}", b"/*� } �if isAdmin� \xE2\x81\xA6 begin admins only "); - | ~~~~~~~~~~~~ +LL - println!("{:?}", b"/*� } �if isAdmin� � begin admins only "); +LL + println!("{:?}", b"/*� } �if isAdmin� \xE2\x81\xA6 begin admins only "); + | error: non-ASCII character in raw byte string literal --> $DIR/unicode-control-codepoints.rs:21:29 @@ -128,8 +132,9 @@ LL | println!("{:?}", "/*� } �if isAdmin� � begin admins only "); = help: if their presence wasn't intentional, you can remove them help: if you want to keep them but make them visible in your source code, you can escape them | -LL | println!("{:?}", "/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} begin admins only "); - | ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ +LL - println!("{:?}", "/*� } �if isAdmin� � begin admins only "); +LL + println!("{:?}", "/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} begin admins only "); + | error: unicode codepoint changing visible direction of text present in literal --> $DIR/unicode-control-codepoints.rs:14:22 @@ -147,8 +152,9 @@ LL | println!("{:?}", r##"/*� } �if isAdmin� � begin admins only "## = help: if their presence wasn't intentional, you can remove them help: if you want to keep them but make them visible in your source code, you can escape them | -LL | println!("{:?}", r##"/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} begin admins only "##); - | ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ +LL - println!("{:?}", r##"/*� } �if isAdmin� � begin admins only "##); +LL + println!("{:?}", r##"/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} begin admins only "##); + | error: unicode codepoint changing visible direction of text present in literal --> $DIR/unicode-control-codepoints.rs:26:22 @@ -163,8 +169,9 @@ LL | println!("{:?}", '�'); = help: if their presence wasn't intentional, you can remove them help: if you want to keep them but make them visible in your source code, you can escape them | -LL | println!("{:?}", '\u{202e}'); - | ~~~~~~~~ +LL - println!("{:?}", '�'); +LL + println!("{:?}", '\u{202e}'); + | error: unicode codepoint changing visible direction of text present in doc comment --> $DIR/unicode-control-codepoints.rs:33:1 diff --git a/tests/ui/parser/unicode-quote-chars.stderr b/tests/ui/parser/unicode-quote-chars.stderr index 092abeb53cd40..0ffb204d64af2 100644 --- a/tests/ui/parser/unicode-quote-chars.stderr +++ b/tests/ui/parser/unicode-quote-chars.stderr @@ -6,8 +6,9 @@ LL | println!(“hello world”); | help: Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '"' (Quotation Mark), but are not | -LL | println!("hello world"); - | ~~~~~~~~~~~~~ +LL - println!(“hello world”); +LL + println!("hello world"); + | error: unknown start of token: \u{201d} --> $DIR/unicode-quote-chars.rs:2:26 @@ -17,8 +18,9 @@ LL | println!(“hello world”); | help: Unicode character '”' (Right Double Quotation Mark) looks like '"' (Quotation Mark), but it is not | -LL | println!(“hello world"); - | ~ +LL - println!(“hello world”); +LL + println!(“hello world"); + | error: expected `,`, found `world` --> $DIR/unicode-quote-chars.rs:2:21 diff --git a/tests/ui/parser/unnecessary-let.stderr b/tests/ui/parser/unnecessary-let.stderr index c6ac0d562f82c..32d635cb5438f 100644 --- a/tests/ui/parser/unnecessary-let.stderr +++ b/tests/ui/parser/unnecessary-let.stderr @@ -18,8 +18,9 @@ LL | for let x of [1, 2, 3] {} | help: try using `in` here instead | -LL | for let x in [1, 2, 3] {} - | ~~ +LL - for let x of [1, 2, 3] {} +LL + for let x in [1, 2, 3] {} + | error: expected pattern, found `let` --> $DIR/unnecessary-let.rs:7:9 diff --git a/tests/ui/parser/use-colon-as-mod-sep.stderr b/tests/ui/parser/use-colon-as-mod-sep.stderr index 347b271df9900..f25a779f31f3b 100644 --- a/tests/ui/parser/use-colon-as-mod-sep.stderr +++ b/tests/ui/parser/use-colon-as-mod-sep.stderr @@ -7,8 +7,9 @@ LL | use std::process:Command; = note: import paths are delimited using `::` help: use double colon | -LL | use std::process::Command; - | ~~ +LL - use std::process:Command; +LL + use std::process::Command; + | error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:5:8 @@ -19,8 +20,9 @@ LL | use std:fs::File; = note: import paths are delimited using `::` help: use double colon | -LL | use std::fs::File; - | ~~ +LL - use std:fs::File; +LL + use std::fs::File; + | error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:7:8 @@ -31,8 +33,9 @@ LL | use std:collections:HashMap; = note: import paths are delimited using `::` help: use double colon | -LL | use std::collections:HashMap; - | ~~ +LL - use std:collections:HashMap; +LL + use std::collections:HashMap; + | error: expected `::`, found `:` --> $DIR/use-colon-as-mod-sep.rs:7:20 @@ -43,8 +46,9 @@ LL | use std:collections:HashMap; = note: import paths are delimited using `::` help: use double colon | -LL | use std:collections::HashMap; - | ~~ +LL - use std:collections:HashMap; +LL + use std:collections::HashMap; + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/utf16-be-without-bom.stderr b/tests/ui/parser/utf16-be-without-bom.stderr index 55ebf7aacd237..b6f4eec384fa2 100644 --- a/tests/ui/parser/utf16-be-without-bom.stderr +++ b/tests/ui/parser/utf16-be-without-bom.stderr @@ -110,8 +110,9 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ | help: consider removing the space to spell keyword `fn` | -LL | ␀fn␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ - | ~~ +LL - ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ +LL + ␀fn␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ + | error: aborting due to 14 previous errors diff --git a/tests/ui/parser/utf16-le-without-bom.stderr b/tests/ui/parser/utf16-le-without-bom.stderr index ad272a70f0627..7bd9304fadf31 100644 --- a/tests/ui/parser/utf16-le-without-bom.stderr +++ b/tests/ui/parser/utf16-le-without-bom.stderr @@ -110,8 +110,9 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ | help: consider removing the space to spell keyword `fn` | -LL | fn␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ - | ~~ +LL - f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ +LL + fn␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀ + | error: aborting due to 14 previous errors diff --git a/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr index 1599edd7a992d..0960af705ce4a 100644 --- a/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr +++ b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr @@ -9,8 +9,9 @@ LL | let _ @ a = 0; | help: switch the order | -LL | let a @ _ = 0; - | ~~~~~ +LL - let _ @ a = 0; +LL + let a @ _ = 0; + | error: pattern on wrong side of `@` --> $DIR/wild-before-at-syntactically-rejected.rs:10:9 @@ -23,8 +24,9 @@ LL | let _ @ ref a = 0; | help: switch the order | -LL | let ref a @ _ = 0; - | ~~~~~~~~~ +LL - let _ @ ref a = 0; +LL + let ref a @ _ = 0; + | error: pattern on wrong side of `@` --> $DIR/wild-before-at-syntactically-rejected.rs:12:9 @@ -37,8 +39,9 @@ LL | let _ @ ref mut a = 0; | help: switch the order | -LL | let ref mut a @ _ = 0; - | ~~~~~~~~~~~~~ +LL - let _ @ ref mut a = 0; +LL + let ref mut a @ _ = 0; + | error: left-hand side of `@` must be a binding --> $DIR/wild-before-at-syntactically-rejected.rs:14:9 diff --git a/tests/ui/pattern/incorrect-placement-of-pattern-modifiers.stderr b/tests/ui/pattern/incorrect-placement-of-pattern-modifiers.stderr index e80789253c0b1..31f8feb1a7101 100644 --- a/tests/ui/pattern/incorrect-placement-of-pattern-modifiers.stderr +++ b/tests/ui/pattern/incorrect-placement-of-pattern-modifiers.stderr @@ -50,8 +50,9 @@ LL | let _: usize = 3u8; | help: change the type of the numeric literal from `u8` to `usize` | -LL | let _: usize = 3usize; - | ~~~~~ +LL - let _: usize = 3u8; +LL + let _: usize = 3usize; + | error: aborting due to 4 previous errors diff --git a/tests/ui/pattern/issue-72574-1.stderr b/tests/ui/pattern/issue-72574-1.stderr index 653869a237d88..a9076c3dff634 100644 --- a/tests/ui/pattern/issue-72574-1.stderr +++ b/tests/ui/pattern/issue-72574-1.stderr @@ -7,8 +7,9 @@ LL | (_a, _x @ ..) => {} = help: remove this and bind each tuple field independently help: if you don't need to use the contents of _x, discard the tuple's remaining fields | -LL | (_a, ..) => {} - | ~~ +LL - (_a, _x @ ..) => {} +LL + (_a, ..) => {} + | error: `..` patterns are not allowed here --> $DIR/issue-72574-1.rs:4:19 diff --git a/tests/ui/pattern/issue-72574-2.stderr b/tests/ui/pattern/issue-72574-2.stderr index 05650f05cbf5b..8edc2634eed69 100644 --- a/tests/ui/pattern/issue-72574-2.stderr +++ b/tests/ui/pattern/issue-72574-2.stderr @@ -7,8 +7,9 @@ LL | Binder(_a, _x @ ..) => {} = help: remove this and bind each tuple field independently help: if you don't need to use the contents of _x, discard the tuple's remaining fields | -LL | Binder(_a, ..) => {} - | ~~ +LL - Binder(_a, _x @ ..) => {} +LL + Binder(_a, ..) => {} + | error: `..` patterns are not allowed here --> $DIR/issue-72574-2.rs:6:25 diff --git a/tests/ui/pattern/issue-74539.stderr b/tests/ui/pattern/issue-74539.stderr index 7443946c013f7..b6bd084ca4ba3 100644 --- a/tests/ui/pattern/issue-74539.stderr +++ b/tests/ui/pattern/issue-74539.stderr @@ -7,8 +7,9 @@ LL | E::A(x @ ..) => { = help: remove this and bind each tuple field independently help: if you don't need to use the contents of x, discard the tuple's remaining fields | -LL | E::A(..) => { - | ~~ +LL - E::A(x @ ..) => { +LL + E::A(..) => { + | error: `..` patterns are not allowed here --> $DIR/issue-74539.rs:8:18 diff --git a/tests/ui/pattern/issue-74702.stderr b/tests/ui/pattern/issue-74702.stderr index f2e2c8f021bad..5bb58de1c6e8b 100644 --- a/tests/ui/pattern/issue-74702.stderr +++ b/tests/ui/pattern/issue-74702.stderr @@ -7,8 +7,9 @@ LL | let (foo @ ..,) = (0, 0); = help: remove this and bind each tuple field independently help: if you don't need to use the contents of foo, discard the tuple's remaining fields | -LL | let (..,) = (0, 0); - | ~~ +LL - let (foo @ ..,) = (0, 0); +LL + let (..,) = (0, 0); + | error: `..` patterns are not allowed here --> $DIR/issue-74702.rs:2:16 diff --git a/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr index 622358126b09e..b61f8dbab0093 100644 --- a/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr +++ b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr @@ -7,8 +7,9 @@ LL | let mut &x = &0; = note: `mut` may be followed by `variable` and `variable @ pattern` help: add `mut` to each binding | -LL | let &(mut x) = &0; - | ~~~~~~~~ +LL - let mut &x = &0; +LL + let &(mut x) = &0; + | error: aborting due to 1 previous error diff --git a/tests/ui/pattern/pat-tuple-field-count-cross.stderr b/tests/ui/pattern/pat-tuple-field-count-cross.stderr index 0d7f2e4af69aa..c084ec0b532ed 100644 --- a/tests/ui/pattern/pat-tuple-field-count-cross.stderr +++ b/tests/ui/pattern/pat-tuple-field-count-cross.stderr @@ -25,12 +25,14 @@ LL | pub struct Z1(); | help: use this syntax instead | -LL | Z0 => {} - | ~~ +LL - Z0() => {} +LL + Z0 => {} + | help: a tuple struct with a similar name exists | -LL | Z1() => {} - | ~~ +LL - Z0() => {} +LL + Z1() => {} + | error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0` --> $DIR/pat-tuple-field-count-cross.rs:10:9 @@ -47,12 +49,14 @@ LL | pub struct Z1(); | help: use this syntax instead | -LL | Z0 => {} - | ~~ +LL - Z0(x) => {} +LL + Z0 => {} + | help: a tuple struct with a similar name exists | -LL | Z1(x) => {} - | ~~ +LL - Z0(x) => {} +LL + Z1(x) => {} + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-field-count-cross.rs:31:9 @@ -69,12 +73,14 @@ LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | help: use this syntax instead | -LL | E1::Z0 => {} - | ~~~~~~ +LL - E1::Z0() => {} +LL + E1::Z0 => {} + | help: a tuple variant with a similar name exists | -LL | E1::Z1() => {} - | ~~ +LL - E1::Z0() => {} +LL + E1::Z1() => {} + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-field-count-cross.rs:32:9 @@ -91,12 +97,14 @@ LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | help: use this syntax instead | -LL | E1::Z0 => {} - | ~~~~~~ +LL - E1::Z0(x) => {} +LL + E1::Z0 => {} + | help: a tuple variant with a similar name exists | -LL | E1::Z1(x) => {} - | ~~ +LL - E1::Z0(x) => {} +LL + E1::Z1(x) => {} + | error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1` --> $DIR/pat-tuple-field-count-cross.rs:35:9 @@ -113,12 +121,14 @@ LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | help: use the tuple variant pattern syntax instead | -LL | E1::Z1() => {} - | ~~~~~~~~ +LL - E1::Z1 => {} +LL + E1::Z1() => {} + | help: a unit variant with a similar name exists | -LL | E1::Z0 => {} - | ~~ +LL - E1::Z1 => {} +LL + E1::Z0 => {} + | error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 fields --> $DIR/pat-tuple-field-count-cross.rs:14:12 diff --git a/tests/ui/pattern/pat-tuple-overfield.stderr b/tests/ui/pattern/pat-tuple-overfield.stderr index 54d89e03101dc..4e8261cb15b84 100644 --- a/tests/ui/pattern/pat-tuple-overfield.stderr +++ b/tests/ui/pattern/pat-tuple-overfield.stderr @@ -23,12 +23,14 @@ LL | Z0() => {} | help: use this syntax instead | -LL | Z0 => {} - | ~~ +LL - Z0() => {} +LL + Z0 => {} + | help: a tuple struct with a similar name exists | -LL | Z1() => {} - | ~~ +LL - Z0() => {} +LL + Z1() => {} + | error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0` --> $DIR/pat-tuple-overfield.rs:53:9 @@ -43,12 +45,14 @@ LL | Z0(_) => {} | help: use this syntax instead | -LL | Z0 => {} - | ~~ +LL - Z0(_) => {} +LL + Z0 => {} + | help: a tuple struct with a similar name exists | -LL | Z1(_) => {} - | ~~ +LL - Z0(_) => {} +LL + Z1(_) => {} + | error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0` --> $DIR/pat-tuple-overfield.rs:54:9 @@ -63,12 +67,14 @@ LL | Z0(_, _) => {} | help: use this syntax instead | -LL | Z0 => {} - | ~~ +LL - Z0(_, _) => {} +LL + Z0 => {} + | help: a tuple struct with a similar name exists | -LL | Z1(_, _) => {} - | ~~ +LL - Z0(_, _) => {} +LL + Z1(_, _) => {} + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-overfield.rs:64:9 @@ -83,12 +89,14 @@ LL | E1::Z0() => {} | help: use this syntax instead | -LL | E1::Z0 => {} - | ~~~~~~ +LL - E1::Z0() => {} +LL + E1::Z0 => {} + | help: a tuple variant with a similar name exists | -LL | E1::Z1() => {} - | ~~ +LL - E1::Z0() => {} +LL + E1::Z1() => {} + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-overfield.rs:65:9 @@ -103,12 +111,14 @@ LL | E1::Z0(_) => {} | help: use this syntax instead | -LL | E1::Z0 => {} - | ~~~~~~ +LL - E1::Z0(_) => {} +LL + E1::Z0 => {} + | help: a tuple variant with a similar name exists | -LL | E1::Z1(_) => {} - | ~~ +LL - E1::Z0(_) => {} +LL + E1::Z1(_) => {} + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-overfield.rs:66:9 @@ -123,12 +133,14 @@ LL | E1::Z0(_, _) => {} | help: use this syntax instead | -LL | E1::Z0 => {} - | ~~~~~~ +LL - E1::Z0(_, _) => {} +LL + E1::Z0 => {} + | help: a tuple variant with a similar name exists | -LL | E1::Z1(_, _) => {} - | ~~ +LL - E1::Z0(_, _) => {} +LL + E1::Z1(_, _) => {} + | error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1` --> $DIR/pat-tuple-overfield.rs:69:9 @@ -143,12 +155,14 @@ LL | E1::Z1 => {} | help: use the tuple variant pattern syntax instead | -LL | E1::Z1() => {} - | ~~~~~~~~ +LL - E1::Z1 => {} +LL + E1::Z1() => {} + | help: a unit variant with a similar name exists | -LL | E1::Z0 => {} - | ~~ +LL - E1::Z1 => {} +LL + E1::Z0 => {} + | error[E0308]: mismatched types --> $DIR/pat-tuple-overfield.rs:19:9 diff --git a/tests/ui/pattern/pat-tuple-underfield.stderr b/tests/ui/pattern/pat-tuple-underfield.stderr index e75f9b38da566..c8620fe85c3c4 100644 --- a/tests/ui/pattern/pat-tuple-underfield.stderr +++ b/tests/ui/pattern/pat-tuple-underfield.stderr @@ -36,8 +36,9 @@ LL | S(_, _) => {} | +++ help: use `..` to ignore all fields | -LL | S(..) => {} - | ~~ +LL - S(_) => {} +LL + S(..) => {} + | error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields --> $DIR/pat-tuple-underfield.rs:20:9 @@ -104,8 +105,9 @@ LL | E::S(_, _) => {} | +++ help: use `..` to ignore all fields | -LL | E::S(..) => {} - | ~~ +LL - E::S(_) => {} +LL + E::S(..) => {} + | error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields --> $DIR/pat-tuple-underfield.rs:44:9 @@ -158,8 +160,9 @@ LL | Point4( a , _ , _, _) => {} | ++++++ help: use `..` to ignore the rest of the fields | -LL | Point4( a, ..) => {} - | ~~~~ +LL - Point4( a , _ ) => {} +LL + Point4( a, ..) => {} + | error: aborting due to 10 previous errors diff --git a/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr index e9c2fccaba284..a12b94176c076 100644 --- a/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr @@ -6,8 +6,9 @@ LL | b.make_ascii_uppercase(); | help: consider changing this to be mutable | -LL | let &(mut b) = a; - | ~~~~~ + +LL - let &b = a; +LL + let &(mut b) = a; + | error: aborting due to 1 previous error diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr index e93b8bbacccdd..68141af491068 100644 --- a/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr @@ -6,8 +6,9 @@ LL | mutate(&mut x); | help: consider changing this to be mutable | -LL | fn foo(&(mut x): &i32) { - | ~~~~~ + +LL - fn foo(&x: &i32) { +LL + fn foo(&(mut x): &i32) { + | error: aborting due to 1 previous error diff --git a/tests/ui/pattern/pattern-bad-ref-box-order.stderr b/tests/ui/pattern/pattern-bad-ref-box-order.stderr index a89d3ed21b629..6f47f704688ba 100644 --- a/tests/ui/pattern/pattern-bad-ref-box-order.stderr +++ b/tests/ui/pattern/pattern-bad-ref-box-order.stderr @@ -6,8 +6,9 @@ LL | Some(ref box _i) => {}, | help: swap them | -LL | Some(box ref _i) => {}, - | ~~~~~~~ +LL - Some(ref box _i) => {}, +LL + Some(box ref _i) => {}, + | error: aborting due to 1 previous error diff --git a/tests/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr index 10fcccb030162..bb5582dd873a7 100644 --- a/tests/ui/pattern/pattern-error-continue.stderr +++ b/tests/ui/pattern/pattern-error-continue.stderr @@ -12,12 +12,14 @@ LL | A::D(_) => (), | help: use this syntax instead | -LL | A::D => (), - | ~~~~ +LL - A::D(_) => (), +LL + A::D => (), + | help: a tuple variant with a similar name exists | -LL | A::B(_) => (), - | ~ +LL - A::D(_) => (), +LL + A::B(_) => (), + | error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields --> $DIR/pattern-error-continue.rs:17:14 diff --git a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr index 9d642b9245a26..37b2d96bb0194 100644 --- a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr +++ b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr @@ -6,8 +6,9 @@ LL | [_, ...tail] => println!("{tail}"), | help: use `..=` instead | -LL | [_, ..=tail] => println!("{tail}"), - | ~~~ +LL - [_, ...tail] => println!("{tail}"), +LL + [_, ..=tail] => println!("{tail}"), + | error[E0425]: cannot find value `rest` in this scope --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13 @@ -34,8 +35,9 @@ LL | [_, ..tail] => println!("{tail}"), | help: if you meant to collect the rest of the slice in `tail`, use the at operator | -LL | [_, tail @ ..] => println!("{tail}"), - | ~~~~~~~~~ +LL - [_, ..tail] => println!("{tail}"), +LL + [_, tail @ ..] => println!("{tail}"), + | error[E0425]: cannot find value `tail` in this scope --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:35 @@ -51,8 +53,9 @@ LL | [_, ...tail] => println!("{tail}"), | help: if you meant to collect the rest of the slice in `tail`, use the at operator | -LL | [_, tail @ ..] => println!("{tail}"), - | ~~~~~~~~~ +LL - [_, ...tail] => println!("{tail}"), +LL + [_, tail @ ..] => println!("{tail}"), + | error[E0425]: cannot find value `tail` in this scope --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:36 diff --git a/tests/ui/pattern/slice-pattern-refutable.stderr b/tests/ui/pattern/slice-pattern-refutable.stderr index df5b58d3e9c63..765dc1223ebd8 100644 --- a/tests/ui/pattern/slice-pattern-refutable.stderr +++ b/tests/ui/pattern/slice-pattern-refutable.stderr @@ -19,8 +19,9 @@ LL | if let [a, b, c] = Zeroes.into() { | help: try using a fully qualified path to specify the expected types | -LL | if let [a, b, c] = >::into(Zeroes) { - | ++++++++++++++++++++++++++ ~ +LL - if let [a, b, c] = Zeroes.into() { +LL + if let [a, b, c] = >::into(Zeroes) { + | error[E0282]: type annotations needed --> $DIR/slice-pattern-refutable.rs:28:31 @@ -32,8 +33,9 @@ LL | if let [a, b, c] = Zeroes.into() { | help: try using a fully qualified path to specify the expected types | -LL | if let [a, b, c] = >::into(Zeroes) { - | ++++++++++++++++++++++++++ ~ +LL - if let [a, b, c] = Zeroes.into() { +LL + if let [a, b, c] = >::into(Zeroes) { + | error: aborting due to 3 previous errors diff --git a/tests/ui/pattern/slice-patterns-ambiguity.stderr b/tests/ui/pattern/slice-patterns-ambiguity.stderr index 3ef99d0e2d1bb..a2db393b553e2 100644 --- a/tests/ui/pattern/slice-patterns-ambiguity.stderr +++ b/tests/ui/pattern/slice-patterns-ambiguity.stderr @@ -19,8 +19,9 @@ LL | if let &[a, b] = Zeroes.into() { | help: try using a fully qualified path to specify the expected types | -LL | if let &[a, b] = >::into(Zeroes) { - | +++++++++++++++++++++++++++ ~ +LL - if let &[a, b] = Zeroes.into() { +LL + if let &[a, b] = >::into(Zeroes) { + | error[E0282]: type annotations needed --> $DIR/slice-patterns-ambiguity.rs:39:29 @@ -32,8 +33,9 @@ LL | if let &[a, b] = Zeroes.into() { | help: try using a fully qualified path to specify the expected types | -LL | if let &[a, b] = >::into(Zeroes) { - | +++++++++++++++++++++++++++ ~ +LL - if let &[a, b] = Zeroes.into() { +LL + if let &[a, b] = >::into(Zeroes) { + | error: aborting due to 3 previous errors diff --git a/tests/ui/pattern/usefulness/doc-hidden-fields.stderr b/tests/ui/pattern/usefulness/doc-hidden-fields.stderr index f277bfbc884fb..2b7e993b17ecc 100644 --- a/tests/ui/pattern/usefulness/doc-hidden-fields.stderr +++ b/tests/ui/pattern/usefulness/doc-hidden-fields.stderr @@ -17,12 +17,14 @@ LL | let HiddenStruct { one } = HiddenStruct::default(); | help: include the missing field in the pattern and ignore the inaccessible fields | -LL | let HiddenStruct { one, two, .. } = HiddenStruct::default(); - | ~~~~~~~~~~~ +LL - let HiddenStruct { one } = HiddenStruct::default(); +LL + let HiddenStruct { one, two, .. } = HiddenStruct::default(); + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let HiddenStruct { one, .. } = HiddenStruct::default(); - | ~~~~~~ +LL - let HiddenStruct { one } = HiddenStruct::default(); +LL + let HiddenStruct { one, .. } = HiddenStruct::default(); + | error[E0027]: pattern does not mention field `two` --> $DIR/doc-hidden-fields.rs:21:9 @@ -32,12 +34,14 @@ LL | let HiddenStruct { one, hide } = HiddenStruct::default(); | help: include the missing field in the pattern | -LL | let HiddenStruct { one, hide, two } = HiddenStruct::default(); - | ~~~~~~~ +LL - let HiddenStruct { one, hide } = HiddenStruct::default(); +LL + let HiddenStruct { one, hide, two } = HiddenStruct::default(); + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let HiddenStruct { one, hide, .. } = HiddenStruct::default(); - | ~~~~~~ +LL - let HiddenStruct { one, hide } = HiddenStruct::default(); +LL + let HiddenStruct { one, hide, .. } = HiddenStruct::default(); + | error[E0027]: pattern does not mention field `im_hidden` --> $DIR/doc-hidden-fields.rs:24:9 @@ -47,12 +51,14 @@ LL | let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 }; | help: include the missing field in the pattern | -LL | let InCrate { a, b, im_hidden } = InCrate { a: 0, b: false, im_hidden: 0 }; - | ~~~~~~~~~~~~~ +LL - let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 }; +LL + let InCrate { a, b, im_hidden } = InCrate { a: 0, b: false, im_hidden: 0 }; + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let InCrate { a, b, .. } = InCrate { a: 0, b: false, im_hidden: 0 }; - | ~~~~~~ +LL - let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 }; +LL + let InCrate { a, b, .. } = InCrate { a: 0, b: false, im_hidden: 0 }; + | error: aborting due to 4 previous errors diff --git a/tests/ui/pattern/usefulness/stable-gated-fields.stderr b/tests/ui/pattern/usefulness/stable-gated-fields.stderr index cf98c51a2b41e..abbb381171636 100644 --- a/tests/ui/pattern/usefulness/stable-gated-fields.stderr +++ b/tests/ui/pattern/usefulness/stable-gated-fields.stderr @@ -6,12 +6,14 @@ LL | let UnstableStruct { stable } = UnstableStruct::default(); | help: include the missing field in the pattern and ignore the inaccessible fields | -LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); - | ~~~~~~~~~~~~~~~ +LL - let UnstableStruct { stable } = UnstableStruct::default(); +LL + let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let UnstableStruct { stable, .. } = UnstableStruct::default(); - | ~~~~~~ +LL - let UnstableStruct { stable } = UnstableStruct::default(); +LL + let UnstableStruct { stable, .. } = UnstableStruct::default(); + | error: pattern requires `..` due to inaccessible fields --> $DIR/stable-gated-fields.rs:11:9 diff --git a/tests/ui/pattern/usefulness/unstable-gated-fields.stderr b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr index e4f5fa06b3ff5..dfc2893159fd7 100644 --- a/tests/ui/pattern/usefulness/unstable-gated-fields.stderr +++ b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr @@ -6,12 +6,14 @@ LL | let UnstableStruct { stable, stable2, } = UnstableStruct::default(); | help: include the missing field in the pattern | -LL | let UnstableStruct { stable, stable2, unstable } = UnstableStruct::default(); - | ~~~~~~~~~~~~ +LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); +LL + let UnstableStruct { stable, stable2, unstable } = UnstableStruct::default(); + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); - | ~~~~~~ +LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); +LL + let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); + | error[E0027]: pattern does not mention field `stable2` --> $DIR/unstable-gated-fields.rs:13:9 @@ -21,12 +23,14 @@ LL | let UnstableStruct { stable, unstable, } = UnstableStruct::default(); | help: include the missing field in the pattern | -LL | let UnstableStruct { stable, unstable, stable2 } = UnstableStruct::default(); - | ~~~~~~~~~~~ +LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); +LL + let UnstableStruct { stable, unstable, stable2 } = UnstableStruct::default(); + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let UnstableStruct { stable, unstable, .. } = UnstableStruct::default(); - | ~~~~~~ +LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); +LL + let UnstableStruct { stable, unstable, .. } = UnstableStruct::default(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/pptypedef.stderr b/tests/ui/pptypedef.stderr index 08b90b365e326..96327cfcc653e 100644 --- a/tests/ui/pptypedef.stderr +++ b/tests/ui/pptypedef.stderr @@ -8,8 +8,9 @@ LL | let_in(3u32, |i| { assert!(i == 3i32); }); | help: change the type of the numeric literal from `i32` to `u32` | -LL | let_in(3u32, |i| { assert!(i == 3u32); }); - | ~~~ +LL - let_in(3u32, |i| { assert!(i == 3i32); }); +LL + let_in(3u32, |i| { assert!(i == 3u32); }); + | error[E0308]: mismatched types --> $DIR/pptypedef.rs:8:37 @@ -21,8 +22,9 @@ LL | let_in(3i32, |i| { assert!(i == 3u32); }); | help: change the type of the numeric literal from `u32` to `i32` | -LL | let_in(3i32, |i| { assert!(i == 3i32); }); - | ~~~ +LL - let_in(3i32, |i| { assert!(i == 3u32); }); +LL + let_in(3i32, |i| { assert!(i == 3i32); }); + | error: aborting due to 2 previous errors diff --git a/tests/ui/privacy/issue-75907.stderr b/tests/ui/privacy/issue-75907.stderr index 3121cc04478a4..8a6484979c009 100644 --- a/tests/ui/privacy/issue-75907.stderr +++ b/tests/ui/privacy/issue-75907.stderr @@ -13,8 +13,9 @@ LL | let Bar(x, y, Foo(z)) = make_bar(); | private field help: consider making the fields publicly accessible | -LL | pub(crate) struct Bar(pub u8, pub u8, pub Foo); - | ~~~ +++ +LL - pub(crate) struct Bar(pub u8, pub(in crate::foo) u8, Foo); +LL + pub(crate) struct Bar(pub u8, pub u8, pub Foo); + | error[E0532]: cannot match against a tuple struct which contains private fields --> $DIR/issue-75907.rs:15:19 diff --git a/tests/ui/privacy/privacy-in-paths.stderr b/tests/ui/privacy/privacy-in-paths.stderr index 9c3d5e97c62a3..e6ece35865d44 100644 --- a/tests/ui/privacy/privacy-in-paths.stderr +++ b/tests/ui/privacy/privacy-in-paths.stderr @@ -25,8 +25,9 @@ LL | mod bar { | ^^^^^^^ help: consider importing this struct through its public re-export instead | -LL | foo::S::f(); - | ~~~~~~ +LL - ::foo::bar::S::f(); +LL + foo::S::f(); + | error[E0603]: trait `T` is private --> $DIR/privacy-in-paths.rs:26:23 diff --git a/tests/ui/privacy/privacy-ns1.stderr b/tests/ui/privacy/privacy-ns1.stderr index 9710cc48637bc..3396330c993cf 100644 --- a/tests/ui/privacy/privacy-ns1.stderr +++ b/tests/ui/privacy/privacy-ns1.stderr @@ -9,8 +9,9 @@ LL | Bar(); | help: a unit struct with a similar name exists | -LL | Baz(); - | ~~~ +LL - Bar(); +LL + Baz(); + | help: consider importing this function instead | LL + use foo2::Bar; @@ -27,8 +28,9 @@ LL | Bar(); | help: a unit struct with a similar name exists | -LL | Baz(); - | ~~~ +LL - Bar(); +LL + Baz(); + | help: consider importing this function | LL + use foo2::Bar; @@ -45,8 +47,9 @@ LL | let _x: Box; | help: a struct with a similar name exists | -LL | let _x: Box; - | ~~~ +LL - let _x: Box; +LL + let _x: Box; + | help: consider importing this trait | LL + use foo1::Bar; diff --git a/tests/ui/privacy/privacy-ns2.stderr b/tests/ui/privacy/privacy-ns2.stderr index 75e735e1e6a28..ac98682b2b39e 100644 --- a/tests/ui/privacy/privacy-ns2.stderr +++ b/tests/ui/privacy/privacy-ns2.stderr @@ -20,8 +20,9 @@ LL | Bar(); | help: a unit struct with a similar name exists | -LL | Baz(); - | ~~~ +LL - Bar(); +LL + Baz(); + | help: consider importing this function instead | LL + use foo2::Bar; @@ -35,8 +36,9 @@ LL | let _x : Bar(); | help: use `=` if you meant to assign | -LL | let _x = Bar(); - | ~ +LL - let _x : Bar(); +LL + let _x = Bar(); + | help: consider importing this trait instead | LL + use foo1::Bar; diff --git a/tests/ui/privacy/privacy1.stderr b/tests/ui/privacy/privacy1.stderr index a3552e146a65a..cb7b858e54dc8 100644 --- a/tests/ui/privacy/privacy1.stderr +++ b/tests/ui/privacy/privacy1.stderr @@ -142,8 +142,9 @@ LL | mod baz { | ^^^^^^^ help: consider importing this function through its public re-export instead | -LL | bar::foo(); - | ~~~~~~~~ +LL - ::bar::baz::foo(); +LL + bar::foo(); + | error[E0603]: module `baz` is private --> $DIR/privacy1.rs:128:16 @@ -158,8 +159,9 @@ LL | mod baz { | ^^^^^^^ help: consider importing this function through its public re-export instead | -LL | bar::bar(); - | ~~~~~~~~ +LL - ::bar::baz::bar(); +LL + bar::bar(); + | error[E0603]: trait `B` is private --> $DIR/privacy1.rs:157:17 diff --git a/tests/ui/privacy/privacy5.stderr b/tests/ui/privacy/privacy5.stderr index ec3abe9b81629..8f28f629ba3ba 100644 --- a/tests/ui/privacy/privacy5.stderr +++ b/tests/ui/privacy/privacy5.stderr @@ -52,8 +52,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:56:12 @@ -261,8 +262,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:69:12 @@ -280,8 +282,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:70:12 @@ -299,8 +302,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:71:12 @@ -318,8 +322,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:72:18 @@ -337,8 +342,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:73:18 @@ -356,8 +362,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:74:18 @@ -375,8 +382,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:75:18 @@ -394,8 +402,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:83:17 @@ -451,8 +460,9 @@ LL | pub struct C(pub isize, isize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the fields publicly accessible | -LL | pub struct C(pub isize, pub isize); - | +++ +LL - pub struct C(pub isize, isize); +LL + pub struct C(pub isize, pub isize); + | error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:90:20 diff --git a/tests/ui/privacy/sealed-traits/re-exported-trait.stderr b/tests/ui/privacy/sealed-traits/re-exported-trait.stderr index 6e2f36e3f381d..368389af0b927 100644 --- a/tests/ui/privacy/sealed-traits/re-exported-trait.stderr +++ b/tests/ui/privacy/sealed-traits/re-exported-trait.stderr @@ -11,8 +11,9 @@ LL | mod b { | ^^^^^ help: consider importing this trait through its public re-export instead | -LL | impl a::Trait for S {} - | ~~~~~~~~ +LL - impl a::b::Trait for S {} +LL + impl a::Trait for S {} + | error: aborting due to 1 previous error diff --git a/tests/ui/privacy/suggest-box-new.stderr b/tests/ui/privacy/suggest-box-new.stderr index 8b01e8c3c10ef..a60c8e67acfb7 100644 --- a/tests/ui/privacy/suggest-box-new.stderr +++ b/tests/ui/privacy/suggest-box-new.stderr @@ -9,18 +9,23 @@ LL | let _ = std::collections::HashMap(); | help: you might have meant to use an associated function to build this type | -LL | let _ = std::collections::HashMap::new(); - | ~~~~~~~ -LL | let _ = std::collections::HashMap::with_capacity(_); - | ~~~~~~~~~~~~~~~~~~ -LL | let _ = std::collections::HashMap::with_hasher(_); - | ~~~~~~~~~~~~~~~~ -LL | let _ = std::collections::HashMap::with_capacity_and_hasher(_, _); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = std::collections::HashMap(); +LL + let _ = std::collections::HashMap::new(); + | +LL - let _ = std::collections::HashMap(); +LL + let _ = std::collections::HashMap::with_capacity(_); + | +LL - let _ = std::collections::HashMap(); +LL + let _ = std::collections::HashMap::with_hasher(_); + | +LL - let _ = std::collections::HashMap(); +LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _); + | help: consider using the `Default` trait | -LL | let _ = ::default(); - | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = std::collections::HashMap(); +LL + let _ = ::default(); + | error[E0423]: cannot initialize a tuple struct which contains private fields --> $DIR/suggest-box-new.rs:8:19 @@ -36,19 +41,36 @@ note: constructor is not visible here due to private fields = note: private field help: you might have meant to use an associated function to build this type | -LL | wtf: Some(Box::new(_)), - | ~~~~~~~~ -LL | wtf: Some(Box::new_uninit()), - | ~~~~~~~~~~~~~~ -LL | wtf: Some(Box::new_zeroed()), - | ~~~~~~~~~~~~~~ -LL | wtf: Some(Box::new_in(_, _)), - | ~~~~~~~~~~~~~~ +LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), +LL + wtf: Some(Box::new(_)), + | +LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), +LL + wtf: Some(Box::new_uninit()), + | +LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), +LL + wtf: Some(Box::new_zeroed()), + | +LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), +LL + wtf: Some(Box::new_in(_, _)), + | and 10 other candidates help: consider using the `Default` trait | -LL | wtf: Some(::default()), - | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - wtf: Some(Box(U { +LL + wtf: Some(::default()), + | error: cannot construct `HashMap<_, _, _>` with struct literal syntax due to private fields --> $DIR/suggest-box-new.rs:16:13 @@ -59,18 +81,23 @@ LL | let _ = std::collections::HashMap {}; = note: private field `base` that was not provided help: you might have meant to use an associated function to build this type | -LL | let _ = std::collections::HashMap::new(); - | ~~~~~~~ -LL | let _ = std::collections::HashMap::with_capacity(_); - | ~~~~~~~~~~~~~~~~~~ -LL | let _ = std::collections::HashMap::with_hasher(_); - | ~~~~~~~~~~~~~~~~ -LL | let _ = std::collections::HashMap::with_capacity_and_hasher(_, _); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = std::collections::HashMap {}; +LL + let _ = std::collections::HashMap::new(); + | +LL - let _ = std::collections::HashMap {}; +LL + let _ = std::collections::HashMap::with_capacity(_); + | +LL - let _ = std::collections::HashMap {}; +LL + let _ = std::collections::HashMap::with_hasher(_); + | +LL - let _ = std::collections::HashMap {}; +LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _); + | help: consider using the `Default` trait | -LL | let _ = ::default(); - | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = std::collections::HashMap {}; +LL + let _ = ::default(); + | error: cannot construct `Box<_, _>` with struct literal syntax due to private fields --> $DIR/suggest-box-new.rs:18:13 @@ -81,19 +108,24 @@ LL | let _ = Box {}; = note: private fields `0` and `1` that were not provided help: you might have meant to use an associated function to build this type | -LL | let _ = Box::new(_); - | ~~~~~~~~ -LL | let _ = Box::new_uninit(); - | ~~~~~~~~~~~~~~ -LL | let _ = Box::new_zeroed(); - | ~~~~~~~~~~~~~~ -LL | let _ = Box::new_in(_, _); - | ~~~~~~~~~~~~~~ +LL - let _ = Box {}; +LL + let _ = Box::new(_); + | +LL - let _ = Box {}; +LL + let _ = Box::new_uninit(); + | +LL - let _ = Box {}; +LL + let _ = Box::new_zeroed(); + | +LL - let _ = Box {}; +LL + let _ = Box::new_in(_, _); + | and 10 other candidates help: consider using the `Default` trait | -LL | let _ = ::default(); - | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = Box {}; +LL + let _ = ::default(); + | error: aborting due to 4 previous errors diff --git a/tests/ui/privacy/suggest-making-field-public.stderr b/tests/ui/privacy/suggest-making-field-public.stderr index e92e9aae310e3..3e52232dd59bf 100644 --- a/tests/ui/privacy/suggest-making-field-public.stderr +++ b/tests/ui/privacy/suggest-making-field-public.stderr @@ -14,8 +14,9 @@ LL | pub struct A(pub(self)String); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the field publicly accessible | -LL | pub struct A(pub String); - | ~~~ +LL - pub struct A(pub(self)String); +LL + pub struct A(pub String); + | error[E0423]: cannot initialize a tuple struct which contains private fields --> $DIR/suggest-making-field-public.rs:9:9 @@ -30,8 +31,9 @@ LL | pub struct A(pub(self)String); | ^^^^^^^^^^^^^^^ private field help: consider making the field publicly accessible | -LL | pub struct A(pub String); - | ~~~ +LL - pub struct A(pub(self)String); +LL + pub struct A(pub String); + | error: aborting due to 2 previous errors diff --git a/tests/ui/proc-macro/disappearing-resolution.stderr b/tests/ui/proc-macro/disappearing-resolution.stderr index e6d0868687e27..a3d6b123f6f9c 100644 --- a/tests/ui/proc-macro/disappearing-resolution.stderr +++ b/tests/ui/proc-macro/disappearing-resolution.stderr @@ -22,8 +22,9 @@ LL | pub fn empty_derive(_: TokenStream) -> TokenStream { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you could import this directly help: import `Empty` directly | -LL | use test_macros::Empty; - | ~~~~~~~~~~~~~~~~~~ +LL - use m::Empty; +LL + use test_macros::Empty; + | error: aborting due to 2 previous errors diff --git a/tests/ui/proc-macro/issue-66286.stderr b/tests/ui/proc-macro/issue-66286.stderr index fc4c2062fd7bc..cc741600b6619 100644 --- a/tests/ui/proc-macro/issue-66286.stderr +++ b/tests/ui/proc-macro/issue-66286.stderr @@ -6,8 +6,9 @@ LL | pub extern fn foo(_: Vec(u32)) -> u32 { | help: use angle brackets instead | -LL | pub extern fn foo(_: Vec) -> u32 { - | ~ ~ +LL - pub extern fn foo(_: Vec(u32)) -> u32 { +LL + pub extern fn foo(_: Vec) -> u32 { + | error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr b/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr index aeb824303e715..835648ab435eb 100644 --- a/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr +++ b/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr @@ -9,8 +9,9 @@ LL | pub struct Foo; | help: to annotate the struct, change the doc comment from inner to outer style | -LL | /// Inner doc comment - | ~ +LL - //! Inner doc comment +LL + /// Inner doc comment + | error: aborting due to 1 previous error diff --git a/tests/ui/pub/pub-ident-fn-or-struct.stderr b/tests/ui/pub/pub-ident-fn-or-struct.stderr index ceadc510c63ef..1bdb547be1e51 100644 --- a/tests/ui/pub/pub-ident-fn-or-struct.stderr +++ b/tests/ui/pub/pub-ident-fn-or-struct.stderr @@ -6,8 +6,9 @@ LL | pub S (foo) bar | help: if you meant to call a macro, try | -LL | pub S! (foo) bar - | ~~ +LL - pub S (foo) bar +LL + pub S! (foo) bar + | error: aborting due to 1 previous error diff --git a/tests/ui/pub/pub-restricted.stderr b/tests/ui/pub/pub-restricted.stderr index fc177aa2033e1..35c48c6d7692c 100644 --- a/tests/ui/pub/pub-restricted.stderr +++ b/tests/ui/pub/pub-restricted.stderr @@ -10,8 +10,9 @@ LL | pub (a) fn afn() {} `pub(in path::to::module)`: visible only on the specified path help: make this visible only to module `a` with `in` | -LL | pub (in a) fn afn() {} - | ~~~~ +LL - pub (a) fn afn() {} +LL + pub (in a) fn afn() {} + | error[E0704]: incorrect visibility restriction --> $DIR/pub-restricted.rs:4:6 @@ -25,8 +26,9 @@ LL | pub (b) fn bfn() {} `pub(in path::to::module)`: visible only on the specified path help: make this visible only to module `b` with `in` | -LL | pub (in b) fn bfn() {} - | ~~~~ +LL - pub (b) fn bfn() {} +LL + pub (in b) fn bfn() {} + | error[E0704]: incorrect visibility restriction --> $DIR/pub-restricted.rs:5:6 @@ -40,8 +42,9 @@ LL | pub (crate::a) fn cfn() {} `pub(in path::to::module)`: visible only on the specified path help: make this visible only to module `crate::a` with `in` | -LL | pub (in crate::a) fn cfn() {} - | ~~~~~~~~~~~ +LL - pub (crate::a) fn cfn() {} +LL + pub (in crate::a) fn cfn() {} + | error[E0704]: incorrect visibility restriction --> $DIR/pub-restricted.rs:22:14 @@ -55,8 +58,9 @@ LL | pub (a) invalid: usize, `pub(in path::to::module)`: visible only on the specified path help: make this visible only to module `a` with `in` | -LL | pub (in a) invalid: usize, - | ~~~~ +LL - pub (a) invalid: usize, +LL + pub (in a) invalid: usize, + | error[E0704]: incorrect visibility restriction --> $DIR/pub-restricted.rs:31:6 @@ -70,8 +74,9 @@ LL | pub (xyz) fn xyz() {} `pub(in path::to::module)`: visible only on the specified path help: make this visible only to module `xyz` with `in` | -LL | pub (in xyz) fn xyz() {} - | ~~~~~~ +LL - pub (xyz) fn xyz() {} +LL + pub (in xyz) fn xyz() {} + | error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/pub-restricted.rs:23:17 diff --git a/tests/ui/qualified/qualified-path-params-2.stderr b/tests/ui/qualified/qualified-path-params-2.stderr index 56644bdd46a8d..6641e81013f05 100644 --- a/tests/ui/qualified/qualified-path-params-2.stderr +++ b/tests/ui/qualified/qualified-path-params-2.stderr @@ -6,8 +6,9 @@ LL | type A = ::A::f; | help: if there were a trait named `Example` with associated type `f` implemented for `::A`, you could use the fully-qualified path | -LL | type A = <::A as Example>::f; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - type A = ::A::f; +LL + type A = <::A as Example>::f; + | error: aborting due to 1 previous error diff --git a/tests/ui/regions/region-object-lifetime-in-coercion.stderr b/tests/ui/regions/region-object-lifetime-in-coercion.stderr index b5bb08c73c890..3880ae8228377 100644 --- a/tests/ui/regions/region-object-lifetime-in-coercion.stderr +++ b/tests/ui/regions/region-object-lifetime-in-coercion.stderr @@ -8,12 +8,14 @@ LL | let x: Box = Box::new(v); | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` | -LL | fn a(v: &[u8]) -> Box { - | ~~ +LL - fn a(v: &[u8]) -> Box { +LL + fn a(v: &[u8]) -> Box { + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn a(v: &'static [u8]) -> Box { - | ~~~~~~~~~~~~~ +LL - fn a(v: &[u8]) -> Box { +LL + fn a(v: &'static [u8]) -> Box { + | error: lifetime may not live long enough --> $DIR/region-object-lifetime-in-coercion.rs:14:5 @@ -25,12 +27,14 @@ LL | Box::new(v) | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` | -LL | fn b(v: &[u8]) -> Box { - | ~~ +LL - fn b(v: &[u8]) -> Box { +LL + fn b(v: &[u8]) -> Box { + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn b(v: &'static [u8]) -> Box { - | ~~~~~~~~~~~~~ +LL - fn b(v: &[u8]) -> Box { +LL + fn b(v: &'static [u8]) -> Box { + | error: lifetime may not live long enough --> $DIR/region-object-lifetime-in-coercion.rs:21:5 diff --git a/tests/ui/regions/regions-close-object-into-object-2.stderr b/tests/ui/regions/regions-close-object-into-object-2.stderr index aacb5ea4e87b7..54364ef0821a6 100644 --- a/tests/ui/regions/regions-close-object-into-object-2.stderr +++ b/tests/ui/regions/regions-close-object-into-object-2.stderr @@ -8,12 +8,14 @@ LL | Box::new(B(&*v)) as Box | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` | -LL | fn g<'a, T: 'static>(v: Box + 'a>) -> Box { - | ~~ +LL - fn g<'a, T: 'static>(v: Box + 'a>) -> Box { +LL + fn g<'a, T: 'static>(v: Box + 'a>) -> Box { + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn g<'a, T: 'static>(v: Box<(dyn A + 'static)>) -> Box { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn g<'a, T: 'static>(v: Box + 'a>) -> Box { +LL + fn g<'a, T: 'static>(v: Box<(dyn A + 'static)>) -> Box { + | error[E0515]: cannot return value referencing local data `*v` --> $DIR/regions-close-object-into-object-2.rs:9:5 diff --git a/tests/ui/regions/regions-close-object-into-object-4.stderr b/tests/ui/regions/regions-close-object-into-object-4.stderr index b8b414b7e125e..02993fe839679 100644 --- a/tests/ui/regions/regions-close-object-into-object-4.stderr +++ b/tests/ui/regions/regions-close-object-into-object-4.stderr @@ -51,12 +51,14 @@ LL | Box::new(B(&*v)) as Box | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` | -LL | fn i<'a, T, U>(v: Box+'a>) -> Box { - | ~~ +LL - fn i<'a, T, U>(v: Box+'a>) -> Box { +LL + fn i<'a, T, U>(v: Box+'a>) -> Box { + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn i<'a, T, U>(v: Box<(dyn A + 'static)>) -> Box { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn i<'a, T, U>(v: Box+'a>) -> Box { +LL + fn i<'a, T, U>(v: Box<(dyn A + 'static)>) -> Box { + | error[E0515]: cannot return value referencing local data `*v` --> $DIR/regions-close-object-into-object-4.rs:9:5 diff --git a/tests/ui/regions/regions-proc-bound-capture.stderr b/tests/ui/regions/regions-proc-bound-capture.stderr index 3fe497bf2e99f..3149cd8c9a1bc 100644 --- a/tests/ui/regions/regions-proc-bound-capture.stderr +++ b/tests/ui/regions/regions-proc-bound-capture.stderr @@ -9,12 +9,14 @@ LL | Box::new(move || { *x }) | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x` | -LL | fn static_proc(x: &isize) -> Box (isize) + '_> { - | ~~ +LL - fn static_proc(x: &isize) -> Box (isize) + 'static> { +LL + fn static_proc(x: &isize) -> Box (isize) + '_> { + | help: alternatively, add an explicit `'static` bound to this reference | -LL | fn static_proc(x: &'static isize) -> Box (isize) + 'static> { - | ~~~~~~~~~~~~~~ +LL - fn static_proc(x: &isize) -> Box (isize) + 'static> { +LL + fn static_proc(x: &'static isize) -> Box (isize) + 'static> { + | error: aborting due to 1 previous error diff --git a/tests/ui/repeat-expr/repeat_count.stderr b/tests/ui/repeat-expr/repeat_count.stderr index 350ac287507a3..46fdf715337b7 100644 --- a/tests/ui/repeat-expr/repeat_count.stderr +++ b/tests/ui/repeat-expr/repeat_count.stderr @@ -6,8 +6,9 @@ LL | let a = [0; n]; | help: consider using `const` instead of `let` | -LL | const n: /* Type */ = 1; - | ~~~~~ ++++++++++++ +LL - let n = 1; +LL + const n: /* Type */ = 1; + | error[E0308]: mismatched types --> $DIR/repeat_count.rs:7:17 @@ -63,8 +64,9 @@ LL | let f = [0; 4u8]; | help: change the type of the numeric literal from `u8` to `usize` | -LL | let f = [0; 4usize]; - | ~~~~~ +LL - let f = [0; 4u8]; +LL + let f = [0; 4usize]; + | error: aborting due to 9 previous errors diff --git a/tests/ui/resolve/issue-101749.stderr b/tests/ui/resolve/issue-101749.stderr index 05515b1b46052..c8e11620fa395 100644 --- a/tests/ui/resolve/issue-101749.stderr +++ b/tests/ui/resolve/issue-101749.stderr @@ -6,8 +6,9 @@ LL | let _ = rect::area(); | help: you may have meant to call an instance method | -LL | let _ = rect.area(); - | ~ +LL - let _ = rect::area(); +LL + let _ = rect.area(); + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-103202.stderr b/tests/ui/resolve/issue-103202.stderr index 87fa940ac3b25..cf32efab981f7 100644 --- a/tests/ui/resolve/issue-103202.stderr +++ b/tests/ui/resolve/issue-103202.stderr @@ -6,8 +6,9 @@ LL | fn f(self: &S::x) {} | help: if there were a trait named `Example` with associated type `x` implemented for `S`, you could use the fully-qualified path | -LL | fn f(self: &::x) {} - | ~~~~~~~~~~~~~~~~~ +LL - fn f(self: &S::x) {} +LL + fn f(self: &::x) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-103474.stderr b/tests/ui/resolve/issue-103474.stderr index e48fb31eccc9a..717892921f142 100644 --- a/tests/ui/resolve/issue-103474.stderr +++ b/tests/ui/resolve/issue-103474.stderr @@ -6,8 +6,9 @@ LL | this.i | help: you might have meant to use `self` here instead | -LL | self.i - | ~~~~ +LL - this.i +LL + self.i + | help: if you meant to use `self`, you are also missing a `self` receiver argument | LL | fn needs_self(&self) { diff --git a/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr b/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr index f463e2dad2cfc..1ed6e68c33352 100644 --- a/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr +++ b/tests/ui/resolve/issue-112472-multi-generics-suggestion.stderr @@ -6,8 +6,9 @@ LL | >::Error: ParseError, | help: constrain the associated type to `ParseError` | -LL | DecodeLine: convert::TryFrom, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - >::Error: ParseError, +LL + DecodeLine: convert::TryFrom, + | error[E0404]: expected trait, found enum `ParseError` --> $DIR/issue-112472-multi-generics-suggestion.rs:25:45 @@ -17,8 +18,9 @@ LL | >::Error: ParseError, | help: constrain the associated type to `ParseError` | -LL | DecodeLine: TryFrom, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - >::Error: ParseError, +LL + DecodeLine: TryFrom, + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-18252.stderr b/tests/ui/resolve/issue-18252.stderr index 6cb9c1f1dd211..b22ad3f5225bd 100644 --- a/tests/ui/resolve/issue-18252.stderr +++ b/tests/ui/resolve/issue-18252.stderr @@ -6,8 +6,9 @@ LL | let f = Foo::Variant(42); | help: you might have meant to create a new value of the struct | -LL | let f = Foo::Variant { x: /* value */ }; - | ~~~~~~~~~~~~~~~~~~ +LL - let f = Foo::Variant(42); +LL + let f = Foo::Variant { x: /* value */ }; + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-22692.stderr b/tests/ui/resolve/issue-22692.stderr index 6962aa161e92a..ced2a6f1745e5 100644 --- a/tests/ui/resolve/issue-22692.stderr +++ b/tests/ui/resolve/issue-22692.stderr @@ -28,8 +28,9 @@ LL | Type!().get(); = note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info) help: use the path separator to refer to an item | -LL | ::get(); - | ~~~~~~~~~~~ +LL - Type!().get(); +LL + ::get(); + | error[E0423]: expected value, found struct `std::cell::Cell` --> $DIR/issue-22692.rs:17:9 @@ -43,8 +44,9 @@ LL | Type! {}.get; = note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info) help: use the path separator to refer to an item | -LL | ::get; - | ~~~~~~~~~~~~ +LL - Type! {}.get; +LL + ::get; + | error[E0423]: expected value, found struct `Vec` --> $DIR/issue-22692.rs:26:9 @@ -80,8 +82,9 @@ LL | let _ = create!(macro method); = note: this error originates in the macro `Type` which comes from the expansion of the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) help: use the path separator to refer to an item | -LL | ::new(0) - | ~~~~~~~~~~~ +LL - Type!().new(0) +LL + ::new(0) + | error: aborting due to 8 previous errors diff --git a/tests/ui/resolve/issue-35675.stderr b/tests/ui/resolve/issue-35675.stderr index 44af65b0768a8..83d92ea7bf1ac 100644 --- a/tests/ui/resolve/issue-35675.stderr +++ b/tests/ui/resolve/issue-35675.stderr @@ -6,8 +6,9 @@ LL | fn should_return_fruit() -> Apple { | help: there is an enum variant `Fruit::Apple`; try using the variant's enum | -LL | fn should_return_fruit() -> Fruit { - | ~~~~~ +LL - fn should_return_fruit() -> Apple { +LL + fn should_return_fruit() -> Fruit { + | error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope --> $DIR/issue-35675.rs:9:5 @@ -57,8 +58,9 @@ LL | fn bar() -> Variant3 { | help: there is an enum variant `x::Enum::Variant3`; try using the variant's enum | -LL | fn bar() -> x::Enum { - | ~~~~~~~ +LL - fn bar() -> Variant3 { +LL + fn bar() -> x::Enum { + | error[E0573]: expected type, found variant `Some` --> $DIR/issue-35675.rs:28:13 diff --git a/tests/ui/resolve/issue-3907.stderr b/tests/ui/resolve/issue-3907.stderr index e9dc344496e51..0dc85829160bf 100644 --- a/tests/ui/resolve/issue-3907.stderr +++ b/tests/ui/resolve/issue-3907.stderr @@ -6,7 +6,8 @@ LL | impl Foo for S { | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait Foo = dyn issue_3907::Foo; +LL - type Foo = dyn issue_3907::Foo; +LL + trait Foo = dyn issue_3907::Foo; | help: consider importing this trait instead | diff --git a/tests/ui/resolve/issue-39226.stderr b/tests/ui/resolve/issue-39226.stderr index 857f6a735178e..3d771b4fc42a2 100644 --- a/tests/ui/resolve/issue-39226.stderr +++ b/tests/ui/resolve/issue-39226.stderr @@ -9,12 +9,14 @@ LL | handle: Handle | help: use struct literal syntax instead | -LL | handle: Handle {} - | ~~~~~~~~~ +LL - handle: Handle +LL + handle: Handle {} + | help: a local variable with a similar name exists | -LL | handle: handle - | ~~~~~~ +LL - handle: Handle +LL + handle: handle + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-42944.stderr b/tests/ui/resolve/issue-42944.stderr index 4ffa9402c667e..53c155d8f1302 100644 --- a/tests/ui/resolve/issue-42944.stderr +++ b/tests/ui/resolve/issue-42944.stderr @@ -23,8 +23,9 @@ LL | pub struct Bx(pub(in crate::foo) ()); | ^^^^^^^^^^^^^^^^^^^^^ private field help: consider making the field publicly accessible | -LL | pub struct Bx(pub ()); - | ~~~ +LL - pub struct Bx(pub(in crate::foo) ()); +LL + pub struct Bx(pub ()); + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-5035.stderr b/tests/ui/resolve/issue-5035.stderr index 32b972b21ffad..b249aaa4b2803 100644 --- a/tests/ui/resolve/issue-5035.stderr +++ b/tests/ui/resolve/issue-5035.stderr @@ -15,12 +15,14 @@ LL | impl K for isize {} | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait K = dyn I; +LL - type K = dyn I; +LL + trait K = dyn I; | help: a trait with a similar name exists | -LL | impl I for isize {} - | ~ +LL - impl K for isize {} +LL + impl I for isize {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-5099.stderr b/tests/ui/resolve/issue-5099.stderr index e9b2a9c4d4844..991c39db33514 100644 --- a/tests/ui/resolve/issue-5099.stderr +++ b/tests/ui/resolve/issue-5099.stderr @@ -6,8 +6,9 @@ LL | this.a | help: you might have meant to use `self` here instead | -LL | self.a - | ~~~~ +LL - this.a +LL + self.a + | help: if you meant to use `self`, you are also missing a `self` receiver argument | LL | fn a(&self) -> A { @@ -21,8 +22,9 @@ LL | this.b(x); | help: you might have meant to use `self` here instead | -LL | self.b(x); - | ~~~~ +LL - this.b(x); +LL + self.b(x); + | help: if you meant to use `self`, you are also missing a `self` receiver argument | LL | fn b(&self, x: i32) { @@ -36,8 +38,9 @@ LL | let _ = || this.a; | help: you might have meant to use `self` here instead | -LL | let _ = || self.a; - | ~~~~ +LL - let _ = || this.a; +LL + let _ = || self.a; + | help: if you meant to use `self`, you are also missing a `self` receiver argument | LL | fn c(&self) { diff --git a/tests/ui/resolve/issue-55673.stderr b/tests/ui/resolve/issue-55673.stderr index 4069b35a99848..85823f256b6c1 100644 --- a/tests/ui/resolve/issue-55673.stderr +++ b/tests/ui/resolve/issue-55673.stderr @@ -6,8 +6,9 @@ LL | T::Baa: std::fmt::Debug, | help: change the associated type name to use `Bar` from `Foo` | -LL | T::Bar: std::fmt::Debug, - | ~~~ +LL - T::Baa: std::fmt::Debug, +LL + T::Bar: std::fmt::Debug, + | error[E0220]: associated type `Baa` not found for `T` --> $DIR/issue-55673.rs:16:8 @@ -17,12 +18,14 @@ LL | T::Baa: std::fmt::Debug, | help: consider further restricting type parameter `T` | -LL | T::Baa: std::fmt::Debug, T: Foo - | ~~~~~~~~ +LL - T::Baa: std::fmt::Debug, +LL + T::Baa: std::fmt::Debug, T: Foo + | help: ...and changing the associated type name | -LL | T::Bar: std::fmt::Debug, - | ~~~ +LL - T::Baa: std::fmt::Debug, +LL + T::Bar: std::fmt::Debug, + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-73427.stderr b/tests/ui/resolve/issue-73427.stderr index 0a9a504f79caa..890bb04f24dac 100644 --- a/tests/ui/resolve/issue-73427.stderr +++ b/tests/ui/resolve/issue-73427.stderr @@ -17,14 +17,17 @@ LL | | } | |_^ help: you might have meant to use one of the following enum variants | -LL | (A::Tuple()).foo(); - | ~~~~~~~~~~~~ -LL | A::Unit.foo(); - | ~~~~~~~ +LL - A.foo(); +LL + (A::Tuple()).foo(); + | +LL - A.foo(); +LL + A::Unit.foo(); + | help: alternatively, the following enum variant is available | -LL | (A::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - A.foo(); +LL + (A::TupleWithFields(/* fields */)).foo(); + | error[E0423]: expected value, found enum `B` --> $DIR/issue-73427.rs:35:5 @@ -58,12 +61,14 @@ LL | | } | |_^ help: you might have meant to use the following enum variant | -LL | C::Unit.foo(); - | ~~~~~~~ +LL - C.foo(); +LL + C::Unit.foo(); + | help: alternatively, the following enum variant is available | -LL | (C::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - C.foo(); +LL + (C::TupleWithFields(/* fields */)).foo(); + | error[E0423]: expected value, found enum `D` --> $DIR/issue-73427.rs:39:5 @@ -81,12 +86,14 @@ LL | | } | |_^ help: you might have meant to use the following enum variant | -LL | D::Unit.foo(); - | ~~~~~~~ +LL - D.foo(); +LL + D::Unit.foo(); + | help: alternatively, the following enum variant is available | -LL | (D::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - D.foo(); +LL + (D::TupleWithFields(/* fields */)).foo(); + | error[E0423]: expected value, found enum `E` --> $DIR/issue-73427.rs:41:5 @@ -103,8 +110,9 @@ LL | | } | |_^ help: the following enum variant is available | -LL | (E::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - E.foo(); +LL + (E::TupleWithFields(/* fields */)).foo(); + | help: consider importing one of these constants instead | LL + use std::f128::consts::E; @@ -136,10 +144,12 @@ LL | | } | |_^ help: try to match against one of the enum's variants | -LL | if let A::Tuple(3) = x { } - | ~~~~~~~~ -LL | if let A::TupleWithFields(3) = x { } - | ~~~~~~~~~~~~~~~~~~ +LL - if let A(3) = x { } +LL + if let A::Tuple(3) = x { } + | +LL - if let A(3) = x { } +LL + if let A::TupleWithFields(3) = x { } + | error[E0423]: expected function, tuple struct or tuple variant, found enum `A` --> $DIR/issue-73427.rs:46:13 @@ -161,10 +171,12 @@ LL | | } | |_^ help: try to construct one of the enum's variants | -LL | let x = A::Tuple(3); - | ~~~~~~~~ -LL | let x = A::TupleWithFields(3); - | ~~~~~~~~~~~~~~~~~~ +LL - let x = A(3); +LL + let x = A::Tuple(3); + | +LL - let x = A(3); +LL + let x = A::TupleWithFields(3); + | error: aborting due to 7 previous errors diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index 12a6580048e17..3bbab3716afe7 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -17,12 +17,14 @@ LL | | } | |_________^ help: you might have meant to use the following enum variant | -LL | m::Z::Unit; - | ~~~~~~~~~~ +LL - n::Z; +LL + m::Z::Unit; + | help: alternatively, the following enum variant is available | -LL | (m::Z::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - n::Z; +LL + (m::Z::Fn(/* fields */)); + | error[E0423]: expected value, found enum `Z` --> $DIR/privacy-enum-ctor.rs:25:9 @@ -43,12 +45,14 @@ LL | | } | |_________^ help: you might have meant to use the following enum variant | -LL | m::Z::Unit; - | ~~~~~~~~~~ +LL - Z; +LL + m::Z::Unit; + | help: alternatively, the following enum variant is available | -LL | (m::Z::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Z; +LL + (m::Z::Fn(/* fields */)); + | error[E0423]: expected value, found enum `m::E` --> $DIR/privacy-enum-ctor.rs:41:16 @@ -72,16 +76,19 @@ LL | | } | |_____^ help: you might have meant to use the following enum variant | -LL | let _: E = E::Unit; - | ~~~~~~~ +LL - let _: E = m::E; +LL + let _: E = E::Unit; + | help: alternatively, the following enum variant is available | -LL | let _: E = (E::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - let _: E = m::E; +LL + let _: E = (E::Fn(/* fields */)); + | help: a function with a similar name exists | -LL | let _: E = m::f; - | ~ +LL - let _: E = m::E; +LL + let _: E = m::f; + | help: consider importing one of these constants instead | LL + use std::f128::consts::E; @@ -117,12 +124,14 @@ LL | | } | |_____^ help: you might have meant to use the following enum variant | -LL | let _: E = E::Unit; - | ~~~~~~~ +LL - let _: E = E; +LL + let _: E = E::Unit; + | help: alternatively, the following enum variant is available | -LL | let _: E = (E::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - let _: E = E; +LL + let _: E = (E::Fn(/* fields */)); + | help: consider importing one of these constants instead | LL + use std::f128::consts::E; @@ -168,12 +177,14 @@ LL | | } | |_________^ help: you might have meant to use the following enum variant | -LL | let _: Z = m::Z::Unit; - | ~~~~~~~~~~ +LL - let _: Z = m::n::Z; +LL + let _: Z = m::Z::Unit; + | help: alternatively, the following enum variant is available | -LL | let _: Z = (m::Z::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: Z = m::n::Z; +LL + let _: Z = (m::Z::Fn(/* fields */)); + | error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:61:12 diff --git a/tests/ui/resolve/privacy-struct-ctor.stderr b/tests/ui/resolve/privacy-struct-ctor.stderr index c1fcaaf05738f..1d8c741c964e1 100644 --- a/tests/ui/resolve/privacy-struct-ctor.stderr +++ b/tests/ui/resolve/privacy-struct-ctor.stderr @@ -55,8 +55,9 @@ LL | pub(in m) struct Z(pub(in m::n) u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the field publicly accessible | -LL | pub(in m) struct Z(pub u8); - | ~~~ +LL - pub(in m) struct Z(pub(in m::n) u8); +LL + pub(in m) struct Z(pub u8); + | error[E0603]: tuple struct constructor `S` is private --> $DIR/privacy-struct-ctor.rs:29:8 @@ -112,8 +113,9 @@ LL | pub(in m) struct Z(pub(in m::n) u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the field publicly accessible | -LL | pub(in m) struct Z(pub u8); - | ~~~ +LL - pub(in m) struct Z(pub(in m::n) u8); +LL + pub(in m) struct Z(pub u8); + | error[E0603]: tuple struct constructor `S` is private --> $DIR/privacy-struct-ctor.rs:41:16 diff --git a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr index 999e9a47d6c5f..f1db2d71b6a66 100644 --- a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr @@ -3,7 +3,8 @@ error[E0259]: the name `std` is defined multiple times = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | extern crate std as other_std; +LL - extern crate std; +LL + extern crate std as other_std; | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr index a8d0efedb6c42..40c76821bb835 100644 --- a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr @@ -7,8 +7,9 @@ LL | use std::slice as std; = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL | use std::slice as other_std; - | ~~~~~~~~~~~~ +LL - use std::slice as std; +LL + use std::slice as other_std; + | error: aborting due to 1 previous error diff --git a/tests/ui/resolve/resolve-inconsistent-names.stderr b/tests/ui/resolve/resolve-inconsistent-names.stderr index d6240fb8f872c..3197e0b08949b 100644 --- a/tests/ui/resolve/resolve-inconsistent-names.stderr +++ b/tests/ui/resolve/resolve-inconsistent-names.stderr @@ -34,8 +34,9 @@ LL | (A, B) | (ref B, c) | (c, A) => () | help: if you meant to match on unit variant `E::A`, use the full path in the pattern | -LL | (E::A, B) | (ref B, c) | (c, A) => () - | ~~~~ +LL - (A, B) | (ref B, c) | (c, A) => () +LL + (E::A, B) | (ref B, c) | (c, A) => () + | error[E0408]: variable `B` is not bound in all patterns --> $DIR/resolve-inconsistent-names.rs:19:31 @@ -64,8 +65,9 @@ LL | (CONST1, _) | (_, Const2) => () | help: if you meant to match on constant `m::Const2`, use the full path in the pattern | -LL | (CONST1, _) | (_, m::Const2) => () - | ~~~~~~~~~ +LL - (CONST1, _) | (_, Const2) => () +LL + (CONST1, _) | (_, m::Const2) => () + | error[E0408]: variable `CONST1` is not bound in all patterns --> $DIR/resolve-inconsistent-names.rs:31:23 diff --git a/tests/ui/resolve/resolve-variant-assoc-item.stderr b/tests/ui/resolve/resolve-variant-assoc-item.stderr index ed157197d17e1..09abc1afb0b2a 100644 --- a/tests/ui/resolve/resolve-variant-assoc-item.stderr +++ b/tests/ui/resolve/resolve-variant-assoc-item.stderr @@ -6,8 +6,9 @@ LL | E::V::associated_item; | help: there is an enum variant `E::V`; try using the variant's enum | -LL | E; - | ~ +LL - E::V::associated_item; +LL + E; + | error[E0433]: failed to resolve: `V` is a variant, not a module --> $DIR/resolve-variant-assoc-item.rs:6:5 @@ -17,12 +18,14 @@ LL | V::associated_item; | help: there is an enum variant `E::V`; try using the variant's enum | -LL | E; - | ~ +LL - V::associated_item; +LL + E; + | help: an enum with a similar name exists | -LL | E::associated_item; - | ~ +LL - V::associated_item; +LL + E::associated_item; + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr index a4ce0deeb70f5..57886b7b1f7ab 100644 --- a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr +++ b/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr @@ -27,12 +27,14 @@ LL | a::b.J | help: use the path separator to refer to an item | -LL | a::b::J - | ~~ +LL - a::b.J +LL + a::b::J + | help: a constant with a similar name exists | -LL | a::I.J - | ~ +LL - a::b.J +LL + a::I.J + | error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:42:5 @@ -62,12 +64,14 @@ LL | a::b.f() | help: use the path separator to refer to an item | -LL | a::b::f() - | ~~ +LL - a::b.f() +LL + a::b::f() + | help: a constant with a similar name exists | -LL | a::I.f() - | ~ +LL - a::b.f() +LL + a::I.f() + | error[E0423]: expected value, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:59:5 diff --git a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr index 5662021a2d523..15fdb975a1b29 100644 --- a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr +++ b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr @@ -28,8 +28,9 @@ LL | println!("{self.config}"); | +++++ help: a local variable with a similar name exists | -LL | println!("{cofig}"); - | ~~~~~ +LL - println!("{config}"); +LL + println!("{cofig}"); + | error[E0425]: cannot find value `bah` in this scope --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9 @@ -46,8 +47,9 @@ LL | Self::bah; | ++++++ help: a function with a similar name exists | -LL | ba; - | ~~ +LL - bah; +LL + ba; + | error[E0425]: cannot find value `BAR` in this scope --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:35:9 @@ -64,8 +66,9 @@ LL | Self::BAR; | ++++++ help: a constant with a similar name exists | -LL | BARR; - | ~~~~ +LL - BAR; +LL + BARR; + | error[E0412]: cannot find type `Baz` in this scope --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:37:18 @@ -82,8 +85,9 @@ LL | let foo: Self::Baz = "".to_string(); | ++++++ help: a type alias with a similar name exists | -LL | let foo: Bar = "".to_string(); - | ~~~ +LL - let foo: Baz = "".to_string(); +LL + let foo: Bar = "".to_string(); + | error[E0425]: cannot find function `baz` in this scope --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9 @@ -100,8 +104,9 @@ LL | self.baz(); | +++++ help: a function with a similar name exists | -LL | ba(); - | ~~ +LL - baz(); +LL + ba(); + | error: aborting due to 7 previous errors diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr index f4fb7fd955f2b..5a6f5982f134a 100644 --- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr +++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr @@ -18,8 +18,9 @@ LL | Struct::fob(); | help: there is an associated function `foo` with a similar name | -LL | Struct::foo(); - | ~~~ +LL - Struct::fob(); +LL + Struct::foo(); + | error[E0433]: failed to resolve: use of undeclared type `Struc` --> $DIR/typo-suggestion-mistyped-in-path.rs:27:5 @@ -38,8 +39,9 @@ LL | modul::foo(); | help: there is a crate or module with a similar name | -LL | module::foo(); - | ~~~~~~ +LL - modul::foo(); +LL + module::foo(); + | error[E0433]: failed to resolve: use of undeclared type `Trai` --> $DIR/typo-suggestion-mistyped-in-path.rs:39:5 diff --git a/tests/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr b/tests/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr index 8addc0303fb91..f885705a17b5c 100644 --- a/tests/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr +++ b/tests/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr @@ -12,7 +12,8 @@ LL | fn g isize>(x: F) {} | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait Typedef = isize; +LL - type Typedef = isize; +LL + trait Typedef = isize; | error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr index 39b1ef1e078c7..d0244f39769a7 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr @@ -58,8 +58,9 @@ LL | let NormalStruct { first_field, second_field } = ns; | help: add `..` at the end of the field list to ignore all other fields | -LL | let NormalStruct { first_field, second_field , .. } = ns; - | ~~~~~~ +LL - let NormalStruct { first_field, second_field } = ns; +LL + let NormalStruct { first_field, second_field , .. } = ns; + | error[E0423]: cannot initialize a tuple struct which contains private fields --> $DIR/struct.rs:20:14 @@ -75,8 +76,9 @@ LL | let TupleStruct { 0: first_field, 1: second_field } = ts; | help: add `..` at the end of the field list to ignore all other fields | -LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts; - | ~~~~~~ +LL - let TupleStruct { 0: first_field, 1: second_field } = ts; +LL + let TupleStruct { 0: first_field, 1: second_field , .. } = ts; + | error[E0638]: `..` required with struct marked as non-exhaustive --> $DIR/struct.rs:35:9 @@ -86,8 +88,9 @@ LL | let UnitStruct { } = us; | help: add `..` at the end of the field list to ignore all other fields | -LL | let UnitStruct { .. } = us; - | ~~~~ +LL - let UnitStruct { } = us; +LL + let UnitStruct { .. } = us; + | error: aborting due to 9 previous errors diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr index 4083f57a9cdf9..4cabd5a81402c 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr @@ -82,8 +82,9 @@ LL | NonExhaustiveVariants::Struct { field } => "" | help: add `..` at the end of the field list to ignore all other fields | -LL | NonExhaustiveVariants::Struct { field , .. } => "" - | ~~~~~~ +LL - NonExhaustiveVariants::Struct { field } => "" +LL + NonExhaustiveVariants::Struct { field , .. } => "" + | error[E0638]: `..` required with variant marked as non-exhaustive --> $DIR/variant.rs:30:12 @@ -93,8 +94,9 @@ LL | if let NonExhaustiveVariants::Struct { field } = variant_struct { | help: add `..` at the end of the field list to ignore all other fields | -LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct { - | ~~~~~~ +LL - if let NonExhaustiveVariants::Struct { field } = variant_struct { +LL + if let NonExhaustiveVariants::Struct { field , .. } = variant_struct { + | error: aborting due to 8 previous errors diff --git a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr index d0c084f7bd5d0..37a0f2bcaa882 100644 --- a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr +++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr @@ -6,8 +6,9 @@ LL | use alloc; | help: consider importing this module instead | -LL | use std::alloc; - | ~~~~~~~~~~ +LL - use alloc; +LL + use std::alloc; + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr index cc941be5479e3..25246bf009f85 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr @@ -15,8 +15,9 @@ LL | let foo: fn() = foo; = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers help: consider casting to a fn pointer | -LL | let foo: fn() = foo as fn(); - | ~~~~~~~~~~~ +LL - let foo: fn() = foo; +LL + let foo: fn() = foo as fn(); + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-119717-constant-lifetime.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-119717-constant-lifetime.stderr index 50cdded8d5114..02fa4fa4275ba 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-119717-constant-lifetime.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-119717-constant-lifetime.stderr @@ -29,8 +29,9 @@ LL | fn from_residual(t: T) -> _ { | help: try replacing `_` with the type in the corresponding trait method signature | -LL | fn from_residual(t: T) -> T { - | ~ +LL - fn from_residual(t: T) -> _ { +LL + fn from_residual(t: T) -> T { + | error: aborting due to 4 previous errors diff --git a/tests/ui/rmeta/rmeta_meta_main.stderr b/tests/ui/rmeta/rmeta_meta_main.stderr index af11c88d9282e..7ee44ce29b295 100644 --- a/tests/ui/rmeta/rmeta_meta_main.stderr +++ b/tests/ui/rmeta/rmeta_meta_main.stderr @@ -6,8 +6,9 @@ LL | let _ = Foo { field2: 42 }; | help: a field with a similar name exists | -LL | let _ = Foo { field: 42 }; - | ~~~~~ +LL - let _ = Foo { field2: 42 }; +LL + let _ = Foo { field: 42 }; + | error: aborting due to 1 previous error diff --git a/tests/ui/rust-2018/remove-extern-crate.stderr b/tests/ui/rust-2018/remove-extern-crate.stderr index 020db9975c092..cb090c621e9f9 100644 --- a/tests/ui/rust-2018/remove-extern-crate.stderr +++ b/tests/ui/rust-2018/remove-extern-crate.stderr @@ -19,8 +19,9 @@ LL | extern crate core; | help: convert it to a `use` | -LL | use core; - | ~~~ +LL - extern crate core; +LL + use core; + | warning: `extern crate` is not idiomatic in the new edition --> $DIR/remove-extern-crate.rs:45:5 @@ -30,8 +31,9 @@ LL | pub extern crate core; | help: convert it to a `use` | -LL | pub use core; - | ~~~ +LL - pub extern crate core; +LL + pub use core; + | warning: 3 warnings emitted diff --git a/tests/ui/rust-2018/trait-import-suggestions.stderr b/tests/ui/rust-2018/trait-import-suggestions.stderr index 852628885794a..077b4a6cf2f71 100644 --- a/tests/ui/rust-2018/trait-import-suggestions.stderr +++ b/tests/ui/rust-2018/trait-import-suggestions.stderr @@ -14,8 +14,9 @@ LL + use crate::foo::foobar::Foobar; | help: there is a method `bar` with a similar name | -LL | x.bar(); - | ~~~ +LL - x.foobar(); +LL + x.bar(); + | error[E0599]: no method named `bar` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:28:7 @@ -33,8 +34,9 @@ LL + use crate::foo::Bar; | help: there is a method `foobar` with a similar name | -LL | x.foobar(); - | ~~~~~~ +LL - x.bar(); +LL + x.foobar(); + | error[E0599]: no method named `baz` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:29:7 @@ -44,8 +46,9 @@ LL | x.baz(); | help: there is a method `bar` with a similar name | -LL | x.bar(); - | ~~~ +LL - x.baz(); +LL + x.bar(); + | error[E0599]: no function or associated item named `from_str` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:30:18 @@ -60,8 +63,9 @@ LL + use std::str::FromStr; | help: there is an associated function `from` with a similar name | -LL | let y = u32::from("33"); - | ~~~~ +LL - let y = u32::from_str("33"); +LL + let y = u32::from("33"); + | error: aborting due to 4 previous errors diff --git a/tests/ui/rust-2021/future-prelude-collision-shadow.stderr b/tests/ui/rust-2021/future-prelude-collision-shadow.stderr index d9c0fa47eca02..966613e12b50c 100644 --- a/tests/ui/rust-2021/future-prelude-collision-shadow.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-shadow.stderr @@ -14,8 +14,9 @@ LL + use std::convert::TryInto; | help: there is a method `into` with a similar name | -LL | let _: u32 = 3u8.into().unwrap(); - | ~~~~ +LL - let _: u32 = 3u8.try_into().unwrap(); +LL + let _: u32 = 3u8.into().unwrap(); + | error: aborting due to 1 previous error diff --git a/tests/ui/self/arbitrary_self_type_mut_difference.stderr b/tests/ui/self/arbitrary_self_type_mut_difference.stderr index ffc61ee0d7838..31c1c9b738205 100644 --- a/tests/ui/self/arbitrary_self_type_mut_difference.stderr +++ b/tests/ui/self/arbitrary_self_type_mut_difference.stderr @@ -11,8 +11,9 @@ LL | fn x(self: Pin<&mut Self>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: there is a method `y` with a similar name | -LL | Pin::new(&S).y(); - | ~ +LL - Pin::new(&S).x(); +LL + Pin::new(&S).y(); + | error[E0599]: no method named `y` found for struct `Pin<&mut S>` in the current scope --> $DIR/arbitrary_self_type_mut_difference.rs:12:22 @@ -27,8 +28,9 @@ LL | fn y(self: Pin<&Self>) {} | ^^^^^^^^^^^^^^^^^^^^^^ help: there is a method `x` with a similar name | -LL | Pin::new(&mut S).x(); - | ~ +LL - Pin::new(&mut S).y(); +LL + Pin::new(&mut S).x(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/self/self-infer.stderr b/tests/ui/self/self-infer.stderr index 4f9e3f21dca52..c6bdff22b6970 100644 --- a/tests/ui/self/self-infer.stderr +++ b/tests/ui/self/self-infer.stderr @@ -6,8 +6,9 @@ LL | fn f(self: _) {} | help: use type parameters instead | -LL | fn f(self: T) {} - | +++ ~ +LL - fn f(self: _) {} +LL + fn f(self: T) {} + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/self-infer.rs:5:17 @@ -17,8 +18,9 @@ LL | fn g(self: &_) {} | help: use type parameters instead | -LL | fn g(self: &T) {} - | +++ ~ +LL - fn g(self: &_) {} +LL + fn g(self: &T) {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/simd/portable-intrinsics-arent-exposed.stderr b/tests/ui/simd/portable-intrinsics-arent-exposed.stderr index d38667f750d92..71b4273fa0630 100644 --- a/tests/ui/simd/portable-intrinsics-arent-exposed.stderr +++ b/tests/ui/simd/portable-intrinsics-arent-exposed.stderr @@ -15,8 +15,9 @@ LL | use std::simd::intrinsics; | help: consider importing this module instead | -LL | use std::intrinsics; - | ~~~~~~~~~~~~~~~ +LL - use std::simd::intrinsics; +LL + use std::intrinsics; + | error: aborting due to 2 previous errors diff --git a/tests/ui/span/issue-35987.stderr b/tests/ui/span/issue-35987.stderr index 36c59137b3125..634bb5ed68f54 100644 --- a/tests/ui/span/issue-35987.stderr +++ b/tests/ui/span/issue-35987.stderr @@ -17,10 +17,12 @@ LL | fn add(self, rhs: Self) -> Self::Output { | help: use fully-qualified syntax | -LL | fn add(self, rhs: Self) -> as BitOr>::Output { - | ~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | fn add(self, rhs: Self) -> as IntoFuture>::Output { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn add(self, rhs: Self) -> Self::Output { +LL + fn add(self, rhs: Self) -> as BitOr>::Output { + | +LL - fn add(self, rhs: Self) -> Self::Output { +LL + fn add(self, rhs: Self) -> as IntoFuture>::Output { + | error: aborting due to 2 previous errors diff --git a/tests/ui/span/issue-37767.stderr b/tests/ui/span/issue-37767.stderr index 457870821a19a..2bb64e3da8617 100644 --- a/tests/ui/span/issue-37767.stderr +++ b/tests/ui/span/issue-37767.stderr @@ -16,12 +16,14 @@ LL | fn foo(&mut self) {} | ^^^^^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | A::foo(&mut a) - | ~~~~~~~~~~~~~~ +LL - a.foo() +LL + A::foo(&mut a) + | help: disambiguate the method for candidate #2 | -LL | B::foo(&mut a) - | ~~~~~~~~~~~~~~ +LL - a.foo() +LL + B::foo(&mut a) + | error[E0034]: multiple applicable items in scope --> $DIR/issue-37767.rs:22:7 @@ -41,12 +43,14 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | C::foo(&a) - | ~~~~~~~~~~ +LL - a.foo() +LL + C::foo(&a) + | help: disambiguate the method for candidate #2 | -LL | D::foo(&a) - | ~~~~~~~~~~ +LL - a.foo() +LL + D::foo(&a) + | error[E0034]: multiple applicable items in scope --> $DIR/issue-37767.rs:34:7 @@ -66,12 +70,14 @@ LL | fn foo(self) {} | ^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | E::foo(a) - | ~~~~~~~~~ +LL - a.foo() +LL + E::foo(a) + | help: disambiguate the method for candidate #2 | -LL | F::foo(a) - | ~~~~~~~~~ +LL - a.foo() +LL + F::foo(a) + | error: aborting due to 3 previous errors diff --git a/tests/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr b/tests/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr index a4b6525657406..00eca70e03361 100644 --- a/tests/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr +++ b/tests/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr @@ -19,8 +19,9 @@ LL | .sum::<_>() | help: consider specifying the generic argument | -LL | .sum::() - | ~~~~~ +LL - .sum::<_>() +LL + .sum::() + | error: aborting due to 2 previous errors diff --git a/tests/ui/span/issue-81800.stderr b/tests/ui/span/issue-81800.stderr index 86c64573b140f..c1583c3ef8f88 100644 --- a/tests/ui/span/issue-81800.stderr +++ b/tests/ui/span/issue-81800.stderr @@ -6,8 +6,9 @@ LL | fn x˂- | help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not | -LL | fn x<- - | ~ +LL - fn x˂- +LL + fn x<- + | error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `-` --> $DIR/issue-81800.rs:1:6 diff --git a/tests/ui/span/missing-unit-argument.stderr b/tests/ui/span/missing-unit-argument.stderr index 79980f48ab6bc..2f3b45a8157f9 100644 --- a/tests/ui/span/missing-unit-argument.stderr +++ b/tests/ui/span/missing-unit-argument.stderr @@ -8,8 +8,9 @@ note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL help: provide the argument | -LL | let _: Result<(), String> = Ok(()); - | ~~~~ +LL - let _: Result<(), String> = Ok(); +LL + let _: Result<(), String> = Ok(()); + | error[E0061]: this function takes 2 arguments but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:12:5 @@ -24,8 +25,9 @@ LL | fn foo(():(), ():()) {} | ^^^ ----- ----- help: provide the arguments | -LL | foo((), ()); - | ~~~~~~~~ +LL - foo(); +LL + foo((), ()); + | error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/missing-unit-argument.rs:13:5 @@ -40,8 +42,9 @@ LL | fn foo(():(), ():()) {} | ^^^ ----- ----- help: provide the argument | -LL | foo((), ()); - | ~~~~~~~~ +LL - foo(()); +LL + foo((), ()); + | error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:14:5 @@ -56,8 +59,9 @@ LL | fn bar(():()) {} | ^^^ ----- help: provide the argument | -LL | bar(()); - | ~~~~ +LL - bar(); +LL + bar(()); + | error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:15:7 @@ -72,8 +76,9 @@ LL | fn baz(self, (): ()) { } | ^^^ ------ help: provide the argument | -LL | S.baz(()); - | ~~~~ +LL - S.baz(); +LL + S.baz(()); + | error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:16:7 @@ -88,8 +93,9 @@ LL | fn generic(self, _: T) { } | ^^^^^^^ ---- help: provide the argument | -LL | S.generic::<()>(()); - | ~~~~ +LL - S.generic::<()>(); +LL + S.generic::<()>(()); + | error: aborting due to 6 previous errors diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr b/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr index 050834ab67609..4cbd93d17cfee 100644 --- a/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr +++ b/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr @@ -11,8 +11,9 @@ LL | #![deny(stable_features)] | ^^^^^^^^^^^^^^^ help: if you are using features which are still unstable, change to using `const_foobar` | -LL | #![feature(const_foobar)] - | ~~~~~~~~~~~~ +LL - #![feature(const_foo)] +LL + #![feature(const_foobar)] + | help: if you are using features which are now stable, remove this line | LL - #![feature(const_foo)] diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr b/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr index 50cc14c3b4f65..38331919ee8ff 100644 --- a/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr +++ b/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr @@ -11,8 +11,9 @@ LL | #![deny(stable_features)] | ^^^^^^^^^^^^^^^ help: if you are using features which are still unstable, change to using `const_foobar` | -LL | #![feature(const_foobar)] - | ~~~~~~~~~~~~ +LL - #![feature(const_foo)] +LL + #![feature(const_foobar)] + | help: if you are using features which are now stable, remove this line | LL - #![feature(const_foo)] diff --git a/tests/ui/stability-attribute/stability-attribute-implies-using-stable.stderr b/tests/ui/stability-attribute/stability-attribute-implies-using-stable.stderr index d783f1e8e4044..1080b977410d7 100644 --- a/tests/ui/stability-attribute/stability-attribute-implies-using-stable.stderr +++ b/tests/ui/stability-attribute/stability-attribute-implies-using-stable.stderr @@ -11,8 +11,9 @@ LL | #![deny(stable_features)] | ^^^^^^^^^^^^^^^ help: if you are using features which are still unstable, change to using `foobar` | -LL | #![feature(foobar)] - | ~~~~~~ +LL - #![feature(foo)] +LL + #![feature(foobar)] + | help: if you are using features which are now stable, remove this line | LL - #![feature(foo)] diff --git a/tests/ui/stability-attribute/stability-attribute-implies-using-unstable.stderr b/tests/ui/stability-attribute/stability-attribute-implies-using-unstable.stderr index 4940650fd4261..02cb25633ab0b 100644 --- a/tests/ui/stability-attribute/stability-attribute-implies-using-unstable.stderr +++ b/tests/ui/stability-attribute/stability-attribute-implies-using-unstable.stderr @@ -11,8 +11,9 @@ LL | #![deny(stable_features)] | ^^^^^^^^^^^^^^^ help: if you are using features which are still unstable, change to using `foobar` | -LL | #![feature(foobar)] - | ~~~~~~ +LL - #![feature(foo)] +LL + #![feature(foobar)] + | help: if you are using features which are now stable, remove this line | LL - #![feature(foo)] diff --git a/tests/ui/static/reference-to-mut-static-safe.e2021.stderr b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr index 9fdfc00dfcd91..70b2a0a584cd4 100644 --- a/tests/ui/static/reference-to-mut-static-safe.e2021.stderr +++ b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr @@ -10,8 +10,9 @@ LL | let _x = &X; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | let _x = addr_of!(X); - | ~~~~~~~~~ + +LL - let _x = &X; +LL + let _x = addr_of!(X); + | error[E0133]: use of mutable static is unsafe and requires unsafe function or block --> $DIR/reference-to-mut-static-safe.rs:9:15 diff --git a/tests/ui/static/reference-to-mut-static-safe.e2024.stderr b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr index b3e0c84d1d89d..32ce7059b1ea9 100644 --- a/tests/ui/static/reference-to-mut-static-safe.e2024.stderr +++ b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr @@ -7,8 +7,9 @@ LL | let _x = &X; = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let _x = addr_of!(X); - | ~~~~~~~~~ + +LL - let _x = &X; +LL + let _x = addr_of!(X); + | error[E0133]: use of mutable static is unsafe and requires unsafe block --> $DIR/reference-to-mut-static-safe.rs:9:15 diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr index ca9cfbf7ac787..bb0f34a0374c9 100644 --- a/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr +++ b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr @@ -7,8 +7,9 @@ LL | let _y = &X; = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let _y = addr_of!(X); - | ~~~~~~~~~ + +LL - let _y = &X; +LL + let _y = addr_of!(X); + | error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-to-mut-static-unsafe-fn.rs:13:22 @@ -43,8 +44,9 @@ LL | let (_b, _c) = (&X, &mut Y); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let (_b, _c) = (addr_of!(X), &mut Y); - | ~~~~~~~~~ + +LL - let (_b, _c) = (&X, &mut Y); +LL + let (_b, _c) = (addr_of!(X), &mut Y); + | error[E0796]: creating a mutable reference to a mutable static --> $DIR/reference-to-mut-static-unsafe-fn.rs:19:29 @@ -55,8 +57,9 @@ LL | let (_b, _c) = (&X, &mut Y); = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | let (_b, _c) = (&X, addr_of_mut!(Y)); - | ~~~~~~~~~~~~~ + +LL - let (_b, _c) = (&X, &mut Y); +LL + let (_b, _c) = (&X, addr_of_mut!(Y)); + | error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-to-mut-static-unsafe-fn.rs:23:13 @@ -67,8 +70,9 @@ LL | foo(&X); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | foo(addr_of!(X)); - | ~~~~~~~~~ + +LL - foo(&X); +LL + foo(addr_of!(X)); + | error: aborting due to 6 previous errors diff --git a/tests/ui/static/reference-to-mut-static.e2021.stderr b/tests/ui/static/reference-to-mut-static.e2021.stderr index 667d7602f34a5..338f2ad89c7f3 100644 --- a/tests/ui/static/reference-to-mut-static.e2021.stderr +++ b/tests/ui/static/reference-to-mut-static.e2021.stderr @@ -14,8 +14,9 @@ LL | #![deny(static_mut_refs)] | ^^^^^^^^^^^^^^^ help: use `addr_of!` instead to create a raw pointer | -LL | let _y = addr_of!(X); - | ~~~~~~~~~ + +LL - let _y = &X; +LL + let _y = addr_of!(X); + | error: creating a mutable reference to mutable static is discouraged --> $DIR/reference-to-mut-static.rs:20:18 @@ -28,8 +29,9 @@ LL | let _y = &mut X; = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | let _y = addr_of_mut!(X); - | ~~~~~~~~~~~~~ + +LL - let _y = &mut X; +LL + let _y = addr_of_mut!(X); + | error: creating a shared reference to mutable static is discouraged --> $DIR/reference-to-mut-static.rs:28:22 @@ -56,8 +58,9 @@ LL | let (_b, _c) = (&X, &Y); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let (_b, _c) = (addr_of!(X), &Y); - | ~~~~~~~~~ + +LL - let (_b, _c) = (&X, &Y); +LL + let (_b, _c) = (addr_of!(X), &Y); + | error: creating a shared reference to mutable static is discouraged --> $DIR/reference-to-mut-static.rs:32:29 @@ -70,8 +73,9 @@ LL | let (_b, _c) = (&X, &Y); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let (_b, _c) = (&X, addr_of!(Y)); - | ~~~~~~~~~ + +LL - let (_b, _c) = (&X, &Y); +LL + let (_b, _c) = (&X, addr_of!(Y)); + | error: creating a shared reference to mutable static is discouraged --> $DIR/reference-to-mut-static.rs:38:13 @@ -84,8 +88,9 @@ LL | foo(&X); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | foo(addr_of!(X)); - | ~~~~~~~~~ + +LL - foo(&X); +LL + foo(addr_of!(X)); + | error: aborting due to 6 previous errors diff --git a/tests/ui/static/reference-to-mut-static.e2024.stderr b/tests/ui/static/reference-to-mut-static.e2024.stderr index e77f43554666c..379d649dc894b 100644 --- a/tests/ui/static/reference-to-mut-static.e2024.stderr +++ b/tests/ui/static/reference-to-mut-static.e2024.stderr @@ -7,8 +7,9 @@ LL | let _y = &X; = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let _y = addr_of!(X); - | ~~~~~~~~~ + +LL - let _y = &X; +LL + let _y = addr_of!(X); + | error[E0796]: creating a mutable reference to a mutable static --> $DIR/reference-to-mut-static.rs:20:18 @@ -19,8 +20,9 @@ LL | let _y = &mut X; = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | let _y = addr_of_mut!(X); - | ~~~~~~~~~~~~~ + +LL - let _y = &mut X; +LL + let _y = addr_of_mut!(X); + | error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-to-mut-static.rs:28:22 @@ -43,8 +45,9 @@ LL | let (_b, _c) = (&X, &Y); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let (_b, _c) = (addr_of!(X), &Y); - | ~~~~~~~~~ + +LL - let (_b, _c) = (&X, &Y); +LL + let (_b, _c) = (addr_of!(X), &Y); + | error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-to-mut-static.rs:32:29 @@ -55,8 +58,9 @@ LL | let (_b, _c) = (&X, &Y); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let (_b, _c) = (&X, addr_of!(Y)); - | ~~~~~~~~~ + +LL - let (_b, _c) = (&X, &Y); +LL + let (_b, _c) = (&X, addr_of!(Y)); + | error[E0796]: creating a shared reference to a mutable static --> $DIR/reference-to-mut-static.rs:38:13 @@ -67,8 +71,9 @@ LL | foo(&X); = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | foo(addr_of!(X)); - | ~~~~~~~~~ + +LL - foo(&X); +LL + foo(addr_of!(X)); + | error: aborting due to 6 previous errors diff --git a/tests/ui/static/safe-extern-statics-mut.stderr b/tests/ui/static/safe-extern-statics-mut.stderr index 7705a897e2717..1ed7ffe696183 100644 --- a/tests/ui/static/safe-extern-statics-mut.stderr +++ b/tests/ui/static/safe-extern-statics-mut.stderr @@ -10,8 +10,9 @@ LL | let rb = &B; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | let rb = addr_of!(B); - | ~~~~~~~~~ + +LL - let rb = &B; +LL + let rb = addr_of!(B); + | warning: creating a shared reference to mutable static is discouraged --> $DIR/safe-extern-statics-mut.rs:15:15 @@ -24,8 +25,9 @@ LL | let xrb = &XB; = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior help: use `addr_of!` instead to create a raw pointer | -LL | let xrb = addr_of!(XB); - | ~~~~~~~~~ + +LL - let xrb = &XB; +LL + let xrb = addr_of!(XB); + | error[E0133]: use of mutable static is unsafe and requires unsafe function or block --> $DIR/safe-extern-statics-mut.rs:11:13 diff --git a/tests/ui/static/static-reference-to-fn-1.stderr b/tests/ui/static/static-reference-to-fn-1.stderr index 6bf64974ef59b..72036269b296c 100644 --- a/tests/ui/static/static-reference-to-fn-1.stderr +++ b/tests/ui/static/static-reference-to-fn-1.stderr @@ -9,8 +9,9 @@ LL | func: &foo, = note: fn items are distinct from fn pointers help: consider casting to a fn pointer | -LL | func: &(foo as fn() -> Option), - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - func: &foo, +LL + func: &(foo as fn() -> Option), + | error: aborting due to 1 previous error diff --git a/tests/ui/statics/issue-15261.stderr b/tests/ui/statics/issue-15261.stderr index 6035eef5b7140..7ab3afb4dc15e 100644 --- a/tests/ui/statics/issue-15261.stderr +++ b/tests/ui/statics/issue-15261.stderr @@ -10,8 +10,9 @@ LL | static n: &'static usize = unsafe { &n_mut }; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | static n: &'static usize = unsafe { addr_of!(n_mut) }; - | ~~~~~~~~~ + +LL - static n: &'static usize = unsafe { &n_mut }; +LL + static n: &'static usize = unsafe { addr_of!(n_mut) }; + | warning: 1 warning emitted diff --git a/tests/ui/statics/static-mut-xc.stderr b/tests/ui/statics/static-mut-xc.stderr index 9751f754332c9..28e8fbaa0af4f 100644 --- a/tests/ui/statics/static-mut-xc.stderr +++ b/tests/ui/statics/static-mut-xc.stderr @@ -10,8 +10,9 @@ LL | static_bound(&static_mut_xc::a); = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | static_bound(addr_of!(static_mut_xc::a)); - | ~~~~~~~~~ + +LL - static_bound(&static_mut_xc::a); +LL + static_bound(addr_of!(static_mut_xc::a)); + | warning: creating a mutable reference to mutable static is discouraged --> $DIR/static-mut-xc.rs:30:22 @@ -24,8 +25,9 @@ LL | static_bound_set(&mut static_mut_xc::a); = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior help: use `addr_of_mut!` instead to create a raw pointer | -LL | static_bound_set(addr_of_mut!(static_mut_xc::a)); - | ~~~~~~~~~~~~~ + +LL - static_bound_set(&mut static_mut_xc::a); +LL + static_bound_set(addr_of_mut!(static_mut_xc::a)); + | warning: 2 warnings emitted diff --git a/tests/ui/statics/static-recursive.stderr b/tests/ui/statics/static-recursive.stderr index a7a1a1610afbb..ed7a53bf4f807 100644 --- a/tests/ui/statics/static-recursive.stderr +++ b/tests/ui/statics/static-recursive.stderr @@ -10,8 +10,9 @@ LL | static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 }; = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | -LL | static mut S: *const u8 = unsafe { addr_of!(S) as *const *const u8 as *const u8 }; - | ~~~~~~~~~ + +LL - static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 }; +LL + static mut S: *const u8 = unsafe { addr_of!(S) as *const *const u8 as *const u8 }; + | warning: 1 warning emitted diff --git a/tests/ui/str/str-as-char.stderr b/tests/ui/str/str-as-char.stderr index 0638d371c173b..b2c716fa4f56f 100644 --- a/tests/ui/str/str-as-char.stderr +++ b/tests/ui/str/str-as-char.stderr @@ -6,8 +6,9 @@ LL | println!('●●'); | help: if you meant to write a string literal, use double quotes | -LL | println!("●●"); - | ~ ~ +LL - println!('●●'); +LL + println!("●●"); + | error: aborting due to 1 previous error diff --git a/tests/ui/structs-enums/issue-103869.stderr b/tests/ui/structs-enums/issue-103869.stderr index 2334e5e9712c4..10e0f29f8762d 100644 --- a/tests/ui/structs-enums/issue-103869.stderr +++ b/tests/ui/structs-enums/issue-103869.stderr @@ -10,8 +10,9 @@ LL | vec: Vec, = help: enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` help: perhaps you meant to use `struct` here | -LL | struct VecOrMap { - | ~~~~~~ +LL - enum VecOrMap { +LL + struct VecOrMap { + | error: aborting due to 1 previous error diff --git a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr index 664a00e3303e0..231bada006cdd 100644 --- a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr +++ b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr @@ -6,8 +6,9 @@ LL | if let Some(Foo::Bar {_}) = foo {} | help: to omit remaining fields, use `..` | -LL | if let Some(Foo::Bar {..}) = foo {} - | ~~ +LL - if let Some(Foo::Bar {_}) = foo {} +LL + if let Some(Foo::Bar {..}) = foo {} + | error: aborting due to 1 previous error diff --git a/tests/ui/structs/struct-field-cfg.stderr b/tests/ui/structs/struct-field-cfg.stderr index 2b9ba85ddcb88..c808671a80d34 100644 --- a/tests/ui/structs/struct-field-cfg.stderr +++ b/tests/ui/structs/struct-field-cfg.stderr @@ -20,12 +20,14 @@ LL | let Foo { #[cfg(any())] present: () } = foo; | help: include the missing field in the pattern | -LL | let Foo { present } = foo; - | ~~~~~~~~~~~ +LL - let Foo { #[cfg(any())] present: () } = foo; +LL + let Foo { present } = foo; + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let Foo { .. } = foo; - | ~~~~~~ +LL - let Foo { #[cfg(any())] present: () } = foo; +LL + let Foo { .. } = foo; + | error[E0026]: struct `Foo` does not have a field named `absent` --> $DIR/struct-field-cfg.rs:16:42 diff --git a/tests/ui/structs/struct-fields-hints-no-dupe.stderr b/tests/ui/structs/struct-fields-hints-no-dupe.stderr index 2b88d802833c3..650f6ddfa88b0 100644 --- a/tests/ui/structs/struct-fields-hints-no-dupe.stderr +++ b/tests/ui/structs/struct-fields-hints-no-dupe.stderr @@ -6,8 +6,9 @@ LL | bar : 42, | help: a field with a similar name exists | -LL | barr : 42, - | ~~~~ +LL - bar : 42, +LL + barr : 42, + | error: aborting due to 1 previous error diff --git a/tests/ui/structs/struct-fields-hints.stderr b/tests/ui/structs/struct-fields-hints.stderr index 8217d7a6e811d..6526e49600ec9 100644 --- a/tests/ui/structs/struct-fields-hints.stderr +++ b/tests/ui/structs/struct-fields-hints.stderr @@ -6,8 +6,9 @@ LL | bar : 42, | help: a field with a similar name exists | -LL | car : 42, - | ~~~ +LL - bar : 42, +LL + car : 42, + | error: aborting due to 1 previous error diff --git a/tests/ui/structs/struct-fields-typo.stderr b/tests/ui/structs/struct-fields-typo.stderr index d87bace727736..dacf2ecea17c7 100644 --- a/tests/ui/structs/struct-fields-typo.stderr +++ b/tests/ui/structs/struct-fields-typo.stderr @@ -6,8 +6,9 @@ LL | let x = foo.baa; | help: a field with a similar name exists | -LL | let x = foo.bar; - | ~~~ +LL - let x = foo.baa; +LL + let x = foo.bar; + | error: aborting due to 1 previous error diff --git a/tests/ui/structs/struct-pat-derived-error.stderr b/tests/ui/structs/struct-pat-derived-error.stderr index 78bb018cb4be7..78f28e323fbc6 100644 --- a/tests/ui/structs/struct-pat-derived-error.stderr +++ b/tests/ui/structs/struct-pat-derived-error.stderr @@ -6,8 +6,9 @@ LL | let A { x, y } = self.d; | help: a field with a similar name exists | -LL | let A { x, y } = self.b; - | ~ +LL - let A { x, y } = self.d; +LL + let A { x, y } = self.b; + | error[E0026]: struct `A` does not have fields named `x`, `y` --> $DIR/struct-pat-derived-error.rs:8:17 @@ -23,12 +24,14 @@ LL | let A { x, y } = self.d; | help: include the missing fields in the pattern | -LL | let A { x, y, b, c } = self.d; - | ~~~~~~~~ +LL - let A { x, y } = self.d; +LL + let A { x, y, b, c } = self.d; + | help: if you don't care about these missing fields, you can explicitly ignore them | -LL | let A { x, y, .. } = self.d; - | ~~~~~~ +LL - let A { x, y } = self.d; +LL + let A { x, y, .. } = self.d; + | error: aborting due to 3 previous errors diff --git a/tests/ui/structs/struct-path-self-type-mismatch.stderr b/tests/ui/structs/struct-path-self-type-mismatch.stderr index bbe5bae29bbe1..6517d7f00ddb1 100644 --- a/tests/ui/structs/struct-path-self-type-mismatch.stderr +++ b/tests/ui/structs/struct-path-self-type-mismatch.stderr @@ -44,8 +44,9 @@ LL | | } = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters help: use the type name directly | -LL | Foo:: { - | ~~~~~~~~ +LL - Self { +LL + Foo:: { + | error: aborting due to 3 previous errors diff --git a/tests/ui/structs/struct-tuple-field-names.stderr b/tests/ui/structs/struct-tuple-field-names.stderr index 0b837a47a8254..5a6b70f5e34be 100644 --- a/tests/ui/structs/struct-tuple-field-names.stderr +++ b/tests/ui/structs/struct-tuple-field-names.stderr @@ -6,8 +6,9 @@ LL | E::S { 0, 1 } => {} | help: use the tuple variant pattern syntax instead | -LL | E::S(_, _) => {} - | ~~~~~~ +LL - E::S { 0, 1 } => {} +LL + E::S(_, _) => {} + | error[E0769]: tuple variant `S` written as struct variant --> $DIR/struct-tuple-field-names.rs:13:9 @@ -17,8 +18,9 @@ LL | S { } => {} | help: use the tuple variant pattern syntax instead | -LL | S(_, _) => {} - | ~~~~~~ +LL - S { } => {} +LL + S(_, _) => {} + | error[E0027]: pattern does not mention field `1` --> $DIR/struct-tuple-field-names.rs:16:12 @@ -28,12 +30,14 @@ LL | if let E::S { 0: a } = x { | help: include the missing field in the pattern | -LL | if let E::S { 0: a, 1: _ } = x { - | ~~~~~~~~ +LL - if let E::S { 0: a } = x { +LL + if let E::S { 0: a, 1: _ } = x { + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | if let E::S { 0: a, .. } = x { - | ~~~~~~ +LL - if let E::S { 0: a } = x { +LL + if let E::S { 0: a, .. } = x { + | error: aborting due to 3 previous errors diff --git a/tests/ui/structs/suggest-private-fields.stderr b/tests/ui/structs/suggest-private-fields.stderr index f67a4ed78e290..adf90f0e1fd65 100644 --- a/tests/ui/structs/suggest-private-fields.stderr +++ b/tests/ui/structs/suggest-private-fields.stderr @@ -6,8 +6,9 @@ LL | aa: 20, | help: a field with a similar name exists | -LL | a: 20, - | ~ +LL - aa: 20, +LL + a: 20, + | error[E0560]: struct `B` has no field named `bb` --> $DIR/suggest-private-fields.rs:17:9 @@ -25,8 +26,9 @@ LL | aa: 20, | help: a field with a similar name exists | -LL | a: 20, - | ~ +LL - aa: 20, +LL + a: 20, + | error[E0560]: struct `A` has no field named `bb` --> $DIR/suggest-private-fields.rs:24:9 @@ -36,8 +38,9 @@ LL | bb: 20, | help: a field with a similar name exists | -LL | b: 20, - | ~ +LL - bb: 20, +LL + b: 20, + | error: aborting due to 4 previous errors diff --git a/tests/ui/structs/suggest-replacing-field-when-specifying-same-type.stderr b/tests/ui/structs/suggest-replacing-field-when-specifying-same-type.stderr index e8503f540c288..7abdcff0bb45e 100644 --- a/tests/ui/structs/suggest-replacing-field-when-specifying-same-type.stderr +++ b/tests/ui/structs/suggest-replacing-field-when-specifying-same-type.stderr @@ -15,12 +15,14 @@ LL | Foo::Bar { a, aa: 1, c } => (), | help: include the missing field in the pattern | -LL | Foo::Bar { a, aa: 1, c, b } => (), - | ~~~~~ +LL - Foo::Bar { a, aa: 1, c } => (), +LL + Foo::Bar { a, aa: 1, c, b } => (), + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Foo::Bar { a, aa: 1, c, .. } => (), - | ~~~~~~ +LL - Foo::Bar { a, aa: 1, c } => (), +LL + Foo::Bar { a, aa: 1, c, .. } => (), + | error[E0026]: variant `Foo::Baz` does not have a field named `bb` --> $DIR/suggest-replacing-field-when-specifying-same-type.rs:13:20 @@ -39,12 +41,14 @@ LL | Foo::Baz { bb: 1.0 } => (), | help: include the missing field in the pattern | -LL | Foo::Baz { bb: 1.0, a } => (), - | ~~~~~ +LL - Foo::Baz { bb: 1.0 } => (), +LL + Foo::Baz { bb: 1.0, a } => (), + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Foo::Baz { bb: 1.0, .. } => (), - | ~~~~~~ +LL - Foo::Baz { bb: 1.0 } => (), +LL + Foo::Baz { bb: 1.0, .. } => (), + | error[E0026]: variant `Foo::Bar` does not have a field named `aa` --> $DIR/suggest-replacing-field-when-specifying-same-type.rs:20:23 @@ -60,12 +64,14 @@ LL | Foo::Bar { a, aa: "", c } => (), | help: include the missing field in the pattern | -LL | Foo::Bar { a, aa: "", c, b } => (), - | ~~~~~ +LL - Foo::Bar { a, aa: "", c } => (), +LL + Foo::Bar { a, aa: "", c, b } => (), + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Foo::Bar { a, aa: "", c, .. } => (), - | ~~~~~~ +LL - Foo::Bar { a, aa: "", c } => (), +LL + Foo::Bar { a, aa: "", c, .. } => (), + | error[E0026]: variant `Foo::Baz` does not have a field named `bb` --> $DIR/suggest-replacing-field-when-specifying-same-type.rs:23:20 @@ -81,12 +87,14 @@ LL | Foo::Baz { bb: "" } => (), | help: include the missing field in the pattern | -LL | Foo::Baz { bb: "", a } => (), - | ~~~~~ +LL - Foo::Baz { bb: "" } => (), +LL + Foo::Baz { bb: "", a } => (), + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Foo::Baz { bb: "", .. } => (), - | ~~~~~~ +LL - Foo::Baz { bb: "" } => (), +LL + Foo::Baz { bb: "", .. } => (), + | error: aborting due to 8 previous errors diff --git a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr index 1051a16b40d7c..8644f4a1dd452 100644 --- a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr @@ -60,8 +60,9 @@ note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: provide the argument | -LL | let _: Option<(i8,)> = Some(/* (i8,) */); - | ~~~~~~~~~~~~~ +LL - let _: Option<(i8,)> = Some(); +LL + let _: Option<(i8,)> = Some(/* (i8,) */); + | error[E0308]: mismatched types --> $DIR/args-instead-of-tuple-errors.rs:14:34 diff --git a/tests/ui/suggestions/args-instead-of-tuple.stderr b/tests/ui/suggestions/args-instead-of-tuple.stderr index 3ca560f93eb79..4b0bab971ee71 100644 --- a/tests/ui/suggestions/args-instead-of-tuple.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple.stderr @@ -34,8 +34,9 @@ note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: provide the argument | -LL | let _: Option<()> = Some(()); - | ~~~~ +LL - let _: Option<()> = Some(); +LL + let _: Option<()> = Some(()); + | error[E0308]: mismatched types --> $DIR/args-instead-of-tuple.rs:14:34 diff --git a/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr b/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr index 8f00a72f1e81a..6d6fd98303845 100644 --- a/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr +++ b/tests/ui/suggestions/assoc-ct-for-assoc-method.stderr @@ -10,8 +10,9 @@ LL | let x: i32 = MyS::foo; found fn item `fn() -> MyS {MyS::foo}` help: try referring to the associated const `FOO` instead (notice the capitalization difference) | -LL | let x: i32 = MyS::FOO; - | ~~~ +LL - let x: i32 = MyS::foo; +LL + let x: i32 = MyS::FOO; + | error[E0308]: mismatched types --> $DIR/assoc-ct-for-assoc-method.rs:15:18 @@ -25,8 +26,9 @@ LL | let z: i32 = i32::max; found fn item `fn(i32, i32) -> i32 {::max}` help: try referring to the associated const `MAX` instead | -LL | let z: i32 = i32::MAX; - | ~~~ +LL - let z: i32 = i32::max; +LL + let z: i32 = i32::MAX; + | error[E0369]: cannot subtract `{integer}` from `fn(i32, i32) -> i32 {::max}` --> $DIR/assoc-ct-for-assoc-method.rs:22:27 diff --git a/tests/ui/suggestions/bad-hex-float-lit.stderr b/tests/ui/suggestions/bad-hex-float-lit.stderr index bc09abb1a5671..94c0715a4e683 100644 --- a/tests/ui/suggestions/bad-hex-float-lit.stderr +++ b/tests/ui/suggestions/bad-hex-float-lit.stderr @@ -8,10 +8,12 @@ LL | let _f: f32 = 0xAAf32; | help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float | -LL | let _f: f32 = 0xAA as f32; - | ~~~~~~~~~~~ -LL | let _f: f32 = 170_f32; - | ~~~~~~~ +LL - let _f: f32 = 0xAAf32; +LL + let _f: f32 = 0xAA as f32; + | +LL - let _f: f32 = 0xAAf32; +LL + let _f: f32 = 170_f32; + | error[E0308]: mismatched types --> $DIR/bad-hex-float-lit.rs:6:19 @@ -23,10 +25,12 @@ LL | let _f: f32 = 0xAB_f32; | help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float | -LL | let _f: f32 = 0xAB as f32; - | ~~~~~~~~~~~ -LL | let _f: f32 = 171_f32; - | ~~~~~~~ +LL - let _f: f32 = 0xAB_f32; +LL + let _f: f32 = 0xAB as f32; + | +LL - let _f: f32 = 0xAB_f32; +LL + let _f: f32 = 171_f32; + | error[E0308]: mismatched types --> $DIR/bad-hex-float-lit.rs:10:19 @@ -38,10 +42,12 @@ LL | let _f: f64 = 0xFF_f64; | help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float | -LL | let _f: f64 = 0xFF as f64; - | ~~~~~~~~~~~ -LL | let _f: f64 = 255_f64; - | ~~~~~~~ +LL - let _f: f64 = 0xFF_f64; +LL + let _f: f64 = 0xFF as f64; + | +LL - let _f: f64 = 0xFF_f64; +LL + let _f: f64 = 255_f64; + | error: aborting due to 3 previous errors diff --git a/tests/ui/suggestions/bad-infer-in-trait-impl.stderr b/tests/ui/suggestions/bad-infer-in-trait-impl.stderr index 50c398de2b08b..68d8f5402e44c 100644 --- a/tests/ui/suggestions/bad-infer-in-trait-impl.stderr +++ b/tests/ui/suggestions/bad-infer-in-trait-impl.stderr @@ -6,8 +6,9 @@ LL | fn bar(s: _) {} | help: use type parameters instead | -LL | fn bar(s: T) {} - | +++ ~ +LL - fn bar(s: _) {} +LL + fn bar(s: T) {} + | error[E0050]: method `bar` has 1 parameter but the declaration in trait `Foo::bar` has 0 --> $DIR/bad-infer-in-trait-impl.rs:6:15 diff --git a/tests/ui/suggestions/bool_typo_err_suggest.stderr b/tests/ui/suggestions/bool_typo_err_suggest.stderr index 8d59ed63e5432..faf799d0fda22 100644 --- a/tests/ui/suggestions/bool_typo_err_suggest.stderr +++ b/tests/ui/suggestions/bool_typo_err_suggest.stderr @@ -6,8 +6,9 @@ LL | let x = True; | help: you may want to use a bool value instead | -LL | let x = true; - | ~~~~ +LL - let x = True; +LL + let x = true; + | error[E0425]: cannot find value `False` in this scope --> $DIR/bool_typo_err_suggest.rs:9:13 @@ -17,8 +18,9 @@ LL | let y = False; | help: you may want to use a bool value instead (notice the capitalization difference) | -LL | let y = false; - | ~~~~~ +LL - let y = False; +LL + let y = false; + | error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/bound-suggestions.stderr b/tests/ui/suggestions/bound-suggestions.stderr index 4965e7439f849..09a7dafdf17c6 100644 --- a/tests/ui/suggestions/bound-suggestions.stderr +++ b/tests/ui/suggestions/bound-suggestions.stderr @@ -43,8 +43,9 @@ LL | println!("{:?} {:?}", x, y); = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider further restricting type parameter `Y` | -LL | fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug { - | ~~~~~~~~~~~~~~~~~~~~ +LL - fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, { +LL + fn test_no_bounds_where(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug { + | error[E0277]: `X` doesn't implement `Debug` --> $DIR/bound-suggestions.rs:33:22 diff --git a/tests/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr index 084d0408a8e7d..aac4fd54620c6 100644 --- a/tests/ui/suggestions/crate-or-module-typo.stderr +++ b/tests/ui/suggestions/crate-or-module-typo.stderr @@ -6,8 +6,9 @@ LL | use st::cell::Cell; | help: there is a crate or module with a similar name | -LL | use std::cell::Cell; - | ~~~ +LL - use st::cell::Cell; +LL + use std::cell::Cell; + | error[E0432]: unresolved import `bas` --> $DIR/crate-or-module-typo.rs:11:5 @@ -17,8 +18,9 @@ LL | use bas::bar; | help: there is a crate or module with a similar name | -LL | use bar::bar; - | ~~~ +LL - use bas::bar; +LL + use bar::bar; + | error[E0433]: failed to resolve: use of undeclared crate or module `st` --> $DIR/crate-or-module-typo.rs:14:10 @@ -28,8 +30,9 @@ LL | bar: st::cell::Cell | help: there is a crate or module with a similar name | -LL | bar: std::cell::Cell - | ~~~ +LL - bar: st::cell::Cell +LL + bar: std::cell::Cell + | help: consider importing this module | LL + use std::cell; diff --git a/tests/ui/suggestions/deref-path-method.stderr b/tests/ui/suggestions/deref-path-method.stderr index b27d9aef06614..17bd391021ae2 100644 --- a/tests/ui/suggestions/deref-path-method.stderr +++ b/tests/ui/suggestions/deref-path-method.stderr @@ -13,8 +13,9 @@ note: if you're trying to build a new `Vec<_, _>` consider using one of the foll --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL help: the function `contains` is implemented on `[_]` | -LL | <[_]>::contains(&vec, &0); - | ~~~~~ +LL - Vec::contains(&vec, &0); +LL + <[_]>::contains(&vec, &0); + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr index 348f7e00d468e..53fdb5880c06f 100644 --- a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr +++ b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr @@ -6,8 +6,9 @@ LL | assert_eq!(10u64, 10usize); | help: change the type of the numeric literal from `usize` to `u64` | -LL | assert_eq!(10u64, 10u64); - | ~~~ +LL - assert_eq!(10u64, 10usize); +LL + assert_eq!(10u64, 10u64); + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/field-access.stderr b/tests/ui/suggestions/field-access.stderr index 007bc6ecf9379..4696950930f33 100644 --- a/tests/ui/suggestions/field-access.stderr +++ b/tests/ui/suggestions/field-access.stderr @@ -11,8 +11,9 @@ LL | if let B::Fst = a {}; | help: you might have meant to use field `b` whose type is `B` | -LL | if let B::Fst = a.b {}; - | ~~~ +LL - if let B::Fst = a {}; +LL + if let B::Fst = a.b {}; + | error[E0308]: mismatched types --> $DIR/field-access.rs:25:9 @@ -28,8 +29,9 @@ LL | B::Fst => (), | help: you might have meant to use field `b` whose type is `B` | -LL | match a.b { - | ~~~ +LL - match a { +LL + match a.b { + | error[E0308]: mismatched types --> $DIR/field-access.rs:26:9 @@ -45,8 +47,9 @@ LL | B::Snd => (), | help: you might have meant to use field `b` whose type is `B` | -LL | match a.b { - | ~~~ +LL - match a { +LL + match a.b { + | error[E0308]: mismatched types --> $DIR/field-access.rs:32:9 @@ -59,8 +62,9 @@ LL | 1u32 => (), | help: you might have meant to use field `bar` whose type is `u32` | -LL | match unsafe { foo.bar } { - | ~~~~~~~~~~~~~~~~~~ +LL - match foo { +LL + match unsafe { foo.bar } { + | error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/fn-to-method.stderr b/tests/ui/suggestions/fn-to-method.stderr index 36c17e60d3572..27999cb537110 100644 --- a/tests/ui/suggestions/fn-to-method.stderr +++ b/tests/ui/suggestions/fn-to-method.stderr @@ -6,8 +6,9 @@ LL | let x = cmp(&1, &2); | help: use the `.` operator to call the method `Ord::cmp` on `&{integer}` | -LL | let x = (&1).cmp(&2); - | ~ ~~~~~~~~~ +LL - let x = cmp(&1, &2); +LL + let x = (&1).cmp(&2); + | error[E0425]: cannot find function `len` in this scope --> $DIR/fn-to-method.rs:12:13 diff --git a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr index d610a3b7cadd2..f943688e6578b 100644 --- a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr +++ b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr @@ -31,8 +31,9 @@ LL | std::ptr::from_ref(num).cast_mut().as_deref(); | help: there is a method `as_ref` with a similar name | -LL | std::ptr::from_ref(num).cast_mut().as_ref(); - | ~~~~~~ +LL - std::ptr::from_ref(num).cast_mut().as_deref(); +LL + std::ptr::from_ref(num).cast_mut().as_ref(); + | error: aborting due to 2 previous errors; 2 warnings emitted diff --git a/tests/ui/suggestions/imm-ref-trait-object-literal.stderr b/tests/ui/suggestions/imm-ref-trait-object-literal.stderr index e01102e3864ea..47f4c551f13d0 100644 --- a/tests/ui/suggestions/imm-ref-trait-object-literal.stderr +++ b/tests/ui/suggestions/imm-ref-trait-object-literal.stderr @@ -14,8 +14,9 @@ LL | fn foo(_: X) {} | ^^^^^ required by this bound in `foo` help: consider changing this borrow's mutability | -LL | foo(&mut s); - | ~~~~ +LL - foo(&s); +LL + foo(&mut s); + | error[E0277]: the trait bound `S: Trait` is not satisfied --> $DIR/imm-ref-trait-object-literal.rs:13:7 diff --git a/tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr b/tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr index 61a2925f582b2..74349770734ca 100644 --- a/tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr +++ b/tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr @@ -11,8 +11,9 @@ LL | fn g(mut x: impl Iterator) -> Option<&'static ()> { x.next( | +++++++ help: consider introducing a named lifetime parameter | -LL | fn g<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } - | ++++ ~~~ ~~~ +LL - fn g(mut x: impl Iterator) -> Option<&()> { x.next() } +LL + fn g<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - fn g(mut x: impl Iterator) -> Option<&()> { x.next() } @@ -32,8 +33,9 @@ LL | async fn i(mut x: impl Iterator) -> Option<&'static ()> { x | +++++++ help: consider introducing a named lifetime parameter | -LL | async fn i<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } - | ++++ ~~~ ~~~ +LL - async fn i(mut x: impl Iterator) -> Option<&()> { x.next() } +LL + async fn i<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - async fn i(mut x: impl Iterator) -> Option<&()> { x.next() } @@ -49,12 +51,14 @@ LL | fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn g(mut x: impl Iterator) -> Option<&'static ()> { x.next() } - | ~~~~~~~ +LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + fn g(mut x: impl Iterator) -> Option<&'static ()> { x.next() } + | help: consider introducing a named lifetime parameter | -LL | fn g<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } - | ++++ ~~~ ~~~ +LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + fn g<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } @@ -70,12 +74,14 @@ LL | async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.n = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | async fn i(mut x: impl Iterator) -> Option<&'static ()> { x.next() } - | ~~~~~~~ +LL - async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + async fn i(mut x: impl Iterator) -> Option<&'static ()> { x.next() } + | help: consider introducing a named lifetime parameter | -LL | async fn i<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } - | ++++ ~~~ ~~~ +LL - async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + async fn i<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } @@ -95,8 +101,9 @@ LL | fn g(mut x: impl Foo) -> Option<&'static ()> { x.next() } | +++++++ help: consider introducing a named lifetime parameter | -LL | fn g<'a>(mut x: impl Foo) -> Option<&'a ()> { x.next() } - | ++++ ~~~ +LL - fn g(mut x: impl Foo) -> Option<&()> { x.next() } +LL + fn g<'a>(mut x: impl Foo) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - fn g(mut x: impl Foo) -> Option<&()> { x.next() } @@ -116,8 +123,9 @@ LL | fn g(mut x: impl Foo<()>) -> Option<&'static ()> { x.next() } | +++++++ help: consider introducing a named lifetime parameter | -LL | fn g<'a>(mut x: impl Foo<()>) -> Option<&'a ()> { x.next() } - | ++++ ~~~ +LL - fn g(mut x: impl Foo<()>) -> Option<&()> { x.next() } +LL + fn g<'a>(mut x: impl Foo<()>) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - fn g(mut x: impl Foo<()>) -> Option<&()> { x.next() } @@ -168,8 +176,9 @@ LL | fn f(_: impl Iterator) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date help: consider introducing a named lifetime parameter | -LL | fn f<'a>(_: impl Iterator) {} - | ++++ ~~ +LL - fn f(_: impl Iterator) {} +LL + fn f<'a>(_: impl Iterator) {} + | error[E0658]: anonymous lifetimes in `impl Trait` are unstable --> $DIR/impl-trait-missing-lifetime-gated.rs:28:39 @@ -181,8 +190,9 @@ LL | fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date help: consider introducing a named lifetime parameter | -LL | fn g<'a>(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } - | ++++ ~~ +LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + fn g<'a>(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } + | error: lifetime may not live long enough --> $DIR/impl-trait-missing-lifetime-gated.rs:38:73 diff --git a/tests/ui/suggestions/impl-trait-missing-lifetime.stderr b/tests/ui/suggestions/impl-trait-missing-lifetime.stderr index 70998b67c04bf..dfbc883680b23 100644 --- a/tests/ui/suggestions/impl-trait-missing-lifetime.stderr +++ b/tests/ui/suggestions/impl-trait-missing-lifetime.stderr @@ -7,12 +7,14 @@ LL | fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn g(mut x: impl Iterator) -> Option<&'static ()> { x.next() } - | ~~~~~~~ +LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + fn g(mut x: impl Iterator) -> Option<&'static ()> { x.next() } + | help: consider introducing a named lifetime parameter | -LL | fn g<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } - | ++++ ~~~ ~~~ +LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + fn g<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } @@ -28,12 +30,14 @@ LL | async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next( = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | async fn i(mut x: impl Iterator) -> Option<&'static ()> { x.next() } - | ~~~~~~~ +LL - async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + async fn i(mut x: impl Iterator) -> Option<&'static ()> { x.next() } + | help: consider introducing a named lifetime parameter | -LL | async fn i<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } - | ++++ ~~~ ~~~ +LL - async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +LL + async fn i<'a>(mut x: impl Iterator) -> Option<&'a ()> { x.next() } + | help: alternatively, you might want to return an owned value | LL - async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } diff --git a/tests/ui/suggestions/impl-trait-with-missing-bounds.stderr b/tests/ui/suggestions/impl-trait-with-missing-bounds.stderr index a763eb6f2f854..d0ce7c9ed4e8a 100644 --- a/tests/ui/suggestions/impl-trait-with-missing-bounds.stderr +++ b/tests/ui/suggestions/impl-trait-with-missing-bounds.stderr @@ -14,8 +14,9 @@ LL | fn qux(_: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^ required by this bound in `qux` help: introduce a type parameter with a trait bound instead of using `impl Trait` | -LL | fn foo(constraints: I) where ::Item: Debug { - | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++ +LL - fn foo(constraints: impl Iterator) { +LL + fn foo(constraints: I) where ::Item: Debug { + | error[E0277]: `::Item` doesn't implement `Debug` --> $DIR/impl-trait-with-missing-bounds.rs:14:13 @@ -33,8 +34,9 @@ LL | fn qux(_: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^ required by this bound in `qux` help: introduce a type parameter with a trait bound instead of using `impl Trait` | -LL | fn bar(t: T, constraints: I) where T: std::fmt::Debug, ::Item: Debug { - | +++++++++++++ ~ ++++++++++++++++++++++++++++++ +LL - fn bar(t: T, constraints: impl Iterator) where T: std::fmt::Debug { +LL + fn bar(t: T, constraints: I) where T: std::fmt::Debug, ::Item: Debug { + | error[E0277]: `::Item` doesn't implement `Debug` --> $DIR/impl-trait-with-missing-bounds.rs:22:13 @@ -52,8 +54,9 @@ LL | fn qux(_: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^ required by this bound in `qux` help: introduce a type parameter with a trait bound instead of using `impl Trait` | -LL | fn baz(t: impl std::fmt::Debug, constraints: I) where ::Item: Debug { - | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++ +LL - fn baz(t: impl std::fmt::Debug, constraints: impl Iterator) { +LL + fn baz(t: impl std::fmt::Debug, constraints: I) where ::Item: Debug { + | error[E0277]: `::Item` doesn't implement `Debug` --> $DIR/impl-trait-with-missing-bounds.rs:30:13 @@ -71,8 +74,9 @@ LL | fn qux(_: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^ required by this bound in `qux` help: introduce a type parameter with a trait bound instead of using `impl Trait` | -LL | fn bat(t: T, constraints: U, _: I) where ::Item: Debug { - | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++ +LL - fn bat(t: T, constraints: impl Iterator, _: I) { +LL + fn bat(t: T, constraints: U, _: I) where ::Item: Debug { + | error[E0277]: `::Item` doesn't implement `Debug` --> $DIR/impl-trait-with-missing-bounds.rs:37:13 @@ -90,8 +94,9 @@ LL | fn qux(_: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^ required by this bound in `qux` help: introduce a type parameter with a trait bound instead of using `impl Trait` | -LL | fn bak(constraints: I) where ::Item: Debug { - | +++++++++++++++++++++++++++++++ ~ ++++++++++++++++++++++++++++++++++ +LL - fn bak(constraints: impl Iterator + std::fmt::Debug) { +LL + fn bak(constraints: I) where ::Item: Debug { + | error[E0277]: `::Item` doesn't implement `Debug` --> $DIR/impl-trait-with-missing-bounds.rs:45:13 @@ -109,8 +114,9 @@ LL | fn qux(_: impl std::fmt::Debug) {} | ^^^^^^^^^^^^^^^ required by this bound in `qux` help: introduce a type parameter with a trait bound instead of using `impl Trait` | -LL | fn baw(constraints: I) where ::Item: Debug { - | ~~~~~~~~~~~~~ ~ ++++++++++++++++++++++++++++++++++ +LL - fn baw<>(constraints: impl Iterator) { +LL + fn baw(constraints: I) where ::Item: Debug { + | error: aborting due to 6 previous errors diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg index 980a7b29a0080..0f2ade633c5ad 100644 --- a/tests/ui/suggestions/incorrect-variant-literal.svg +++ b/tests/ui/suggestions/incorrect-variant-literal.svg @@ -1,4 +1,4 @@ - + ` --> $DIR/suggest-field-through-deref.rs:16:15 @@ -50,8 +53,9 @@ LL | let _ = c.longname; | help: a field with a similar name exists | -LL | let _ = c.unwrap().long_name; - | ~~~~~~~~~~~~~~~~~~ +LL - let _ = c.longname; +LL + let _ = c.unwrap().long_name; + | error[E0609]: no field `long_name` on type `Result` --> $DIR/suggest-field-through-deref.rs:20:15 diff --git a/tests/ui/suggestions/suggest-let-for-assignment.stderr b/tests/ui/suggestions/suggest-let-for-assignment.stderr index 8d97dbeb14a7a..9dc859dbe0e0c 100644 --- a/tests/ui/suggestions/suggest-let-for-assignment.stderr +++ b/tests/ui/suggestions/suggest-let-for-assignment.stderr @@ -40,8 +40,9 @@ LL | let_some_variable = 6; | help: you might have meant to introduce a new binding | -LL | let some_variable = 6; - | ~~~~~~~~~~~~~~~~~ +LL - let_some_variable = 6; +LL + let some_variable = 6; + | error[E0425]: cannot find value `some_variable` in this scope --> $DIR/suggest-let-for-assignment.rs:11:35 @@ -57,8 +58,9 @@ LL | letother_variable = 6; | help: you might have meant to introduce a new binding | -LL | let other_variable = 6; - | ~~~~~~~~~~~~~~~~~~ +LL - letother_variable = 6; +LL + let other_variable = 6; + | error[E0425]: cannot find value `other_variable` in this scope --> $DIR/suggest-let-for-assignment.rs:14:36 diff --git a/tests/ui/suggestions/suggest-methods.stderr b/tests/ui/suggestions/suggest-methods.stderr index 5bacad8c6e89f..6f1c2cc4cab09 100644 --- a/tests/ui/suggestions/suggest-methods.stderr +++ b/tests/ui/suggestions/suggest-methods.stderr @@ -21,8 +21,9 @@ LL | let _ = s.is_emtpy(); | help: there is a method `is_empty` with a similar name | -LL | let _ = s.is_empty(); - | ~~~~~~~~ +LL - let _ = s.is_emtpy(); +LL + let _ = s.is_empty(); + | error[E0599]: no method named `count_eos` found for type `u32` in the current scope --> $DIR/suggest-methods.rs:27:19 @@ -32,8 +33,9 @@ LL | let _ = 63u32.count_eos(); | help: there is a method `count_zeros` with a similar name | -LL | let _ = 63u32.count_zeros(); - | ~~~~~~~~~~~ +LL - let _ = 63u32.count_eos(); +LL + let _ = 63u32.count_zeros(); + | error[E0599]: no method named `count_o` found for type `u32` in the current scope --> $DIR/suggest-methods.rs:30:19 @@ -43,8 +45,9 @@ LL | let _ = 63u32.count_o(); | help: there is a method `count_ones` with a similar name | -LL | let _ = 63u32.count_ones(); - | ~~~~~~~~~~ +LL - let _ = 63u32.count_o(); +LL + let _ = 63u32.count_ones(); + | error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/suggest-move-types.stderr b/tests/ui/suggestions/suggest-move-types.stderr index b222e8142bab5..397e8ad29c6ef 100644 --- a/tests/ui/suggestions/suggest-move-types.stderr +++ b/tests/ui/suggestions/suggest-move-types.stderr @@ -8,8 +8,9 @@ LL | struct A> { | help: move the constraint after the generic argument | -LL | struct A> { - | ~~~~~~~~~~~ +LL - struct A> { +LL + struct A> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:33:43 @@ -21,8 +22,9 @@ LL | struct Al<'a, T, M: OneWithLifetime> { | help: move the constraint after the generic arguments | -LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> { - | ~~~~~~~~~~~~~~~ +LL - struct Al<'a, T, M: OneWithLifetime> { +LL + struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:40:46 @@ -34,8 +36,9 @@ LL | struct B> { | help: move the constraints after the generic arguments | -LL | struct B> { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct B> { +LL + struct B> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:48:71 @@ -47,8 +50,9 @@ LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { +LL + struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:57:28 @@ -60,8 +64,9 @@ LL | struct C> { | help: move the constraints after the generic arguments | -LL | struct C> { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct C> { +LL + struct C> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:65:53 @@ -73,8 +78,9 @@ LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { +LL + struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:74:28 @@ -86,8 +92,9 @@ LL | struct D> { | help: move the constraints after the generic arguments | -LL | struct D> { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct D> { +LL + struct D> { + | error: generic arguments must come before the first constraint --> $DIR/suggest-move-types.rs:82:53 @@ -99,8 +106,9 @@ LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { +LL + struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> { + | error[E0747]: type provided when a lifetime was expected --> $DIR/suggest-move-types.rs:33:43 diff --git a/tests/ui/suggestions/suggest-null-ptr.stderr b/tests/ui/suggestions/suggest-null-ptr.stderr index 66a79d0749ee8..64896b18ebb69 100644 --- a/tests/ui/suggestions/suggest-null-ptr.stderr +++ b/tests/ui/suggestions/suggest-null-ptr.stderr @@ -15,8 +15,9 @@ LL | fn foo(ptr: *const u8); | ^^^ help: if you meant to create a null pointer, use `std::ptr::null()` | -LL | foo(std::ptr::null()); - | ~~~~~~~~~~~~~~~~ +LL - foo(0); +LL + foo(std::ptr::null()); + | error[E0308]: mismatched types --> $DIR/suggest-null-ptr.rs:21:17 @@ -35,8 +36,9 @@ LL | fn foo_mut(ptr: *mut u8); | ^^^^^^^ help: if you meant to create a null pointer, use `std::ptr::null_mut()` | -LL | foo_mut(std::ptr::null_mut()); - | ~~~~~~~~~~~~~~~~~~~~ +LL - foo_mut(0); +LL + foo_mut(std::ptr::null_mut()); + | error[E0308]: mismatched types --> $DIR/suggest-null-ptr.rs:24:15 @@ -55,8 +57,9 @@ LL | fn usize(ptr: *const usize); | ^^^^^ help: if you meant to create a null pointer, use `std::ptr::null()` | -LL | usize(std::ptr::null()); - | ~~~~~~~~~~~~~~~~ +LL - usize(0); +LL + usize(std::ptr::null()); + | error[E0308]: mismatched types --> $DIR/suggest-null-ptr.rs:27:19 @@ -75,8 +78,9 @@ LL | fn usize_mut(ptr: *mut usize); | ^^^^^^^^^ help: if you meant to create a null pointer, use `std::ptr::null_mut()` | -LL | usize_mut(std::ptr::null_mut()); - | ~~~~~~~~~~~~~~~~~~~~ +LL - usize_mut(0); +LL + usize_mut(std::ptr::null_mut()); + | error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/suggest-ref-mut.stderr b/tests/ui/suggestions/suggest-ref-mut.stderr index cc00022ab8e3d..9ed672737a0bb 100644 --- a/tests/ui/suggestions/suggest-ref-mut.stderr +++ b/tests/ui/suggestions/suggest-ref-mut.stderr @@ -6,8 +6,9 @@ LL | self.0 = 32; | help: consider changing this to be a mutable reference | -LL | fn zap(&mut self) { - | ~~~~~~~~~ +LL - fn zap(&self) { +LL + fn zap(&mut self) { + | error[E0594]: cannot assign to `*foo`, which is behind a `&` reference --> $DIR/suggest-ref-mut.rs:15:5 diff --git a/tests/ui/suggestions/suggest-slice-swap.stderr b/tests/ui/suggestions/suggest-slice-swap.stderr index 2840fc0a76116..95b547aad5de9 100644 --- a/tests/ui/suggestions/suggest-slice-swap.stderr +++ b/tests/ui/suggestions/suggest-slice-swap.stderr @@ -9,8 +9,9 @@ LL | std::mem::swap(&mut arr[0], &mut arr[1]); | help: use `.swap()` to swap elements at the specified indices instead | -LL | arr.swap(1, 0); - | ~~~~~~~~~~~~~~ +LL - std::mem::swap(&mut arr[0], &mut arr[1]); +LL + arr.swap(1, 0); + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr index 2893370570d24..46d7782b4cf06 100644 --- a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr @@ -6,8 +6,9 @@ LL | impl<'a, T> Struct for Trait<'a, T> {} | help: `impl` items mention the trait being implemented first and the type it is being implemented for second | -LL | impl<'a, T> Trait<'a, T> for Struct {} - | ~~~~~~~~~~~~ ~~~~~~~~~ +LL - impl<'a, T> Struct for Trait<'a, T> {} +LL + impl<'a, T> Trait<'a, T> for Struct {} + | error[E0404]: expected trait, found enum `Enum` --> $DIR/suggest-swapping-self-ty-and-trait-edition-2021.rs:19:13 @@ -17,8 +18,9 @@ LL | impl<'a, T> Enum for Trait<'a, T> {} | help: `impl` items mention the trait being implemented first and the type it is being implemented for second | -LL | impl<'a, T> Trait<'a, T> for Enum {} - | ~~~~~~~~~~~~ ~~~~~~~ +LL - impl<'a, T> Enum for Trait<'a, T> {} +LL + impl<'a, T> Trait<'a, T> for Enum {} + | error[E0404]: expected trait, found union `Union` --> $DIR/suggest-swapping-self-ty-and-trait-edition-2021.rs:23:13 @@ -28,8 +30,9 @@ LL | impl<'a, T> Union for Trait<'a, T> {} | help: `impl` items mention the trait being implemented first and the type it is being implemented for second | -LL | impl<'a, T> Trait<'a, T> for Union {} - | ~~~~~~~~~~~~ ~~~~~~~~ +LL - impl<'a, T> Union for Trait<'a, T> {} +LL + impl<'a, T> Trait<'a, T> for Union {} + | error[E0392]: type parameter `T` is never used --> $DIR/suggest-swapping-self-ty-and-trait-edition-2021.rs:5:19 diff --git a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr index 5d805d97a4358..85c952c503967 100644 --- a/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr +++ b/tests/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr @@ -6,8 +6,9 @@ LL | impl<'a, T> Struct for Trait<'a, T> {} | help: `impl` items mention the trait being implemented first and the type it is being implemented for second | -LL | impl<'a, T> Trait<'a, T> for Struct {} - | ~~~~~~~~~~~~ ~~~~~~~~~ +LL - impl<'a, T> Struct for Trait<'a, T> {} +LL + impl<'a, T> Trait<'a, T> for Struct {} + | error[E0404]: expected trait, found enum `Enum` --> $DIR/suggest-swapping-self-ty-and-trait.rs:18:13 @@ -17,8 +18,9 @@ LL | impl<'a, T> Enum for Trait<'a, T> {} | help: `impl` items mention the trait being implemented first and the type it is being implemented for second | -LL | impl<'a, T> Trait<'a, T> for Enum {} - | ~~~~~~~~~~~~ ~~~~~~~ +LL - impl<'a, T> Enum for Trait<'a, T> {} +LL + impl<'a, T> Trait<'a, T> for Enum {} + | error[E0404]: expected trait, found union `Union` --> $DIR/suggest-swapping-self-ty-and-trait.rs:23:13 @@ -28,8 +30,9 @@ LL | impl<'a, T> Union for Trait<'a, T> {} | help: `impl` items mention the trait being implemented first and the type it is being implemented for second | -LL | impl<'a, T> Trait<'a, T> for Union {} - | ~~~~~~~~~~~~ ~~~~~~~~ +LL - impl<'a, T> Union for Trait<'a, T> {} +LL + impl<'a, T> Trait<'a, T> for Union {} + | error[E0392]: type parameter `T` is never used --> $DIR/suggest-swapping-self-ty-and-trait.rs:3:19 diff --git a/tests/ui/suggestions/suggest-trait-in-ufcs-in-hrtb.stderr b/tests/ui/suggestions/suggest-trait-in-ufcs-in-hrtb.stderr index cabaa76a8867d..fac93da98293d 100644 --- a/tests/ui/suggestions/suggest-trait-in-ufcs-in-hrtb.stderr +++ b/tests/ui/suggestions/suggest-trait-in-ufcs-in-hrtb.stderr @@ -6,10 +6,12 @@ LL | impl Foo for Bar where for<'a> <&'a S>::Item: Foo {} | help: use fully-qualified syntax | -LL | impl Foo for Bar where for<'a> <&'a S as IntoAsyncIterator>::Item: Foo {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | impl Foo for Bar where for<'a> <&'a S as IntoIterator>::Item: Foo {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - impl Foo for Bar where for<'a> <&'a S>::Item: Foo {} +LL + impl Foo for Bar where for<'a> <&'a S as IntoAsyncIterator>::Item: Foo {} + | +LL - impl Foo for Bar where for<'a> <&'a S>::Item: Foo {} +LL + impl Foo for Bar where for<'a> <&'a S as IntoIterator>::Item: Foo {} + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-tryinto-edition-change.stderr b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr index 5be55f75cd15d..0008b4fb5ed2e 100644 --- a/tests/ui/suggestions/suggest-tryinto-edition-change.stderr +++ b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr @@ -31,8 +31,9 @@ LL | let _v: Vec<_> = FromIterator::from_iter(&[1]); = note: 'std::iter::FromIterator' is included in the prelude starting in Edition 2021 help: a trait with a similar name exists | -LL | let _v: Vec<_> = IntoIterator::from_iter(&[1]); - | ~~~~~~~~~~~~ +LL - let _v: Vec<_> = FromIterator::from_iter(&[1]); +LL + let _v: Vec<_> = IntoIterator::from_iter(&[1]); + | help: consider importing this trait | LL + use std::iter::FromIterator; @@ -55,8 +56,9 @@ LL + use std::convert::TryInto; | help: there is a method `into` with a similar name | -LL | let _i: i16 = 0_i32.into().unwrap(); - | ~~~~ +LL - let _i: i16 = 0_i32.try_into().unwrap(); +LL + let _i: i16 = 0_i32.into().unwrap(); + | error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/suggest-using-chars.stderr b/tests/ui/suggestions/suggest-using-chars.stderr index ba80ec6a2019c..a197223beb056 100644 --- a/tests/ui/suggestions/suggest-using-chars.stderr +++ b/tests/ui/suggestions/suggest-using-chars.stderr @@ -6,8 +6,9 @@ LL | let _ = "foo".iter(); | help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars` | -LL | let _ = "foo".chars(); - | ~~~~~ +LL - let _ = "foo".iter(); +LL + let _ = "foo".chars(); + | error[E0599]: no method named `foo` found for reference `&'static str` in the current scope --> $DIR/suggest-using-chars.rs:3:19 @@ -23,8 +24,9 @@ LL | let _ = String::from("bar").iter(); | help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars` | -LL | let _ = String::from("bar").chars(); - | ~~~~~ +LL - let _ = String::from("bar").iter(); +LL + let _ = String::from("bar").chars(); + | error[E0599]: no method named `iter` found for reference `&String` in the current scope --> $DIR/suggest-using-chars.rs:5:36 @@ -34,8 +36,9 @@ LL | let _ = (&String::from("bar")).iter(); | help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars` | -LL | let _ = (&String::from("bar")).chars(); - | ~~~~~ +LL - let _ = (&String::from("bar")).iter(); +LL + let _ = (&String::from("bar")).chars(); + | error[E0599]: no method named `iter` found for type `{integer}` in the current scope --> $DIR/suggest-using-chars.rs:6:15 diff --git a/tests/ui/suggestions/suggest-variants.stderr b/tests/ui/suggestions/suggest-variants.stderr index d93bf2d8cd72c..b422da8fbfac1 100644 --- a/tests/ui/suggestions/suggest-variants.stderr +++ b/tests/ui/suggestions/suggest-variants.stderr @@ -9,8 +9,9 @@ LL | println!("My shape is {:?}", Shape::Squareee { size: 5}); | help: there is a variant with a similar name | -LL | println!("My shape is {:?}", Shape::Square { size: 5}); - | ~~~~~~ +LL - println!("My shape is {:?}", Shape::Squareee { size: 5}); +LL + println!("My shape is {:?}", Shape::Square { size: 5}); + | error[E0599]: no variant named `Circl` found for enum `Shape` --> $DIR/suggest-variants.rs:13:41 @@ -23,8 +24,9 @@ LL | println!("My shape is {:?}", Shape::Circl { size: 5}); | help: there is a variant with a similar name | -LL | println!("My shape is {:?}", Shape::Circle { size: 5}); - | ~~~~~~ +LL - println!("My shape is {:?}", Shape::Circl { size: 5}); +LL + println!("My shape is {:?}", Shape::Circle { size: 5}); + | error[E0599]: no variant named `Rombus` found for enum `Shape` --> $DIR/suggest-variants.rs:14:41 @@ -46,8 +48,9 @@ LL | Shape::Squareee; | help: there is a variant with a similar name | -LL | Shape::Square { size: /* value */ }; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Shape::Squareee; +LL + Shape::Square { size: /* value */ }; + | error[E0599]: no variant or associated item named `Circl` found for enum `Shape` in the current scope --> $DIR/suggest-variants.rs:16:12 @@ -60,8 +63,9 @@ LL | Shape::Circl; | help: there is a variant with a similar name | -LL | Shape::Circle { radius: /* value */ }; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Shape::Circl; +LL + Shape::Circle { radius: /* value */ }; + | error[E0599]: no variant or associated item named `Rombus` found for enum `Shape` in the current scope --> $DIR/suggest-variants.rs:17:12 diff --git a/tests/ui/suggestions/suggest_print_over_printf.stderr b/tests/ui/suggestions/suggest_print_over_printf.stderr index 8a79745133c93..48a50de0f7ab5 100644 --- a/tests/ui/suggestions/suggest_print_over_printf.stderr +++ b/tests/ui/suggestions/suggest_print_over_printf.stderr @@ -6,8 +6,9 @@ LL | printf("%d", x); | help: you may have meant to use the `print` macro | -LL | print!("%d", x); - | ~~~~~~ +LL - printf("%d", x); +LL + print!("%d", x); + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/type-ascription-instead-of-path-2.stderr b/tests/ui/suggestions/type-ascription-instead-of-path-2.stderr index ba0682cda3212..70e8f5b58acb3 100644 --- a/tests/ui/suggestions/type-ascription-instead-of-path-2.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-path-2.stderr @@ -7,8 +7,9 @@ LL | let _ = vec![Ok(2)].into_iter().collect:,_>>()?; = note: type ascription syntax has been removed, see issue #101728 help: maybe write a path separator here | -LL | let _ = vec![Ok(2)].into_iter().collect::,_>>()?; - | ~~ +LL - let _ = vec![Ok(2)].into_iter().collect:,_>>()?; +LL + let _ = vec![Ok(2)].into_iter().collect::,_>>()?; + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr index 56b6a69a283f4..5ba56d095f73d 100644 --- a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr @@ -6,8 +6,9 @@ LL | let _: Vec = A::B; | help: you might have meant to write a path instead of an associated type bound | -LL | let _: Vec = A::B; - | ~~ +LL - let _: Vec = A::B; +LL + let _: Vec = A::B; + | error[E0107]: struct takes at least 1 generic argument but 0 generic arguments were supplied --> $DIR/type-ascription-instead-of-path-in-type.rs:6:12 diff --git a/tests/ui/suggestions/type-mismatch-byte-literal.stderr b/tests/ui/suggestions/type-mismatch-byte-literal.stderr index 3d27149f0dcf1..e96ead569d980 100644 --- a/tests/ui/suggestions/type-mismatch-byte-literal.stderr +++ b/tests/ui/suggestions/type-mismatch-byte-literal.stderr @@ -8,8 +8,9 @@ LL | let _x: u8 = 'X'; | help: if you meant to write a byte literal, prefix with `b` | -LL | let _x: u8 = b'X'; - | ~~~~ +LL - let _x: u8 = 'X'; +LL + let _x: u8 = b'X'; + | error[E0308]: mismatched types --> $DIR/type-mismatch-byte-literal.rs:11:9 @@ -26,8 +27,9 @@ LL | fn foo(_t: u8) {} | ^^^ ------ help: if you meant to write a byte literal, prefix with `b` | -LL | foo(b'#'); - | ~~~~ +LL - foo('#'); +LL + foo(b'#'); + | error[E0308]: mismatched types --> $DIR/type-mismatch-byte-literal.rs:15:18 @@ -39,8 +41,9 @@ LL | let _a: u8 = '\x20'; | help: if you meant to write a byte literal, prefix with `b` | -LL | let _a: u8 = b'\x20'; - | ~~~~~~~ +LL - let _a: u8 = '\x20'; +LL + let _a: u8 = b'\x20'; + | error[E0308]: mismatched types --> $DIR/type-mismatch-byte-literal.rs:20:9 diff --git a/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr b/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr index fb3573ee2a4ee..e60de526945ae 100644 --- a/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr +++ b/tests/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr @@ -28,8 +28,9 @@ LL | let _ = RGB { r, g, c }; | help: a field with a similar name exists | -LL | let _ = RGB { r, g, b }; - | ~ +LL - let _ = RGB { r, g, c }; +LL + let _ = RGB { r, g, b }; + | error: aborting due to 3 previous errors diff --git a/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr index 8b48ee9f1247b..15aa86374cc9f 100644 --- a/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr +++ b/tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr @@ -10,8 +10,9 @@ LL | let _: f64 = 0..10; found struct `std::ops::Range<{integer}>` help: remove the unnecessary `.` operator for a floating point literal | -LL | let _: f64 = 0.10; - | ~ +LL - let _: f64 = 0..10; +LL + let _: f64 = 0.10; + | error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:3:18 @@ -25,8 +26,9 @@ LL | let _: f64 = 1..; found struct `RangeFrom<{integer}>` help: remove the unnecessary `.` operator for a floating point literal | -LL | let _: f64 = 1.; - | ~ +LL - let _: f64 = 1..; +LL + let _: f64 = 1.; + | error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:4:18 @@ -40,8 +42,9 @@ LL | let _: f64 = ..10; found struct `RangeTo<{integer}>` help: remove the unnecessary `.` operator and add an integer part for a floating point literal | -LL | let _: f64 = 0.10; - | ~~ +LL - let _: f64 = ..10; +LL + let _: f64 = 0.10; + | error[E0308]: mismatched types --> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18 diff --git a/tests/ui/test-attrs/inaccessible-test-modules.stderr b/tests/ui/test-attrs/inaccessible-test-modules.stderr index 7635f579d66b9..39f69b164fb00 100644 --- a/tests/ui/test-attrs/inaccessible-test-modules.stderr +++ b/tests/ui/test-attrs/inaccessible-test-modules.stderr @@ -12,8 +12,9 @@ LL | use test as y; | help: consider importing this module instead | -LL | use test::test as y; - | ~~~~~~~~~~~~~~~ +LL - use test as y; +LL + use test::test as y; + | error: aborting due to 2 previous errors diff --git a/tests/ui/test-attrs/issue-109816.stderr b/tests/ui/test-attrs/issue-109816.stderr index 6f5e3ae6b63f6..433421fff1b57 100644 --- a/tests/ui/test-attrs/issue-109816.stderr +++ b/tests/ui/test-attrs/issue-109816.stderr @@ -9,7 +9,8 @@ LL | struct A5(u32, u8); | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] +LL - #[test] +LL + #[cfg(test)] | error: aborting due to 1 previous error diff --git a/tests/ui/test-attrs/test-attr-non-associated-functions.stderr b/tests/ui/test-attrs/test-attr-non-associated-functions.stderr index 3e3a951aff3e9..0ede0cbb97f33 100644 --- a/tests/ui/test-attrs/test-attr-non-associated-functions.stderr +++ b/tests/ui/test-attrs/test-attr-non-associated-functions.stderr @@ -6,7 +6,8 @@ LL | #[test] | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] +LL - #[test] +LL + #[cfg(test)] | error: the `#[test]` attribute may only be used on a non-associated function @@ -17,7 +18,8 @@ LL | #[test] | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] +LL - #[test] +LL + #[cfg(test)] | error: aborting due to 2 previous errors diff --git a/tests/ui/test-attrs/test-on-not-fn.stderr b/tests/ui/test-attrs/test-on-not-fn.stderr index 7a9913fbcfa11..a282db012540a 100644 --- a/tests/ui/test-attrs/test-on-not-fn.stderr +++ b/tests/ui/test-attrs/test-on-not-fn.stderr @@ -8,8 +8,9 @@ LL | mod test {} | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:6:1 @@ -27,8 +28,9 @@ LL | | } | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:20:1 @@ -40,8 +42,9 @@ LL | extern "C" {} | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:23:1 @@ -53,8 +56,9 @@ LL | trait Foo {} | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:26:1 @@ -66,8 +70,9 @@ LL | impl Foo for i32 {} | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:29:1 @@ -79,8 +84,9 @@ LL | const FOO: i32 = -1_i32; | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:32:1 @@ -92,8 +98,9 @@ LL | static BAR: u64 = 10_000_u64; | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:35:1 @@ -107,8 +114,9 @@ LL | | } | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:40:1 @@ -120,8 +128,9 @@ LL | struct NewI32(i32); | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:43:1 @@ -136,8 +145,9 @@ LL | | } | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:50:1 @@ -153,8 +163,9 @@ LL | | } | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | warning: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:61:1 @@ -166,8 +177,9 @@ LL | foo!(); | help: replace with conditional compilation to make the item only exist when tests are being run | -LL | #[cfg(test)] - | ~~~~~~~~~~~~ +LL - #[test] +LL + #[cfg(test)] + | error: aborting due to 11 previous errors; 1 warning emitted diff --git a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr index 49230c98a12c1..7d795581ea9d8 100644 --- a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr +++ b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr @@ -14,8 +14,9 @@ LL | fn qux(_: impl From) {} | ^^^^^^^^^ required by this bound in `qux` help: try using a fully qualified path to specify the expected types | -LL | qux(>::into(Bar)); - | +++++++++++++++++++++++ ~ +LL - qux(Bar.into()); +LL + qux(>::into(Bar)); + | help: consider removing this method call, as the receiver has type `Bar` and `Bar: From` trivially holds | LL - qux(Bar.into()); diff --git a/tests/ui/traits/alias/ambiguous.stderr b/tests/ui/traits/alias/ambiguous.stderr index 034e8a3fb7b99..542ee1901296d 100644 --- a/tests/ui/traits/alias/ambiguous.stderr +++ b/tests/ui/traits/alias/ambiguous.stderr @@ -16,12 +16,14 @@ LL | fn foo(&self) {} | ^^^^^^^^^^^^^ help: disambiguate the method for candidate #1 | -LL | A::foo(&t); - | ~~~~~~~~~~ +LL - t.foo(); +LL + A::foo(&t); + | help: disambiguate the method for candidate #2 | -LL | B::foo(&t); - | ~~~~~~~~~~ +LL - t.foo(); +LL + B::foo(&t); + | error: aborting due to 1 previous error diff --git a/tests/ui/traits/alias/dont-elaborate-non-self.stderr b/tests/ui/traits/alias/dont-elaborate-non-self.stderr index 4e2edb474c06a..deef43b0af33b 100644 --- a/tests/ui/traits/alias/dont-elaborate-non-self.stderr +++ b/tests/ui/traits/alias/dont-elaborate-non-self.stderr @@ -8,8 +8,9 @@ LL | fn f(a: dyn F) {} = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | fn f(a: impl F) {} - | ~~~~ +LL - fn f(a: dyn F) {} +LL + fn f(a: impl F) {} + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | fn f(a: &dyn F) {} diff --git a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr index afe34a125b202..af4e4214be2db 100644 --- a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr +++ b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.stderr @@ -6,7 +6,8 @@ LL | struct Struct(S); | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait Strings = Iterator; +LL - type Strings = Iterator; +LL + trait Strings = Iterator; | error: aborting due to 1 previous error diff --git a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr index 0020f9e416df2..23974c5b4aaa4 100644 --- a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr +++ b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr @@ -9,12 +9,14 @@ LL | struct Foo where T: Bar, ::Baz: String { | help: constrain the associated type to `String` | -LL | struct Foo where T: Bar, T: Bar { - | ~~~~~~~~~~~~~~~~~~~~ +LL - struct Foo where T: Bar, ::Baz: String { +LL + struct Foo where T: Bar, T: Bar { + | help: a trait with a similar name exists | -LL | struct Foo where T: Bar, ::Baz: ToString { - | ~~~~~~~~ +LL - struct Foo where T: Bar, ::Baz: String { +LL + struct Foo where T: Bar, ::Baz: ToString { + | error[E0404]: expected trait, found struct `String` --> $DIR/assoc_type_bound_with_struct.rs:9:54 @@ -27,12 +29,14 @@ LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String { | help: constrain the associated type to `String` | -LL | struct Qux<'a, T> where T: Bar, &'a T: Bar { - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String { +LL + struct Qux<'a, T> where T: Bar, &'a T: Bar { + | help: a trait with a similar name exists | -LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString { - | ~~~~~~~~ +LL - struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String { +LL + struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString { + | error[E0404]: expected trait, found struct `String` --> $DIR/assoc_type_bound_with_struct.rs:13:45 @@ -45,12 +49,14 @@ LL | fn foo(_: T) where ::Baz: String { | help: constrain the associated type to `String` | -LL | fn foo(_: T) where T: Bar { - | ~~~~~~~~~~~~~~~~~~~~ +LL - fn foo(_: T) where ::Baz: String { +LL + fn foo(_: T) where T: Bar { + | help: a trait with a similar name exists | -LL | fn foo(_: T) where ::Baz: ToString { - | ~~~~~~~~ +LL - fn foo(_: T) where ::Baz: String { +LL + fn foo(_: T) where ::Baz: ToString { + | error[E0404]: expected trait, found struct `String` --> $DIR/assoc_type_bound_with_struct.rs:16:57 @@ -63,12 +69,14 @@ LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { | help: constrain the associated type to `String` | -LL | fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar { - | ~~~~~~~~~~~~~~~~~~~~~~~~ +LL - fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { +LL + fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar { + | help: a trait with a similar name exists | -LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString { - | ~~~~~~~~ +LL - fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { +LL + fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString { + | error[E0405]: cannot find trait `Unresolved` in this scope --> $DIR/assoc_type_bound_with_struct.rs:19:31 diff --git a/tests/ui/traits/bound/not-on-bare-trait-2021.stderr b/tests/ui/traits/bound/not-on-bare-trait-2021.stderr index 57d3bc8f10948..9576218abbb5c 100644 --- a/tests/ui/traits/bound/not-on-bare-trait-2021.stderr +++ b/tests/ui/traits/bound/not-on-bare-trait-2021.stderr @@ -40,8 +40,9 @@ LL | fn foo(_x: Foo + Send) { | help: use a new generic type parameter, constrained by `Foo + Send` | -LL | fn foo(_x: T) { - | +++++++++++++++ ~ +LL - fn foo(_x: Foo + Send) { +LL + fn foo(_x: T) { + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn foo(_x: impl Foo + Send) { @@ -59,8 +60,9 @@ LL | fn bar(x: Foo) -> Foo { | help: use a new generic type parameter, constrained by `Foo` | -LL | fn bar(x: T) -> Foo { - | ++++++++ ~ +LL - fn bar(x: Foo) -> Foo { +LL + fn bar(x: T) -> Foo { + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn bar(x: impl Foo) -> Foo { diff --git a/tests/ui/traits/bound/not-on-bare-trait.stderr b/tests/ui/traits/bound/not-on-bare-trait.stderr index f1e7a28654a74..560dbfd493fcb 100644 --- a/tests/ui/traits/bound/not-on-bare-trait.stderr +++ b/tests/ui/traits/bound/not-on-bare-trait.stderr @@ -39,8 +39,9 @@ LL | fn bar(_x: (dyn Foo + Send)) { = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | -LL | fn bar(_x: (impl Foo + Send)) { - | ~~~~ +LL - fn bar(_x: (dyn Foo + Send)) { +LL + fn bar(_x: (impl Foo + Send)) { + | help: function arguments must have a statically known size, borrowed types always have a known size | LL | fn bar(_x: (&(dyn Foo + Send))) { diff --git a/tests/ui/traits/bound/not-on-struct.stderr b/tests/ui/traits/bound/not-on-struct.stderr index 2de35dc7fc376..1fb5b1c20670c 100644 --- a/tests/ui/traits/bound/not-on-struct.stderr +++ b/tests/ui/traits/bound/not-on-struct.stderr @@ -166,8 +166,9 @@ LL + fn g() -> Traitor { | help: a trait with a similar name exists | -LL | fn g() -> Trait + 'static { - | ~~~~~ +LL - fn g() -> Traitor + 'static { +LL + fn g() -> Trait + 'static { + | error: aborting due to 11 previous errors diff --git a/tests/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr b/tests/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr index 460595dd961e0..139488d79f13b 100644 --- a/tests/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr +++ b/tests/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr @@ -14,8 +14,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | as Method>::method(thing, 42); - | +++++++++++++++++++++++++++++++++++ ~ +LL - thing.method(42); +LL + as Method>::method(thing, 42); + | error: aborting due to 1 previous error diff --git a/tests/ui/traits/issue-28576.stderr b/tests/ui/traits/issue-28576.stderr index 7e0f52bc4fe09..19d9a3866dc3d 100644 --- a/tests/ui/traits/issue-28576.stderr +++ b/tests/ui/traits/issue-28576.stderr @@ -36,8 +36,9 @@ LL | pub trait Bar: Foo { | this trait cannot be made into an object... help: consider using an opaque type instead | -LL | impl Bar - | ~~~~ +LL - dyn Bar +LL + impl Bar + | error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/issue-28576.rs:5:16 diff --git a/tests/ui/traits/issue-35869.stderr b/tests/ui/traits/issue-35869.stderr index 503f9cee246e9..73cf961785433 100644 --- a/tests/ui/traits/issue-35869.stderr +++ b/tests/ui/traits/issue-35869.stderr @@ -13,8 +13,9 @@ LL | fn foo(_: fn(u8) -> ()); found signature `fn(fn(u16))` help: change the parameter type to match the trait | -LL | fn foo(_: fn(u8)) {} - | ~~~~~~ +LL - fn foo(_: fn(u16) -> ()) {} +LL + fn foo(_: fn(u8)) {} + | error[E0053]: method `bar` has an incompatible type for trait --> $DIR/issue-35869.rs:13:15 @@ -31,8 +32,9 @@ LL | fn bar(_: Option); found signature `fn(Option)` help: change the parameter type to match the trait | -LL | fn bar(_: Option) {} - | ~~~~~~~~~~ +LL - fn bar(_: Option) {} +LL + fn bar(_: Option) {} + | error[E0053]: method `baz` has an incompatible type for trait --> $DIR/issue-35869.rs:15:15 @@ -49,8 +51,9 @@ LL | fn baz(_: (u8, u16)); found signature `fn((u16, _))` help: change the parameter type to match the trait | -LL | fn baz(_: (u8, u16)) {} - | ~~~~~~~~~ +LL - fn baz(_: (u16, u16)) {} +LL + fn baz(_: (u8, u16)) {} + | error[E0053]: method `qux` has an incompatible type for trait --> $DIR/issue-35869.rs:17:17 @@ -67,8 +70,9 @@ LL | fn qux() -> u8; found signature `fn() -> u16` help: change the output type to match the trait | -LL | fn qux() -> u8 { 5u16 } - | ~~ +LL - fn qux() -> u16 { 5u16 } +LL + fn qux() -> u8 { 5u16 } + | error: aborting due to 4 previous errors diff --git a/tests/ui/traits/issue-50480.stderr b/tests/ui/traits/issue-50480.stderr index 330b23b5755d7..d3c11238ede16 100644 --- a/tests/ui/traits/issue-50480.stderr +++ b/tests/ui/traits/issue-50480.stderr @@ -47,8 +47,9 @@ LL | struct Bar(T, N, NotDefined, ::Item, Vec, String); | help: a type parameter with a similar name exists | -LL | struct Bar(T, T, NotDefined, ::Item, Vec, String); - | ~ +LL - struct Bar(T, N, NotDefined, ::Item, Vec, String); +LL + struct Bar(T, T, NotDefined, ::Item, Vec, String); + | help: you might be missing a type parameter | LL | struct Bar(T, N, NotDefined, ::Item, Vec, String); diff --git a/tests/ui/traits/issue-77982.stderr b/tests/ui/traits/issue-77982.stderr index 0f4b3c3c877c9..9c3927c620944 100644 --- a/tests/ui/traits/issue-77982.stderr +++ b/tests/ui/traits/issue-77982.stderr @@ -52,8 +52,9 @@ LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect( - impl From for u32; help: try using a fully qualified path to specify the expected types | -LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(>::into(0u32))).collect(); - | +++++++++++++++++++++++ ~ +LL - let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect(); +LL + let ips: Vec<_> = (0..100_000).map(|_| u32::from(>::into(0u32))).collect(); + | error[E0283]: type annotations needed for `Box<_>` --> $DIR/issue-77982.rs:37:9 diff --git a/tests/ui/traits/issue-78372.stderr b/tests/ui/traits/issue-78372.stderr index cdcb0cdf2593d..c77d2f6d136fe 100644 --- a/tests/ui/traits/issue-78372.stderr +++ b/tests/ui/traits/issue-78372.stderr @@ -19,8 +19,9 @@ LL | impl DispatchFromDyn> for T {} | help: a type parameter with a similar name exists | -LL | impl DispatchFromDyn> for T {} - | ~ +LL - impl DispatchFromDyn> for T {} +LL + impl DispatchFromDyn> for T {} + | help: you might be missing a type parameter | LL | impl DispatchFromDyn> for T {} diff --git a/tests/ui/traits/item-privacy.stderr b/tests/ui/traits/item-privacy.stderr index fd474fac15589..2897c782903d3 100644 --- a/tests/ui/traits/item-privacy.stderr +++ b/tests/ui/traits/item-privacy.stderr @@ -11,8 +11,9 @@ LL | S.a(); = help: trait `method::A` which provides `a` is implemented but not reachable help: there is a method `b` with a similar name | -LL | S.b(); - | ~ +LL - S.a(); +LL + S.b(); + | error[E0599]: no method named `b` found for struct `S` in the current scope --> $DIR/item-privacy.rs:68:7 @@ -33,8 +34,9 @@ LL + use method::B; | help: there is a method `c` with a similar name | -LL | S.c(); - | ~ +LL - S.b(); +LL + S.c(); + | error[E0624]: method `a` is private --> $DIR/item-privacy.rs:72:7 @@ -104,8 +106,9 @@ LL | S::A; = help: trait `assoc_const::A` which provides `A` is implemented but not reachable help: there is an associated constant `B` with a similar name | -LL | S::B; - | ~ +LL - S::A; +LL + S::B; + | error[E0599]: no associated item named `B` found for struct `S` in the current scope --> $DIR/item-privacy.rs:98:8 @@ -168,8 +171,9 @@ LL | let _: S::A; | help: if there were a trait named `Example` with associated type `A` implemented for `S`, you could use the fully-qualified path | -LL | let _: ::A; - | ~~~~~~~~~~~~~~~~~ +LL - let _: S::A; +LL + let _: ::A; + | error[E0223]: ambiguous associated type --> $DIR/item-privacy.rs:116:12 diff --git a/tests/ui/traits/method-argument-mismatch-variance-ice-119867.stderr b/tests/ui/traits/method-argument-mismatch-variance-ice-119867.stderr index e63cc522dd13a..d535c39639f2a 100644 --- a/tests/ui/traits/method-argument-mismatch-variance-ice-119867.stderr +++ b/tests/ui/traits/method-argument-mismatch-variance-ice-119867.stderr @@ -6,8 +6,9 @@ LL | fn deserialize(s: _) {} | help: try replacing `_` with the type in the corresponding trait method signature | -LL | fn deserialize(s: &ArchivedVec) {} - | ~~~~~~~~~~~~~~~ +LL - fn deserialize(s: _) {} +LL + fn deserialize(s: &ArchivedVec) {} + | error[E0186]: method `deserialize` has a `&self` declaration in the trait, but not in the impl --> $DIR/method-argument-mismatch-variance-ice-119867.rs:8:5 diff --git a/tests/ui/traits/multidispatch-bad.stderr b/tests/ui/traits/multidispatch-bad.stderr index 0bb095fb0e13f..f605459ca8c62 100644 --- a/tests/ui/traits/multidispatch-bad.stderr +++ b/tests/ui/traits/multidispatch-bad.stderr @@ -13,8 +13,9 @@ LL | fn test(_: T, _: U) | ^^^^ ---- help: change the type of the numeric literal from `i32` to `u32` | -LL | test(22i32, 44u32); - | ~~~ +LL - test(22i32, 44i32); +LL + test(22i32, 44u32); + | error: aborting due to 1 previous error diff --git a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr index eecf8e88fb64d..02295307cb22a 100644 --- a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr +++ b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr @@ -15,8 +15,9 @@ LL | for B::Item: Send, | help: if there were a trait named `Example` with associated type `Item` implemented for `B`, you could use the fully-qualified path | -LL | for ::Item: Send, - | ~~~~~~~~~~~~~~~~~~~~ +LL - for B::Item: Send, +LL + for ::Item: Send, + | error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr b/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr index 40e16dde6e4a4..1117ee7efb30d 100644 --- a/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr +++ b/tests/ui/traits/non_lifetime_binders/type-match-with-late-bound.stderr @@ -25,8 +25,9 @@ LL | for F: 'a, | ^^ help: consider adding an explicit lifetime bound | -LL | for F: 'a, !1_"F": 'a - | ~~~~~~~~~~~~ +LL - for F: 'a, +LL + for F: 'a, !1_"F": 'a + | error[E0309]: the placeholder type `!1_"F"` may not live long enough --> $DIR/type-match-with-late-bound.rs:11:1 @@ -39,8 +40,9 @@ LL | {} | help: consider adding an explicit lifetime bound | -LL | for F: 'a, !1_"F": 'a - | ~~~~~~~~~~~~ +LL - for F: 'a, +LL + for F: 'a, !1_"F": 'a + | error[E0309]: the placeholder type `!2_"F"` may not live long enough --> $DIR/type-match-with-late-bound.rs:11:1 @@ -53,8 +55,9 @@ LL | {} | help: consider adding an explicit lifetime bound | -LL | for F: 'a, !2_"F": 'a - | ~~~~~~~~~~~~ +LL - for F: 'a, +LL + for F: 'a, !2_"F": 'a + | error: aborting due to 3 previous errors; 1 warning emitted diff --git a/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr b/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr index 1d5489845efe6..7a2db203ac3f8 100644 --- a/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr +++ b/tests/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr @@ -21,8 +21,9 @@ LL | T: I, | ---- unsatisfied trait bound introduced here help: try using a fully qualified path to specify the expected types | -LL | as V>::method(a); - | +++++++++++++++++++++++ ~ +LL - a.method(); +LL + as V>::method(a); + | error: aborting due to 1 previous error diff --git a/tests/ui/traits/suggest-fully-qualified-closure.stderr b/tests/ui/traits/suggest-fully-qualified-closure.stderr index a2c1115e673a3..8975d04d5b3ed 100644 --- a/tests/ui/traits/suggest-fully-qualified-closure.stderr +++ b/tests/ui/traits/suggest-fully-qualified-closure.stderr @@ -14,8 +14,9 @@ LL | impl MyTrait for Qqq{ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::lol::<_>(&q, ||()); - | +++++++++++++++++++++++++++++++ ~ +LL - q.lol(||()); +LL + >::lol::<_>(&q, ||()); + | error: aborting due to 1 previous error diff --git a/tests/ui/traits/suggest-fully-qualified-path-with-adjustment.stderr b/tests/ui/traits/suggest-fully-qualified-path-with-adjustment.stderr index 841acb5ffd3cd..0996227e69701 100644 --- a/tests/ui/traits/suggest-fully-qualified-path-with-adjustment.stderr +++ b/tests/ui/traits/suggest-fully-qualified-path-with-adjustment.stderr @@ -14,8 +14,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(&thing); - | ++++++++++++++++++++++++++++++ ~ +LL - thing.method(); +LL + >::method(&thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:46:11 @@ -33,8 +34,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::mut_method(&mut thing); - | +++++++++++++++++++++++++++++++++++++ ~ +LL - thing.mut_method(); +LL + >::mut_method(&mut thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:47:11 @@ -52,8 +54,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(&thing); - | +++++++++++++++++++++++++++++++++++ ~ +LL - thing.by_self(); +LL + <&Thing as MethodRef>::by_self(&thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:50:14 @@ -71,8 +74,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(&deref_to); - | ++++++++++++++++++++++++++++++ ~ +LL - deref_to.method(); +LL + >::method(&deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:51:14 @@ -90,8 +94,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::mut_method(&mut deref_to); - | +++++++++++++++++++++++++++++++++++++ ~ +LL - deref_to.mut_method(); +LL + >::mut_method(&mut deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:52:14 @@ -109,8 +114,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(&deref_to); - | +++++++++++++++++++++++++++++++++++ ~ +LL - deref_to.by_self(); +LL + <&Thing as MethodRef>::by_self(&deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:55:20 @@ -128,8 +134,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(&deref_deref_to); - | ++++++++++++++++++++++++++++++ ~ +LL - deref_deref_to.method(); +LL + >::method(&deref_deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:56:20 @@ -147,8 +154,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::mut_method(&mut deref_deref_to); - | +++++++++++++++++++++++++++++++++++++ ~ +LL - deref_deref_to.mut_method(); +LL + >::mut_method(&mut deref_deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-with-adjustment.rs:57:20 @@ -166,8 +174,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(&deref_deref_to); - | +++++++++++++++++++++++++++++++++++ ~ +LL - deref_deref_to.by_self(); +LL + <&Thing as MethodRef>::by_self(&deref_deref_to); + | error: aborting due to 9 previous errors diff --git a/tests/ui/traits/suggest-fully-qualified-path-without-adjustment.stderr b/tests/ui/traits/suggest-fully-qualified-path-without-adjustment.stderr index 1865d81bad19c..629904815f312 100644 --- a/tests/ui/traits/suggest-fully-qualified-path-without-adjustment.stderr +++ b/tests/ui/traits/suggest-fully-qualified-path-without-adjustment.stderr @@ -14,8 +14,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(ref_thing); - | +++++++++++++++++++++++++++++ ~ +LL - ref_thing.method(); +LL + >::method(ref_thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:46:15 @@ -33,8 +34,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(ref_thing); - | ++++++++++++++++++++++++++++++++++ ~ +LL - ref_thing.by_self(); +LL + <&Thing as MethodRef>::by_self(ref_thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:49:15 @@ -52,8 +54,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(mut_thing); - | +++++++++++++++++++++++++++++ ~ +LL - mut_thing.method(); +LL + >::method(mut_thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:50:15 @@ -71,8 +74,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::mut_method(mut_thing); - | +++++++++++++++++++++++++++++++++ ~ +LL - mut_thing.mut_method(); +LL + >::mut_method(mut_thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:51:15 @@ -90,8 +94,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(mut_thing); - | ++++++++++++++++++++++++++++++++++ ~ +LL - mut_thing.by_self(); +LL + <&Thing as MethodRef>::by_self(mut_thing); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:54:14 @@ -109,8 +114,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(deref_to); - | +++++++++++++++++++++++++++++ ~ +LL - deref_to.method(); +LL + >::method(deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:55:14 @@ -128,8 +134,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::mut_method(deref_to); - | +++++++++++++++++++++++++++++++++ ~ +LL - deref_to.mut_method(); +LL + >::mut_method(deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:56:14 @@ -147,8 +154,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(deref_to); - | ++++++++++++++++++++++++++++++++++ ~ +LL - deref_to.by_self(); +LL + <&Thing as MethodRef>::by_self(deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:59:20 @@ -166,8 +174,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::method(deref_deref_to); - | +++++++++++++++++++++++++++++ ~ +LL - deref_deref_to.method(); +LL + >::method(deref_deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:60:20 @@ -185,8 +194,9 @@ LL | impl Method for Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | >::mut_method(deref_deref_to); - | +++++++++++++++++++++++++++++++++ ~ +LL - deref_deref_to.mut_method(); +LL + >::mut_method(deref_deref_to); + | error[E0283]: type annotations needed --> $DIR/suggest-fully-qualified-path-without-adjustment.rs:61:20 @@ -204,8 +214,9 @@ LL | impl MethodRef for &Thing { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <&Thing as MethodRef>::by_self(deref_deref_to); - | ++++++++++++++++++++++++++++++++++ ~ +LL - deref_deref_to.by_self(); +LL + <&Thing as MethodRef>::by_self(deref_deref_to); + | error: aborting due to 11 previous errors diff --git a/tests/ui/traits/trait-upcasting/subtrait-method.stderr b/tests/ui/traits/trait-upcasting/subtrait-method.stderr index 0408be6986bd7..b99afc4f26182 100644 --- a/tests/ui/traits/trait-upcasting/subtrait-method.stderr +++ b/tests/ui/traits/trait-upcasting/subtrait-method.stderr @@ -12,8 +12,9 @@ LL | trait Baz: Bar { | ^^^^^^^^^^^^^^ help: there is a method `a` with a similar name | -LL | bar.a(); - | ~ +LL - bar.c(); +LL + bar.a(); + | error[E0599]: no method named `b` found for reference `&dyn Foo` in the current scope --> $DIR/subtrait-method.rs:59:9 @@ -29,8 +30,9 @@ LL | trait Bar: Foo { | ^^^^^^^^^^^^^^ help: there is a method `a` with a similar name | -LL | foo.a(); - | ~ +LL - foo.b(); +LL + foo.a(); + | error[E0599]: no method named `c` found for reference `&dyn Foo` in the current scope --> $DIR/subtrait-method.rs:61:9 @@ -46,8 +48,9 @@ LL | trait Baz: Bar { | ^^^^^^^^^^^^^^ help: there is a method `a` with a similar name | -LL | foo.a(); - | ~ +LL - foo.c(); +LL + foo.a(); + | error[E0599]: no method named `b` found for reference `&dyn Foo` in the current scope --> $DIR/subtrait-method.rs:65:9 @@ -63,8 +66,9 @@ LL | trait Bar: Foo { | ^^^^^^^^^^^^^^ help: there is a method `a` with a similar name | -LL | foo.a(); - | ~ +LL - foo.b(); +LL + foo.a(); + | error[E0599]: no method named `c` found for reference `&dyn Foo` in the current scope --> $DIR/subtrait-method.rs:67:9 @@ -80,8 +84,9 @@ LL | trait Baz: Bar { | ^^^^^^^^^^^^^^ help: there is a method `a` with a similar name | -LL | foo.a(); - | ~ +LL - foo.c(); +LL + foo.a(); + | error: aborting due to 5 previous errors diff --git a/tests/ui/traits/wrong-mul-method-signature.stderr b/tests/ui/traits/wrong-mul-method-signature.stderr index e30b61622ae01..c85775f48871d 100644 --- a/tests/ui/traits/wrong-mul-method-signature.stderr +++ b/tests/ui/traits/wrong-mul-method-signature.stderr @@ -8,8 +8,9 @@ LL | fn mul(self, s: &f64) -> Vec1 { found signature `fn(Vec1, &_) -> Vec1` help: change the parameter type to match the trait | -LL | fn mul(self, s: f64) -> Vec1 { - | ~~~ +LL - fn mul(self, s: &f64) -> Vec1 { +LL + fn mul(self, s: f64) -> Vec1 { + | error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:33:21 @@ -21,8 +22,9 @@ LL | fn mul(self, s: f64) -> Vec2 { found signature `fn(Vec2, f64) -> Vec2` help: change the parameter type to match the trait | -LL | fn mul(self, s: Vec2) -> Vec2 { - | ~~~~ +LL - fn mul(self, s: f64) -> Vec2 { +LL + fn mul(self, s: Vec2) -> Vec2 { + | error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:52:29 @@ -34,8 +36,9 @@ LL | fn mul(self, s: f64) -> f64 { found signature `fn(Vec3, _) -> f64` help: change the output type to match the trait | -LL | fn mul(self, s: f64) -> i32 { - | ~~~ +LL - fn mul(self, s: f64) -> f64 { +LL + fn mul(self, s: f64) -> i32 { + | error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:45 diff --git a/tests/ui/tuple/tuple-index-not-tuple.stderr b/tests/ui/tuple/tuple-index-not-tuple.stderr index a267e41b1bc32..faf9a313478df 100644 --- a/tests/ui/tuple/tuple-index-not-tuple.stderr +++ b/tests/ui/tuple/tuple-index-not-tuple.stderr @@ -6,8 +6,9 @@ LL | origin.0; | help: a field with a similar name exists | -LL | origin.x; - | ~ +LL - origin.0; +LL + origin.x; + | error[E0609]: no field `0` on type `Empty` --> $DIR/tuple-index-not-tuple.rs:8:11 diff --git a/tests/ui/tuple/tuple-index-out-of-bounds.stderr b/tests/ui/tuple/tuple-index-out-of-bounds.stderr index 96090435d06be..8b3c835c3e3ce 100644 --- a/tests/ui/tuple/tuple-index-out-of-bounds.stderr +++ b/tests/ui/tuple/tuple-index-out-of-bounds.stderr @@ -6,8 +6,9 @@ LL | origin.2; | help: a field with a similar name exists | -LL | origin.0; - | ~ +LL - origin.2; +LL + origin.0; + | error[E0609]: no field `2` on type `({integer}, {integer})` --> $DIR/tuple-index-out-of-bounds.rs:12:11 diff --git a/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr index 482a314db602e..8caf17ae2da5a 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr +++ b/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr @@ -43,8 +43,9 @@ LL | impl Enum { | --------------- `Self` is on type `Enum` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters | -LL | Enum::<()>::TSVariant(()); - | ~~~~ +LL - Self::<()>::TSVariant(()); +LL + Enum::<()>::TSVariant(()); + | error[E0308]: mismatched types --> $DIR/enum-variant-generic-args.rs:17:31 @@ -83,8 +84,9 @@ LL | impl Enum { | --------------- `Self` is on type `Enum` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters | -LL | Enum::<()>::TSVariant::<()>(()); - | ~~~~ +LL - Self::<()>::TSVariant::<()>(()); +LL + Enum::<()>::TSVariant::<()>(()); + | error[E0109]: type arguments are not allowed on this type --> $DIR/enum-variant-generic-args.rs:20:33 @@ -151,8 +153,9 @@ LL | impl Enum { | --------------- `Self` is on type `Enum` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters | -LL | Enum::<()>::SVariant { v: () }; - | ~~~~ +LL - Self::<()>::SVariant { v: () }; +LL + Enum::<()>::SVariant { v: () }; + | error[E0308]: mismatched types --> $DIR/enum-variant-generic-args.rs:31:35 @@ -184,8 +187,9 @@ LL | impl Enum { | --------------- `Self` is on type `Enum` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters | -LL | Enum::<()>::SVariant::<()> { v: () }; - | ~~~~ +LL - Self::<()>::SVariant::<()> { v: () }; +LL + Enum::<()>::SVariant::<()> { v: () }; + | error[E0109]: type arguments are not allowed on this type --> $DIR/enum-variant-generic-args.rs:34:32 @@ -240,8 +244,9 @@ LL | impl Enum { | --------------- `Self` is on type `Enum` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters | -LL | Enum::<()>::UVariant; - | ~~~~ +LL - Self::<()>::UVariant; +LL + Enum::<()>::UVariant; + | error[E0109]: type arguments are not allowed on self type --> $DIR/enum-variant-generic-args.rs:45:16 @@ -261,8 +266,9 @@ LL | impl Enum { | --------------- `Self` is on type `Enum` in this `impl` help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters | -LL | Enum::<()>::UVariant::<()>; - | ~~~~ +LL - Self::<()>::UVariant::<()>; +LL + Enum::<()>::UVariant::<()>; + | error[E0109]: type arguments are not allowed on this type --> $DIR/enum-variant-generic-args.rs:45:32 diff --git a/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index 371f5b10988a8..c4deafd4f6b7a 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -11,8 +11,9 @@ LL | V(u8) | ^ help: provide the argument | -LL | ::V(/* u8 */); - | ~~~~~~~~~~ +LL - ::V(); +LL + ::V(/* u8 */); + | error[E0308]: mismatched types --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17 diff --git a/tests/ui/type-alias-impl-trait/unnameable_type.stderr b/tests/ui/type-alias-impl-trait/unnameable_type.stderr index 5b331c5660d9c..25dc41df41930 100644 --- a/tests/ui/type-alias-impl-trait/unnameable_type.stderr +++ b/tests/ui/type-alias-impl-trait/unnameable_type.stderr @@ -16,8 +16,9 @@ LL | fn dont_define_this(_private: Private) {} found signature `fn(MyPrivate)` help: change the parameter type to match the trait | -LL | fn dont_define_this(private: Private) { - | ~~~~~~~ +LL - fn dont_define_this(private: MyPrivate) { +LL + fn dont_define_this(private: Private) { + | error: aborting due to 1 previous error diff --git a/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.eager.stderr b/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.eager.stderr index e891ff10fdaa9..b0b183d652b09 100644 --- a/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.eager.stderr +++ b/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.eager.stderr @@ -17,8 +17,9 @@ LL | type AssokOf = T::Assok; | help: consider fully qualifying and renaming the associated type | -LL | type AssokOf = ::Assoc; - | + +++++++++ ~~~~~ +LL - type AssokOf = T::Assok; +LL + type AssokOf = ::Assoc; + | error[E0220]: associated type `Proj` not found for `T` --> $DIR/unresolved-assoc-ty-suggest-trait.rs:22:21 diff --git a/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.lazy.stderr b/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.lazy.stderr index 96179a7b48466..9c9bac95b76ab 100644 --- a/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.lazy.stderr +++ b/tests/ui/type-alias/unresolved-assoc-ty-suggest-trait.lazy.stderr @@ -21,8 +21,9 @@ LL | type AssokOf = T::Assok; | +++++++ help: ...and changing the associated type name | -LL | type AssokOf = T::Assoc; - | ~~~~~ +LL - type AssokOf = T::Assok; +LL + type AssokOf = T::Assoc; + | error[E0220]: associated type `Proj` not found for `T` --> $DIR/unresolved-assoc-ty-suggest-trait.rs:22:21 diff --git a/tests/ui/type/issue-100584.stderr b/tests/ui/type/issue-100584.stderr index e1db14d1f001b..7cbab1540660c 100644 --- a/tests/ui/type/issue-100584.stderr +++ b/tests/ui/type/issue-100584.stderr @@ -19,8 +19,9 @@ LL | let _ = format!("{xyza}"); | ++++++++ + help: if this is intentional, prefix it with an underscore | -LL | fn foo(_xyza: &str) { - | ~~~~~ +LL - fn foo(xyza: &str) { +LL + fn foo(_xyza: &str) { + | error: unused variable: `xyza` --> $DIR/issue-100584.rs:7:9 @@ -37,8 +38,9 @@ LL | let _ = format!("aaa{xyza}bbb"); | ++++++++ + help: if this is intentional, prefix it with an underscore | -LL | fn foo3(_xyza: &str) { - | ~~~~~ +LL - fn foo3(xyza: &str) { +LL + fn foo3(_xyza: &str) { + | error: aborting due to 2 previous errors diff --git a/tests/ui/type/issue-103271.stderr b/tests/ui/type/issue-103271.stderr index f4dac51b2b478..1b84033291a5d 100644 --- a/tests/ui/type/issue-103271.stderr +++ b/tests/ui/type/issue-103271.stderr @@ -6,8 +6,9 @@ LL | let iter_fun = <&[u32]>::iter; | help: the function `iter` is implemented on `[u32]` | -LL | let iter_fun = <[u32]>::iter; - | ~~~~~ +LL - let iter_fun = <&[u32]>::iter; +LL + let iter_fun = <[u32]>::iter; + | error[E0599]: no function or associated item named `iter` found for reference `&[u32]` in the current scope --> $DIR/issue-103271.rs:10:33 @@ -17,8 +18,9 @@ LL | let iter_fun2 = <(&[u32])>::iter; | help: the function `iter` is implemented on `[u32]` | -LL | let iter_fun2 = <([u32])>::iter; - | ~~~~~ +LL - let iter_fun2 = <(&[u32])>::iter; +LL + let iter_fun2 = <([u32])>::iter; + | error: aborting due to 2 previous errors diff --git a/tests/ui/type/type-ascription-instead-of-statement-end.stderr b/tests/ui/type/type-ascription-instead-of-statement-end.stderr index 34c8864232393..34759b413d89d 100644 --- a/tests/ui/type/type-ascription-instead-of-statement-end.stderr +++ b/tests/ui/type/type-ascription-instead-of-statement-end.stderr @@ -7,8 +7,9 @@ LL | println!("test"): = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 help: use a semicolon instead | -LL | println!("test"); - | ~ +LL - println!("test"): +LL + println!("test"); + | error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:` --> $DIR/type-ascription-instead-of-statement-end.rs:7:21 diff --git a/tests/ui/type/type-ascription-with-fn-call.stderr b/tests/ui/type/type-ascription-with-fn-call.stderr index 2691f10cf3ed7..4222762373dcc 100644 --- a/tests/ui/type/type-ascription-with-fn-call.stderr +++ b/tests/ui/type/type-ascription-with-fn-call.stderr @@ -7,8 +7,9 @@ LL | f() : = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 help: use a semicolon instead | -LL | f() ; - | ~ +LL - f() : +LL + f() ; + | error: aborting due to 1 previous error diff --git a/tests/ui/type/type-check/issue-41314.stderr b/tests/ui/type/type-check/issue-41314.stderr index 2a089029b0a51..6a1b22c542cdd 100644 --- a/tests/ui/type/type-check/issue-41314.stderr +++ b/tests/ui/type/type-check/issue-41314.stderr @@ -6,8 +6,9 @@ LL | X::Y { number } => {} | help: use the tuple variant pattern syntax instead | -LL | X::Y(number) => {} - | ~~~~~~~~ +LL - X::Y { number } => {} +LL + X::Y(number) => {} + | error: aborting due to 1 previous error diff --git a/tests/ui/type/type-check/point-at-inference-3.stderr b/tests/ui/type/type-check/point-at-inference-3.stderr index 663799e9f86b4..58460aefdf866 100644 --- a/tests/ui/type/type-check/point-at-inference-3.stderr +++ b/tests/ui/type/type-check/point-at-inference-3.stderr @@ -15,8 +15,9 @@ note: method defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL help: change the type of the numeric literal from `u32` to `i32` | -LL | v.push(1i32); - | ~~~ +LL - v.push(1u32); +LL + v.push(1i32); + | error: aborting due to 1 previous error diff --git a/tests/ui/type/type-check/point-at-inference-4.stderr b/tests/ui/type/type-check/point-at-inference-4.stderr index a953ca70ea27a..04f0316cde58e 100644 --- a/tests/ui/type/type-check/point-at-inference-4.stderr +++ b/tests/ui/type/type-check/point-at-inference-4.stderr @@ -11,8 +11,9 @@ LL | fn infer(&self, a: A, b: B) {} | ^^^^^ ---- ---- help: provide the argument | -LL | s.infer(0i32, /* b */); - | ~~~~~~~~~~~~~~~ +LL - s.infer(0i32); +LL + s.infer(0i32, /* b */); + | error[E0308]: mismatched types --> $DIR/point-at-inference-4.rs:19:24 @@ -31,8 +32,9 @@ LL | let t: S = s; found struct `S` help: change the type of the numeric literal from `i32` to `u32` | -LL | s.infer(0u32); - | ~~~ +LL - s.infer(0i32); +LL + s.infer(0u32); + | error: aborting due to 2 previous errors diff --git a/tests/ui/type/type-dependent-def-issue-49241.stderr b/tests/ui/type/type-dependent-def-issue-49241.stderr index cf372dc59681e..9b395af8c1392 100644 --- a/tests/ui/type/type-dependent-def-issue-49241.stderr +++ b/tests/ui/type/type-dependent-def-issue-49241.stderr @@ -6,8 +6,9 @@ LL | const l: usize = v.count(); | help: consider using `let` instead of `const` | -LL | let l: usize = v.count(); - | ~~~ +LL - const l: usize = v.count(); +LL + let l: usize = v.count(); + | error: aborting due to 1 previous error diff --git a/tests/ui/type/wrong-call-return-type-due-to-generic-arg.stderr b/tests/ui/type/wrong-call-return-type-due-to-generic-arg.stderr index fbe6bfeebb149..53920bc9e02ec 100644 --- a/tests/ui/type/wrong-call-return-type-due-to-generic-arg.stderr +++ b/tests/ui/type/wrong-call-return-type-due-to-generic-arg.stderr @@ -13,8 +13,9 @@ LL | fn wrong_arg_type(x: u32) -> u32 { | ^^^^^^^^^^^^^^ ------ help: change the type of the numeric literal from `u16` to `u32` | -LL | let x = wrong_arg_type(0u32); - | ~~~ +LL - let x = wrong_arg_type(0u16); +LL + let x = wrong_arg_type(0u32); + | error[E0308]: mismatched types --> $DIR/wrong-call-return-type-due-to-generic-arg.rs:19:30 @@ -52,8 +53,9 @@ LL | fn function(x: T, y: bool) -> T { | ^^^^^^^^ ---- ------- help: change the type of the numeric literal from `u32` to `u16` | -LL | let x: u16 = function(0u16, 0u8); - | ~~~ +LL - let x: u16 = function(0u32, 0u8); +LL + let x: u16 = function(0u16, 0u8); + | error[E0308]: mismatched types --> $DIR/wrong-call-return-type-due-to-generic-arg.rs:25:27 @@ -77,8 +79,9 @@ LL | fn function(x: T, y: bool) -> T { | ^^^^^^^^ ---- help: change the type of the numeric literal from `u32` to `u16` | -LL | let x: u16 = function(0u16, true); - | ~~~ +LL - let x: u16 = function(0u32, true); +LL + let x: u16 = function(0u16, true); + | error[E0308]: mismatched types --> $DIR/wrong-call-return-type-due-to-generic-arg.rs:26:32 @@ -102,8 +105,9 @@ LL | fn method(&self, x: T) -> T { | ^^^^^^ ---- help: change the type of the numeric literal from `u32` to `u16` | -LL | let x: u16 = (S {}).method(0u16); - | ~~~ +LL - let x: u16 = (S {}).method(0u32); +LL + let x: u16 = (S {}).method(0u16); + | error[E0308]: arguments to this function are incorrect --> $DIR/wrong-call-return-type-due-to-generic-arg.rs:27:5 diff --git a/tests/ui/typeck/check-args-on-fn-err-2.stderr b/tests/ui/typeck/check-args-on-fn-err-2.stderr index 301bb88dbacf6..ccc006a902de4 100644 --- a/tests/ui/typeck/check-args-on-fn-err-2.stderr +++ b/tests/ui/typeck/check-args-on-fn-err-2.stderr @@ -8,8 +8,9 @@ LL | a((), 1i32 == 2u32); | help: change the type of the numeric literal from `u32` to `i32` | -LL | a((), 1i32 == 2i32); - | ~~~ +LL - a((), 1i32 == 2u32); +LL + a((), 1i32 == 2i32); + | error[E0425]: cannot find function `a` in this scope --> $DIR/check-args-on-fn-err-2.rs:2:5 diff --git a/tests/ui/typeck/cyclic_type_ice.stderr b/tests/ui/typeck/cyclic_type_ice.stderr index 36715b4ee5d1f..4dc02a53c0211 100644 --- a/tests/ui/typeck/cyclic_type_ice.stderr +++ b/tests/ui/typeck/cyclic_type_ice.stderr @@ -22,8 +22,9 @@ LL | let f = |_, _| (); | ^^^^^^ help: provide the argument | -LL | f(/* */, /* */); - | ~~~~~~~~~~~~~~~~ +LL - f(f); +LL + f(/* */, /* */); + | error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/deref-multi.stderr b/tests/ui/typeck/deref-multi.stderr index 4346e273d0d66..02513853c486d 100644 --- a/tests/ui/typeck/deref-multi.stderr +++ b/tests/ui/typeck/deref-multi.stderr @@ -34,8 +34,9 @@ LL | &x | help: consider removing the `&` and dereferencing the borrow instead | -LL | *x - | ~ +LL - &x +LL + *x + | error[E0308]: mismatched types --> $DIR/deref-multi.rs:17:5 @@ -49,8 +50,9 @@ LL | &x found reference `&Box` help: consider removing the `&` and dereferencing the borrow instead | -LL | *x - | ~ +LL - &x +LL + *x + | error[E0308]: mismatched types --> $DIR/deref-multi.rs:22:5 diff --git a/tests/ui/typeck/ice-self-mismatch-const-generics.stderr b/tests/ui/typeck/ice-self-mismatch-const-generics.stderr index c502ea4565f68..12e4b6352e75c 100644 --- a/tests/ui/typeck/ice-self-mismatch-const-generics.stderr +++ b/tests/ui/typeck/ice-self-mismatch-const-generics.stderr @@ -12,8 +12,9 @@ LL | Self { thing } found struct `GenericStruct<_, 0>` help: use the type name directly | -LL | GenericStruct::<1, T> { thing } - | ~~~~~~~~~~~~~~~~~~~~~ +LL - Self { thing } +LL + GenericStruct::<1, T> { thing } + | error[E0308]: mismatched types --> $DIR/ice-self-mismatch-const-generics.rs:20:9 @@ -29,8 +30,9 @@ LL | Self { 0: thing } found struct `GenericStruct2<_, 0>` help: use the type name directly | -LL | GenericStruct2::<1, T> { 0: thing } - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - Self { 0: thing } +LL + GenericStruct2::<1, T> { 0: thing } + | error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/ice-unexpected-region-123863.stderr b/tests/ui/typeck/ice-unexpected-region-123863.stderr index 0479f134a3897..45a1f50ff06fa 100644 --- a/tests/ui/typeck/ice-unexpected-region-123863.stderr +++ b/tests/ui/typeck/ice-unexpected-region-123863.stderr @@ -38,8 +38,9 @@ LL | Inner::concat_strs::<"a">::A | help: if there were a trait named `Example` with associated type `concat_strs` implemented for `Inner<_>`, you could use the fully-qualified path | -LL | as Example>::concat_strs::A - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - Inner::concat_strs::<"a">::A +LL + as Example>::concat_strs::A + | error: aborting due to 3 previous errors diff --git a/tests/ui/typeck/issue-104582.stderr b/tests/ui/typeck/issue-104582.stderr index 61b6b23642cce..704579698b90e 100644 --- a/tests/ui/typeck/issue-104582.stderr +++ b/tests/ui/typeck/issue-104582.stderr @@ -6,8 +6,9 @@ LL | let my_var: String(String?); | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | -LL | let my_var: String(Option); - | +++++++ ~ +LL - let my_var: String(String?); +LL + let my_var: String(Option); + | error[E0214]: parenthesized type parameters may only be used with a `Fn` trait --> $DIR/issue-104582.rs:2:17 @@ -17,8 +18,9 @@ LL | let my_var: String(String?); | help: use angle brackets instead | -LL | let my_var: String; - | ~ ~ +LL - let my_var: String(String?); +LL + let my_var: String; + | error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-110052.stderr b/tests/ui/typeck/issue-110052.stderr index 5eb10d9a30e86..649fc8429b9c2 100644 --- a/tests/ui/typeck/issue-110052.stderr +++ b/tests/ui/typeck/issue-110052.stderr @@ -6,10 +6,12 @@ LL | for<'iter> dyn Validator<<&'iter I>::Item>:, | help: use fully-qualified syntax | -LL | for<'iter> dyn Validator<<&'iter I as IntoAsyncIterator>::Item>:, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | for<'iter> dyn Validator<<&'iter I as IntoIterator>::Item>:, - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - for<'iter> dyn Validator<<&'iter I>::Item>:, +LL + for<'iter> dyn Validator<<&'iter I as IntoAsyncIterator>::Item>:, + | +LL - for<'iter> dyn Validator<<&'iter I>::Item>:, +LL + for<'iter> dyn Validator<<&'iter I as IntoIterator>::Item>:, + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr index f81736245f3cf..18a992b2f341d 100644 --- a/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr +++ b/tests/ui/typeck/issue-112252-ptr-arithmetics-help.stderr @@ -8,8 +8,9 @@ LL | let _a = _ptr1 + 5; | help: consider using `wrapping_add` or `add` for pointer + {integer} | -LL | let _a = _ptr1.wrapping_add(5); - | ~~~~~~~~~~~~~~ + +LL - let _a = _ptr1 + 5; +LL + let _a = _ptr1.wrapping_add(5); + | error[E0369]: cannot subtract `{integer}` from `*const u32` --> $DIR/issue-112252-ptr-arithmetics-help.rs:7:20 @@ -21,8 +22,9 @@ LL | let _b = _ptr1 - 5; | help: consider using `wrapping_sub` or `sub` for pointer - {integer} | -LL | let _b = _ptr1.wrapping_sub(5); - | ~~~~~~~~~~~~~~ + +LL - let _b = _ptr1 - 5; +LL + let _b = _ptr1.wrapping_sub(5); + | error[E0369]: cannot subtract `*const u32` from `*const u32` --> $DIR/issue-112252-ptr-arithmetics-help.rs:8:20 @@ -34,8 +36,9 @@ LL | let _c = _ptr2 - _ptr1; | help: consider using `offset_from` for pointer - pointer if the pointers point to the same allocation | -LL | let _c = unsafe { _ptr2.offset_from(_ptr1) }; - | ++++++++ ~~~~~~~~~~~~~ +++ +LL - let _c = _ptr2 - _ptr1; +LL + let _c = unsafe { _ptr2.offset_from(_ptr1) }; + | error[E0608]: cannot index into a value of type `*const u32` --> $DIR/issue-112252-ptr-arithmetics-help.rs:9:19 @@ -45,8 +48,9 @@ LL | let _d = _ptr1[5]; | help: consider using `wrapping_add` or `add` for indexing into raw pointer | -LL | let _d = _ptr1.wrapping_add(5); - | ~~~~~~~~~~~~~~ ~ +LL - let _d = _ptr1[5]; +LL + let _d = _ptr1.wrapping_add(5); + | error: aborting due to 4 previous errors diff --git a/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr b/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr index 731f234c162ad..de993df722ceb 100644 --- a/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr +++ b/tests/ui/typeck/issue-114529-illegal-break-with-value.stderr @@ -8,8 +8,9 @@ LL | break 9; | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break 9; +LL + break; + | error[E0571]: `break` with value from a `while` loop --> $DIR/issue-114529-illegal-break-with-value.rs:16:13 @@ -21,8 +22,9 @@ LL | break v; | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break v; +LL + break; + | error[E0571]: `break` with value from a `while` loop --> $DIR/issue-114529-illegal-break-with-value.rs:22:9 @@ -36,8 +38,11 @@ LL | | }); | help: use `break` on its own without a value inside this `while` loop | -LL | break; - | ~~~~~ +LL - break (|| { +LL - let local = 9; +LL - }); +LL + break; + | error: aborting due to 3 previous errors diff --git a/tests/ui/typeck/issue-29181.stderr b/tests/ui/typeck/issue-29181.stderr index 53addf2fe4d09..e73c3e5188183 100644 --- a/tests/ui/typeck/issue-29181.stderr +++ b/tests/ui/typeck/issue-29181.stderr @@ -12,8 +12,9 @@ LL | let _ = |x: f64| x * 2.0.exp(); | help: you must specify a concrete type for this numeric value, like `f32` | -LL | let _ = |x: f64| x * 2.0_f32.exp(); - | ~~~~~~~ +LL - let _ = |x: f64| x * 2.0.exp(); +LL + let _ = |x: f64| x * 2.0_f32.exp(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-53712.stderr b/tests/ui/typeck/issue-53712.stderr index ffaf5cde1d71e..16a7ce0ea62f7 100644 --- a/tests/ui/typeck/issue-53712.stderr +++ b/tests/ui/typeck/issue-53712.stderr @@ -6,8 +6,9 @@ LL | arr.0; | help: instead of using tuple indexing, use array indexing | -LL | arr[0]; - | ~ + +LL - arr.0; +LL + arr[0]; + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr b/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr index 96ac481438f7a..6760d662a51f5 100644 --- a/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr +++ b/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr @@ -6,12 +6,14 @@ LL | let foo::Foo {} = foo::Foo::default(); | help: include the missing field in the pattern and ignore the inaccessible fields | -LL | let foo::Foo { visible, .. } = foo::Foo::default(); - | ~~~~~~~~~~~~~~~ +LL - let foo::Foo {} = foo::Foo::default(); +LL + let foo::Foo { visible, .. } = foo::Foo::default(); + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | let foo::Foo { .. } = foo::Foo::default(); - | ~~~~~~ +LL - let foo::Foo {} = foo::Foo::default(); +LL + let foo::Foo { .. } = foo::Foo::default(); + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/method-chain-gats.stderr b/tests/ui/typeck/method-chain-gats.stderr index 6338379221471..902255a28a621 100644 --- a/tests/ui/typeck/method-chain-gats.stderr +++ b/tests/ui/typeck/method-chain-gats.stderr @@ -19,8 +19,9 @@ LL | Self::Base: Functor; | ^^^^^^^^^^ required by this bound in `Functor::fmap` help: consider further restricting the associated type | -LL | T::Base: Functor = T::Base>, ::Base: Functor - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - T::Base: Functor = T::Base>, +LL + T::Base: Functor = T::Base>, ::Base: Functor + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/mismatched-map-under-self.stderr b/tests/ui/typeck/mismatched-map-under-self.stderr index 59de00a58bbea..fd6b3093ec977 100644 --- a/tests/ui/typeck/mismatched-map-under-self.stderr +++ b/tests/ui/typeck/mismatched-map-under-self.stderr @@ -13,8 +13,9 @@ LL | fn values(&self) -> Self::Values; found signature `fn(Option<_>)` help: change the self-receiver type to match the trait | -LL | fn values(&self) -> Self::Values { - | ~~~~~ +LL - fn values(self) -> Self::Values { +LL + fn values(&self) -> Self::Values { + | error[E0631]: type mismatch in function arguments --> $DIR/mismatched-map-under-self.rs:12:18 diff --git a/tests/ui/typeck/ptr-null-mutability-suggestions.stderr b/tests/ui/typeck/ptr-null-mutability-suggestions.stderr index 2912977a461a3..aa1e79ac0d4a6 100644 --- a/tests/ui/typeck/ptr-null-mutability-suggestions.stderr +++ b/tests/ui/typeck/ptr-null-mutability-suggestions.stderr @@ -15,8 +15,9 @@ LL | fn expecting_null_mut(_: *mut u8) {} | ^^^^^^^^^^^^^^^^^^ ---------- help: consider using `core::ptr::null_mut` instead | -LL | expecting_null_mut(core::ptr::null_mut()); - | ~~~~~~~~~~~~~~~~~~~~~ +LL - expecting_null_mut(ptr::null()); +LL + expecting_null_mut(core::ptr::null_mut()); + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/remove-semi-but-confused-char.stderr b/tests/ui/typeck/remove-semi-but-confused-char.stderr index 2d0b53a60ce40..7f5c0758dd142 100644 --- a/tests/ui/typeck/remove-semi-but-confused-char.stderr +++ b/tests/ui/typeck/remove-semi-but-confused-char.stderr @@ -6,8 +6,9 @@ LL | num * num; | help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not | -LL | num * num; - | ~ +LL - num * num; +LL + num * num; + | error[E0308]: mismatched types --> $DIR/remove-semi-but-confused-char.rs:5:28 diff --git a/tests/ui/typeck/struct-enum-wrong-args.stderr b/tests/ui/typeck/struct-enum-wrong-args.stderr index e58d162901e1c..d1003fbb6b313 100644 --- a/tests/ui/typeck/struct-enum-wrong-args.stderr +++ b/tests/ui/typeck/struct-enum-wrong-args.stderr @@ -38,8 +38,9 @@ note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL help: provide the argument | -LL | let _ = Ok(/* value */); - | ~~~~~~~~~~~~~ +LL - let _ = Ok(); +LL + let _ = Ok(/* value */); + | error[E0061]: this struct takes 1 argument but 0 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:9:13 @@ -54,8 +55,9 @@ LL | struct Wrapper(i32); | ^^^^^^^ help: provide the argument | -LL | let _ = Wrapper(/* i32 */); - | ~~~~~~~~~~~ +LL - let _ = Wrapper(); +LL + let _ = Wrapper(/* i32 */); + | error[E0061]: this struct takes 1 argument but 2 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:10:13 @@ -87,8 +89,9 @@ LL | struct DoubleWrapper(i32, i32); | ^^^^^^^^^^^^^ help: provide the arguments | -LL | let _ = DoubleWrapper(/* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~ +LL - let _ = DoubleWrapper(); +LL + let _ = DoubleWrapper(/* i32 */, /* i32 */); + | error[E0061]: this struct takes 2 arguments but 1 argument was supplied --> $DIR/struct-enum-wrong-args.rs:12:13 @@ -103,8 +106,9 @@ LL | struct DoubleWrapper(i32, i32); | ^^^^^^^^^^^^^ help: provide the argument | -LL | let _ = DoubleWrapper(5, /* i32 */); - | ~~~~~~~~~~~~~~ +LL - let _ = DoubleWrapper(5); +LL + let _ = DoubleWrapper(5, /* i32 */); + | error[E0061]: this struct takes 2 arguments but 3 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:13:13 diff --git a/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr b/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr index 53608391f3c89..0b899ad271232 100644 --- a/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr +++ b/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr @@ -6,8 +6,9 @@ LL | main(rahh); | help: Unicode character ')' (Fullwidth Right Parenthesis) looks like ')' (Right Parenthesis), but it is not | -LL | main(rahh); - | ~ +LL - main(rahh); +LL + main(rahh); + | error[E0425]: cannot find value `rahh` in this scope --> $DIR/suggest-arg-comma-delete-ice.rs:15:10 diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr index 9d295f88da5aa..6bfca3101b940 100644 --- a/tests/ui/typeck/typeck_type_placeholder_item.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr @@ -95,8 +95,9 @@ LL | fn test6(_: _) { } | help: use type parameters instead | -LL | fn test6(_: T) { } - | +++ ~ +LL - fn test6(_: _) { } +LL + fn test6(_: T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:25:18 @@ -106,8 +107,9 @@ LL | fn test6_b(_: _, _: T) { } | help: use type parameters instead | -LL | fn test6_b(_: U, _: T) { } - | +++ ~ +LL - fn test6_b(_: _, _: T) { } +LL + fn test6_b(_: U, _: T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:28:30 @@ -117,8 +119,9 @@ LL | fn test6_c(_: _, _: (T, K, L, A, B)) { } | help: use type parameters instead | -LL | fn test6_c(_: U, _: (T, K, L, A, B)) { } - | +++ ~ +LL - fn test6_c(_: _, _: (T, K, L, A, B)) { } +LL + fn test6_c(_: U, _: (T, K, L, A, B)) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:31:13 @@ -128,8 +131,9 @@ LL | fn test7(x: _) { let _x: usize = x; } | help: use type parameters instead | -LL | fn test7(x: T) { let _x: usize = x; } - | +++ ~ +LL - fn test7(x: _) { let _x: usize = x; } +LL + fn test7(x: T) { let _x: usize = x; } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:34:22 @@ -148,8 +152,9 @@ LL | fn test8(_f: fn() -> _) { } | help: use type parameters instead | -LL | fn test8(_f: fn() -> T) { } - | +++ ~ +LL - fn test8(_f: fn() -> _) { } +LL + fn test8(_f: fn() -> T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:48:26 @@ -177,8 +182,9 @@ LL | fn clone(&self) -> _ { Test9 } | help: try replacing `_` with the type in the corresponding trait method signature | -LL | fn clone(&self) -> Test9 { Test9 } - | ~~~~~ +LL - fn clone(&self) -> _ { Test9 } +LL + fn clone(&self) -> Test9 { Test9 } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:62:37 @@ -188,8 +194,9 @@ LL | fn clone_from(&mut self, other: _) { *self = Test9; } | help: try replacing `_` with the type in the corresponding trait method signature | -LL | fn clone_from(&mut self, other: &Test9) { *self = Test9; } - | ~~~~~~ +LL - fn clone_from(&mut self, other: _) { *self = Test9; } +LL + fn clone_from(&mut self, other: &Test9) { *self = Test9; } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs --> $DIR/typeck_type_placeholder_item.rs:67:8 @@ -282,8 +289,9 @@ LL | fn fn_test6(_: _) { } | help: use type parameters instead | -LL | fn fn_test6(_: T) { } - | +++ ~ +LL - fn fn_test6(_: _) { } +LL + fn fn_test6(_: T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:97:20 @@ -293,8 +301,9 @@ LL | fn fn_test7(x: _) { let _x: usize = x; } | help: use type parameters instead | -LL | fn fn_test7(x: T) { let _x: usize = x; } - | +++ ~ +LL - fn fn_test7(x: _) { let _x: usize = x; } +LL + fn fn_test7(x: T) { let _x: usize = x; } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:100:29 @@ -313,8 +322,9 @@ LL | fn fn_test8(_f: fn() -> _) { } | help: use type parameters instead | -LL | fn fn_test8(_f: fn() -> T) { } - | +++ ~ +LL - fn fn_test8(_f: fn() -> _) { } +LL + fn fn_test8(_f: fn() -> T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:115:28 @@ -324,8 +334,9 @@ LL | fn clone(&self) -> _ { FnTest9 } | help: try replacing `_` with the type in the corresponding trait method signature | -LL | fn clone(&self) -> FnTest9 { FnTest9 } - | ~~~~~~~ +LL - fn clone(&self) -> _ { FnTest9 } +LL + fn clone(&self) -> FnTest9 { FnTest9 } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:118:41 @@ -335,8 +346,9 @@ LL | fn clone_from(&mut self, other: _) { *self = FnTest9; } | help: try replacing `_` with the type in the corresponding trait method signature | -LL | fn clone_from(&mut self, other: &FnTest9) { *self = FnTest9; } - | ~~~~~~~~ +LL - fn clone_from(&mut self, other: _) { *self = FnTest9; } +LL + fn clone_from(&mut self, other: &FnTest9) { *self = FnTest9; } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs --> $DIR/typeck_type_placeholder_item.rs:123:12 @@ -398,8 +410,9 @@ LL | fn method_test1(&self, x: _); | help: use type parameters instead | -LL | fn method_test1(&self, x: T); - | +++ ~ +LL - fn method_test1(&self, x: _); +LL + fn method_test1(&self, x: T); + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:142:31 @@ -411,8 +424,9 @@ LL | fn method_test2(&self, x: _) -> _; | help: use type parameters instead | -LL | fn method_test2(&self, x: T) -> T; - | +++ ~ ~ +LL - fn method_test2(&self, x: _) -> _; +LL + fn method_test2(&self, x: T) -> T; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:144:31 @@ -422,8 +436,9 @@ LL | fn method_test3(&self) -> _; | help: use type parameters instead | -LL | fn method_test3(&self) -> T; - | +++ ~ +LL - fn method_test3(&self) -> _; +LL + fn method_test3(&self) -> T; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:146:26 @@ -433,8 +448,9 @@ LL | fn assoc_fn_test1(x: _); | help: use type parameters instead | -LL | fn assoc_fn_test1(x: T); - | +++ ~ +LL - fn assoc_fn_test1(x: _); +LL + fn assoc_fn_test1(x: T); + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:148:26 @@ -446,8 +462,9 @@ LL | fn assoc_fn_test2(x: _) -> _; | help: use type parameters instead | -LL | fn assoc_fn_test2(x: T) -> T; - | +++ ~ ~ +LL - fn assoc_fn_test2(x: _) -> _; +LL + fn assoc_fn_test2(x: T) -> T; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:150:28 @@ -457,8 +474,9 @@ LL | fn assoc_fn_test3() -> _; | help: use type parameters instead | -LL | fn assoc_fn_test3() -> T; - | +++ ~ +LL - fn assoc_fn_test3() -> _; +LL + fn assoc_fn_test3() -> T; + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs --> $DIR/typeck_type_placeholder_item.rs:154:21 @@ -468,8 +486,9 @@ LL | struct BadStruct<_>(_); | help: use type parameters instead | -LL | struct BadStruct(T); - | ~ ~ +LL - struct BadStruct<_>(_); +LL + struct BadStruct(T); + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for implementations --> $DIR/typeck_type_placeholder_item.rs:159:15 @@ -481,8 +500,9 @@ LL | impl BadTrait<_> for BadStruct<_> {} | help: use type parameters instead | -LL | impl BadTrait for BadStruct {} - | +++ ~ ~ +LL - impl BadTrait<_> for BadStruct<_> {} +LL + impl BadTrait for BadStruct {} + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for opaque types --> $DIR/typeck_type_placeholder_item.rs:162:34 @@ -498,8 +518,9 @@ LL | struct BadStruct1<_, _>(_); | help: use type parameters instead | -LL | struct BadStruct1(T); - | ~ ~ +LL - struct BadStruct1<_, _>(_); +LL + struct BadStruct1(T); + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs --> $DIR/typeck_type_placeholder_item.rs:172:25 @@ -509,8 +530,9 @@ LL | struct BadStruct2<_, T>(_, T); | help: use type parameters instead | -LL | struct BadStruct2(U, T); - | ~ ~ +LL - struct BadStruct2<_, T>(_, T); +LL + struct BadStruct2(U, T); + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases --> $DIR/typeck_type_placeholder_item.rs:176:14 @@ -532,8 +554,9 @@ LL | fn test10(&self, _x : _) { } | help: use type parameters instead | -LL | fn test10(&self, _x : T) { } - | +++ ~ +LL - fn test10(&self, _x : _) { } +LL + fn test10(&self, _x : T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:110:34 @@ -543,8 +566,9 @@ LL | fn fn_test10(&self, _x : _) { } | help: use type parameters instead | -LL | fn fn_test10(&self, _x : T) { } - | +++ ~ +LL - fn fn_test10(&self, _x : _) { } +LL + fn fn_test10(&self, _x : T) { } + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants --> $DIR/typeck_type_placeholder_item.rs:194:14 diff --git a/tests/ui/typeof/issue-100183.stderr b/tests/ui/typeof/issue-100183.stderr index 57317d449cf3a..765a5c54428f8 100644 --- a/tests/ui/typeof/issue-100183.stderr +++ b/tests/ui/typeof/issue-100183.stderr @@ -6,8 +6,9 @@ LL | y: (typeof("hey"),), | help: consider replacing `typeof(...)` with an actual type | -LL | y: (&str,), - | ~~~~ +LL - y: (typeof("hey"),), +LL + y: (&str,), + | error: aborting due to 1 previous error diff --git a/tests/ui/typeof/issue-29184.stderr b/tests/ui/typeof/issue-29184.stderr index f07c850e55669..d8d43504d7224 100644 --- a/tests/ui/typeof/issue-29184.stderr +++ b/tests/ui/typeof/issue-29184.stderr @@ -6,8 +6,9 @@ LL | let x: typeof(92) = 92; | help: consider replacing `typeof(...)` with an actual type | -LL | let x: i32 = 92; - | ~~~ +LL - let x: typeof(92) = 92; +LL + let x: i32 = 92; + | error: aborting due to 1 previous error diff --git a/tests/ui/typeof/issue-42060.stderr b/tests/ui/typeof/issue-42060.stderr index 86ba9432384b2..733ad37693bec 100644 --- a/tests/ui/typeof/issue-42060.stderr +++ b/tests/ui/typeof/issue-42060.stderr @@ -6,8 +6,9 @@ LL | let other: typeof(thing) = thing; | help: consider using `const` instead of `let` | -LL | const thing: /* Type */ = (); - | ~~~~~ ++++++++++++ +LL - let thing = (); +LL + const thing: /* Type */ = (); + | error[E0435]: attempt to use a non-constant value in a constant --> $DIR/issue-42060.rs:9:13 @@ -17,8 +18,9 @@ LL | ::N | help: consider using `const` instead of `let` | -LL | const q: /* Type */ = 1; - | ~~~~~ ++++++++++++ +LL - let q = 1; +LL + const q: /* Type */ = 1; + | error[E0516]: `typeof` is a reserved keyword but unimplemented --> $DIR/issue-42060.rs:3:16 diff --git a/tests/ui/typeof/type_mismatch.stderr b/tests/ui/typeof/type_mismatch.stderr index e75214cd31a6d..d5494922b1661 100644 --- a/tests/ui/typeof/type_mismatch.stderr +++ b/tests/ui/typeof/type_mismatch.stderr @@ -6,8 +6,9 @@ LL | let b: typeof(a) = 1i8; | help: consider replacing `typeof(...)` with an actual type | -LL | let b: u8 = 1i8; - | ~~ +LL - let b: typeof(a) = 1i8; +LL + let b: u8 = 1i8; + | error[E0308]: mismatched types --> $DIR/type_mismatch.rs:5:24 @@ -19,8 +20,9 @@ LL | let b: typeof(a) = 1i8; | help: change the type of the numeric literal from `i8` to `u8` | -LL | let b: typeof(a) = 1u8; - | ~~ +LL - let b: typeof(a) = 1i8; +LL + let b: typeof(a) = 1u8; + | error: aborting due to 2 previous errors diff --git a/tests/ui/ufcs/bad-builder.stderr b/tests/ui/ufcs/bad-builder.stderr index 9cfeb7a5d09d6..b5e614a2179e6 100644 --- a/tests/ui/ufcs/bad-builder.stderr +++ b/tests/ui/ufcs/bad-builder.stderr @@ -13,8 +13,9 @@ note: if you're trying to build a new `Vec` consider using one of the followi --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL help: there is an associated function `new` with a similar name | -LL | Vec::::new() - | ~~~ +LL - Vec::::mew() +LL + Vec::::new() + | error: aborting due to 1 previous error diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr index 2a8c4edbdb5f3..7b5f7cd9f7033 100644 --- a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr +++ b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr @@ -13,8 +13,9 @@ LL | fn dummy2(&self); found signature `fn(&Bar<_>)` help: change the self-receiver type to match the trait | -LL | fn dummy2(&self) {} - | ~~~~~ +LL - fn dummy2(self: &Bar) {} +LL + fn dummy2(&self) {} + | error[E0307]: invalid `self` parameter type: `isize` --> $DIR/ufcs-explicit-self-bad.rs:8:18 diff --git a/tests/ui/ufcs/ufcs-partially-resolved.stderr b/tests/ui/ufcs/ufcs-partially-resolved.stderr index eef55c8dc686f..0a9c190cb3561 100644 --- a/tests/ui/ufcs/ufcs-partially-resolved.stderr +++ b/tests/ui/ufcs/ufcs-partially-resolved.stderr @@ -24,7 +24,8 @@ LL | let _: ::N; | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait A = u32; +LL - type A = u32; +LL + trait A = u32; | error[E0576]: cannot find method or associated constant `N` in trait `Tr` @@ -53,7 +54,8 @@ LL | ::N; | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait A = u32; +LL - type A = u32; +LL + trait A = u32; | error[E0404]: expected trait, found enum `E` @@ -100,7 +102,8 @@ LL | let _: ::N::NN; | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait A = u32; +LL - type A = u32; +LL + trait A = u32; | error[E0576]: cannot find associated type `N` in trait `Tr` @@ -129,7 +132,8 @@ LL | ::N::NN; | help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias | -LL | trait A = u32; +LL - type A = u32; +LL + trait A = u32; | error[E0404]: expected trait, found enum `E` @@ -253,8 +257,9 @@ LL | let _: ::Y::NN; | help: if there were a trait named `Example` with associated type `NN` implemented for `::Y`, you could use the fully-qualified path | -LL | let _: <::Y as Example>::NN; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - let _: ::Y::NN; +LL + let _: <::Y as Example>::NN; + | error[E0599]: no associated item named `NN` found for type `u16` in the current scope --> $DIR/ufcs-partially-resolved.rs:38:20 diff --git a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr index a0430240dc43b..52c214697ed07 100644 --- a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -30,8 +30,9 @@ note: method defined here --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: change the type of the numeric literal from `u32` to `i32` | -LL | >::add(1i32, 2); - | ~~~ +LL - >::add(1u32, 2); +LL + >::add(1i32, 2); + | error[E0308]: mismatched types --> $DIR/ufcs-qpath-self-mismatch.rs:9:31 @@ -52,8 +53,9 @@ note: method defined here --> $SRC_DIR/core/src/ops/arith.rs:LL:COL help: change the type of the numeric literal from `u32` to `i32` | -LL | >::add(1, 2i32); - | ~~~ +LL - >::add(1, 2u32); +LL + >::add(1, 2i32); + | error[E0277]: cannot add `u32` to `i32` --> $DIR/ufcs-qpath-self-mismatch.rs:4:5 diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr index ce2c90f97da6a..1c6470eef8f7d 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr @@ -6,8 +6,9 @@ LL | let b = Bar::(isize, usize)::new(); // OK too (for the parser) | help: use angle brackets instead | -LL | let b = Bar::::new(); // OK too (for the parser) - | ~ ~ +LL - let b = Bar::(isize, usize)::new(); // OK too (for the parser) +LL + let b = Bar::::new(); // OK too (for the parser) + | error: aborting due to 1 previous error diff --git a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr index 327df50e645d5..d87588d182256 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr @@ -13,8 +13,9 @@ LL | let mut f = |x: isize, y: isize| -> isize { x + y }; | ^^^^^^^^ help: change the type of the numeric literal from `usize` to `isize` | -LL | let z = f(1_isize, 2); - | ~~~~~ +LL - let z = f(1_usize, 2); +LL + let z = f(1_isize, 2); + | error[E0308]: mismatched types --> $DIR/unboxed-closures-type-mismatch.rs:9:15 @@ -38,8 +39,9 @@ LL | let mut g = |x, y| { x + y }; | ^ help: change the type of the numeric literal from `usize` to `i32` | -LL | let z = g(1_i32, 2); - | ~~~ +LL - let z = g(1_usize, 2); +LL + let z = g(1_i32, 2); + | error[E0308]: mismatched types --> $DIR/unboxed-closures-type-mismatch.rs:17:18 @@ -63,8 +65,9 @@ LL | let identity = |x| x; | ^ help: change the type of the numeric literal from `u16` to `u8` | -LL | identity(1u8); - | ~~ +LL - identity(1u16); +LL + identity(1u8); + | error[E0308]: mismatched types --> $DIR/unboxed-closures-type-mismatch.rs:20:18 @@ -111,8 +114,9 @@ LL | let identity = |x| x; | ^ help: change the type of the numeric literal from `u16` to `u8` | -LL | identity(1u8); - | ~~ +LL - identity(1u16); +LL + identity(1u8); + | error[E0308]: mismatched types --> $DIR/unboxed-closures-type-mismatch.rs:33:18 diff --git a/tests/ui/underscore-lifetime/in-fn-return-illegal.stderr b/tests/ui/underscore-lifetime/in-fn-return-illegal.stderr index fb036c695b41c..a53e8adbecf93 100644 --- a/tests/ui/underscore-lifetime/in-fn-return-illegal.stderr +++ b/tests/ui/underscore-lifetime/in-fn-return-illegal.stderr @@ -7,8 +7,9 @@ LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y` help: consider introducing a named lifetime parameter | -LL | fn foo<'a>(x: &'a u32, y: &'a u32) -> &'a u32 { loop { } } - | ++++ ++ ++ ~~ +LL - fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } } +LL + fn foo<'a>(x: &'a u32, y: &'a u32) -> &'a u32 { loop { } } + | error: aborting due to 1 previous error diff --git a/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr b/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr index cd74d27dcb55f..d940166e9e28b 100644 --- a/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr +++ b/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr @@ -6,8 +6,9 @@ LL | struct Baz<'a>(&'_ &'a u8); | help: consider using the `'a` lifetime | -LL | struct Baz<'a>(&'a &'a u8); - | ~~ +LL - struct Baz<'a>(&'_ &'a u8); +LL + struct Baz<'a>(&'a &'a u8); + | error[E0637]: `'_` cannot be used here --> $DIR/underscore-lifetime-binders.rs:4:8 @@ -30,8 +31,9 @@ LL | fn meh() -> Box Meh<'_>> = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`, or if you will only have owned values | -LL | fn meh() -> Box Meh<'static>> - | ~~~~~~~ +LL - fn meh() -> Box Meh<'_>> +LL + fn meh() -> Box Meh<'static>> + | error[E0106]: missing lifetime specifier --> $DIR/underscore-lifetime-binders.rs:16:35 @@ -42,8 +44,9 @@ LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or `y` help: consider introducing a named lifetime parameter | -LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y } - | ++++ ~~ ~~ ~~ +LL - fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } +LL + fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y } + | error: aborting due to 5 previous errors diff --git a/tests/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr b/tests/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr index ed9d22d255839..b899834d6d187 100644 --- a/tests/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr +++ b/tests/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr @@ -9,8 +9,9 @@ LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } | help: consider introducing a named lifetime parameter | -LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } - | ++++ ~~ ~~ +LL - fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } +LL + fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); } + | error: aborting due to 1 previous error diff --git a/tests/ui/union/union-suggest-field.stderr b/tests/ui/union/union-suggest-field.stderr index 5c428cf6c8993..fc6daca2a4795 100644 --- a/tests/ui/union/union-suggest-field.stderr +++ b/tests/ui/union/union-suggest-field.stderr @@ -6,8 +6,9 @@ LL | let u = U { principle: 0 }; | help: a field with a similar name exists | -LL | let u = U { principal: 0 }; - | ~~~~~~~~~ +LL - let u = U { principle: 0 }; +LL + let u = U { principal: 0 }; + | error[E0609]: no field `principial` on type `U` --> $DIR/union-suggest-field.rs:14:15 @@ -17,8 +18,9 @@ LL | let w = u.principial; | help: a field with a similar name exists | -LL | let w = u.principal; - | ~~~~~~~~~ +LL - let w = u.principial; +LL + let w = u.principal; + | error[E0615]: attempted to take value of method `calculate` on type `U` --> $DIR/union-suggest-field.rs:18:15 diff --git a/tests/ui/unresolved/unresolved-candidates.stderr b/tests/ui/unresolved/unresolved-candidates.stderr index 7ef2f6b1a2922..0810f90306e89 100644 --- a/tests/ui/unresolved/unresolved-candidates.stderr +++ b/tests/ui/unresolved/unresolved-candidates.stderr @@ -6,8 +6,9 @@ LL | use Trait; | help: consider importing this trait instead | -LL | use a::Trait; - | ~~~~~~~~ +LL - use Trait; +LL + use a::Trait; + | error[E0405]: cannot find trait `Trait` in this scope --> $DIR/unresolved-candidates.rs:10:10 diff --git a/tests/ui/unresolved/unresolved-import-avoid-suggesting-global-path.stderr b/tests/ui/unresolved/unresolved-import-avoid-suggesting-global-path.stderr index b0352ab675435..f96cf69a2afc9 100644 --- a/tests/ui/unresolved/unresolved-import-avoid-suggesting-global-path.stderr +++ b/tests/ui/unresolved/unresolved-import-avoid-suggesting-global-path.stderr @@ -6,8 +6,9 @@ LL | use module::SomeUsefulType; | help: consider importing this struct instead | -LL | use library::SomeUsefulType; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - use module::SomeUsefulType; +LL + use library::SomeUsefulType; + | error[E0432]: unresolved import `module::SomeUsefulType` --> $DIR/unresolved-import-avoid-suggesting-global-path.rs:28:9 @@ -17,8 +18,9 @@ LL | use module::SomeUsefulType; | help: consider importing this struct instead | -LL | use library::SomeUsefulType; - | ~~~~~~~~~~~~~~~~~~~~~~~ +LL - use module::SomeUsefulType; +LL + use library::SomeUsefulType; + | error: aborting due to 2 previous errors diff --git a/tests/ui/unresolved/unresolved-import-suggest-disambiguated-crate-name.stderr b/tests/ui/unresolved/unresolved-import-suggest-disambiguated-crate-name.stderr index c6812dbb19639..31b943defbaa9 100644 --- a/tests/ui/unresolved/unresolved-import-suggest-disambiguated-crate-name.stderr +++ b/tests/ui/unresolved/unresolved-import-suggest-disambiguated-crate-name.stderr @@ -6,8 +6,9 @@ LL | pub use module::SomeUsefulType; | help: consider importing this struct instead | -LL | pub use ::library::SomeUsefulType; - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - pub use module::SomeUsefulType; +LL + pub use ::library::SomeUsefulType; + | error: aborting due to 1 previous error diff --git a/tests/ui/unsigned-literal-negation.stderr b/tests/ui/unsigned-literal-negation.stderr index b0a730477a1b0..0bedbc1accd3b 100644 --- a/tests/ui/unsigned-literal-negation.stderr +++ b/tests/ui/unsigned-literal-negation.stderr @@ -7,8 +7,9 @@ LL | let x = -1 as usize; = note: unsigned values cannot be negated help: you may have meant the maximum value of `usize` | -LL | let x = usize::MAX; - | ~~~~~~~~~~ +LL - let x = -1 as usize; +LL + let x = usize::MAX; + | error[E0600]: cannot apply unary operator `-` to type `usize` --> $DIR/unsigned-literal-negation.rs:3:13 @@ -19,8 +20,9 @@ LL | let x = (-1) as usize; = note: unsigned values cannot be negated help: you may have meant the maximum value of `usize` | -LL | let x = usize::MAX; - | ~~~~~~~~~~ +LL - let x = (-1) as usize; +LL + let x = usize::MAX; + | error[E0600]: cannot apply unary operator `-` to type `u32` --> $DIR/unsigned-literal-negation.rs:4:18 @@ -31,8 +33,9 @@ LL | let x: u32 = -1; = note: unsigned values cannot be negated help: you may have meant the maximum value of `u32` | -LL | let x: u32 = u32::MAX; - | ~~~~~~~~ +LL - let x: u32 = -1; +LL + let x: u32 = u32::MAX; + | error: aborting due to 3 previous errors diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.stderr b/tests/ui/unsized/box-instead-of-dyn-fn.stderr index 1f1845569ef17..ed17ff69a1237 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.stderr +++ b/tests/ui/unsized/box-instead-of-dyn-fn.stderr @@ -6,8 +6,9 @@ LL | fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> impl Fn() + 'a { - | ~~~~ +LL - fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { +LL + fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> impl Fn() + 'a { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> Box { diff --git a/tests/ui/unsized/issue-91803.stderr b/tests/ui/unsized/issue-91803.stderr index 3b89066499dfe..812fac3585c8a 100644 --- a/tests/ui/unsized/issue-91803.stderr +++ b/tests/ui/unsized/issue-91803.stderr @@ -6,8 +6,9 @@ LL | fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn or<'a>(first: &'static dyn Foo<'a>) -> impl Foo<'a> { - | ~~~~ +LL - fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { +LL + fn or<'a>(first: &'static dyn Foo<'a>) -> impl Foo<'a> { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL | fn or<'a>(first: &'static dyn Foo<'a>) -> Box> { diff --git a/tests/ui/variants/variant-used-as-type.stderr b/tests/ui/variants/variant-used-as-type.stderr index 64424abbcecce..1857c10a8e9ba 100644 --- a/tests/ui/variants/variant-used-as-type.stderr +++ b/tests/ui/variants/variant-used-as-type.stderr @@ -6,10 +6,12 @@ LL | B(Ty::A), | help: try using the variant's enum | -LL | B(E), - | ~ -LL | B(Ty), - | ~~ +LL - B(Ty::A), +LL + B(E), + | +LL - B(Ty::A), +LL + B(Ty), + | error[E0573]: expected type, found variant `E::A` --> $DIR/variant-used-as-type.rs:17:6 @@ -19,10 +21,12 @@ LL | impl E::A {} | help: try using the variant's enum | -LL | impl E {} - | ~ -LL | impl Ty {} - | ~~ +LL - impl E::A {} +LL + impl E {} + | +LL - impl E::A {} +LL + impl Ty {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr index f2456f99e6233..ebef179ce7f56 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr @@ -150,8 +150,9 @@ LL | fn fnc(&self) -> Trait { | help: you might have meant to use `Self` to refer to the implementing type | -LL | fn fnc(&self) -> Self { - | ~~~~ +LL - fn fnc(&self) -> Trait { +LL + fn fnc(&self) -> Self { + | warning: trait objects without an explicit `dyn` are deprecated --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:12:21