about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/compile-test.rs12
-rw-r--r--tests/lint_message_convention.rs1
-rw-r--r--tests/ui-cargo/lint_groups_priority/fail/Cargo.stderr22
-rw-r--r--tests/ui-internal/check_clippy_version_attribute.rs4
-rw-r--r--tests/ui-internal/check_clippy_version_attribute.stderr19
-rw-r--r--tests/ui-internal/check_formulation.rs2
-rw-r--r--tests/ui-internal/check_formulation.stderr2
-rw-r--r--tests/ui-internal/collapsible_span_lint_calls.rs5
-rw-r--r--tests/ui-internal/collapsible_span_lint_calls.stderr13
-rw-r--r--tests/ui-internal/custom_ice_message.rs1
-rw-r--r--tests/ui-internal/custom_ice_message.stderr25
-rw-r--r--tests/ui-internal/default_lint.rs1
-rw-r--r--tests/ui-internal/default_lint.stderr1
-rw-r--r--tests/ui-internal/disallow_span_lint.rs2
-rw-r--r--tests/ui-internal/disallow_span_lint.stderr2
-rw-r--r--tests/ui-internal/interning_defined_symbol.fixed4
-rw-r--r--tests/ui-internal/interning_defined_symbol.rs4
-rw-r--r--tests/ui-internal/interning_defined_symbol.stderr6
-rw-r--r--tests/ui-internal/invalid_msrv_attr_impl.fixed12
-rw-r--r--tests/ui-internal/invalid_msrv_attr_impl.rs9
-rw-r--r--tests/ui-internal/invalid_msrv_attr_impl.stderr26
-rw-r--r--tests/ui-internal/invalid_paths.rs3
-rw-r--r--tests/ui-internal/invalid_paths.stderr4
-rw-r--r--tests/ui-internal/lint_without_lint_pass.rs1
-rw-r--r--tests/ui-internal/lint_without_lint_pass.stderr1
-rw-r--r--tests/ui-internal/outer_expn_data.fixed1
-rw-r--r--tests/ui-internal/outer_expn_data.rs1
-rw-r--r--tests/ui-internal/unnecessary_def_path.fixed15
-rw-r--r--tests/ui-internal/unnecessary_def_path.rs15
-rw-r--r--tests/ui-internal/unnecessary_def_path.stderr28
-rw-r--r--tests/ui-internal/unnecessary_def_path_hardcoded_path.rs3
-rw-r--r--tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr4
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.fixed5
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.rs5
-rw-r--r--tests/ui-internal/unnecessary_symbol_str.stderr8
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4/clippy.toml1
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/bad_conf_5/clippy.toml1
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/bad_conf_6/clippy.toml1
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/default_exp/clippy.toml2
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ord_in_2/clippy.toml1
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ord_in_3/clippy.toml2
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ord_within/clippy.toml1
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_4.stderr8
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_5.stderr4
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_6.stderr4
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs8
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default.stderr125
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default_exp.stderr160
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.ord_within.stderr235
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs14
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.default.stderr19
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_2.stderr36
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_3.stderr19
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_within.stderr48
-rw-r--r--tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs46
-rw-r--r--tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.default.stderr11
-rw-r--r--tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.enabled.stderr23
-rw-r--r--tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs31
-rw-r--r--tests/ui-toml/check_incompatible_msrv_in_tests/default/clippy.toml1
-rw-r--r--tests/ui-toml/check_incompatible_msrv_in_tests/enabled/clippy.toml1
-rw-r--r--tests/ui-toml/dbg_macro/dbg_macro.stderr31
-rw-r--r--tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr5
-rw-r--r--tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr15
-rw-r--r--tests/ui-toml/enum_variant_size/enum_variant_size.stderr5
-rw-r--r--tests/ui-toml/large_include_file/large_include_file.stderr18
-rw-r--r--tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr5
-rw-r--r--tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr5
-rw-r--r--tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr6
-rw-r--r--tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.default.stderr46
-rw-r--r--tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.disabled.stderr62
-rw-r--r--tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs91
-rw-r--r--tests/ui-toml/unwrap_used/unwrap_used.stderr75
-rw-r--r--tests/ui/asm_syntax_not_x86.rs6
-rw-r--r--tests/ui/assign_ops2.stderr90
-rw-r--r--tests/ui/async_yields_async.stderr12
-rw-r--r--tests/ui/attrs.rs5
-rw-r--r--tests/ui/attrs.stderr4
-rw-r--r--tests/ui/author/blocks.stdout4
-rw-r--r--tests/ui/author/macro_in_closure.stdout2
-rw-r--r--tests/ui/author/repeat.stdout2
-rw-r--r--tests/ui/bind_instead_of_map_multipart.stderr20
-rw-r--r--tests/ui/blocks_in_conditions.fixed7
-rw-r--r--tests/ui/blocks_in_conditions.rs7
-rw-r--r--tests/ui/borrow_deref_ref_unfixable.stderr7
-rw-r--r--tests/ui/cast.stderr103
-rw-r--r--tests/ui/cast_lossless_bool.stderr75
-rw-r--r--tests/ui/cast_lossless_float.stderr65
-rw-r--r--tests/ui/cast_lossless_integer.stderr198
-rw-r--r--tests/ui/cast_size.32bit.stderr45
-rw-r--r--tests/ui/cast_size.64bit.stderr45
-rw-r--r--tests/ui/crashes/elidable_lifetime_names_impl_trait.fixed (renamed from tests/ui/crashes/needless_lifetimes_impl_trait.fixed)6
-rw-r--r--tests/ui/crashes/elidable_lifetime_names_impl_trait.rs (renamed from tests/ui/crashes/needless_lifetimes_impl_trait.rs)6
-rw-r--r--tests/ui/crashes/elidable_lifetime_names_impl_trait.stderr (renamed from tests/ui/crashes/needless_lifetimes_impl_trait.stderr)10
-rw-r--r--tests/ui/crashes/ice-14303.rs12
-rw-r--r--tests/ui/crashes/ice-14325.rs17
-rw-r--r--tests/ui/crashes/ice-5835.fixed10
-rw-r--r--tests/ui/crashes/ice-5835.rs5
-rw-r--r--tests/ui/crashes/ice-5835.stderr20
-rw-r--r--tests/ui/crashes/if_same_then_else.rs1
-rw-r--r--tests/ui/crashes/needless_pass_by_value-w-late-bound.stderr6
-rw-r--r--tests/ui/create_dir.stderr10
-rw-r--r--tests/ui/dbg_macro/dbg_macro.stderr81
-rw-r--r--tests/ui/dbg_macro/dbg_macro_unfixable.stderr25
-rw-r--r--tests/ui/doc/doc-fixable.stderr161
-rw-r--r--tests/ui/doc/doc_comment_double_space_linebreaks.fixed98
-rw-r--r--tests/ui/doc/doc_comment_double_space_linebreaks.rs98
-rw-r--r--tests/ui/doc/doc_comment_double_space_linebreaks.stderr50
-rw-r--r--tests/ui/doc/doc_markdown-issue_13097.stderr5
-rw-r--r--tests/ui/doc/doc_nested_refdef_list_item.fixed8
-rw-r--r--tests/ui/doc/doc_nested_refdef_list_item.rs8
-rw-r--r--tests/ui/doc/doc_nested_refdef_list_item.stderr26
-rw-r--r--tests/ui/doc/issue_10262.stderr5
-rw-r--r--tests/ui/doc/issue_12795.stderr20
-rw-r--r--tests/ui/doc/issue_9473.stderr5
-rw-r--r--tests/ui/doc/link_adjacent.stderr50
-rw-r--r--tests/ui/doc/unbalanced_ticks.rs42
-rw-r--r--tests/ui/doc/unbalanced_ticks.stderr189
-rw-r--r--tests/ui/doc_link_with_quotes.rs1
-rw-r--r--tests/ui/doc_link_with_quotes.stderr4
-rw-r--r--tests/ui/double_ended_iterator_last.fixed45
-rw-r--r--tests/ui/double_ended_iterator_last.rs45
-rw-r--r--tests/ui/double_ended_iterator_last.stderr75
-rw-r--r--tests/ui/double_ended_iterator_last_unfixable.rs23
-rw-r--r--tests/ui/double_ended_iterator_last_unfixable.stderr33
-rw-r--r--tests/ui/eager_transmute.stderr85
-rw-r--r--tests/ui/elidable_lifetime_names.fixed194
-rw-r--r--tests/ui/elidable_lifetime_names.rs194
-rw-r--r--tests/ui/elidable_lifetime_names.stderr162
-rw-r--r--tests/ui/empty_line_after/doc_comments.1.fixed33
-rw-r--r--tests/ui/empty_line_after/doc_comments.2.fixed61
-rw-r--r--tests/ui/empty_line_after/doc_comments.rs34
-rw-r--r--tests/ui/empty_line_after/doc_comments.stderr120
-rw-r--r--tests/ui/empty_line_after/outer_attribute.stderr30
-rw-r--r--tests/ui/entry.fixed31
-rw-r--r--tests/ui/entry.rs31
-rw-r--r--tests/ui/entry_unfixable.rs94
-rw-r--r--tests/ui/entry_unfixable.stderr41
-rw-r--r--tests/ui/excessive_precision.stderr80
-rw-r--r--tests/ui/fn_to_numeric_cast_any.stderr34
-rw-r--r--tests/ui/for_kv_map.stderr30
-rw-r--r--tests/ui/format_args_unfixable.rs8
-rw-r--r--tests/ui/four_forward_slashes.stderr8
-rw-r--r--tests/ui/four_forward_slashes_first_line.stderr2
-rw-r--r--tests/ui/from_over_into.fixed11
-rw-r--r--tests/ui/from_over_into.rs11
-rw-r--r--tests/ui/from_over_into.stderr18
-rw-r--r--tests/ui/get_unwrap.stderr85
-rw-r--r--tests/ui/ifs_same_cond.rs7
-rw-r--r--tests/ui/ifs_same_cond.stderr16
-rw-r--r--tests/ui/implicit_hasher.stderr6
-rw-r--r--tests/ui/implicit_return.stderr51
-rw-r--r--tests/ui/implicit_saturating_sub.fixed24
-rw-r--r--tests/ui/implicit_saturating_sub.rs24
-rw-r--r--tests/ui/implicit_saturating_sub.stderr20
-rw-r--r--tests/ui/incompatible_msrv.rs39
-rw-r--r--tests/ui/incompatible_msrv.stderr37
-rw-r--r--tests/ui/io_other_error.fixed60
-rw-r--r--tests/ui/io_other_error.rs60
-rw-r--r--tests/ui/io_other_error.stderr64
-rw-r--r--tests/ui/iter_nth.stderr40
-rw-r--r--tests/ui/join_absolute_paths.stderr40
-rw-r--r--tests/ui/large_enum_variant.32bit.stderr75
-rw-r--r--tests/ui/large_enum_variant.64bit.stderr85
-rw-r--r--tests/ui/legacy_numeric_constants.stderr77
-rw-r--r--tests/ui/literals.rs4
-rw-r--r--tests/ui/literals.stderr77
-rw-r--r--tests/ui/lossy_float_literal.stderr55
-rw-r--r--tests/ui/manual_arithmetic_check-2.rs9
-rw-r--r--tests/ui/manual_arithmetic_check-2.stderr38
-rw-r--r--tests/ui/manual_assert.edition2018.stderr67
-rw-r--r--tests/ui/manual_assert.edition2021.stderr67
-rw-r--r--tests/ui/manual_async_fn.stderr60
-rw-r--r--tests/ui/manual_bits.stderr58
-rw-r--r--tests/ui/manual_flatten.stderr9
-rw-r--r--tests/ui/manual_float_methods.stderr45
-rw-r--r--tests/ui/manual_ignore_case_cmp.stderr245
-rw-r--r--tests/ui/manual_is_ascii_check.stderr20
-rw-r--r--tests/ui/manual_let_else.rs34
-rw-r--r--tests/ui/manual_let_else.stderr42
-rw-r--r--tests/ui/manual_midpoint.fixed74
-rw-r--r--tests/ui/manual_midpoint.rs74
-rw-r--r--tests/ui/manual_midpoint.stderr65
-rw-r--r--tests/ui/manual_ok_err.fixed9
-rw-r--r--tests/ui/manual_ok_err.rs11
-rw-r--r--tests/ui/manual_ok_err.stderr20
-rw-r--r--tests/ui/manual_slice_fill.fixed8
-rw-r--r--tests/ui/manual_slice_fill.rs8
-rw-r--r--tests/ui/manual_strip.rs17
-rw-r--r--tests/ui/manual_strip.stderr47
-rw-r--r--tests/ui/manual_strip_fixable.fixed15
-rw-r--r--tests/ui/manual_strip_fixable.rs17
-rw-r--r--tests/ui/manual_strip_fixable.stderr40
-rw-r--r--tests/ui/map_all_any_identity.stderr10
-rw-r--r--tests/ui/map_with_unused_argument_over_ranges.stderr10
-rw-r--r--tests/ui/map_with_unused_argument_over_ranges_nostd.stderr5
-rw-r--r--tests/ui/match_result_ok.stderr15
-rw-r--r--tests/ui/match_str_case_mismatch.stderr35
-rw-r--r--tests/ui/methods.rs1
-rw-r--r--tests/ui/methods.stderr4
-rw-r--r--tests/ui/mixed_attributes_style/auxiliary/submodule.rs2
-rw-r--r--tests/ui/mixed_attributes_style/global_allow.rs5
-rw-r--r--tests/ui/mixed_attributes_style/global_allow.stderr20
-rw-r--r--tests/ui/mixed_attributes_style/mod_declaration.rs1
-rw-r--r--tests/ui/mixed_attributes_style/mod_declaration.stderr22
-rw-r--r--tests/ui/msrv_attributes_without_early_lints.rs14
-rw-r--r--tests/ui/must_use_unit.fixed8
-rw-r--r--tests/ui/must_use_unit.rs8
-rw-r--r--tests/ui/must_use_unit.stderr18
-rw-r--r--tests/ui/must_use_unit_unfixable.rs11
-rw-r--r--tests/ui/must_use_unit_unfixable.stderr28
-rw-r--r--tests/ui/needless_borrow_pat.stderr10
-rw-r--r--tests/ui/needless_collect.fixed23
-rw-r--r--tests/ui/needless_collect.rs23
-rw-r--r--tests/ui/needless_for_each_unfixable.stderr5
-rw-r--r--tests/ui/needless_lifetimes.fixed199
-rw-r--r--tests/ui/needless_lifetimes.rs199
-rw-r--r--tests/ui/needless_lifetimes.stderr237
-rw-r--r--tests/ui/needless_option_as_deref.fixed13
-rw-r--r--tests/ui/needless_option_as_deref.rs13
-rw-r--r--tests/ui/needless_pass_by_value.rs36
-rw-r--r--tests/ui/needless_pass_by_value.stderr192
-rw-r--r--tests/ui/needless_range_loop.stderr70
-rw-r--r--tests/ui/needless_range_loop2.stderr40
-rw-r--r--tests/ui/needless_return.fixed12
-rw-r--r--tests/ui/needless_return.rs12
-rw-r--r--tests/ui/needless_return.stderr172
-rw-r--r--tests/ui/never_loop.stderr10
-rw-r--r--tests/ui/non_canonical_partial_ord_impl.stderr5
-rw-r--r--tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.stderr15
-rw-r--r--tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.stderr15
-rw-r--r--tests/ui/nonminimal_bool.stderr50
-rw-r--r--tests/ui/obfuscated_if_else.fixed24
-rw-r--r--tests/ui/obfuscated_if_else.rs24
-rw-r--r--tests/ui/obfuscated_if_else.stderr60
-rw-r--r--tests/ui/octal_escapes.stderr65
-rw-r--r--tests/ui/op_ref.stderr5
-rw-r--r--tests/ui/option_as_ref_cloned.stderr15
-rw-r--r--tests/ui/option_if_let_else.fixed21
-rw-r--r--tests/ui/option_if_let_else.rs21
-rw-r--r--tests/ui/option_if_let_else.stderr50
-rw-r--r--tests/ui/owned_cow.fixed23
-rw-r--r--tests/ui/owned_cow.rs23
-rw-r--r--tests/ui/owned_cow.stderr41
-rw-r--r--tests/ui/ptr_eq.fixed23
-rw-r--r--tests/ui/ptr_eq.rs15
-rw-r--r--tests/ui/ptr_eq.stderr44
-rw-r--r--tests/ui/ptr_eq_no_std.fixed12
-rw-r--r--tests/ui/ptr_eq_no_std.rs4
-rw-r--r--tests/ui/ptr_eq_no_std.stderr26
-rw-r--r--tests/ui/question_mark.fixed55
-rw-r--r--tests/ui/question_mark.rs72
-rw-r--r--tests/ui/question_mark.stderr62
-rw-r--r--tests/ui/redundant_guards.stderr5
-rw-r--r--tests/ui/ref_binding_to_reference.stderr10
-rw-r--r--tests/ui/ref_option/ref_option.all.stderr10
-rw-r--r--tests/ui/ref_option/ref_option.private.stderr5
-rw-r--r--tests/ui/repeat_vec_with_capacity.fixed5
-rw-r--r--tests/ui/repeat_vec_with_capacity.rs5
-rw-r--r--tests/ui/repeat_vec_with_capacity.stderr15
-rw-r--r--tests/ui/repeat_vec_with_capacity_nostd.stderr5
-rw-r--r--tests/ui/reversed_empty_ranges_fixable.stderr20
-rw-r--r--tests/ui/reversed_empty_ranges_loops_fixable.stderr30
-rw-r--r--tests/ui/same_functions_in_if_condition.rs7
-rw-r--r--tests/ui/same_functions_in_if_condition.stderr24
-rw-r--r--tests/ui/single_match.fixed34
-rw-r--r--tests/ui/single_match.rs10
-rw-r--r--tests/ui/single_match.stderr97
-rw-r--r--tests/ui/single_match_else.fixed8
-rw-r--r--tests/ui/single_match_else.rs12
-rw-r--r--tests/ui/single_match_else.stderr43
-rw-r--r--tests/ui/single_range_in_vec_init.stderr90
-rw-r--r--tests/ui/size_of_ref.stderr12
-rw-r--r--tests/ui/string_lit_chars_any.stderr25
-rw-r--r--tests/ui/string_to_string.rs15
-rw-r--r--tests/ui/string_to_string.stderr18
-rw-r--r--tests/ui/string_to_string_in_map.fixed20
-rw-r--r--tests/ui/string_to_string_in_map.rs20
-rw-r--r--tests/ui/string_to_string_in_map.stderr38
-rw-r--r--tests/ui/struct_fields.rs27
-rw-r--r--tests/ui/struct_fields.stderr21
-rw-r--r--tests/ui/suspicious_command_arg_space.stderr10
-rw-r--r--tests/ui/suspicious_doc_comments.fixed1
-rw-r--r--tests/ui/suspicious_doc_comments.rs1
-rw-r--r--tests/ui/suspicious_doc_comments.stderr33
-rw-r--r--tests/ui/suspicious_doc_comments_unfixable.rs2
-rw-r--r--tests/ui/suspicious_else_formatting.rs3
-rw-r--r--tests/ui/suspicious_else_formatting.stderr16
-rw-r--r--tests/ui/suspicious_operation_groupings.fixed2
-rw-r--r--tests/ui/suspicious_operation_groupings.rs2
-rw-r--r--tests/ui/suspicious_to_owned.stderr28
-rw-r--r--tests/ui/suspicious_xor_used_as_pow.stderr35
-rw-r--r--tests/ui/too_long_first_doc_paragraph-fix.stderr4
-rw-r--r--tests/ui/too_long_first_doc_paragraph.rs7
-rw-r--r--tests/ui/too_long_first_doc_paragraph.stderr17
-rw-r--r--tests/ui/transmute_ptr_to_ptr.stderr55
-rw-r--r--tests/ui/transmutes_expressible_as_ptr_casts.stderr10
-rw-r--r--tests/ui/unit_arg.stderr18
-rw-r--r--tests/ui/unknown_clippy_lints.stderr10
-rw-r--r--tests/ui/unnecessary_lazy_eval.stderr315
-rw-r--r--tests/ui/unnecessary_lazy_eval_unfixable.stderr20
-rw-r--r--tests/ui/unnecessary_literal_unwrap.stderr50
-rw-r--r--tests/ui/unnecessary_map_or.stderr49
-rw-r--r--tests/ui/unnecessary_os_str_debug_formatting.rs22
-rw-r--r--tests/ui/unnecessary_os_str_debug_formatting.stderr58
-rw-r--r--tests/ui/unnecessary_path_debug_formatting.rs49
-rw-r--r--tests/ui/unnecessary_path_debug_formatting.stderr85
-rw-r--r--tests/ui/unnecessary_to_owned.fixed39
-rw-r--r--tests/ui/unnecessary_to_owned.rs39
-rw-r--r--tests/ui/unnecessary_to_owned.stderr210
-rw-r--r--tests/ui/unnecessary_wraps.stderr44
-rw-r--r--tests/ui/unneeded_struct_pattern.fixed39
-rw-r--r--tests/ui/unneeded_struct_pattern.rs24
-rw-r--r--tests/ui/unneeded_struct_pattern.stderr146
-rw-r--r--tests/ui/unnested_or_patterns.stderr85
-rw-r--r--tests/ui/unnested_or_patterns2.stderr40
-rw-r--r--tests/ui/unused_enumerate_index.stderr10
-rw-r--r--tests/ui/unused_format_specs.stderr20
-rw-r--r--tests/ui/unused_result_ok.stderr20
-rw-r--r--tests/ui/useless_asref.fixed30
-rw-r--r--tests/ui/useless_asref.rs30
-rw-r--r--tests/ui/useless_asref.stderr36
321 files changed, 7973 insertions, 3312 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 837096d0062..956a05288f3 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -16,7 +16,7 @@ use test_utils::IS_RUSTC_TEST_SUITE;
 use ui_test::custom_flags::Flag;
 use ui_test::custom_flags::rustfix::RustfixMode;
 use ui_test::spanned::Spanned;
-use ui_test::{Args, CommandBuilder, Config, Match, OutputConflictHandling, status_emitter};
+use ui_test::{Args, CommandBuilder, Config, Match, error_on_output_conflict, status_emitter};
 
 use std::collections::{BTreeMap, HashMap};
 use std::env::{self, set_var, var_os};
@@ -142,7 +142,7 @@ impl TestContext {
     fn base_config(&self, test_dir: &str, mandatory_annotations: bool) -> Config {
         let target_dir = PathBuf::from(var_os("CARGO_TARGET_DIR").unwrap_or_else(|| "target".into()));
         let mut config = Config {
-            output_conflict_handling: OutputConflictHandling::Error,
+            output_conflict_handling: error_on_output_conflict,
             filter_files: env::var("TESTNAME")
                 .map(|filters| filters.split(',').map(str::to_string).collect())
                 .unwrap_or_default(),
@@ -220,7 +220,7 @@ fn run_internal_tests(cx: &TestContext) {
     if !RUN_INTERNAL_TESTS {
         return;
     }
-    let mut config = cx.base_config("ui-internal", false);
+    let mut config = cx.base_config("ui-internal", true);
     config.bless_command = Some("cargo uitest --features internal -- -- --bless".into());
 
     ui_test::run_tests_generic(
@@ -383,13 +383,15 @@ fn ui_cargo_toml_metadata() {
                 .map(|component| component.as_os_str().to_string_lossy().replace('-', "_"))
                 .any(|s| *s == name)
                 || path.starts_with(&cargo_common_metadata_path),
-            "{path:?} has incorrect package name"
+            "`{}` has incorrect package name",
+            path.display(),
         );
 
         let publish = package.get("publish").and_then(toml::Value::as_bool).unwrap_or(true);
         assert!(
             !publish || publish_exceptions.contains(&path.parent().unwrap().to_path_buf()),
-            "{path:?} lacks `publish = false`"
+            "`{}` lacks `publish = false`",
+            path.display(),
         );
     }
 }
diff --git a/tests/lint_message_convention.rs b/tests/lint_message_convention.rs
index 7ed1f485c1c..9229e2e8c49 100644
--- a/tests/lint_message_convention.rs
+++ b/tests/lint_message_convention.rs
@@ -44,6 +44,7 @@ impl Message {
                 ".*AT&T x86 assembly syntax used",
                 "note: Clippy version: .*",
                 "the compiler unexpectedly panicked. this is a bug.",
+                "internal compiler error:",
             ])
             .unwrap()
         });
diff --git a/tests/ui-cargo/lint_groups_priority/fail/Cargo.stderr b/tests/ui-cargo/lint_groups_priority/fail/Cargo.stderr
index 4fe7f6f7a9e..059427d8ee0 100644
--- a/tests/ui-cargo/lint_groups_priority/fail/Cargo.stderr
+++ b/tests/ui-cargo/lint_groups_priority/fail/Cargo.stderr
@@ -11,8 +11,9 @@ error: lint group `rust_2018_idioms` has the same priority (0) as a lint
    = note: `#[deny(clippy::lint_groups_priority)]` on by default
 help: to have lints override the group set `rust_2018_idioms` to a lower priority
    |
-7  | rust_2018_idioms = { level = "warn", priority = -1 }
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+7  - rust_2018_idioms = "warn"
+7  + rust_2018_idioms = { level = "warn", priority = -1 }
+   |
 
 error: lint group `unused` has the same priority (0) as a lint
   --> Cargo.toml:10:1
@@ -27,7 +28,7 @@ error: lint group `unused` has the same priority (0) as a lint
 help: to have lints override the group set `unused` to a lower priority
    |
 10 | unused = { level = "deny", priority = -1 }
-   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   |                          +++++++++++++++
 
 error: lint group `pedantic` has the same priority (-1) as a lint
   --> Cargo.toml:15:1
@@ -40,8 +41,9 @@ error: lint group `pedantic` has the same priority (-1) as a lint
    = note: the order of the lints in the table is ignored by Cargo
 help: to have lints override the group set `pedantic` to a lower priority
    |
-15 | pedantic = { level = "warn", priority = -2 }
-   |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+15 - pedantic = { level = "warn", priority = -1 }
+15 + pedantic = { level = "warn", priority = -2 }
+   |
 
 error: lint group `rust_2018_idioms` has the same priority (0) as a lint
   --> Cargo.toml:19:1
@@ -54,8 +56,9 @@ error: lint group `rust_2018_idioms` has the same priority (0) as a lint
    = note: the order of the lints in the table is ignored by Cargo
 help: to have lints override the group set `rust_2018_idioms` to a lower priority
    |
-19 | rust_2018_idioms = { level = "warn", priority = -1 }
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+19 - rust_2018_idioms = "warn"
+19 + rust_2018_idioms = { level = "warn", priority = -1 }
+   |
 
 error: lint group `pedantic` has the same priority (0) as a lint
   --> Cargo.toml:23:1
@@ -68,7 +71,8 @@ error: lint group `pedantic` has the same priority (0) as a lint
    = note: the order of the lints in the table is ignored by Cargo
 help: to have lints override the group set `pedantic` to a lower priority
    |
-23 | pedantic = { level = "warn", priority = -1 }
-   |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+23 - pedantic = "warn"
+23 + pedantic = { level = "warn", priority = -1 }
+   |
 
 error: could not compile `fail` (lib) due to 5 previous errors
diff --git a/tests/ui-internal/check_clippy_version_attribute.rs b/tests/ui-internal/check_clippy_version_attribute.rs
index 31acac89cc6..e5f6001b74d 100644
--- a/tests/ui-internal/check_clippy_version_attribute.rs
+++ b/tests/ui-internal/check_clippy_version_attribute.rs
@@ -38,6 +38,7 @@ declare_tool_lint! {
 // Invalid attributes
 ///////////////////////
 declare_tool_lint! {
+//~^ invalid_clippy_version_attribute
     #[clippy::version = "1.2.3.4.5.6"]
     pub clippy::INVALID_ONE,
     Warn,
@@ -46,6 +47,7 @@ declare_tool_lint! {
 }
 
 declare_tool_lint! {
+//~^ invalid_clippy_version_attribute
     #[clippy::version = "I'm a string"]
     pub clippy::INVALID_TWO,
     Warn,
@@ -57,6 +59,7 @@ declare_tool_lint! {
 // Missing attribute test
 ///////////////////////
 declare_tool_lint! {
+//~^ missing_clippy_version_attribute
     #[clippy::version]
     pub clippy::MISSING_ATTRIBUTE_ONE,
     Warn,
@@ -65,6 +68,7 @@ declare_tool_lint! {
 }
 
 declare_tool_lint! {
+//~^ missing_clippy_version_attribute
     pub clippy::MISSING_ATTRIBUTE_TWO,
     Warn,
     "Two",
diff --git a/tests/ui-internal/check_clippy_version_attribute.stderr b/tests/ui-internal/check_clippy_version_attribute.stderr
index 631c292f524..1129c35d1d0 100644
--- a/tests/ui-internal/check_clippy_version_attribute.stderr
+++ b/tests/ui-internal/check_clippy_version_attribute.stderr
@@ -2,10 +2,10 @@ error: this item has an invalid `clippy::version` attribute
   --> tests/ui-internal/check_clippy_version_attribute.rs:40:1
    |
 LL | / declare_tool_lint! {
+LL | |
 LL | |     #[clippy::version = "1.2.3.4.5.6"]
 LL | |     pub clippy::INVALID_ONE,
-LL | |     Warn,
-LL | |     "One",
+...  |
 LL | |     report_in_external_macro: true
 LL | | }
    | |_^
@@ -20,13 +20,13 @@ LL | #![deny(clippy::internal)]
    = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: this item has an invalid `clippy::version` attribute
-  --> tests/ui-internal/check_clippy_version_attribute.rs:48:1
+  --> tests/ui-internal/check_clippy_version_attribute.rs:49:1
    |
 LL | / declare_tool_lint! {
+LL | |
 LL | |     #[clippy::version = "I'm a string"]
 LL | |     pub clippy::INVALID_TWO,
-LL | |     Warn,
-LL | |     "Two",
+...  |
 LL | |     report_in_external_macro: true
 LL | | }
    | |_^
@@ -35,13 +35,13 @@ LL | | }
    = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: this lint is missing the `clippy::version` attribute or version value
-  --> tests/ui-internal/check_clippy_version_attribute.rs:59:1
+  --> tests/ui-internal/check_clippy_version_attribute.rs:61:1
    |
 LL | / declare_tool_lint! {
+LL | |
 LL | |     #[clippy::version]
 LL | |     pub clippy::MISSING_ATTRIBUTE_ONE,
-LL | |     Warn,
-LL | |     "Two",
+...  |
 LL | |     report_in_external_macro: true
 LL | | }
    | |_^
@@ -51,9 +51,10 @@ LL | | }
    = note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: this lint is missing the `clippy::version` attribute or version value
-  --> tests/ui-internal/check_clippy_version_attribute.rs:67:1
+  --> tests/ui-internal/check_clippy_version_attribute.rs:70:1
    |
 LL | / declare_tool_lint! {
+LL | |
 LL | |     pub clippy::MISSING_ATTRIBUTE_TWO,
 LL | |     Warn,
 LL | |     "Two",
diff --git a/tests/ui-internal/check_formulation.rs b/tests/ui-internal/check_formulation.rs
index 43fc996033e..8265a78769d 100644
--- a/tests/ui-internal/check_formulation.rs
+++ b/tests/ui-internal/check_formulation.rs
@@ -21,6 +21,7 @@ declare_tool_lint! {
 declare_tool_lint! {
     /// # What it does
     /// Check for lint formulations that are correct
+    //~^ almost_standard_lint_formulation
     #[clippy::version = "pre 1.29.0"]
     pub clippy::INVALID1,
     Warn,
@@ -31,6 +32,7 @@ declare_tool_lint! {
 declare_tool_lint! {
     /// # What it does
     /// Detects uses of incorrect formulations
+    //~^ almost_standard_lint_formulation
     #[clippy::version = "pre 1.29.0"]
     pub clippy::INVALID2,
     Warn,
diff --git a/tests/ui-internal/check_formulation.stderr b/tests/ui-internal/check_formulation.stderr
index 12514370e6d..b16e1bf8687 100644
--- a/tests/ui-internal/check_formulation.stderr
+++ b/tests/ui-internal/check_formulation.stderr
@@ -9,7 +9,7 @@ LL |     /// Check for lint formulations that are correct
    = help: to override `-D warnings` add `#[allow(clippy::almost_standard_lint_formulation)]`
 
 error: non-standard lint formulation
-  --> tests/ui-internal/check_formulation.rs:33:5
+  --> tests/ui-internal/check_formulation.rs:34:5
    |
 LL |     /// Detects uses of incorrect formulations
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-internal/collapsible_span_lint_calls.rs b/tests/ui-internal/collapsible_span_lint_calls.rs
index 1baf6142b34..2f289ae2b48 100644
--- a/tests/ui-internal/collapsible_span_lint_calls.rs
+++ b/tests/ui-internal/collapsible_span_lint_calls.rs
@@ -33,18 +33,23 @@ impl EarlyLintPass for Pass {
         let predicate = true;
 
         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+            //~^ collapsible_span_lint_calls
             db.span_suggestion(expr.span, help_msg, sugg.to_string(), Applicability::MachineApplicable);
         });
         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+            //~^ collapsible_span_lint_calls
             db.span_help(expr.span, help_msg);
         });
         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+            //~^ collapsible_span_lint_calls
             db.help(help_msg);
         });
         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+            //~^ collapsible_span_lint_calls
             db.span_note(expr.span, note_msg);
         });
         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+            //~^ collapsible_span_lint_calls
             db.note(note_msg);
         });
 
diff --git a/tests/ui-internal/collapsible_span_lint_calls.stderr b/tests/ui-internal/collapsible_span_lint_calls.stderr
index 104995918de..a2be1f1cd36 100644
--- a/tests/ui-internal/collapsible_span_lint_calls.stderr
+++ b/tests/ui-internal/collapsible_span_lint_calls.stderr
@@ -2,6 +2,7 @@ error: this call is collapsible
   --> tests/ui-internal/collapsible_span_lint_calls.rs:35:9
    |
 LL | /         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+LL | |
 LL | |             db.span_suggestion(expr.span, help_msg, sugg.to_string(), Applicability::MachineApplicable);
 LL | |         });
    | |__________^ help: collapse into: `span_lint_and_sugg(cx, TEST_LINT, expr.span, lint_msg, help_msg, sugg.to_string(), Applicability::MachineApplicable)`
@@ -14,33 +15,37 @@ LL | #![deny(clippy::internal)]
    = note: `#[deny(clippy::collapsible_span_lint_calls)]` implied by `#[deny(clippy::internal)]`
 
 error: this call is collapsible
-  --> tests/ui-internal/collapsible_span_lint_calls.rs:38:9
+  --> tests/ui-internal/collapsible_span_lint_calls.rs:39:9
    |
 LL | /         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+LL | |
 LL | |             db.span_help(expr.span, help_msg);
 LL | |         });
    | |__________^ help: collapse into: `span_lint_and_help(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), help_msg)`
 
 error: this call is collapsible
-  --> tests/ui-internal/collapsible_span_lint_calls.rs:41:9
+  --> tests/ui-internal/collapsible_span_lint_calls.rs:43:9
    |
 LL | /         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+LL | |
 LL | |             db.help(help_msg);
 LL | |         });
    | |__________^ help: collapse into: `span_lint_and_help(cx, TEST_LINT, expr.span, lint_msg, None, help_msg)`
 
 error: this call is collapsible
-  --> tests/ui-internal/collapsible_span_lint_calls.rs:44:9
+  --> tests/ui-internal/collapsible_span_lint_calls.rs:47:9
    |
 LL | /         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+LL | |
 LL | |             db.span_note(expr.span, note_msg);
 LL | |         });
    | |__________^ help: collapse into: `span_lint_and_note(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), note_msg)`
 
 error: this call is collapsible
-  --> tests/ui-internal/collapsible_span_lint_calls.rs:47:9
+  --> tests/ui-internal/collapsible_span_lint_calls.rs:51:9
    |
 LL | /         span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
+LL | |
 LL | |             db.note(note_msg);
 LL | |         });
    | |__________^ help: collapse into: `span_lint_and_note(cx, TEST_LINT, expr.span, lint_msg, None, note_msg)`
diff --git a/tests/ui-internal/custom_ice_message.rs b/tests/ui-internal/custom_ice_message.rs
index 9b0db660c99..71819fe3707 100644
--- a/tests/ui-internal/custom_ice_message.rs
+++ b/tests/ui-internal/custom_ice_message.rs
@@ -10,5 +10,6 @@
 #![allow(clippy::missing_clippy_version_attribute)]
 
 fn it_looks_like_you_are_trying_to_kill_clippy() {}
+//~^ ice: Would you like some help with that?
 
 fn main() {}
diff --git a/tests/ui-internal/custom_ice_message.stderr b/tests/ui-internal/custom_ice_message.stderr
index ae5d8ef1d0b..589e1190a90 100644
--- a/tests/ui-internal/custom_ice_message.stderr
+++ b/tests/ui-internal/custom_ice_message.stderr
@@ -1,9 +1,18 @@
-
-thread '<unnamed>' panicked at clippy_lints/src/utils/internal_lints/produce_ice.rs:
-Would you like some help with that?
-note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-
-error: the compiler unexpectedly panicked. this is a bug.
+note: no errors encountered even though delayed bugs were created
+
+note: those delayed bugs will now be shown as internal compiler errors
+
+error: internal compiler error: Would you like some help with that?
+  --> tests/ui-internal/custom_ice_message.rs:12:1
+   |
+LL | fn it_looks_like_you_are_trying_to_kill_clippy() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: delayed at clippy_lints/src/utils/internal_lints/produce_ice.rs - disabled backtrace
+  --> tests/ui-internal/custom_ice_message.rs:12:1
+   |
+LL | fn it_looks_like_you_are_trying_to_kill_clippy() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml
 
@@ -13,9 +22,5 @@ note: rustc <version> running on <target>
 
 note: compiler flags: -Z ui-testing -Z deduplicate-diagnostics=no
 
-query stack during panic:
-#0 [early_lint_checks] perform lints prior to macro expansion
-#1 [hir_crate] getting the crate HIR
-... and 3 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
 note: Clippy version: foo
 
diff --git a/tests/ui-internal/default_lint.rs b/tests/ui-internal/default_lint.rs
index da29aedb2a3..959bfd27e38 100644
--- a/tests/ui-internal/default_lint.rs
+++ b/tests/ui-internal/default_lint.rs
@@ -16,6 +16,7 @@ declare_tool_lint! {
 }
 
 declare_tool_lint! {
+//~^ default_lint
     pub clippy::TEST_LINT_DEFAULT,
     Warn,
     "default lint description",
diff --git a/tests/ui-internal/default_lint.stderr b/tests/ui-internal/default_lint.stderr
index c939125e875..9d4c2e15349 100644
--- a/tests/ui-internal/default_lint.stderr
+++ b/tests/ui-internal/default_lint.stderr
@@ -2,6 +2,7 @@ error: the lint `TEST_LINT_DEFAULT` has the default lint description
   --> tests/ui-internal/default_lint.rs:18:1
    |
 LL | / declare_tool_lint! {
+LL | |
 LL | |     pub clippy::TEST_LINT_DEFAULT,
 LL | |     Warn,
 LL | |     "default lint description",
diff --git a/tests/ui-internal/disallow_span_lint.rs b/tests/ui-internal/disallow_span_lint.rs
index ca71dddcc24..3fed38cab64 100644
--- a/tests/ui-internal/disallow_span_lint.rs
+++ b/tests/ui-internal/disallow_span_lint.rs
@@ -12,12 +12,14 @@ use rustc_middle::ty::TyCtxt;
 
 pub fn a(cx: impl LintContext, lint: &'static Lint, span: impl Into<MultiSpan>, msg: impl Into<DiagMessage>) {
     cx.span_lint(lint, span, |lint| {
+        //~^ disallowed_methods
         lint.primary_message(msg);
     });
 }
 
 pub fn b(tcx: TyCtxt<'_>, lint: &'static Lint, hir_id: HirId, span: impl Into<MultiSpan>, msg: impl Into<DiagMessage>) {
     tcx.node_span_lint(lint, hir_id, span, |lint| {
+        //~^ disallowed_methods
         lint.primary_message(msg);
     });
 }
diff --git a/tests/ui-internal/disallow_span_lint.stderr b/tests/ui-internal/disallow_span_lint.stderr
index 16e1487f2bb..9a7a7ecbbff 100644
--- a/tests/ui-internal/disallow_span_lint.stderr
+++ b/tests/ui-internal/disallow_span_lint.stderr
@@ -9,7 +9,7 @@ LL |     cx.span_lint(lint, span, |lint| {
    = help: to override `-D warnings` add `#[allow(clippy::disallowed_methods)]`
 
 error: use of a disallowed method `rustc_middle::ty::context::TyCtxt::node_span_lint`
-  --> tests/ui-internal/disallow_span_lint.rs:20:9
+  --> tests/ui-internal/disallow_span_lint.rs:21:9
    |
 LL |     tcx.node_span_lint(lint, hir_id, span, |lint| {
    |         ^^^^^^^^^^^^^^
diff --git a/tests/ui-internal/interning_defined_symbol.fixed b/tests/ui-internal/interning_defined_symbol.fixed
index 3bcabb4ab2d..92d3b1537e0 100644
--- a/tests/ui-internal/interning_defined_symbol.fixed
+++ b/tests/ui-internal/interning_defined_symbol.fixed
@@ -15,15 +15,19 @@ macro_rules! sym {
 fn main() {
     // Direct use of Symbol::intern
     let _ = rustc_span::sym::f32;
+    //~^ interning_defined_symbol
 
     // Using a sym macro
     let _ = rustc_span::sym::f32;
+    //~^ interning_defined_symbol
 
     // Correct suggestion when symbol isn't stringified constant name
     let _ = rustc_span::sym::proc_dash_macro;
+    //~^ interning_defined_symbol
 
     // interning a keyword
     let _ = rustc_span::kw::SelfLower;
+    //~^ interning_defined_symbol
 
     // Interning a symbol that is not defined
     let _ = Symbol::intern("xyz123");
diff --git a/tests/ui-internal/interning_defined_symbol.rs b/tests/ui-internal/interning_defined_symbol.rs
index 92e92d4fbc1..d1e6f9cb1c4 100644
--- a/tests/ui-internal/interning_defined_symbol.rs
+++ b/tests/ui-internal/interning_defined_symbol.rs
@@ -15,15 +15,19 @@ macro_rules! sym {
 fn main() {
     // Direct use of Symbol::intern
     let _ = Symbol::intern("f32");
+    //~^ interning_defined_symbol
 
     // Using a sym macro
     let _ = sym!(f32);
+    //~^ interning_defined_symbol
 
     // Correct suggestion when symbol isn't stringified constant name
     let _ = Symbol::intern("proc-macro");
+    //~^ interning_defined_symbol
 
     // interning a keyword
     let _ = Symbol::intern("self");
+    //~^ interning_defined_symbol
 
     // Interning a symbol that is not defined
     let _ = Symbol::intern("xyz123");
diff --git a/tests/ui-internal/interning_defined_symbol.stderr b/tests/ui-internal/interning_defined_symbol.stderr
index c4d0308979f..c84a566436a 100644
--- a/tests/ui-internal/interning_defined_symbol.stderr
+++ b/tests/ui-internal/interning_defined_symbol.stderr
@@ -12,19 +12,19 @@ LL | #![deny(clippy::internal)]
    = note: `#[deny(clippy::interning_defined_symbol)]` implied by `#[deny(clippy::internal)]`
 
 error: interning a defined symbol
-  --> tests/ui-internal/interning_defined_symbol.rs:20:13
+  --> tests/ui-internal/interning_defined_symbol.rs:21:13
    |
 LL |     let _ = sym!(f32);
    |             ^^^^^^^^^ help: try: `rustc_span::sym::f32`
 
 error: interning a defined symbol
-  --> tests/ui-internal/interning_defined_symbol.rs:23:13
+  --> tests/ui-internal/interning_defined_symbol.rs:25:13
    |
 LL |     let _ = Symbol::intern("proc-macro");
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::proc_dash_macro`
 
 error: interning a defined symbol
-  --> tests/ui-internal/interning_defined_symbol.rs:26:13
+  --> tests/ui-internal/interning_defined_symbol.rs:29:13
    |
 LL |     let _ = Symbol::intern("self");
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::kw::SelfLower`
diff --git a/tests/ui-internal/invalid_msrv_attr_impl.fixed b/tests/ui-internal/invalid_msrv_attr_impl.fixed
index 928596d0809..6804e2bbae8 100644
--- a/tests/ui-internal/invalid_msrv_attr_impl.fixed
+++ b/tests/ui-internal/invalid_msrv_attr_impl.fixed
@@ -9,7 +9,7 @@ extern crate rustc_middle;
 #[macro_use]
 extern crate rustc_session;
 use clippy_utils::extract_msrv_attr;
-use clippy_utils::msrvs::Msrv;
+use clippy_utils::msrvs::MsrvStack;
 use rustc_hir::Expr;
 use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass};
 
@@ -20,18 +20,14 @@ declare_lint! {
 }
 
 struct Pass {
-    msrv: Msrv,
+    msrv: MsrvStack,
 }
 
 impl_lint_pass!(Pass => [TEST_LINT]);
 
-impl LateLintPass<'_> for Pass {
-    extract_msrv_attr!(LateContext);
-    fn check_expr(&mut self, _: &LateContext<'_>, _: &Expr<'_>) {}
-}
-
 impl EarlyLintPass for Pass {
-    extract_msrv_attr!(EarlyContext);
+    extract_msrv_attr!();
+    //~^ missing_msrv_attr_impl
     fn check_expr(&mut self, _: &EarlyContext<'_>, _: &rustc_ast::Expr) {}
 }
 
diff --git a/tests/ui-internal/invalid_msrv_attr_impl.rs b/tests/ui-internal/invalid_msrv_attr_impl.rs
index 50b28648ccc..c625a5d9a45 100644
--- a/tests/ui-internal/invalid_msrv_attr_impl.rs
+++ b/tests/ui-internal/invalid_msrv_attr_impl.rs
@@ -9,7 +9,7 @@ extern crate rustc_middle;
 #[macro_use]
 extern crate rustc_session;
 use clippy_utils::extract_msrv_attr;
-use clippy_utils::msrvs::Msrv;
+use clippy_utils::msrvs::MsrvStack;
 use rustc_hir::Expr;
 use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass};
 
@@ -20,16 +20,13 @@ declare_lint! {
 }
 
 struct Pass {
-    msrv: Msrv,
+    msrv: MsrvStack,
 }
 
 impl_lint_pass!(Pass => [TEST_LINT]);
 
-impl LateLintPass<'_> for Pass {
-    fn check_expr(&mut self, _: &LateContext<'_>, _: &Expr<'_>) {}
-}
-
 impl EarlyLintPass for Pass {
+    //~^ missing_msrv_attr_impl
     fn check_expr(&mut self, _: &EarlyContext<'_>, _: &rustc_ast::Expr) {}
 }
 
diff --git a/tests/ui-internal/invalid_msrv_attr_impl.stderr b/tests/ui-internal/invalid_msrv_attr_impl.stderr
index aa649c627a1..0a7636313ef 100644
--- a/tests/ui-internal/invalid_msrv_attr_impl.stderr
+++ b/tests/ui-internal/invalid_msrv_attr_impl.stderr
@@ -1,8 +1,8 @@
-error: `extract_msrv_attr!` macro missing from `LateLintPass` implementation
+error: `extract_msrv_attr!` macro missing from `EarlyLintPass` implementation
   --> tests/ui-internal/invalid_msrv_attr_impl.rs:28:1
    |
-LL | impl LateLintPass<'_> for Pass {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl EarlyLintPass for Pass {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
   --> tests/ui-internal/invalid_msrv_attr_impl.rs:1:9
@@ -10,23 +10,11 @@ note: the lint level is defined here
 LL | #![deny(clippy::internal)]
    |         ^^^^^^^^^^^^^^^^
    = note: `#[deny(clippy::missing_msrv_attr_impl)]` implied by `#[deny(clippy::internal)]`
-help: add `extract_msrv_attr!(LateContext)` to the `LateLintPass` implementation
-   |
-LL + impl LateLintPass<'_> for Pass {
-LL +     extract_msrv_attr!(LateContext);
-   |
-
-error: `extract_msrv_attr!` macro missing from `EarlyLintPass` implementation
-  --> tests/ui-internal/invalid_msrv_attr_impl.rs:32:1
-   |
-LL | impl EarlyLintPass for Pass {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-help: add `extract_msrv_attr!(EarlyContext)` to the `EarlyLintPass` implementation
+help: add `extract_msrv_attr!()` to the `EarlyLintPass` implementation
    |
-LL + impl EarlyLintPass for Pass {
-LL +     extract_msrv_attr!(EarlyContext);
+LL ~ impl EarlyLintPass for Pass {
+LL +     extract_msrv_attr!();
    |
 
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
diff --git a/tests/ui-internal/invalid_paths.rs b/tests/ui-internal/invalid_paths.rs
index 9a9790a4bae..abfb111f938 100644
--- a/tests/ui-internal/invalid_paths.rs
+++ b/tests/ui-internal/invalid_paths.rs
@@ -13,12 +13,15 @@ mod paths {
 
     // Path with empty segment
     pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
+    //~^ invalid_paths
 
     // Path with bad crate
     pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"];
+    //~^ invalid_paths
 
     // Path with bad module
     pub const BAD_MOD_PATH: [&str; 2] = ["std", "xxx"];
+    //~^ invalid_paths
 
     // Path to method on an enum inherent impl
     pub const OPTION_IS_SOME: [&str; 4] = ["core", "option", "Option", "is_some"];
diff --git a/tests/ui-internal/invalid_paths.stderr b/tests/ui-internal/invalid_paths.stderr
index fc530a2efa3..7bde37667be 100644
--- a/tests/ui-internal/invalid_paths.stderr
+++ b/tests/ui-internal/invalid_paths.stderr
@@ -8,13 +8,13 @@ LL |     pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"
    = help: to override `-D warnings` add `#[allow(clippy::invalid_paths)]`
 
 error: invalid path
-  --> tests/ui-internal/invalid_paths.rs:18:5
+  --> tests/ui-internal/invalid_paths.rs:19:5
    |
 LL |     pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"];
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: invalid path
-  --> tests/ui-internal/invalid_paths.rs:21:5
+  --> tests/ui-internal/invalid_paths.rs:23:5
    |
 LL |     pub const BAD_MOD_PATH: [&str; 2] = ["std", "xxx"];
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-internal/lint_without_lint_pass.rs b/tests/ui-internal/lint_without_lint_pass.rs
index d59e9cbbb61..69591523432 100644
--- a/tests/ui-internal/lint_without_lint_pass.rs
+++ b/tests/ui-internal/lint_without_lint_pass.rs
@@ -10,6 +10,7 @@ extern crate rustc_lint;
 use rustc_lint::{LintPass, LintVec};
 
 declare_tool_lint! {
+//~^ lint_without_lint_pass
     pub clippy::TEST_LINT,
     Warn,
     "",
diff --git a/tests/ui-internal/lint_without_lint_pass.stderr b/tests/ui-internal/lint_without_lint_pass.stderr
index 187bba97fd4..9cca96ca160 100644
--- a/tests/ui-internal/lint_without_lint_pass.stderr
+++ b/tests/ui-internal/lint_without_lint_pass.stderr
@@ -2,6 +2,7 @@ error: the lint `TEST_LINT` is not added to any `LintPass`
   --> tests/ui-internal/lint_without_lint_pass.rs:12:1
    |
 LL | / declare_tool_lint! {
+LL | |
 LL | |     pub clippy::TEST_LINT,
 LL | |     Warn,
 LL | |     "",
diff --git a/tests/ui-internal/outer_expn_data.fixed b/tests/ui-internal/outer_expn_data.fixed
index cef16cf6ca5..cb7680b8bb1 100644
--- a/tests/ui-internal/outer_expn_data.fixed
+++ b/tests/ui-internal/outer_expn_data.fixed
@@ -21,6 +21,7 @@ declare_lint_pass!(Pass => [TEST_LINT]);
 impl<'tcx> LateLintPass<'tcx> for Pass {
     fn check_expr(&mut self, _cx: &LateContext<'tcx>, expr: &'tcx Expr) {
         let _ = expr.span.ctxt().outer_expn_data();
+        //~^ outer_expn_expn_data
     }
 }
 
diff --git a/tests/ui-internal/outer_expn_data.rs b/tests/ui-internal/outer_expn_data.rs
index fb453be661c..41d735110b5 100644
--- a/tests/ui-internal/outer_expn_data.rs
+++ b/tests/ui-internal/outer_expn_data.rs
@@ -21,6 +21,7 @@ declare_lint_pass!(Pass => [TEST_LINT]);
 impl<'tcx> LateLintPass<'tcx> for Pass {
     fn check_expr(&mut self, _cx: &LateContext<'tcx>, expr: &'tcx Expr) {
         let _ = expr.span.ctxt().outer_expn().expn_data();
+        //~^ outer_expn_expn_data
     }
 }
 
diff --git a/tests/ui-internal/unnecessary_def_path.fixed b/tests/ui-internal/unnecessary_def_path.fixed
index d3fab60f9e3..577fad9341b 100644
--- a/tests/ui-internal/unnecessary_def_path.fixed
+++ b/tests/ui-internal/unnecessary_def_path.fixed
@@ -35,28 +35,43 @@ const RESULT: &[&str] = &["core", "result", "Result"];
 
 fn _f<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, did: DefId, expr: &Expr<'_>) {
     let _ = is_type_diagnostic_item(cx, ty, sym::Option);
+    //~^ unnecessary_def_path
     let _ = is_type_diagnostic_item(cx, ty, sym::Result);
+    //~^ unnecessary_def_path
     let _ = is_type_diagnostic_item(cx, ty, sym::Result);
+    //~^ unnecessary_def_path
 
     #[allow(unused, clippy::unnecessary_def_path)]
     let rc_path = &["alloc", "rc", "Rc"];
     let _ = is_type_diagnostic_item(cx, ty, sym::Rc);
+    //~^ unnecessary_def_path
 
     let _ = is_type_diagnostic_item(cx, ty, sym::Option);
+    //~^ unnecessary_def_path
     let _ = is_type_diagnostic_item(cx, ty, sym::Result);
+    //~^ unnecessary_def_path
 
     let _ = is_type_lang_item(cx, ty, LangItem::OwnedBox);
+    //~^ unnecessary_def_path
     let _ = is_type_diagnostic_item(cx, ty, sym::maybe_uninit_uninit);
+    //~^ unnecessary_def_path
 
     let _ = cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did);
+    //~^ unnecessary_def_path
     let _ = cx.tcx.is_diagnostic_item(sym::Option, did);
+    //~^ unnecessary_def_path
     let _ = cx.tcx.lang_items().get(LangItem::OptionSome) == Some(did);
+    //~^ unnecessary_def_path
 
     let _ = is_trait_method(cx, expr, sym::AsRef);
+    //~^ unnecessary_def_path
 
     let _ = is_path_diagnostic_item(cx, expr, sym::Option);
+    //~^ unnecessary_def_path
     let _ = path_res(cx, expr).opt_def_id().map_or(false, |id| cx.tcx.lang_items().get(LangItem::IteratorNext) == Some(id));
+    //~^ unnecessary_def_path
     let _ = is_res_lang_ctor(cx, path_res(cx, expr), LangItem::OptionSome);
+    //~^ unnecessary_def_path
 }
 
 fn main() {}
diff --git a/tests/ui-internal/unnecessary_def_path.rs b/tests/ui-internal/unnecessary_def_path.rs
index 1b36f6b09e9..d4deb3626d0 100644
--- a/tests/ui-internal/unnecessary_def_path.rs
+++ b/tests/ui-internal/unnecessary_def_path.rs
@@ -35,28 +35,43 @@ const RESULT: &[&str] = &["core", "result", "Result"];
 
 fn _f<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, did: DefId, expr: &Expr<'_>) {
     let _ = match_type(cx, ty, &OPTION);
+    //~^ unnecessary_def_path
     let _ = match_type(cx, ty, RESULT);
+    //~^ unnecessary_def_path
     let _ = match_type(cx, ty, &["core", "result", "Result"]);
+    //~^ unnecessary_def_path
 
     #[allow(unused, clippy::unnecessary_def_path)]
     let rc_path = &["alloc", "rc", "Rc"];
     let _ = clippy_utils::ty::match_type(cx, ty, rc_path);
+    //~^ unnecessary_def_path
 
     let _ = match_type(cx, ty, &paths::OPTION);
+    //~^ unnecessary_def_path
     let _ = match_type(cx, ty, paths::RESULT);
+    //~^ unnecessary_def_path
 
     let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]);
+    //~^ unnecessary_def_path
     let _ = match_type(cx, ty, &["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"]);
+    //~^ unnecessary_def_path
 
     let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]);
+    //~^ unnecessary_def_path
     let _ = match_def_path(cx, did, &["core", "option", "Option"]);
+    //~^ unnecessary_def_path
     let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]);
+    //~^ unnecessary_def_path
 
     let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]);
+    //~^ unnecessary_def_path
 
     let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]);
+    //~^ unnecessary_def_path
     let _ = is_expr_path_def_path(cx, expr, &["core", "iter", "traits", "Iterator", "next"]);
+    //~^ unnecessary_def_path
     let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option", "Some"]);
+    //~^ unnecessary_def_path
 }
 
 fn main() {}
diff --git a/tests/ui-internal/unnecessary_def_path.stderr b/tests/ui-internal/unnecessary_def_path.stderr
index 79521c5037a..0053ba321bb 100644
--- a/tests/ui-internal/unnecessary_def_path.stderr
+++ b/tests/ui-internal/unnecessary_def_path.stderr
@@ -12,61 +12,61 @@ LL | #![deny(clippy::internal)]
    = note: `#[deny(clippy::unnecessary_def_path)]` implied by `#[deny(clippy::internal)]`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:38:13
+  --> tests/ui-internal/unnecessary_def_path.rs:39:13
    |
 LL |     let _ = match_type(cx, ty, RESULT);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:39:13
+  --> tests/ui-internal/unnecessary_def_path.rs:41:13
    |
 LL |     let _ = match_type(cx, ty, &["core", "result", "Result"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:43:13
+  --> tests/ui-internal/unnecessary_def_path.rs:46:13
    |
 LL |     let _ = clippy_utils::ty::match_type(cx, ty, rc_path);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Rc)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:45:13
+  --> tests/ui-internal/unnecessary_def_path.rs:49:13
    |
 LL |     let _ = match_type(cx, ty, &paths::OPTION);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:46:13
+  --> tests/ui-internal/unnecessary_def_path.rs:51:13
    |
 LL |     let _ = match_type(cx, ty, paths::RESULT);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
 
 error: use of a def path to a `LangItem`
-  --> tests/ui-internal/unnecessary_def_path.rs:48:13
+  --> tests/ui-internal/unnecessary_def_path.rs:54:13
    |
 LL |     let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_lang_item(cx, ty, LangItem::OwnedBox)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:49:13
+  --> tests/ui-internal/unnecessary_def_path.rs:56:13
    |
 LL |     let _ = match_type(cx, ty, &["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::maybe_uninit_uninit)`
 
 error: use of a def path to a `LangItem`
-  --> tests/ui-internal/unnecessary_def_path.rs:51:13
+  --> tests/ui-internal/unnecessary_def_path.rs:59:13
    |
 LL |     let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:52:13
+  --> tests/ui-internal/unnecessary_def_path.rs:61:13
    |
 LL |     let _ = match_def_path(cx, did, &["core", "option", "Option"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.is_diagnostic_item(sym::Option, did)`
 
 error: use of a def path to a `LangItem`
-  --> tests/ui-internal/unnecessary_def_path.rs:53:13
+  --> tests/ui-internal/unnecessary_def_path.rs:63:13
    |
 LL |     let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OptionSome) == Some(did)`
@@ -74,25 +74,25 @@ LL |     let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]);
    = help: if this `DefId` came from a constructor expression or pattern then the parent `DefId` should be used instead
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:55:13
+  --> tests/ui-internal/unnecessary_def_path.rs:66:13
    |
 LL |     let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_trait_method(cx, expr, sym::AsRef)`
 
 error: use of a def path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path.rs:57:13
+  --> tests/ui-internal/unnecessary_def_path.rs:69:13
    |
 LL |     let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_path_diagnostic_item(cx, expr, sym::Option)`
 
 error: use of a def path to a `LangItem`
-  --> tests/ui-internal/unnecessary_def_path.rs:58:13
+  --> tests/ui-internal/unnecessary_def_path.rs:71:13
    |
 LL |     let _ = is_expr_path_def_path(cx, expr, &["core", "iter", "traits", "Iterator", "next"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path_res(cx, expr).opt_def_id().map_or(false, |id| cx.tcx.lang_items().get(LangItem::IteratorNext) == Some(id))`
 
 error: use of a def path to a `LangItem`
-  --> tests/ui-internal/unnecessary_def_path.rs:59:13
+  --> tests/ui-internal/unnecessary_def_path.rs:73:13
    |
 LL |     let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option", "Some"]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_res_lang_ctor(cx, path_res(cx, expr), LangItem::OptionSome)`
diff --git a/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs b/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs
index f6abb3cc3d7..4801d76bd26 100644
--- a/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs
+++ b/tests/ui-internal/unnecessary_def_path_hardcoded_path.rs
@@ -8,8 +8,11 @@ use rustc_hir::LangItem;
 
 fn main() {
     const DEREF_TRAIT: [&str; 4] = ["core", "ops", "deref", "Deref"];
+    //~^ unnecessary_def_path
     const DEREF_MUT_TRAIT: [&str; 4] = ["core", "ops", "deref", "DerefMut"];
+    //~^ unnecessary_def_path
     const DEREF_TRAIT_METHOD: [&str; 5] = ["core", "ops", "deref", "Deref", "deref"];
+    //~^ unnecessary_def_path
 
     // Don't lint, not a diagnostic or language item
     const OPS_MOD: [&str; 2] = ["core", "ops"];
diff --git a/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr b/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr
index e4575d99d03..ff4726de69a 100644
--- a/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr
+++ b/tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr
@@ -9,7 +9,7 @@ LL |     const DEREF_TRAIT: [&str; 4] = ["core", "ops", "deref", "Deref"];
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_def_path)]`
 
 error: hardcoded path to a language item
-  --> tests/ui-internal/unnecessary_def_path_hardcoded_path.rs:11:40
+  --> tests/ui-internal/unnecessary_def_path_hardcoded_path.rs:12:40
    |
 LL |     const DEREF_MUT_TRAIT: [&str; 4] = ["core", "ops", "deref", "DerefMut"];
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL |     const DEREF_MUT_TRAIT: [&str; 4] = ["core", "ops", "deref", "DerefMut"]
    = help: convert all references to use `LangItem::DerefMut`
 
 error: hardcoded path to a diagnostic item
-  --> tests/ui-internal/unnecessary_def_path_hardcoded_path.rs:12:43
+  --> tests/ui-internal/unnecessary_def_path_hardcoded_path.rs:14:43
    |
 LL |     const DEREF_TRAIT_METHOD: [&str; 5] = ["core", "ops", "deref", "Deref", "deref"];
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-internal/unnecessary_symbol_str.fixed b/tests/ui-internal/unnecessary_symbol_str.fixed
index 3d9deb705ac..dc564daef82 100644
--- a/tests/ui-internal/unnecessary_symbol_str.fixed
+++ b/tests/ui-internal/unnecessary_symbol_str.fixed
@@ -14,8 +14,13 @@ use rustc_span::symbol::{Ident, Symbol};
 
 fn main() {
     Symbol::intern("foo") == rustc_span::sym::clippy;
+    //~^ unnecessary_symbol_str
     Symbol::intern("foo") == rustc_span::kw::SelfLower;
+    //~^ unnecessary_symbol_str
     Symbol::intern("foo") != rustc_span::kw::SelfUpper;
+    //~^ unnecessary_symbol_str
     Ident::empty().name == rustc_span::sym::clippy;
+    //~^ unnecessary_symbol_str
     rustc_span::sym::clippy == Ident::empty().name;
+    //~^ unnecessary_symbol_str
 }
diff --git a/tests/ui-internal/unnecessary_symbol_str.rs b/tests/ui-internal/unnecessary_symbol_str.rs
index 9aeeb9aaf3a..d74262d1294 100644
--- a/tests/ui-internal/unnecessary_symbol_str.rs
+++ b/tests/ui-internal/unnecessary_symbol_str.rs
@@ -14,8 +14,13 @@ use rustc_span::symbol::{Ident, Symbol};
 
 fn main() {
     Symbol::intern("foo").as_str() == "clippy";
+    //~^ unnecessary_symbol_str
     Symbol::intern("foo").to_string() == "self";
+    //~^ unnecessary_symbol_str
     Symbol::intern("foo").to_ident_string() != "Self";
+    //~^ unnecessary_symbol_str
     &*Ident::empty().as_str() == "clippy";
+    //~^ unnecessary_symbol_str
     "clippy" == Ident::empty().to_string();
+    //~^ unnecessary_symbol_str
 }
diff --git a/tests/ui-internal/unnecessary_symbol_str.stderr b/tests/ui-internal/unnecessary_symbol_str.stderr
index 1742603eff6..517a395e93f 100644
--- a/tests/ui-internal/unnecessary_symbol_str.stderr
+++ b/tests/ui-internal/unnecessary_symbol_str.stderr
@@ -12,25 +12,25 @@ LL | #![deny(clippy::internal)]
    = note: `#[deny(clippy::unnecessary_symbol_str)]` implied by `#[deny(clippy::internal)]`
 
 error: unnecessary `Symbol` to string conversion
-  --> tests/ui-internal/unnecessary_symbol_str.rs:17:5
+  --> tests/ui-internal/unnecessary_symbol_str.rs:18:5
    |
 LL |     Symbol::intern("foo").to_string() == "self";
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") == rustc_span::kw::SelfLower`
 
 error: unnecessary `Symbol` to string conversion
-  --> tests/ui-internal/unnecessary_symbol_str.rs:18:5
+  --> tests/ui-internal/unnecessary_symbol_str.rs:20:5
    |
 LL |     Symbol::intern("foo").to_ident_string() != "Self";
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Symbol::intern("foo") != rustc_span::kw::SelfUpper`
 
 error: unnecessary `Symbol` to string conversion
-  --> tests/ui-internal/unnecessary_symbol_str.rs:19:5
+  --> tests/ui-internal/unnecessary_symbol_str.rs:22:5
    |
 LL |     &*Ident::empty().as_str() == "clippy";
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Ident::empty().name == rustc_span::sym::clippy`
 
 error: unnecessary `Symbol` to string conversion
-  --> tests/ui-internal/unnecessary_symbol_str.rs:20:5
+  --> tests/ui-internal/unnecessary_symbol_str.rs:24:5
    |
 LL |     "clippy" == Ident::empty().to_string();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::clippy == Ident::empty().name`
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4/clippy.toml
new file mode 100644
index 00000000000..baf7041138f
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4/clippy.toml
@@ -0,0 +1 @@
+module-items-ordered-within-groupings = true
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_5/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_5/clippy.toml
new file mode 100644
index 00000000000..1fa80c73012
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_5/clippy.toml
@@ -0,0 +1 @@
+module-items-ordered-within-groupings = ["madules"]
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_6/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_6/clippy.toml
new file mode 100644
index 00000000000..cee857a155b
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_6/clippy.toml
@@ -0,0 +1 @@
+module-items-ordered-within-groupings = ["entirely garbled"]
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/default_exp/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/default_exp/clippy.toml
index ddca5cfa577..af3aa1cc62a 100644
--- a/tests/ui-toml/arbitrary_source_item_ordering/default_exp/clippy.toml
+++ b/tests/ui-toml/arbitrary_source_item_ordering/default_exp/clippy.toml
@@ -9,4 +9,4 @@ module-item-order-groupings = [
     ["PascalCase", ["ty_alias", "enum", "struct", "union", "trait", "trait_alias", "impl"]],
     ["lower_snake_case", ["fn"]]
 ]
-
+module-items-ordered-within-groupings = "none"
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ord_in_2/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/ord_in_2/clippy.toml
new file mode 100644
index 00000000000..fd961c82d6f
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ord_in_2/clippy.toml
@@ -0,0 +1 @@
+module-items-ordered-within-groupings = ["PascalCase"]
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ord_in_3/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/ord_in_3/clippy.toml
new file mode 100644
index 00000000000..de2a7307eca
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ord_in_3/clippy.toml
@@ -0,0 +1,2 @@
+source-item-ordering = ["module"]
+module-items-ordered-within-groupings = ["PascalCase"]
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ord_within/clippy.toml b/tests/ui-toml/arbitrary_source_item_ordering/ord_within/clippy.toml
new file mode 100644
index 00000000000..e7640efde10
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ord_within/clippy.toml
@@ -0,0 +1 @@
+module-items-ordered-within-groupings = "all"
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_4.stderr b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_4.stderr
new file mode 100644
index 00000000000..c38c54ffeb0
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_4.stderr
@@ -0,0 +1,8 @@
+error: error reading Clippy's configuration file: data did not match any variant of untagged enum StringOrVecOfString  The available options for configuring an ordering within module item groups are: "all", "none", or a list of module item group names (as configured with the `module-item-order-groupings` configuration option).
+  --> $DIR/tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4/clippy.toml:1:41
+   |
+LL | module-items-ordered-within-groupings = true
+   |                                         ^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_5.stderr b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_5.stderr
new file mode 100644
index 00000000000..7b1dafb6d0d
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_5.stderr
@@ -0,0 +1,4 @@
+error: error reading Clippy's configuration file: unknown ordering group: `madules` was not specified in `module-items-ordered-within-groupings`, perhaps you meant `modules`? expected one of: `modules`, `use`, `macros`, `global_asm`, `UPPER_SNAKE_CASE`, `PascalCase`, `lower_snake_case`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_6.stderr b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_6.stderr
new file mode 100644
index 00000000000..996cabeeed4
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_6.stderr
@@ -0,0 +1,4 @@
+error: error reading Clippy's configuration file: unknown ordering group: `entirely garbled` was not specified in `module-items-ordered-within-groupings`, expected one of: `modules`, `use`, `macros`, `global_asm`, `UPPER_SNAKE_CASE`, `PascalCase`, `lower_snake_case`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs
index 05eb40506db..b43791521cb 100644
--- a/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs
@@ -1,15 +1,21 @@
 //@aux-build:../../ui/auxiliary/proc_macros.rs
-//@revisions: default default_exp bad_conf_1 bad_conf_2 bad_conf_3
+//@revisions: default default_exp bad_conf_1 bad_conf_2 bad_conf_3 bad_conf_4 bad_conf_5 bad_conf_6
 //@[default] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/default
 //@[default_exp] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/default_exp
 //@[bad_conf_1] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_1
 //@[bad_conf_2] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_2
 //@[bad_conf_3] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_3
+//@[bad_conf_4] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4
+//@[bad_conf_5] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_5
+//@[bad_conf_6] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/bad_conf_6
 //@[default] check-pass
 //@[default_exp] check-pass
 //@[bad_conf_1] error-in-other-file:
 //@[bad_conf_2] error-in-other-file:
 //@[bad_conf_3] error-in-other-file:
+//@[bad_conf_4] error-in-other-file:
+//@[bad_conf_5] error-in-other-file:
+//@[bad_conf_6] error-in-other-file:
 
 #![allow(dead_code)]
 #![warn(clippy::arbitrary_source_item_ordering)]
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default.stderr b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default.stderr
index 3605952bddc..50567e32b1b 100644
--- a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default.stderr
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default.stderr
@@ -1,223 +1,160 @@
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:22:14
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:26:14
    |
 LL | use std::rc::Weak;
    |              ^^^^
    |
 note: should be placed before `SNAKE_CASE`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:20:7
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:23:7
    |
 LL | const SNAKE_CASE: &str = "zzzzzzzz";
    |       ^^^^^^^^^^
    = note: `-D clippy::arbitrary-source-item-ordering` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::arbitrary_source_item_ordering)]`
 
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:67:1
-   |
-LL | / impl CloneSelf for StructOrdered {
-LL | |
-LL | |     fn clone_self(&self) -> Self {
-LL | |         Self {
-...  |
-LL | | }
-   | |_^
-   |
-note: should be placed before the following item
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:57:1
-   |
-LL | / impl Default for StructOrdered {
-LL | |     fn default() -> Self {
-LL | |         Self {
-LL | |             a: true,
-...  |
-LL | | }
-   | |_^
-
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:145:7
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:149:7
    |
 LL | const ZIS_SHOULD_BE_REALLY_EARLY: () = ();
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: should be placed before `TraitUnorderedItemKinds`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:132:7
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:136:7
    |
 LL | trait TraitUnorderedItemKinds {
    |       ^^^^^^^^^^^^^^^^^^^^^^^
 
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:163:1
-   |
-LL | impl BasicEmptyTrait for StructOrdered {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: should be placed before the following item
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:148:1
-   |
-LL | / impl TraitUnordered for StructUnordered {
-LL | |     const A: bool = false;
-LL | |     const C: bool = false;
-LL | |     const B: bool = false;
-...  |
-LL | | }
-   | |_^
-
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:184:5
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:188:5
    |
 LL | mod this_is_in_the_wrong_position {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: should be placed before `main`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:179:4
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:183:4
    |
 LL | fn main() {
    |    ^^^^
 
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:194:7
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:198:7
    |
 LL | const ZIS_SHOULD_BE_EVEN_EARLIER: () = ();
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: should be placed before `ZisShouldBeBeforeZeMainFn`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:192:8
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:196:8
    |
 LL | struct ZisShouldBeBeforeZeMainFn;
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:12:11
-   |
-LL |     const AFTER: i8 = 0;
-   |           ^^^^^
-   |
-note: should be placed before `BEFORE`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:10:11
-   |
-LL |     const BEFORE: i8 = 0;
-   |           ^^^^^^
-
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:40:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:44:5
    |
 LL |     B,
    |     ^
    |
 note: should be placed before `C`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:39:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:43:5
    |
 LL |     C,
    |     ^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:92:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:96:5
    |
 LL |     b: bool,
    |     ^
    |
 note: should be placed before `c`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:91:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:95:5
    |
 LL |     c: bool,
    |     ^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:101:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:105:5
    |
 LL |     b: bool,
    |     ^
    |
 note: should be placed before `c`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:100:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:104:5
    |
 LL |     c: bool,
    |     ^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:121:11
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:125:11
    |
 LL |     const B: bool;
    |           ^
    |
 note: should be placed before `C`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:120:11
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:124:11
    |
 LL |     const C: bool;
    |           ^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:128:8
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:132:8
    |
 LL |     fn b();
    |        ^
    |
 note: should be placed before `c`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:127:8
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:131:8
    |
 LL |     fn c();
    |        ^
 
 error: incorrect ordering of trait items (defined order: [Const, Type, Fn])
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:135:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:139:5
    |
 LL |     const A: bool;
    |     ^^^^^^^^^^^^^^
    |
 note: should be placed before `SomeType`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:133:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:137:5
    |
 LL |     type SomeType;
    |     ^^^^^^^^^^^^^^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:151:11
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:155:11
    |
 LL |     const B: bool = false;
    |           ^
    |
 note: should be placed before `C`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:150:11
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:154:11
    |
 LL |     const C: bool = false;
    |           ^
 
 error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:158:8
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:162:8
    |
 LL |     fn b() {}
    |        ^
    |
 note: should be placed before `c`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:157:8
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:161:8
    |
 LL |     fn c() {}
    |        ^
 
 error: incorrect ordering of impl items (defined order: [Const, Type, Fn])
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:169:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:173:5
    |
 LL |     const A: bool = false;
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: should be placed before `SomeType`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:167:5
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:171:5
    |
 LL |     type SomeType = ();
    |     ^^^^^^^^^^^^^^^^^^^
 
-error: incorrect ordering of items (must be alphabetically ordered)
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:187:11
-   |
-LL |     const A: i8 = 1;
-   |           ^
-   |
-note: should be placed before `C`
-  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:186:11
-   |
-LL |     const C: i8 = 0;
-   |           ^
-
-error: aborting due to 17 previous errors
+error: aborting due to 13 previous errors
 
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default_exp.stderr b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default_exp.stderr
new file mode 100644
index 00000000000..50567e32b1b
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.default_exp.stderr
@@ -0,0 +1,160 @@
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:26:14
+   |
+LL | use std::rc::Weak;
+   |              ^^^^
+   |
+note: should be placed before `SNAKE_CASE`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:23:7
+   |
+LL | const SNAKE_CASE: &str = "zzzzzzzz";
+   |       ^^^^^^^^^^
+   = note: `-D clippy::arbitrary-source-item-ordering` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::arbitrary_source_item_ordering)]`
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:149:7
+   |
+LL | const ZIS_SHOULD_BE_REALLY_EARLY: () = ();
+   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `TraitUnorderedItemKinds`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:136:7
+   |
+LL | trait TraitUnorderedItemKinds {
+   |       ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:188:5
+   |
+LL | mod this_is_in_the_wrong_position {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `main`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:183:4
+   |
+LL | fn main() {
+   |    ^^^^
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:198:7
+   |
+LL | const ZIS_SHOULD_BE_EVEN_EARLIER: () = ();
+   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `ZisShouldBeBeforeZeMainFn`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:196:8
+   |
+LL | struct ZisShouldBeBeforeZeMainFn;
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:44:5
+   |
+LL |     B,
+   |     ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:43:5
+   |
+LL |     C,
+   |     ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:96:5
+   |
+LL |     b: bool,
+   |     ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:95:5
+   |
+LL |     c: bool,
+   |     ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:105:5
+   |
+LL |     b: bool,
+   |     ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:104:5
+   |
+LL |     c: bool,
+   |     ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:125:11
+   |
+LL |     const B: bool;
+   |           ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:124:11
+   |
+LL |     const C: bool;
+   |           ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:132:8
+   |
+LL |     fn b();
+   |        ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:131:8
+   |
+LL |     fn c();
+   |        ^
+
+error: incorrect ordering of trait items (defined order: [Const, Type, Fn])
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:139:5
+   |
+LL |     const A: bool;
+   |     ^^^^^^^^^^^^^^
+   |
+note: should be placed before `SomeType`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:137:5
+   |
+LL |     type SomeType;
+   |     ^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:155:11
+   |
+LL |     const B: bool = false;
+   |           ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:154:11
+   |
+LL |     const C: bool = false;
+   |           ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:162:8
+   |
+LL |     fn b() {}
+   |        ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:161:8
+   |
+LL |     fn c() {}
+   |        ^
+
+error: incorrect ordering of impl items (defined order: [Const, Type, Fn])
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:173:5
+   |
+LL |     const A: bool = false;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `SomeType`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:171:5
+   |
+LL |     type SomeType = ();
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 13 previous errors
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.ord_within.stderr b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.ord_within.stderr
new file mode 100644
index 00000000000..ae5261dcc6d
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.ord_within.stderr
@@ -0,0 +1,235 @@
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:23:7
+   |
+LL | const SNAKE_CASE: &str = "zzzzzzzz";
+   |       ^^^^^^^^^^
+   |
+note: should be placed before `ZNAKE_CASE`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:22:7
+   |
+LL | const ZNAKE_CASE: &str = "123";
+   |       ^^^^^^^^^^
+   = note: `-D clippy::arbitrary-source-item-ordering` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::arbitrary_source_item_ordering)]`
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:26:14
+   |
+LL | use std::rc::Weak;
+   |              ^^^^
+   |
+note: should be placed before `SNAKE_CASE`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:23:7
+   |
+LL | const SNAKE_CASE: &str = "zzzzzzzz";
+   |       ^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:71:1
+   |
+LL | / impl CloneSelf for StructOrdered {
+LL | |
+LL | |     fn clone_self(&self) -> Self {
+LL | |         Self {
+...  |
+LL | | }
+   | |_^
+   |
+note: should be placed before the following item
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:61:1
+   |
+LL | / impl Default for StructOrdered {
+LL | |     fn default() -> Self {
+LL | |         Self {
+LL | |             a: true,
+...  |
+LL | | }
+   | |_^
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:149:7
+   |
+LL | const ZIS_SHOULD_BE_REALLY_EARLY: () = ();
+   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `TraitUnorderedItemKinds`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:136:7
+   |
+LL | trait TraitUnorderedItemKinds {
+   |       ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:167:1
+   |
+LL | impl BasicEmptyTrait for StructOrdered {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before the following item
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:152:1
+   |
+LL | / impl TraitUnordered for StructUnordered {
+LL | |     const A: bool = false;
+LL | |     const C: bool = false;
+LL | |     const B: bool = false;
+...  |
+LL | | }
+   | |_^
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:188:5
+   |
+LL | mod this_is_in_the_wrong_position {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `main`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:183:4
+   |
+LL | fn main() {
+   |    ^^^^
+
+error: incorrect ordering of items (module item groupings specify another order)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:198:7
+   |
+LL | const ZIS_SHOULD_BE_EVEN_EARLIER: () = ();
+   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `ZisShouldBeBeforeZeMainFn`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:196:8
+   |
+LL | struct ZisShouldBeBeforeZeMainFn;
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:14:11
+   |
+LL |     const AFTER: i8 = 0;
+   |           ^^^^^
+   |
+note: should be placed before `BEFORE`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:12:11
+   |
+LL |     const BEFORE: i8 = 0;
+   |           ^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:44:5
+   |
+LL |     B,
+   |     ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:43:5
+   |
+LL |     C,
+   |     ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:96:5
+   |
+LL |     b: bool,
+   |     ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:95:5
+   |
+LL |     c: bool,
+   |     ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:105:5
+   |
+LL |     b: bool,
+   |     ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:104:5
+   |
+LL |     c: bool,
+   |     ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:125:11
+   |
+LL |     const B: bool;
+   |           ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:124:11
+   |
+LL |     const C: bool;
+   |           ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:132:8
+   |
+LL |     fn b();
+   |        ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:131:8
+   |
+LL |     fn c();
+   |        ^
+
+error: incorrect ordering of trait items (defined order: [Const, Type, Fn])
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:139:5
+   |
+LL |     const A: bool;
+   |     ^^^^^^^^^^^^^^
+   |
+note: should be placed before `SomeType`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:137:5
+   |
+LL |     type SomeType;
+   |     ^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:155:11
+   |
+LL |     const B: bool = false;
+   |           ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:154:11
+   |
+LL |     const C: bool = false;
+   |           ^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:162:8
+   |
+LL |     fn b() {}
+   |        ^
+   |
+note: should be placed before `c`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:161:8
+   |
+LL |     fn c() {}
+   |        ^
+
+error: incorrect ordering of impl items (defined order: [Const, Type, Fn])
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:173:5
+   |
+LL |     const A: bool = false;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: should be placed before `SomeType`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:171:5
+   |
+LL |     type SomeType = ();
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:191:11
+   |
+LL |     const A: i8 = 1;
+   |           ^
+   |
+note: should be placed before `C`
+  --> tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs:190:11
+   |
+LL |     const C: i8 = 0;
+   |           ^
+
+error: aborting due to 18 previous errors
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs
index 9e65a9cca0d..90399470d4c 100644
--- a/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs
+++ b/tests/ui-toml/arbitrary_source_item_ordering/ordering_mixed.rs
@@ -1,6 +1,8 @@
 //@aux-build:../../ui/auxiliary/proc_macros.rs
-//@revisions: default
+//@revisions: default default_exp ord_within
 //@[default] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/default
+//@[default_exp] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/default_exp
+//@[ord_within] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/ord_within
 
 #![allow(dead_code)]
 #![warn(clippy::arbitrary_source_item_ordering)]
@@ -10,14 +12,16 @@ mod i_am_just_right {
     const BEFORE: i8 = 0;
 
     const AFTER: i8 = 0;
-    //~^ arbitrary_source_item_ordering
+    //~[ord_within]^ arbitrary_source_item_ordering
 }
 
 // Use statements should not be linted internally - this is normally auto-sorted using rustfmt.
 use std::rc::Rc;
 use std::sync::{Arc, Barrier, RwLock};
 
+const ZNAKE_CASE: &str = "123";
 const SNAKE_CASE: &str = "zzzzzzzz";
+//~[ord_within]^ arbitrary_source_item_ordering
 
 use std::rc::Weak;
 //~^ arbitrary_source_item_ordering
@@ -65,7 +69,7 @@ impl Default for StructOrdered {
 }
 
 impl CloneSelf for StructOrdered {
-    //~^ arbitrary_source_item_ordering
+    //~[ord_within]^ arbitrary_source_item_ordering
     fn clone_self(&self) -> Self {
         Self {
             a: true,
@@ -161,7 +165,7 @@ impl TraitUnordered for StructUnordered {
 
 // Trait impls should be located just after the type they implement it for.
 impl BasicEmptyTrait for StructOrdered {}
-//~^ arbitrary_source_item_ordering
+//~[ord_within]^ arbitrary_source_item_ordering
 
 impl TraitUnorderedItemKinds for StructUnordered {
     type SomeType = ();
@@ -185,7 +189,7 @@ mod this_is_in_the_wrong_position {
     //~^ arbitrary_source_item_ordering
     const C: i8 = 0;
     const A: i8 = 1;
-    //~^ arbitrary_source_item_ordering
+    //~[ord_within]^ arbitrary_source_item_ordering
 }
 
 #[derive(Default, std::clone::Clone)]
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.default.stderr b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.default.stderr
new file mode 100644
index 00000000000..7fc216b30d5
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.default.stderr
@@ -0,0 +1,19 @@
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:35:5
+   |
+LL |     a: bool,
+   |     ^
+   |
+note: should be placed before `b`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:34:5
+   |
+LL |     b: bool,
+   |     ^
+note: the lint level is defined here
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:32:8
+   |
+LL | #[deny(clippy::arbitrary_source_item_ordering)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_2.stderr b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_2.stderr
new file mode 100644
index 00000000000..1f75f5099ec
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_2.stderr
@@ -0,0 +1,36 @@
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:24:8
+   |
+LL | struct OrderedChecked {
+   |        ^^^^^^^^^^^^^^
+   |
+note: should be placed before `Unordered`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:18:8
+   |
+LL | struct Unordered {
+   |        ^^^^^^^^^
+note: the lint level is defined here
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:9:9
+   |
+LL | #![deny(clippy::arbitrary_source_item_ordering)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:35:5
+   |
+LL |     a: bool,
+   |     ^
+   |
+note: should be placed before `b`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:34:5
+   |
+LL |     b: bool,
+   |     ^
+note: the lint level is defined here
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:32:8
+   |
+LL | #[deny(clippy::arbitrary_source_item_ordering)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_3.stderr b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_3.stderr
new file mode 100644
index 00000000000..8027f55add6
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_in_3.stderr
@@ -0,0 +1,19 @@
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:24:8
+   |
+LL | struct OrderedChecked {
+   |        ^^^^^^^^^^^^^^
+   |
+note: should be placed before `Unordered`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:18:8
+   |
+LL | struct Unordered {
+   |        ^^^^^^^^^
+note: the lint level is defined here
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:9:9
+   |
+LL | #![deny(clippy::arbitrary_source_item_ordering)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_within.stderr b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_within.stderr
new file mode 100644
index 00000000000..333a601f6a9
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.ord_within.stderr
@@ -0,0 +1,48 @@
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:24:8
+   |
+LL | struct OrderedChecked {
+   |        ^^^^^^^^^^^^^^
+   |
+note: should be placed before `Unordered`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:18:8
+   |
+LL | struct Unordered {
+   |        ^^^^^^^^^
+note: the lint level is defined here
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:9:9
+   |
+LL | #![deny(clippy::arbitrary_source_item_ordering)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:45:4
+   |
+LL | fn before_main() {}
+   |    ^^^^^^^^^^^
+   |
+note: should be placed before `main`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:41:4
+   |
+LL | fn main() {
+   |    ^^^^
+
+error: incorrect ordering of items (must be alphabetically ordered)
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:35:5
+   |
+LL |     a: bool,
+   |     ^
+   |
+note: should be placed before `b`
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:34:5
+   |
+LL |     b: bool,
+   |     ^
+note: the lint level is defined here
+  --> tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs:32:8
+   |
+LL | #[deny(clippy::arbitrary_source_item_ordering)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs
new file mode 100644
index 00000000000..e32b921dd96
--- /dev/null
+++ b/tests/ui-toml/arbitrary_source_item_ordering/selective_ordering.rs
@@ -0,0 +1,46 @@
+//@aux-build:../../ui/auxiliary/proc_macros.rs
+//@revisions: default ord_within ord_in_2 ord_in_3
+//@[default] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/default
+//@[ord_within] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/ord_within
+//@[ord_in_2] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/ord_in_2
+//@[ord_in_3] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/ord_in_3
+
+#![allow(dead_code)]
+#![deny(clippy::arbitrary_source_item_ordering)]
+
+#[allow(clippy::arbitrary_source_item_ordering)]
+struct Ordered {
+    a: bool,
+    b: bool,
+}
+
+#[allow(clippy::arbitrary_source_item_ordering)]
+struct Unordered {
+    b: bool,
+    a: bool,
+}
+
+#[deny(clippy::arbitrary_source_item_ordering)]
+struct OrderedChecked {
+    //~[ord_within]^ arbitrary_source_item_ordering
+    //~[ord_in_2]| arbitrary_source_item_ordering
+    //~[ord_in_3]| arbitrary_source_item_ordering
+    a: bool,
+    b: bool,
+}
+
+#[deny(clippy::arbitrary_source_item_ordering)]
+struct UnorderedChecked {
+    b: bool,
+    a: bool,
+    //~[ord_within]^ arbitrary_source_item_ordering
+    //~[default]| arbitrary_source_item_ordering
+    //~[ord_in_2]| arbitrary_source_item_ordering
+}
+
+fn main() {
+    // test code goes here
+}
+
+fn before_main() {}
+//~[ord_within]^ arbitrary_source_item_ordering
diff --git a/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.default.stderr b/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.default.stderr
new file mode 100644
index 00000000000..2a6170b0bcd
--- /dev/null
+++ b/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.default.stderr
@@ -0,0 +1,11 @@
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.4.0`
+  --> tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs:14:5
+   |
+LL |     sleep(Duration::new(1, 0))
+   |     ^^^^^
+   |
+   = note: `-D clippy::incompatible-msrv` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.enabled.stderr b/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.enabled.stderr
new file mode 100644
index 00000000000..8a85d38fba3
--- /dev/null
+++ b/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.enabled.stderr
@@ -0,0 +1,23 @@
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.4.0`
+  --> tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs:14:5
+   |
+LL |     sleep(Duration::new(1, 0))
+   |     ^^^^^
+   |
+   = note: `-D clippy::incompatible-msrv` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]`
+
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.4.0`
+  --> tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs:20:5
+   |
+LL |     sleep(Duration::new(1, 0));
+   |     ^^^^^
+
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.4.0`
+  --> tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs:28:9
+   |
+LL |         sleep(Duration::new(1, 0));
+   |         ^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs b/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs
new file mode 100644
index 00000000000..fed5f350b72
--- /dev/null
+++ b/tests/ui-toml/check_incompatible_msrv_in_tests/check_incompatible_msrv_in_tests.rs
@@ -0,0 +1,31 @@
+//@compile-flags: --test
+//@revisions: default enabled
+//@[enabled] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/check_incompatible_msrv_in_tests/enabled
+//@[default] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/check_incompatible_msrv_in_tests/default
+
+#![warn(clippy::incompatible_msrv)]
+#![feature(custom_inner_attributes)]
+#![clippy::msrv = "1.3.0"]
+
+use std::thread::sleep;
+use std::time::Duration;
+
+fn main() {
+    sleep(Duration::new(1, 0))
+    //~^ incompatible_msrv
+}
+
+#[test]
+fn test() {
+    sleep(Duration::new(1, 0));
+    //~[enabled]^ incompatible_msrv
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    fn helper() {
+        sleep(Duration::new(1, 0));
+        //~[enabled]^ incompatible_msrv
+    }
+}
diff --git a/tests/ui-toml/check_incompatible_msrv_in_tests/default/clippy.toml b/tests/ui-toml/check_incompatible_msrv_in_tests/default/clippy.toml
new file mode 100644
index 00000000000..1d13759aceb
--- /dev/null
+++ b/tests/ui-toml/check_incompatible_msrv_in_tests/default/clippy.toml
@@ -0,0 +1 @@
+# default config has check-incompatible-msrv-in-tests as false
diff --git a/tests/ui-toml/check_incompatible_msrv_in_tests/enabled/clippy.toml b/tests/ui-toml/check_incompatible_msrv_in_tests/enabled/clippy.toml
new file mode 100644
index 00000000000..c56af6c8218
--- /dev/null
+++ b/tests/ui-toml/check_incompatible_msrv_in_tests/enabled/clippy.toml
@@ -0,0 +1 @@
+check-incompatible-msrv-in-tests = true
diff --git a/tests/ui-toml/dbg_macro/dbg_macro.stderr b/tests/ui-toml/dbg_macro/dbg_macro.stderr
index 3d869f97c0a..4587d28c3f3 100644
--- a/tests/ui-toml/dbg_macro/dbg_macro.stderr
+++ b/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: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-toml/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-toml/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-toml/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: aborting due to 7 previous errors
 
diff --git a/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr b/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr
index a6e0ad0f804..8ba237ee75c 100644
--- a/tests/ui-toml/doc_valid_idents_append/doc_markdown.stderr
+++ b/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/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr b/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr
index cb5f5abda6c..e06b958a1b3 100644
--- a/tests/ui-toml/doc_valid_idents_replace/doc_markdown.stderr
+++ b/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:11: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/tests/ui-toml/enum_variant_size/enum_variant_size.stderr b/tests/ui-toml/enum_variant_size/enum_variant_size.stderr
index 8f7ebbd9546..020b3cc7878 100644
--- a/tests/ui-toml/enum_variant_size/enum_variant_size.stderr
+++ b/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/tests/ui-toml/large_include_file/large_include_file.stderr b/tests/ui-toml/large_include_file/large_include_file.stderr
index 82b926cc53b..c9f0e661dbd 100644
--- a/tests/ui-toml/large_include_file/large_include_file.stderr
+++ b/tests/ui-toml/large_include_file/large_include_file.stderr
@@ -1,26 +1,26 @@
 error: attempted to include a large file
-  --> tests/ui-toml/large_include_file/large_include_file.rs:14:43
+  --> tests/ui-toml/large_include_file/large_include_file.rs:19:1
    |
-LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
-   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[doc = include_str!("too_big.txt")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: the configuration allows a maximum size of 600 bytes
    = note: `-D clippy::large-include-file` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::large_include_file)]`
 
 error: attempted to include a large file
-  --> tests/ui-toml/large_include_file/large_include_file.rs:16:35
+  --> tests/ui-toml/large_include_file/large_include_file.rs:14:43
    |
-LL | const TOO_BIG_INCLUDE_STR: &str = include_str!("too_big.txt");
-   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
+   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: the configuration allows a maximum size of 600 bytes
 
 error: attempted to include a large file
-  --> tests/ui-toml/large_include_file/large_include_file.rs:19:1
+  --> tests/ui-toml/large_include_file/large_include_file.rs:16:35
    |
-LL | #[doc = include_str!("too_big.txt")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | const TOO_BIG_INCLUDE_STR: &str = include_str!("too_big.txt");
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: the configuration allows a maximum size of 600 bytes
 
diff --git a/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr b/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr
index e7e526628ce..7fdaa442045 100644
--- a/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr
+++ b/tests/ui-toml/renamed_function_params/renamed_function_params.default.stderr
@@ -33,8 +33,9 @@ LL |     fn hash_slice<H: Hasher>(date: &[Self], states: &mut H) {
    |
 help: consider using the default names
    |
-LL |     fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) {
-   |                              ~~~~           ~~~~~
+LL -     fn hash_slice<H: Hasher>(date: &[Self], states: &mut H) {
+LL +     fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) {
+   |
 
 error: renamed function parameter of trait impl
   --> tests/ui-toml/renamed_function_params/renamed_function_params.rs:82:18
diff --git a/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr b/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr
index 46e5f34b176..d670026b541 100644
--- a/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr
+++ b/tests/ui-toml/renamed_function_params/renamed_function_params.extend.stderr
@@ -27,8 +27,9 @@ LL |     fn hash_slice<H: Hasher>(date: &[Self], states: &mut H) {
    |
 help: consider using the default names
    |
-LL |     fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) {
-   |                              ~~~~           ~~~~~
+LL -     fn hash_slice<H: Hasher>(date: &[Self], states: &mut H) {
+LL +     fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) {
+   |
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
index 842059df1e9..fee5b01b689 100644
--- a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
+++ b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
@@ -31,6 +31,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
            await-holding-invalid-types
            blacklisted-names
            cargo-ignore-publish
+           check-incompatible-msrv-in-tests
            check-private-items
            cognitive-complexity-threshold
            cyclomatic-complexity-threshold
@@ -59,6 +60,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
            min-ident-chars-threshold
            missing-docs-in-crate-items
            module-item-order-groupings
+           module-items-ordered-within-groupings
            msrv
            pass-by-value-size-limit
            pub-underscore-fields-behavior
@@ -122,6 +124,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
            await-holding-invalid-types
            blacklisted-names
            cargo-ignore-publish
+           check-incompatible-msrv-in-tests
            check-private-items
            cognitive-complexity-threshold
            cyclomatic-complexity-threshold
@@ -150,6 +153,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
            min-ident-chars-threshold
            missing-docs-in-crate-items
            module-item-order-groupings
+           module-items-ordered-within-groupings
            msrv
            pass-by-value-size-limit
            pub-underscore-fields-behavior
@@ -213,6 +217,7 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
            await-holding-invalid-types
            blacklisted-names
            cargo-ignore-publish
+           check-incompatible-msrv-in-tests
            check-private-items
            cognitive-complexity-threshold
            cyclomatic-complexity-threshold
@@ -241,6 +246,7 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
            min-ident-chars-threshold
            missing-docs-in-crate-items
            module-item-order-groupings
+           module-items-ordered-within-groupings
            msrv
            pass-by-value-size-limit
            pub-underscore-fields-behavior
diff --git a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.default.stderr b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.default.stderr
index 32ed78151d2..8a2f201009a 100644
--- a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.default.stderr
+++ b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.default.stderr
@@ -310,5 +310,49 @@ LL |             let bar = unsafe {};
    |
    = help: consider adding a safety comment on the preceding line
 
-error: aborting due to 35 previous errors
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:638:52
+   |
+LL |         const NO_SAFETY_IN_TRAIT_BUT_IN_IMPL: u8 = unsafe { 0 };
+   |                                                    ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:647:41
+   |
+LL |         const NO_SAFETY_IN_TRAIT: i32 = unsafe { 1 };
+   |                                         ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:657:42
+   |
+LL |         const HAS_SAFETY_IN_TRAIT: i32 = unsafe { 3 };
+   |                                          ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:662:40
+   |
+LL |         const NO_SAFETY_IN_IMPL: i32 = unsafe { 1 };
+   |                                        ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: statement has unnecessary safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:719:5
+   |
+LL |     _ = bar();
+   |     ^^^^^^^^^^
+   |
+help: consider removing the safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:718:5
+   |
+LL |     // SAFETY: unnecessary_safety_comment triggers here
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 40 previous errors
 
diff --git a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.disabled.stderr b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.disabled.stderr
index 83a6986addf..e9c5e5f9f11 100644
--- a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.disabled.stderr
+++ b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.disabled.stderr
@@ -390,5 +390,65 @@ LL |     unsafe {}
    |
    = help: consider adding a safety comment on the preceding line
 
-error: aborting due to 45 previous errors
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:638:52
+   |
+LL |         const NO_SAFETY_IN_TRAIT_BUT_IN_IMPL: u8 = unsafe { 0 };
+   |                                                    ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:647:41
+   |
+LL |         const NO_SAFETY_IN_TRAIT: i32 = unsafe { 1 };
+   |                                         ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:657:42
+   |
+LL |         const HAS_SAFETY_IN_TRAIT: i32 = unsafe { 3 };
+   |                                          ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:662:40
+   |
+LL |         const NO_SAFETY_IN_IMPL: i32 = unsafe { 1 };
+   |                                        ^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:673:9
+   |
+LL |         unsafe { here_is_another_variable_with_long_name };
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: unsafe block missing a safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:702:9
+   |
+LL |         unsafe { Date::__from_ordinal_date_unchecked(1970, 1) }.into_julian_day_just_make_this_line_longer();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: consider adding a safety comment on the preceding line
+
+error: statement has unnecessary safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:719:5
+   |
+LL |     _ = bar();
+   |     ^^^^^^^^^^
+   |
+help: consider removing the safety comment
+  --> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:718:5
+   |
+LL |     // SAFETY: unnecessary_safety_comment triggers here
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 52 previous errors
 
diff --git a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs
index 6a3fda3df5c..91a02bc3d7c 100644
--- a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs
+++ b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs
@@ -632,4 +632,95 @@ mod issue_11246 {
 // Safety: Another safety comment
 const FOO: () = unsafe {};
 
+// trait items and impl items
+mod issue_11709 {
+    trait MyTrait {
+        const NO_SAFETY_IN_TRAIT_BUT_IN_IMPL: u8 = unsafe { 0 };
+        //~^ ERROR: unsafe block missing a safety comment
+
+        // SAFETY: safe
+        const HAS_SAFETY_IN_TRAIT: i32 = unsafe { 1 };
+
+        // SAFETY: unrelated
+        unsafe fn unsafe_fn() {}
+
+        const NO_SAFETY_IN_TRAIT: i32 = unsafe { 1 };
+        //~^ ERROR: unsafe block missing a safety comment
+    }
+
+    struct UnsafeStruct;
+
+    impl MyTrait for UnsafeStruct {
+        // SAFETY: safe in this impl
+        const NO_SAFETY_IN_TRAIT_BUT_IN_IMPL: u8 = unsafe { 2 };
+
+        const HAS_SAFETY_IN_TRAIT: i32 = unsafe { 3 };
+        //~^ ERROR: unsafe block missing a safety comment
+    }
+
+    impl UnsafeStruct {
+        const NO_SAFETY_IN_IMPL: i32 = unsafe { 1 };
+        //~^ ERROR: unsafe block missing a safety comment
+    }
+}
+
+fn issue_13024() {
+    let mut just_a_simple_variable_with_a_very_long_name_that_has_seventy_eight_characters = 0;
+    let here_is_another_variable_with_long_name = 100;
+
+    // SAFETY: fail ONLY if `accept-comment-above-statement = false`
+    just_a_simple_variable_with_a_very_long_name_that_has_seventy_eight_characters =
+        unsafe { here_is_another_variable_with_long_name };
+    //~[disabled]^ undocumented_unsafe_blocks
+}
+
+// https://docs.rs/time/0.3.36/src/time/offset_date_time.rs.html#35
+mod issue_11709_regression {
+    use std::num::NonZeroI32;
+
+    struct Date {
+        value: NonZeroI32,
+    }
+
+    impl Date {
+        const unsafe fn __from_ordinal_date_unchecked(year: i32, ordinal: u16) -> Self {
+            Self {
+                // Safety: The caller must guarantee that `ordinal` is not zero.
+                value: unsafe { NonZeroI32::new_unchecked((year << 9) | ordinal as i32) },
+            }
+        }
+
+        const fn into_julian_day_just_make_this_line_longer(self) -> i32 {
+            42
+        }
+    }
+
+    /// The Julian day of the Unix epoch.
+    // SAFETY: fail ONLY if `accept-comment-above-attribute = false`
+    #[allow(unsafe_code)]
+    const UNIX_EPOCH_JULIAN_DAY: i32 =
+        unsafe { Date::__from_ordinal_date_unchecked(1970, 1) }.into_julian_day_just_make_this_line_longer();
+    //~[disabled]^ undocumented_unsafe_blocks
+}
+
+fn issue_13039() {
+    unsafe fn foo() -> usize {
+        1234
+    }
+
+    fn bar() -> usize {
+        1234
+    }
+
+    // SAFETY: unnecessary_safety_comment should not trigger here
+    _ = unsafe { foo() };
+
+    // SAFETY: unnecessary_safety_comment triggers here
+    _ = bar();
+    //~^ unnecessary_safety_comment
+
+    // SAFETY: unnecessary_safety_comment should not trigger here
+    _ = unsafe { foo() }
+}
+
 fn main() {}
diff --git a/tests/ui-toml/unwrap_used/unwrap_used.stderr b/tests/ui-toml/unwrap_used/unwrap_used.stderr
index cb9a3f6887d..135e35323fd 100644
--- a/tests/ui-toml/unwrap_used/unwrap_used.stderr
+++ b/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:41: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:44: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:47: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:50: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:53: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:59: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:66: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:69: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:72: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:75: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:89: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:92: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:121: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/tests/ui/asm_syntax_not_x86.rs b/tests/ui/asm_syntax_not_x86.rs
index 91fde12680c..edcd5247f18 100644
--- a/tests/ui/asm_syntax_not_x86.rs
+++ b/tests/ui/asm_syntax_not_x86.rs
@@ -1,5 +1,6 @@
 //@ignore-target: i686 x86
 //@needs-asm-support
+//@check-pass
 
 #[warn(clippy::inline_asm_x86_intel_syntax)]
 #[warn(clippy::inline_asm_x86_att_syntax)]
@@ -8,17 +9,12 @@ mod dont_warn {
 
     pub(super) unsafe fn use_asm() {
         asm!("");
-        //~^ inline_asm_x86_intel_syntax
         asm!("", options());
-        //~^ inline_asm_x86_intel_syntax
         asm!("", options(nostack));
-        //~^ inline_asm_x86_intel_syntax
     }
 
     global_asm!("");
-    //~^ inline_asm_x86_intel_syntax
     global_asm!("", options());
-    //~^ inline_asm_x86_intel_syntax
 }
 
 fn main() {
diff --git a/tests/ui/assign_ops2.stderr b/tests/ui/assign_ops2.stderr
index 19deebe1785..d9ecd3f8b23 100644
--- a/tests/ui/assign_ops2.stderr
+++ b/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:14: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:17: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:20: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:23: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:26: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:29: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:32: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:71:5
diff --git a/tests/ui/async_yields_async.stderr b/tests/ui/async_yields_async.stderr
index 01533268a51..17a35076fa3 100644
--- a/tests/ui/async_yields_async.stderr
+++ b/tests/ui/async_yields_async.stderr
@@ -14,9 +14,9 @@ LL | |      };
    = help: to override `-D warnings` add `#[allow(clippy::async_yields_async)]`
 help: consider awaiting this value
    |
-LL ~         async {
-LL +             3
-LL +         }.await
+LL |         async {
+LL |             3
+LL ~         }.await
    |
 
 error: an async construct yields a type which is itself awaitable
@@ -46,9 +46,9 @@ LL | |      };
    |
 help: consider awaiting this value
    |
-LL ~         async {
-LL +             3
-LL +         }.await
+LL |         async {
+LL |             3
+LL ~         }.await
    |
 
 error: an async construct yields a type which is itself awaitable
diff --git a/tests/ui/attrs.rs b/tests/ui/attrs.rs
index 583a0ada437..f60c71837d5 100644
--- a/tests/ui/attrs.rs
+++ b/tests/ui/attrs.rs
@@ -1,10 +1,9 @@
 #![warn(clippy::inline_always, clippy::deprecated_semver)]
-#![allow(clippy::assertions_on_constants, clippy::empty_line_after_outer_attr)]
+#![allow(clippy::assertions_on_constants)]
 #![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]
 
 #[inline(always)]
 //~^ inline_always
-
 fn test_attr_lint() {
     assert!(true)
 }
@@ -26,12 +25,10 @@ fn empty_and_false_positive_stmt() {
 
 #[deprecated(since = "forever")]
 //~^ deprecated_semver
-
 pub const SOME_CONST: u8 = 42;
 
 #[deprecated(since = "1")]
 //~^ deprecated_semver
-
 pub const ANOTHER_CONST: u8 = 23;
 
 #[deprecated(since = "0.1.1")]
diff --git a/tests/ui/attrs.stderr b/tests/ui/attrs.stderr
index a7fdceaba6f..85b318cc0fd 100644
--- a/tests/ui/attrs.stderr
+++ b/tests/ui/attrs.stderr
@@ -1,5 +1,5 @@
 error: the since field must contain a semver-compliant version
-  --> tests/ui/attrs.rs:27:14
+  --> tests/ui/attrs.rs:26:14
    |
 LL | #[deprecated(since = "forever")]
    |              ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #[deprecated(since = "forever")]
    = help: to override `-D warnings` add `#[allow(clippy::deprecated_semver)]`
 
 error: the since field must contain a semver-compliant version
-  --> tests/ui/attrs.rs:32:14
+  --> tests/ui/attrs.rs:30:14
    |
 LL | #[deprecated(since = "1")]
    |              ^^^^^^^^^^^
diff --git a/tests/ui/author/blocks.stdout b/tests/ui/author/blocks.stdout
index 6bf48d5ba4e..54325f9776c 100644
--- a/tests/ui/author/blocks.stdout
+++ b/tests/ui/author/blocks.stdout
@@ -42,10 +42,10 @@ if let ExprKind::Block(block, None) = expr.kind
 }
 if let ExprKind::Closure { capture_clause: CaptureBy::Value { .. }, fn_decl: fn_decl, body: body_id, closure_kind: ClosureKind::CoroutineClosure(CoroutineDesugaring::Async), .. } = expr.kind
     && let FnRetTy::DefaultReturn(_) = fn_decl.output
-    && expr1 = &cx.tcx.hir().body(body_id).value
+    && expr1 = &cx.tcx.hir_body(body_id).value
     && let ExprKind::Closure { capture_clause: CaptureBy::Ref, fn_decl: fn_decl1, body: body_id1, closure_kind: ClosureKind::Coroutine(CoroutineKind::Desugared(CoroutineDesugaring::Async, CoroutineSource::Closure)), .. } = expr1.kind
     && let FnRetTy::DefaultReturn(_) = fn_decl1.output
-    && expr2 = &cx.tcx.hir().body(body_id1).value
+    && expr2 = &cx.tcx.hir_body(body_id1).value
     && let ExprKind::Block(block, None) = expr2.kind
     && block.stmts.is_empty()
     && let Some(trailing_expr) = block.expr
diff --git a/tests/ui/author/macro_in_closure.stdout b/tests/ui/author/macro_in_closure.stdout
index 66caf382d89..3186d0cbc27 100644
--- a/tests/ui/author/macro_in_closure.stdout
+++ b/tests/ui/author/macro_in_closure.stdout
@@ -2,7 +2,7 @@ if let StmtKind::Let(local) = stmt.kind
     && let Some(init) = local.init
     && let ExprKind::Closure { capture_clause: CaptureBy::Ref, fn_decl: fn_decl, body: body_id, closure_kind: ClosureKind::Closure, .. } = init.kind
     && let FnRetTy::DefaultReturn(_) = fn_decl.output
-    && expr = &cx.tcx.hir().body(body_id).value
+    && expr = &cx.tcx.hir_body(body_id).value
     && let ExprKind::Block(block, None) = expr.kind
     && block.stmts.len() == 1
     && let StmtKind::Semi(e) = block.stmts[0].kind
diff --git a/tests/ui/author/repeat.stdout b/tests/ui/author/repeat.stdout
index 1a608734ada..f2c6b3f807f 100644
--- a/tests/ui/author/repeat.stdout
+++ b/tests/ui/author/repeat.stdout
@@ -2,7 +2,7 @@ if let ExprKind::Repeat(value, length) = expr.kind
     && let ExprKind::Lit(ref lit) = value.kind
     && let LitKind::Int(1, LitIntType::Unsigned(UintTy::U8)) = lit.node
     && let ConstArgKind::Anon(anon_const) = length.kind
-    && expr1 = &cx.tcx.hir().body(anon_const.body).value
+    && expr1 = &cx.tcx.hir_body(anon_const.body).value
     && let ExprKind::Lit(ref lit1) = expr1.kind
     && let LitKind::Int(5, LitIntType::Unsuffixed) = lit1.node
 {
diff --git a/tests/ui/bind_instead_of_map_multipart.stderr b/tests/ui/bind_instead_of_map_multipart.stderr
index 336b19433a6..3ae11422357 100644
--- a/tests/ui/bind_instead_of_map_multipart.stderr
+++ b/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:9: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:13: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:22: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/tests/ui/blocks_in_conditions.fixed b/tests/ui/blocks_in_conditions.fixed
index df375e37057..cd307e803d0 100644
--- a/tests/ui/blocks_in_conditions.fixed
+++ b/tests/ui/blocks_in_conditions.fixed
@@ -118,6 +118,13 @@ mod issue_12016 {
     }
 }
 
+fn issue_9911() {
+    if { return } {}
+
+    let a = 1;
+    if { if a == 1 { return } else { true } } {}
+}
+
 fn in_closure() {
     let v = vec![1, 2, 3];
     if v.into_iter()
diff --git a/tests/ui/blocks_in_conditions.rs b/tests/ui/blocks_in_conditions.rs
index 1d9c9dd4246..6a211c8edfd 100644
--- a/tests/ui/blocks_in_conditions.rs
+++ b/tests/ui/blocks_in_conditions.rs
@@ -118,6 +118,13 @@ mod issue_12016 {
     }
 }
 
+fn issue_9911() {
+    if { return } {}
+
+    let a = 1;
+    if { if a == 1 { return } else { true } } {}
+}
+
 fn in_closure() {
     let v = vec![1, 2, 3];
     if v.into_iter()
diff --git a/tests/ui/borrow_deref_ref_unfixable.stderr b/tests/ui/borrow_deref_ref_unfixable.stderr
index 7d3a5c84a82..b8a0eedeb9e 100644
--- a/tests/ui/borrow_deref_ref_unfixable.stderr
+++ b/tests/ui/borrow_deref_ref_unfixable.stderr
@@ -8,12 +8,13 @@ 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;
-   |                       ~~~~
+   |                         +
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/cast.stderr b/tests/ui/cast.stderr
index 1c5ff52ae72..4d03282f667 100644
--- a/tests/ui/cast.stderr
+++ b/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:60: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:63: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:70: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:79: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:110: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:110: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:115: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:134: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:253: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:276: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:279: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:324: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:362: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:410: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:422: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:427: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:440: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:540: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:571: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/tests/ui/cast_lossless_bool.stderr b/tests/ui/cast_lossless_bool.stderr
index 54edab2856c..802eeaebbbd 100644
--- a/tests/ui/cast_lossless_bool.stderr
+++ b/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:10: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:12: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:14: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:16: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:18: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:21: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:23: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:25: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:27: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:29: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:31: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:35: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:38: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:67: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/tests/ui/cast_lossless_float.stderr b/tests/ui/cast_lossless_float.stderr
index c983d4ccc6b..35ae38b1d36 100644
--- a/tests/ui/cast_lossless_float.stderr
+++ b/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:14: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:16: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:18: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:21: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:23: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:26: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:28: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:31: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:33: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:36: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:39: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:43: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/tests/ui/cast_lossless_integer.stderr b/tests/ui/cast_lossless_integer.stderr
index 393c20f6829..9852eca7127 100644
--- a/tests/ui/cast_lossless_integer.stderr
+++ b/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:11: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:14: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:17: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:20: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:23: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:26: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:29: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:32: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:35: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:38: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:41: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:44: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:47: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:50: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:53: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:56: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:59: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:62: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:65: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:68: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:71: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:74: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:77: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:80: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:83: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:86: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:89: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:92: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:95: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:99: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:102: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:105: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:108: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:111: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:114: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:149: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:152: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:159: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 `<ty!()>::from` instead
    |
-LL |     let _ = <ty!()>::from(0u8);
-   |             ~~~~~~~~~~~~~~~~~~
+LL -     let _ = 0u8 as ty!();
+LL +     let _ = <ty!()>::from(0u8);
+   |
 
 error: aborting due to 40 previous errors
 
diff --git a/tests/ui/cast_size.32bit.stderr b/tests/ui/cast_size.32bit.stderr
index 637dd6fddea..cb1620e36a2 100644
--- a/tests/ui/cast_size.32bit.stderr
+++ b/tests/ui/cast_size.32bit.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:24: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:37: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:39: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:41: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:41: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:46: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:48: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:48: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:53:5
diff --git a/tests/ui/cast_size.64bit.stderr b/tests/ui/cast_size.64bit.stderr
index 0e12ecb6f2d..b6000a52abb 100644
--- a/tests/ui/cast_size.64bit.stderr
+++ b/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:24: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:37: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:39: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:41: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:41: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:46: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:48: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:48: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:53:5
diff --git a/tests/ui/crashes/needless_lifetimes_impl_trait.fixed b/tests/ui/crashes/elidable_lifetime_names_impl_trait.fixed
index da3b82a60c5..681887314ed 100644
--- a/tests/ui/crashes/needless_lifetimes_impl_trait.fixed
+++ b/tests/ui/crashes/elidable_lifetime_names_impl_trait.fixed
@@ -1,4 +1,4 @@
-#![deny(clippy::needless_lifetimes)]
+#![deny(clippy::elidable_lifetime_names)]
 #![allow(dead_code)]
 
 trait Foo {}
@@ -10,11 +10,11 @@ struct Baz<'a> {
 }
 
 impl Foo for Baz<'_> {}
-//~^ needless_lifetimes
+//~^ elidable_lifetime_names
 
 impl Bar {
     fn baz(&self) -> impl Foo + '_ {
-        //~^ needless_lifetimes
+        //~^ elidable_lifetime_names
 
         Baz { bar: self }
     }
diff --git a/tests/ui/crashes/needless_lifetimes_impl_trait.rs b/tests/ui/crashes/elidable_lifetime_names_impl_trait.rs
index 456d315926d..ed5f95bdca8 100644
--- a/tests/ui/crashes/needless_lifetimes_impl_trait.rs
+++ b/tests/ui/crashes/elidable_lifetime_names_impl_trait.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::needless_lifetimes)]
+#![deny(clippy::elidable_lifetime_names)]
 #![allow(dead_code)]
 
 trait Foo {}
@@ -10,11 +10,11 @@ struct Baz<'a> {
 }
 
 impl<'a> Foo for Baz<'a> {}
-//~^ needless_lifetimes
+//~^ elidable_lifetime_names
 
 impl Bar {
     fn baz<'a>(&'a self) -> impl Foo + 'a {
-        //~^ needless_lifetimes
+        //~^ elidable_lifetime_names
 
         Baz { bar: self }
     }
diff --git a/tests/ui/crashes/needless_lifetimes_impl_trait.stderr b/tests/ui/crashes/elidable_lifetime_names_impl_trait.stderr
index 97fb6d29cfb..ef4b7e0a476 100644
--- a/tests/ui/crashes/needless_lifetimes_impl_trait.stderr
+++ b/tests/ui/crashes/elidable_lifetime_names_impl_trait.stderr
@@ -1,14 +1,14 @@
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/crashes/needless_lifetimes_impl_trait.rs:12:6
+  --> tests/ui/crashes/elidable_lifetime_names_impl_trait.rs:12:6
    |
 LL | impl<'a> Foo for Baz<'a> {}
    |      ^^              ^^
    |
 note: the lint level is defined here
-  --> tests/ui/crashes/needless_lifetimes_impl_trait.rs:1:9
+  --> tests/ui/crashes/elidable_lifetime_names_impl_trait.rs:1:9
    |
-LL | #![deny(clippy::needless_lifetimes)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #![deny(clippy::elidable_lifetime_names)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: elide the lifetimes
    |
 LL - impl<'a> Foo for Baz<'a> {}
@@ -16,7 +16,7 @@ LL + impl Foo for Baz<'_> {}
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/crashes/needless_lifetimes_impl_trait.rs:16:12
+  --> tests/ui/crashes/elidable_lifetime_names_impl_trait.rs:16:12
    |
 LL |     fn baz<'a>(&'a self) -> impl Foo + 'a {
    |            ^^   ^^                     ^^
diff --git a/tests/ui/crashes/ice-14303.rs b/tests/ui/crashes/ice-14303.rs
new file mode 100644
index 00000000000..e81f29cd7af
--- /dev/null
+++ b/tests/ui/crashes/ice-14303.rs
@@ -0,0 +1,12 @@
+//@check-pass
+#![warn(clippy::macro_use_imports)]
+
+#[repr(transparent)]
+pub struct X(());
+
+#[repr(u8)]
+pub enum Action {
+    Off = 0,
+}
+
+fn main() {}
diff --git a/tests/ui/crashes/ice-14325.rs b/tests/ui/crashes/ice-14325.rs
new file mode 100644
index 00000000000..d762bd6c9e0
--- /dev/null
+++ b/tests/ui/crashes/ice-14325.rs
@@ -0,0 +1,17 @@
+//@check-pass
+
+#![allow(clippy::redundant_pattern_matching)]
+
+struct S<'a> {
+    s: &'a str,
+}
+
+fn foo() -> Option<S<'static>> {
+    if let Some(_) = Some(0) {
+        Some(S { s: "xyz" })
+    } else {
+        None
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/crashes/ice-5835.fixed b/tests/ui/crashes/ice-5835.fixed
new file mode 100644
index 00000000000..e9c24b8e9f0
--- /dev/null
+++ b/tests/ui/crashes/ice-5835.fixed
@@ -0,0 +1,10 @@
+#[rustfmt::skip]
+pub struct Foo {
+    //~v tabs_in_doc_comments
+    /// 位    
+    ///   ^ Do not remove this tab character.
+    ///   It was required to trigger the ICE.
+    pub bar: u8,
+}
+
+fn main() {}
diff --git a/tests/ui/crashes/ice-5835.rs b/tests/ui/crashes/ice-5835.rs
index 149ba478618..99858f45933 100644
--- a/tests/ui/crashes/ice-5835.rs
+++ b/tests/ui/crashes/ice-5835.rs
@@ -1,10 +1,7 @@
 #[rustfmt::skip]
 pub struct Foo {
+    //~v tabs_in_doc_comments
     /// 位	
-    //~^ tabs_in_doc_comments
-    //~| empty_line_after_doc_comments
-
-
     ///   ^ Do not remove this tab character.
     ///   It was required to trigger the ICE.
     pub bar: u8,
diff --git a/tests/ui/crashes/ice-5835.stderr b/tests/ui/crashes/ice-5835.stderr
index b342b43d041..4ef91e4116b 100644
--- a/tests/ui/crashes/ice-5835.stderr
+++ b/tests/ui/crashes/ice-5835.stderr
@@ -1,5 +1,5 @@
 error: using tabs in doc comments is not recommended
-  --> tests/ui/crashes/ice-5835.rs:3:10
+  --> tests/ui/crashes/ice-5835.rs:4:10
    |
 LL |     /// 位    
    |           ^^^^ help: consider using four spaces per tab
@@ -7,21 +7,5 @@ LL |     /// 位
    = note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]`
 
-error: empty lines after doc comment
-  --> tests/ui/crashes/ice-5835.rs:3:5
-   |
-LL | /     /// 位    
-...  |
-LL | |
-   | |_^
-   |
-   = note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
-   = help: if the empty lines are unintentional remove them
-help: if the doc comment should not document `bar` comment it out
-   |
-LL |     // /// 位    
-   |     ++
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
diff --git a/tests/ui/crashes/if_same_then_else.rs b/tests/ui/crashes/if_same_then_else.rs
index 58ee751948b..8a27b3c6d47 100644
--- a/tests/ui/crashes/if_same_then_else.rs
+++ b/tests/ui/crashes/if_same_then_else.rs
@@ -1,6 +1,5 @@
 //@ check-pass
 
-#![allow(clippy::comparison_chain)]
 #![deny(clippy::if_same_then_else)]
 
 // Test for https://github.com/rust-lang/rust-clippy/issues/2426
diff --git a/tests/ui/crashes/needless_pass_by_value-w-late-bound.stderr b/tests/ui/crashes/needless_pass_by_value-w-late-bound.stderr
index 28479570006..b4fb1222539 100644
--- a/tests/ui/crashes/needless_pass_by_value-w-late-bound.stderr
+++ b/tests/ui/crashes/needless_pass_by_value-w-late-bound.stderr
@@ -2,7 +2,7 @@ error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/crashes/needless_pass_by_value-w-late-bound.rs:7:12
    |
 LL | fn test(x: Foo<'_>) {}
-   |            ^^^^^^^ help: consider taking a reference instead: `&Foo<'_>`
+   |            ^^^^^^^
    |
 help: or consider marking this type as `Copy`
   --> tests/ui/crashes/needless_pass_by_value-w-late-bound.rs:5:1
@@ -11,6 +11,10 @@ LL | struct Foo<'a>(&'a [(); 100]);
    | ^^^^^^^^^^^^^^
    = note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_value)]`
+help: consider taking a reference instead
+   |
+LL | fn test(x: &Foo<'_>) {}
+   |            +
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/create_dir.stderr b/tests/ui/create_dir.stderr
index 2aba2944aa6..51d6ac686e0 100644
--- a/tests/ui/create_dir.stderr
+++ b/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:12: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/tests/ui/dbg_macro/dbg_macro.stderr b/tests/ui/dbg_macro/dbg_macro.stderr
index 83b497a539c..cd6dce584a2 100644
--- a/tests/ui/dbg_macro/dbg_macro.stderr
+++ b/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:14: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:26: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:29: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:51: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:58: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:61: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:64: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:46: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:94: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:100: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:107: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:114: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:117: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/tests/ui/dbg_macro/dbg_macro_unfixable.stderr b/tests/ui/dbg_macro/dbg_macro_unfixable.stderr
index df053a7a5f2..afade6f08b3 100644
--- a/tests/ui/dbg_macro/dbg_macro_unfixable.stderr
+++ b/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:9: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:9: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:14: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:14: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/tests/ui/doc/doc-fixable.stderr b/tests/ui/doc/doc-fixable.stderr
index f630f72ca85..d67da75a230 100644
--- a/tests/ui/doc/doc-fixable.stderr
+++ b/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:12: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:15: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:15: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:18: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:20: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:22: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:24: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:39: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:47: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:62: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:91: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:109: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:118: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:122: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:125: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:127: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:135: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:149: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:161: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:166: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:167: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:180: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:181: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:215: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:240: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:264: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:264: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:269: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:276: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:281:5
diff --git a/tests/ui/doc/doc_comment_double_space_linebreaks.fixed b/tests/ui/doc/doc_comment_double_space_linebreaks.fixed
new file mode 100644
index 00000000000..6a616b2c7e1
--- /dev/null
+++ b/tests/ui/doc/doc_comment_double_space_linebreaks.fixed
@@ -0,0 +1,98 @@
+#![feature(custom_inner_attributes)]
+#![rustfmt::skip]
+
+#![warn(clippy::doc_comment_double_space_linebreaks)]
+#![allow(unused, clippy::empty_docs)]
+
+//~v doc_comment_double_space_linebreaks
+//! Should warn on double space linebreaks\
+//! in file/module doc comment
+
+/// Should not warn on single-line doc comments
+fn single_line() {}
+
+/// Should not warn on single-line doc comments
+/// split across multiple lines
+fn single_line_split() {}
+
+// Should not warn on normal comments
+
+// note: cargo fmt can remove double spaces from normal and block comments
+// Should not warn on normal comments  
+// with double spaces at the end of a line  
+
+#[doc = "This is a doc attribute, which should not be linted"]
+fn normal_comment() {
+   /*
+   Should not warn on block comments
+   */
+  
+  /*
+  Should not warn on block comments  
+  with double space at the end of a line
+  */
+}
+
+//~v doc_comment_double_space_linebreaks
+/// Should warn when doc comment uses double space\
+/// as a line-break, even when there are multiple\
+/// in a row
+fn double_space_doc_comment() {}
+
+/// Should not warn when back-slash is used \
+/// as a line-break
+fn back_slash_doc_comment() {}
+
+//~v doc_comment_double_space_linebreaks
+/// 🌹 are 🟥\
+/// 🌷 are 🟦\
+/// 📎 is 😎\
+/// and so are 🫵\
+/// (hopefully no formatting weirdness linting this)
+fn multi_byte_chars_tada() {}
+
+macro_rules! macro_that_makes_function {
+   () => {
+      /// Shouldn't lint on this!  
+      /// (hopefully)
+      fn my_macro_created_function() {}
+   }
+}
+
+macro_that_makes_function!();
+
+// dont lint when its alone on a line
+///  
+fn alone() {}
+
+/// | First column | Second column |  
+/// | ------------ | ------------- |  
+/// | Not a line   | break when    |  
+/// | after a line | in a table    |  
+fn table() {}
+
+/// ```text  
+/// It's also not a hard line break if  
+/// there's two spaces at the end of a  
+/// line in a block code.  
+/// ```  
+fn codeblock() {}
+
+/// It's also not a hard line break `if  
+/// there's` two spaces in the middle of inline code.  
+fn inline() {}
+
+/// It's also not a hard line break [when](  
+/// https://example.com) in a URL.  
+fn url() {}
+
+//~v doc_comment_double_space_linebreaks
+/// here we mix\
+/// double spaces\
+/// and also\
+/// adding backslash\
+/// to some of them\
+/// to see how that looks
+fn mixed() {}
+
+fn main() {}
diff --git a/tests/ui/doc/doc_comment_double_space_linebreaks.rs b/tests/ui/doc/doc_comment_double_space_linebreaks.rs
new file mode 100644
index 00000000000..e36cf7dea23
--- /dev/null
+++ b/tests/ui/doc/doc_comment_double_space_linebreaks.rs
@@ -0,0 +1,98 @@
+#![feature(custom_inner_attributes)]
+#![rustfmt::skip]
+
+#![warn(clippy::doc_comment_double_space_linebreaks)]
+#![allow(unused, clippy::empty_docs)]
+
+//~v doc_comment_double_space_linebreaks
+//! Should warn on double space linebreaks  
+//! in file/module doc comment
+
+/// Should not warn on single-line doc comments
+fn single_line() {}
+
+/// Should not warn on single-line doc comments
+/// split across multiple lines
+fn single_line_split() {}
+
+// Should not warn on normal comments
+
+// note: cargo fmt can remove double spaces from normal and block comments
+// Should not warn on normal comments  
+// with double spaces at the end of a line  
+
+#[doc = "This is a doc attribute, which should not be linted"]
+fn normal_comment() {
+   /*
+   Should not warn on block comments
+   */
+  
+  /*
+  Should not warn on block comments  
+  with double space at the end of a line
+  */
+}
+
+//~v doc_comment_double_space_linebreaks
+/// Should warn when doc comment uses double space  
+/// as a line-break, even when there are multiple  
+/// in a row
+fn double_space_doc_comment() {}
+
+/// Should not warn when back-slash is used \
+/// as a line-break
+fn back_slash_doc_comment() {}
+
+//~v doc_comment_double_space_linebreaks
+/// 🌹 are 🟥  
+/// 🌷 are 🟦  
+/// 📎 is 😎  
+/// and so are 🫵  
+/// (hopefully no formatting weirdness linting this)
+fn multi_byte_chars_tada() {}
+
+macro_rules! macro_that_makes_function {
+   () => {
+      /// Shouldn't lint on this!  
+      /// (hopefully)
+      fn my_macro_created_function() {}
+   }
+}
+
+macro_that_makes_function!();
+
+// dont lint when its alone on a line
+///  
+fn alone() {}
+
+/// | First column | Second column |  
+/// | ------------ | ------------- |  
+/// | Not a line   | break when    |  
+/// | after a line | in a table    |  
+fn table() {}
+
+/// ```text  
+/// It's also not a hard line break if  
+/// there's two spaces at the end of a  
+/// line in a block code.  
+/// ```  
+fn codeblock() {}
+
+/// It's also not a hard line break `if  
+/// there's` two spaces in the middle of inline code.  
+fn inline() {}
+
+/// It's also not a hard line break [when](  
+/// https://example.com) in a URL.  
+fn url() {}
+
+//~v doc_comment_double_space_linebreaks
+/// here we mix  
+/// double spaces\
+/// and also  
+/// adding backslash\
+/// to some of them  
+/// to see how that looks
+fn mixed() {}
+
+fn main() {}
diff --git a/tests/ui/doc/doc_comment_double_space_linebreaks.stderr b/tests/ui/doc/doc_comment_double_space_linebreaks.stderr
new file mode 100644
index 00000000000..08c6956c3d0
--- /dev/null
+++ b/tests/ui/doc/doc_comment_double_space_linebreaks.stderr
@@ -0,0 +1,50 @@
+error: doc comment uses two spaces for a hard line break
+  --> tests/ui/doc/doc_comment_double_space_linebreaks.rs:8:43
+   |
+LL | //! Should warn on double space linebreaks  
+   |                                           ^^
+   |
+   = help: replace this double space with a backslash: `\`
+   = note: `-D clippy::doc-comment-double-space-linebreaks` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::doc_comment_double_space_linebreaks)]`
+
+error: doc comment uses two spaces for a hard line break
+  --> tests/ui/doc/doc_comment_double_space_linebreaks.rs:37:51
+   |
+LL | /// Should warn when doc comment uses double space  
+   |                                                   ^^
+LL | /// as a line-break, even when there are multiple  
+   |                                                  ^^
+   |
+   = help: replace this double space with a backslash: `\`
+
+error: doc comment uses two spaces for a hard line break
+  --> tests/ui/doc/doc_comment_double_space_linebreaks.rs:47:12
+   |
+LL | /// 🌹 are 🟥  
+   |              ^^
+LL | /// 🌷 are 🟦  
+   |              ^^
+LL | /// 📎 is 😎  
+   |             ^^
+LL | /// and so are 🫵  
+   |                  ^^
+   |
+   = help: replace this double space with a backslash: `\`
+
+error: doc comment uses two spaces for a hard line break
+  --> tests/ui/doc/doc_comment_double_space_linebreaks.rs:90:16
+   |
+LL | /// here we mix  
+   |                ^^
+LL | /// double spaces\
+LL | /// and also  
+   |             ^^
+LL | /// adding backslash\
+LL | /// to some of them  
+   |                    ^^
+   |
+   = help: replace this double space with a backslash: `\`
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/doc/doc_markdown-issue_13097.stderr b/tests/ui/doc/doc_markdown-issue_13097.stderr
index ae68a767ec9..65b8f2ed80b 100644
--- a/tests/ui/doc/doc_markdown-issue_13097.stderr
+++ b/tests/ui/doc/doc_markdown-issue_13097.stderr
@@ -11,8 +11,9 @@ LL | #![deny(clippy::doc_markdown)]
    |         ^^^^^^^^^^^^^^^^^^^^
 help: try
    |
-LL |     /// `HumaNified`
-   |         ~~~~~~~~~~~~
+LL -     /// HumaNified
+LL +     /// `HumaNified`
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/doc/doc_nested_refdef_list_item.fixed b/tests/ui/doc/doc_nested_refdef_list_item.fixed
index fcfcfcc4073..065f4486e39 100644
--- a/tests/ui/doc/doc_nested_refdef_list_item.fixed
+++ b/tests/ui/doc/doc_nested_refdef_list_item.fixed
@@ -69,3 +69,11 @@ pub struct NotEmpty;
 /// - [link]\: notdef
 ///   inner text
 pub struct NotEmptyTight;
+
+/// ## Heading
+///
+/// - [x][] - Done
+//~^ ERROR: link reference defined in list item
+/// - [ ][] - Not Done
+//~^ ERROR: link reference defined in list item
+pub struct GithubCheckboxes;
diff --git a/tests/ui/doc/doc_nested_refdef_list_item.rs b/tests/ui/doc/doc_nested_refdef_list_item.rs
index 53368de4616..c7eab50c8b3 100644
--- a/tests/ui/doc/doc_nested_refdef_list_item.rs
+++ b/tests/ui/doc/doc_nested_refdef_list_item.rs
@@ -69,3 +69,11 @@ pub struct NotEmpty;
 /// - [link]\: notdef
 ///   inner text
 pub struct NotEmptyTight;
+
+/// ## Heading
+///
+/// - [x] - Done
+//~^ ERROR: link reference defined in list item
+/// - [ ] - Not Done
+//~^ ERROR: link reference defined in list item
+pub struct GithubCheckboxes;
diff --git a/tests/ui/doc/doc_nested_refdef_list_item.stderr b/tests/ui/doc/doc_nested_refdef_list_item.stderr
index 27314c7e968..5a815dabf4d 100644
--- a/tests/ui/doc/doc_nested_refdef_list_item.stderr
+++ b/tests/ui/doc/doc_nested_refdef_list_item.stderr
@@ -144,5 +144,29 @@ help: for an intra-doc link, add `[]` between the label and the colon
 LL | /// - [link][]: def "title"
    |             ++
 
-error: aborting due to 12 previous errors
+error: link reference defined in list item
+  --> tests/ui/doc/doc_nested_refdef_list_item.rs:75:7
+   |
+LL | /// - [x] - Done
+   |       ^^^
+   |
+   = help: link definitions are not shown in rendered documentation
+help: for an intra-doc link, add `[]` between the label and the colon
+   |
+LL | /// - [x][] - Done
+   |          ++
+
+error: link reference defined in list item
+  --> tests/ui/doc/doc_nested_refdef_list_item.rs:77:7
+   |
+LL | /// - [ ] - Not Done
+   |       ^^^
+   |
+   = help: link definitions are not shown in rendered documentation
+help: for an intra-doc link, add `[]` between the label and the colon
+   |
+LL | /// - [ ][] - Not Done
+   |          ++
+
+error: aborting due to 14 previous errors
 
diff --git a/tests/ui/doc/issue_10262.stderr b/tests/ui/doc/issue_10262.stderr
index f43d9551e94..f9ecb3de219 100644
--- a/tests/ui/doc/issue_10262.stderr
+++ b/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/tests/ui/doc/issue_12795.stderr b/tests/ui/doc/issue_12795.stderr
index 5700145ec8f..047de915ed4 100644
--- a/tests/ui/doc/issue_12795.stderr
+++ b/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/tests/ui/doc/issue_9473.stderr b/tests/ui/doc/issue_9473.stderr
index 35aa2884cc1..744c8dc8c83 100644
--- a/tests/ui/doc/issue_9473.stderr
+++ b/tests/ui/doc/issue_9473.stderr
@@ -8,8 +8,9 @@ LL | /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar].
    = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`
 help: try
    |
-LL | /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[`FooBar`].
-   |                                                          ~~~~~~~~
+LL - /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar].
+LL + /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[`FooBar`].
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/doc/link_adjacent.stderr b/tests/ui/doc/link_adjacent.stderr
index f09762fb6a0..27e8a73c708 100644
--- a/tests/ui/doc/link_adjacent.stderr
+++ b/tests/ui/doc/link_adjacent.stderr
@@ -9,8 +9,9 @@ LL | //! This is: [`first`](x)`second`
    = help: to override `-D warnings` add `#[allow(clippy::doc_link_code)]`
 help: wrap the entire group in `<code>` tags
    |
-LL | //! This is: <code>[first](x)second</code>
-   |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - //! This is: [`first`](x)`second`
+LL + //! This is: <code>[first](x)second</code>
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:16:16
@@ -21,8 +22,9 @@ LL | //! So is this `first`[`second`](x)
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | //! So is this <code>first[second](x)</code>
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - //! So is this `first`[`second`](x)
+LL + //! So is this <code>first[second](x)</code>
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:19:16
@@ -33,8 +35,9 @@ LL | //! So is this [`first`](x)[`second`](x)
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | //! So is this <code>[first](x)[second](x)</code>
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - //! So is this [`first`](x)[`second`](x)
+LL + //! So is this <code>[first](x)[second](x)</code>
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:22:16
@@ -45,8 +48,9 @@ LL | //! So is this [`first`](x)[`second`](x)[`third`](x)
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | //! So is this <code>[first](x)[second](x)[third](x)</code>
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - //! So is this [`first`](x)[`second`](x)[`third`](x)
+LL + //! So is this <code>[first](x)[second](x)[third](x)</code>
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:25:16
@@ -57,8 +61,9 @@ LL | //! So is this [`first`](x)`second`[`third`](x)
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | //! So is this <code>[first](x)second[third](x)</code>
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - //! So is this [`first`](x)`second`[`third`](x)
+LL + //! So is this <code>[first](x)second[third](x)</code>
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:38:14
@@ -69,8 +74,9 @@ LL | /// This is: [`first`](x)`second` arst
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | /// This is: <code>[first](x)second</code> arst
-   |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - /// This is: [`first`](x)`second` arst
+LL + /// This is: <code>[first](x)second</code> arst
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:41:16
@@ -81,8 +87,9 @@ LL | /// So is this `first`[`second`](x) arst
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | /// So is this <code>first[second](x)</code> arst
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - /// So is this `first`[`second`](x) arst
+LL + /// So is this <code>first[second](x)</code> arst
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:44:16
@@ -93,8 +100,9 @@ LL | /// So is this [`first`](x)[`second`](x) arst
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | /// So is this <code>[first](x)[second](x)</code> arst
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - /// So is this [`first`](x)[`second`](x) arst
+LL + /// So is this <code>[first](x)[second](x)</code> arst
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:47:16
@@ -105,8 +113,9 @@ LL | /// So is this [`first`](x)[`second`](x)[`third`](x) arst
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | /// So is this <code>[first](x)[second](x)[third](x)</code> arst
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - /// So is this [`first`](x)[`second`](x)[`third`](x) arst
+LL + /// So is this <code>[first](x)[second](x)[third](x)</code> arst
+   |
 
 error: code link adjacent to code text
   --> tests/ui/doc/link_adjacent.rs:50:16
@@ -117,8 +126,9 @@ LL | /// So is this [`first`](x)`second`[`third`](x) arst
    = help: separate code snippets will be shown with a gap
 help: wrap the entire group in `<code>` tags
    |
-LL | /// So is this <code>[first](x)second[third](x)</code> arst
-   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL - /// So is this [`first`](x)`second`[`third`](x) arst
+LL + /// So is this <code>[first](x)second[third](x)</code> arst
+   |
 
 error: aborting due to 10 previous errors
 
diff --git a/tests/ui/doc/unbalanced_ticks.rs b/tests/ui/doc/unbalanced_ticks.rs
index 8adbb1f7f71..76befb15db8 100644
--- a/tests/ui/doc/unbalanced_ticks.rs
+++ b/tests/ui/doc/unbalanced_ticks.rs
@@ -5,22 +5,20 @@
 #![warn(clippy::doc_markdown)]
 
 /// This is a doc comment with `unbalanced_tick marks and several words that
-//~^ empty_line_after_doc_comments
-
+//~^ doc_markdown
 /// should be `encompassed_by` tick marks because they `contain_underscores`.
 /// Because of the initial `unbalanced_tick` pair, the error message is
 /// very `confusing_and_misleading`.
 fn main() {}
 
 /// This paragraph has `unbalanced_tick marks and should stop_linting.
-//~^ empty_line_after_doc_comments
-
+//~^ doc_markdown
 ///
 /// This paragraph is fine and should_be linted normally.
-
+//~^ doc_markdown
 ///
 /// Double unbalanced backtick from ``here to here` should lint.
-
+//~^ doc_markdown
 ///
 /// Double balanced back ticks ``start end`` is fine.
 fn multiple_paragraphs() {}
@@ -34,16 +32,15 @@ fn in_code_block() {}
 /// # `Fine`
 ///
 /// ## not_fine
-//~^ empty_line_after_doc_comments
-
+//~^ doc_markdown
 ///
 /// ### `unbalanced
-
+//~^ doc_markdown
 ///
 /// - This `item has unbalanced tick marks
-
+//~^ doc_markdown
 /// - This item needs backticks_here
-
+//~^ doc_markdown
 fn other_markdown() {}
 
 #[rustfmt::skip]
@@ -54,8 +51,7 @@ fn other_markdown() {}
 fn issue_7421() {}
 
 /// `
-//~^ empty_line_after_doc_comments
-
+//~^ doc_markdown
 fn escape_0() {}
 
 /// Escaped \` backticks don't count.
@@ -65,9 +61,25 @@ fn escape_1() {}
 fn escape_2() {}
 
 /// Escaped \` ` backticks don't count, but unescaped backticks do.
-//~^ empty_line_after_doc_comments
-
+//~^ doc_markdown
 fn escape_3() {}
 
 /// Backslashes ` \` within code blocks don't count.
 fn escape_4() {}
+
+trait Foo {
+    fn bar();
+}
+
+struct Bar;
+impl Foo for Bar {
+    // NOTE: false positive
+    /// Returns an `Option<Month>` from a i64, assuming a 1-index, January = 1.
+    ///
+    /// `Month::from_i64(n: i64)`: | `1`                  | `2`                   | ... | `12`
+    /// ---------------------------| -------------------- | --------------------- | ... | -----
+    /// ``:                        | Some(Month::January) | Some(Month::February) | ... |
+    /// Some(Month::December)
+    //~^^^^ doc_markdown
+    fn bar() {}
+}
diff --git a/tests/ui/doc/unbalanced_ticks.stderr b/tests/ui/doc/unbalanced_ticks.stderr
index 563d8637648..4114a823822 100644
--- a/tests/ui/doc/unbalanced_ticks.stderr
+++ b/tests/ui/doc/unbalanced_ticks.stderr
@@ -1,112 +1,113 @@
-error: empty line after doc comment
-  --> tests/ui/doc/unbalanced_ticks.rs:7:1
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:7:5
    |
-LL | / /// This is a doc comment with `unbalanced_tick marks and several words that
+LL |   /// This is a doc comment with `unbalanced_tick marks and several words that
+   |  _____^
 LL | |
-LL | |
-   | |_^
-...
-LL |   fn main() {}
-   |   --------- the comment documents this function
-   |
-   = note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `main` comment it out
-   |
-LL | // /// This is a doc comment with `unbalanced_tick marks and several words that
-   | ++
+LL | | /// should be `encompassed_by` tick marks because they `contain_underscores`.
+LL | | /// Because of the initial `unbalanced_tick` pair, the error message is
+LL | | /// very `confusing_and_misleading`.
+   | |____________________________________^
+   |
+   = help: a backtick may be missing a pair
+   = note: `-D clippy::doc-markdown` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`
 
-error: empty lines after doc comment
-  --> tests/ui/doc/unbalanced_ticks.rs:15:1
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:14:5
    |
-LL | / /// This paragraph has `unbalanced_tick marks and should stop_linting.
-LL | |
-LL | |
-LL | | ///
-...  |
-LL | | /// Double unbalanced backtick from ``here to here` should lint.
-LL | |
-   | |_^
-...
-LL |   fn multiple_paragraphs() {}
-   |   ------------------------ the comment documents this function
-   |
-   = help: if the empty lines are unintentional remove them
-help: if the doc comment should not document `multiple_paragraphs` comment it out
-   |
-LL ~ // /// This paragraph has `unbalanced_tick marks and should stop_linting.
-LL |
-LL |
-LL ~ // ///
-LL ~ // /// This paragraph is fine and should_be linted normally.
-LL |
-LL ~ // ///
-LL ~ // /// Double unbalanced backtick from ``here to here` should lint.
+LL | /// This paragraph has `unbalanced_tick marks and should stop_linting.
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
+   = help: a backtick may be missing a pair
 
-error: empty lines after doc comment
-  --> tests/ui/doc/unbalanced_ticks.rs:36:1
+error: item in documentation is missing backticks
+  --> tests/ui/doc/unbalanced_ticks.rs:17:32
    |
-LL | / /// ## not_fine
-LL | |
-LL | |
-LL | | ///
-...  |
-LL | | /// - This item needs backticks_here
-LL | |
-   | |_^
-LL |   fn other_markdown() {}
-   |   ------------------- the comment documents this function
-   |
-   = help: if the empty lines are unintentional remove them
-help: if the doc comment should not document `other_markdown` comment it out
-   |
-LL ~ // /// # `Fine`
-LL ~ // ///
-LL ~ // /// ## not_fine
-LL |
-LL |
-LL ~ // ///
-LL ~ // /// ### `unbalanced
-LL |
-LL ~ // ///
-LL ~ // /// - This `item has unbalanced tick marks
-LL |
-LL ~ // /// - This item needs backticks_here
+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.
    |
 
-error: empty line after doc comment
-  --> tests/ui/doc/unbalanced_ticks.rs:56:1
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:20:5
    |
-LL | / /// `
-LL | |
-LL | |
-   | |_^
-LL |   fn escape_0() {}
-   |   ------------- the comment documents this function
+LL | /// Double unbalanced backtick from ``here to here` should lint.
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: a backtick may be missing a pair
+
+error: item in documentation is missing backticks
+  --> tests/ui/doc/unbalanced_ticks.rs:34:8
    |
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `escape_0` comment it out
+LL | /// ## not_fine
+   |        ^^^^^^^^
+   |
+help: try
+   |
+LL - /// ## not_fine
+LL + /// ## `not_fine`
    |
-LL | // /// `
-   | ++
 
-error: empty line after doc comment
-  --> tests/ui/doc/unbalanced_ticks.rs:67:1
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:37:5
    |
-LL | / /// Escaped \` ` backticks don't count, but unescaped backticks do.
-LL | |
-LL | |
-   | |_^
-LL |   fn escape_3() {}
-   |   ------------- the comment documents this function
+LL | /// ### `unbalanced
+   |     ^^^^^^^^^^^^^^^
+   |
+   = help: a backtick may be missing a pair
+
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:40:5
+   |
+LL | /// - This `item has unbalanced tick marks
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: a backtick may be missing a pair
+
+error: item in documentation is missing backticks
+  --> tests/ui/doc/unbalanced_ticks.rs:42:23
+   |
+LL | /// - This item needs backticks_here
+   |                       ^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL - /// - This item needs backticks_here
+LL + /// - This item needs `backticks_here`
+   |
+
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:53:5
+   |
+LL | /// `
+   |     ^
+   |
+   = help: a backtick may be missing a pair
+
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:63:5
+   |
+LL | /// Escaped \` ` backticks don't count, but unescaped backticks do.
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: a backtick may be missing a pair
+
+error: backticks are unbalanced
+  --> tests/ui/doc/unbalanced_ticks.rs:79:9
    |
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `escape_3` comment it out
+LL |       /// `Month::from_i64(n: i64)`: | `1`                  | `2`                   | ... | `12`
+   |  _________^
+LL | |     /// ---------------------------| -------------------- | --------------------- | ... | -----
+LL | |     /// ``:                        | Some(Month::January) | Some(Month::February) | ... |
+LL | |     /// Some(Month::December)
+   | |_____________________________^
    |
-LL | // /// Escaped \` ` backticks don't count, but unescaped backticks do.
-   | ++
+   = help: a backtick may be missing a pair
 
-error: aborting due to 5 previous errors
+error: aborting due to 11 previous errors
 
diff --git a/tests/ui/doc_link_with_quotes.rs b/tests/ui/doc_link_with_quotes.rs
index e2614e6b431..0c0e273da6d 100644
--- a/tests/ui/doc_link_with_quotes.rs
+++ b/tests/ui/doc_link_with_quotes.rs
@@ -1,5 +1,4 @@
 #![warn(clippy::doc_link_with_quotes)]
-#![allow(clippy::empty_line_after_doc_comments)]
 
 fn main() {
     foo()
diff --git a/tests/ui/doc_link_with_quotes.stderr b/tests/ui/doc_link_with_quotes.stderr
index 1c1d8e0ffd5..47c60390310 100644
--- a/tests/ui/doc_link_with_quotes.stderr
+++ b/tests/ui/doc_link_with_quotes.stderr
@@ -1,5 +1,5 @@
 error: possible intra-doc link using quotes instead of backticks
-  --> tests/ui/doc_link_with_quotes.rs:8:12
+  --> tests/ui/doc_link_with_quotes.rs:7:12
    |
 LL | /// Calls ['bar'] uselessly
    |            ^^^^^
@@ -8,7 +8,7 @@ LL | /// Calls ['bar'] uselessly
    = help: to override `-D warnings` add `#[allow(clippy::doc_link_with_quotes)]`
 
 error: possible intra-doc link using quotes instead of backticks
-  --> tests/ui/doc_link_with_quotes.rs:14:12
+  --> tests/ui/doc_link_with_quotes.rs:13:12
    |
 LL | /// Calls ["bar"] uselessly
    |            ^^^^^
diff --git a/tests/ui/double_ended_iterator_last.fixed b/tests/ui/double_ended_iterator_last.fixed
index 08f3d490715..17d0d71a885 100644
--- a/tests/ui/double_ended_iterator_last.fixed
+++ b/tests/ui/double_ended_iterator_last.fixed
@@ -2,8 +2,7 @@
 
 // Typical case
 pub fn last_arg(s: &str) -> Option<&str> {
-    s.split(' ').next_back()
-    //~^ double_ended_iterator_last
+    s.split(' ').next_back() //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
 }
 
 fn main() {
@@ -20,8 +19,7 @@ fn main() {
             Some(())
         }
     }
-    let _ = DeIterator.next_back();
-    //~^ double_ended_iterator_last
+    let _ = DeIterator.next_back(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
     // Should not apply to other methods of Iterator
     let _ = DeIterator.count();
 
@@ -53,3 +51,42 @@ fn main() {
     }
     let _ = CustomLast.last();
 }
+
+fn issue_14139() {
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let _ = subindex.next_back(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let _ = subindex.next_back(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let subindex = &mut subindex;
+    let _ = subindex.next_back(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let subindex = &mut subindex;
+    let _ = subindex.next_back(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let (mut subindex, _) = (index.by_ref().take(3), 42);
+    let _ = subindex.next_back(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+}
+
+fn drop_order() {
+    struct S(&'static str);
+    impl std::ops::Drop for S {
+        fn drop(&mut self) {
+            println!("Dropping {}", self.0);
+        }
+    }
+
+    let v = vec![S("one"), S("two"), S("three")];
+    let mut v = v.into_iter();
+    println!("Last element is {}", v.next_back().unwrap().0);
+    //~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+    println!("Done");
+}
diff --git a/tests/ui/double_ended_iterator_last.rs b/tests/ui/double_ended_iterator_last.rs
index 2c2f311805e..41bc669b171 100644
--- a/tests/ui/double_ended_iterator_last.rs
+++ b/tests/ui/double_ended_iterator_last.rs
@@ -2,8 +2,7 @@
 
 // Typical case
 pub fn last_arg(s: &str) -> Option<&str> {
-    s.split(' ').last()
-    //~^ double_ended_iterator_last
+    s.split(' ').last() //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
 }
 
 fn main() {
@@ -20,8 +19,7 @@ fn main() {
             Some(())
         }
     }
-    let _ = DeIterator.last();
-    //~^ double_ended_iterator_last
+    let _ = DeIterator.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
     // Should not apply to other methods of Iterator
     let _ = DeIterator.count();
 
@@ -53,3 +51,42 @@ fn main() {
     }
     let _ = CustomLast.last();
 }
+
+fn issue_14139() {
+    let mut index = [true, true, false, false, false, true].iter();
+    let subindex = index.by_ref().take(3);
+    let _ = subindex.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let _ = subindex.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let subindex = &mut subindex;
+    let _ = subindex.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let mut subindex = index.by_ref().take(3);
+    let subindex = &mut subindex;
+    let _ = subindex.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+
+    let mut index = [true, true, false, false, false, true].iter();
+    let (subindex, _) = (index.by_ref().take(3), 42);
+    let _ = subindex.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+}
+
+fn drop_order() {
+    struct S(&'static str);
+    impl std::ops::Drop for S {
+        fn drop(&mut self) {
+            println!("Dropping {}", self.0);
+        }
+    }
+
+    let v = vec![S("one"), S("two"), S("three")];
+    let v = v.into_iter();
+    println!("Last element is {}", v.last().unwrap().0);
+    //~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+    println!("Done");
+}
diff --git a/tests/ui/double_ended_iterator_last.stderr b/tests/ui/double_ended_iterator_last.stderr
index ea1962176a6..1702a24d7a0 100644
--- a/tests/ui/double_ended_iterator_last.stderr
+++ b/tests/ui/double_ended_iterator_last.stderr
@@ -1,17 +1,82 @@
 error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
-  --> tests/ui/double_ended_iterator_last.rs:5:18
+  --> tests/ui/double_ended_iterator_last.rs:5:5
    |
 LL |     s.split(' ').last()
-   |                  ^^^^^^ help: try: `next_back()`
+   |     ^^^^^^^^^^^^^------
+   |                  |
+   |                  help: try: `next_back()`
    |
    = note: `-D clippy::double-ended-iterator-last` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::double_ended_iterator_last)]`
 
 error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
-  --> tests/ui/double_ended_iterator_last.rs:23:24
+  --> tests/ui/double_ended_iterator_last.rs:22:13
    |
 LL |     let _ = DeIterator.last();
-   |                        ^^^^^^ help: try: `next_back()`
+   |             ^^^^^^^^^^^------
+   |                        |
+   |                        help: try: `next_back()`
 
-error: aborting due to 2 previous errors
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last.rs:58:13
+   |
+LL |     let _ = subindex.last();
+   |             ^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL ~     let mut subindex = index.by_ref().take(3);
+LL ~     let _ = subindex.next_back();
+   |
+
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last.rs:62:13
+   |
+LL |     let _ = subindex.last();
+   |             ^^^^^^^^^------
+   |                      |
+   |                      help: try: `next_back()`
+
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last.rs:67:13
+   |
+LL |     let _ = subindex.last();
+   |             ^^^^^^^^^------
+   |                      |
+   |                      help: try: `next_back()`
+
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last.rs:72:13
+   |
+LL |     let _ = subindex.last();
+   |             ^^^^^^^^^------
+   |                      |
+   |                      help: try: `next_back()`
+
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last.rs:76:13
+   |
+LL |     let _ = subindex.last();
+   |             ^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL ~     let (mut subindex, _) = (index.by_ref().take(3), 42);
+LL ~     let _ = subindex.next_back();
+   |
+
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last.rs:89:36
+   |
+LL |     println!("Last element is {}", v.last().unwrap().0);
+   |                                    ^^^^^^^^
+   |
+   = note: this change will alter drop order which may be undesirable
+help: try
+   |
+LL ~     let mut v = v.into_iter();
+LL ~     println!("Last element is {}", v.next_back().unwrap().0);
+   |
+
+error: aborting due to 8 previous errors
 
diff --git a/tests/ui/double_ended_iterator_last_unfixable.rs b/tests/ui/double_ended_iterator_last_unfixable.rs
new file mode 100644
index 00000000000..3f125c7f20c
--- /dev/null
+++ b/tests/ui/double_ended_iterator_last_unfixable.rs
@@ -0,0 +1,23 @@
+//@no-rustfix
+#![warn(clippy::double_ended_iterator_last)]
+
+fn main() {
+    let mut index = [true, true, false, false, false, true].iter();
+    let subindex = (index.by_ref().take(3), 42);
+    let _ = subindex.0.last(); //~ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+}
+
+fn drop_order() {
+    struct S(&'static str);
+    impl std::ops::Drop for S {
+        fn drop(&mut self) {
+            println!("Dropping {}", self.0);
+        }
+    }
+
+    let v = vec![S("one"), S("two"), S("three")];
+    let v = (v.into_iter(), 42);
+    println!("Last element is {}", v.0.last().unwrap().0);
+    //~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
+    println!("Done");
+}
diff --git a/tests/ui/double_ended_iterator_last_unfixable.stderr b/tests/ui/double_ended_iterator_last_unfixable.stderr
new file mode 100644
index 00000000000..f4be757d00d
--- /dev/null
+++ b/tests/ui/double_ended_iterator_last_unfixable.stderr
@@ -0,0 +1,33 @@
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last_unfixable.rs:7:13
+   |
+LL |     let _ = subindex.0.last();
+   |             ^^^^^^^^^^^------
+   |                        |
+   |                        help: try: `next_back()`
+   |
+note: this must be made mutable to use `.next_back()`
+  --> tests/ui/double_ended_iterator_last_unfixable.rs:7:13
+   |
+LL |     let _ = subindex.0.last();
+   |             ^^^^^^^^^^
+   = note: `-D clippy::double-ended-iterator-last` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::double_ended_iterator_last)]`
+
+error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
+  --> tests/ui/double_ended_iterator_last_unfixable.rs:20:36
+   |
+LL |     println!("Last element is {}", v.0.last().unwrap().0);
+   |                                    ^^^^------
+   |                                        |
+   |                                        help: try: `next_back()`
+   |
+   = note: this change will alter drop order which may be undesirable
+note: this must be made mutable to use `.next_back()`
+  --> tests/ui/double_ended_iterator_last_unfixable.rs:20:36
+   |
+LL |     println!("Last element is {}", v.0.last().unwrap().0);
+   |                                    ^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/eager_transmute.stderr b/tests/ui/eager_transmute.stderr
index e31c12eb522..54850d110eb 100644
--- a/tests/ui/eager_transmute.stderr
+++ b/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:28: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:30: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:32: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:35:68
@@ -52,8 +56,9 @@ LL |     let _: Option<Opcode> = (op > 0 && op < 10).then_some(unsafe { std::mem
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (op > 0 && op < 10).then(|| unsafe { std::mem::transmute(op) });
-   |                                                 ~~~~ ++
+LL -     let _: Option<Opcode> = (op > 0 && op < 10).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (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:37:86
@@ -63,8 +68,9 @@ LL |     let _: Option<Opcode> = (op > 0 && op < 10 && unrelated == 0).then_some
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (op > 0 && op < 10 && unrelated == 0).then(|| unsafe { std::mem::transmute(op) });
-   |                                                                   ~~~~ ++
+LL -     let _: Option<Opcode> = (op > 0 && op < 10 && unrelated == 0).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (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:41:84
@@ -74,8 +80,9 @@ LL |     let _: Option<Opcode> = (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<Opcode> = (op2.foo[0] > 0 && op2.foo[0] < 10).then(|| unsafe { std::mem::transmute(op2.foo[0]) });
-   |                                                                 ~~~~ ++
+LL -     let _: Option<Opcode> = (op2.foo[0] > 0 && op2.foo[0] < 10).then_some(unsafe { std::mem::transmute(op2.foo[0]) });
+LL +     let _: Option<Opcode> = (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:54:70
@@ -85,8 +92,9 @@ LL |     let _: Option<Opcode> = (1..=3).contains(&op).then_some(unsafe { std::m
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (1..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
-   |                                                   ~~~~ ++
+LL -     let _: Option<Opcode> = (1..=3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (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:56:83
@@ -96,8 +104,9 @@ LL |     let _: Option<Opcode> = ((1..=3).contains(&op) || op == 4).then_some(un
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = ((1..=3).contains(&op) || op == 4).then(|| unsafe { std::mem::transmute(op) });
-   |                                                                ~~~~ ++
+LL -     let _: Option<Opcode> = ((1..=3).contains(&op) || op == 4).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = ((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:58:69
@@ -107,8 +116,9 @@ LL |     let _: Option<Opcode> = (1..3).contains(&op).then_some(unsafe { std::me
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (1..3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
-   |                                                  ~~~~ ++
+LL -     let _: Option<Opcode> = (1..3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (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:60:68
@@ -118,8 +128,9 @@ LL |     let _: Option<Opcode> = (1..).contains(&op).then_some(unsafe { std::mem
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (1..).contains(&op).then(|| unsafe { std::mem::transmute(op) });
-   |                                                 ~~~~ ++
+LL -     let _: Option<Opcode> = (1..).contains(&op).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (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:62:68
@@ -129,8 +140,9 @@ LL |     let _: Option<Opcode> = (..3).contains(&op).then_some(unsafe { std::mem
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (..3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
-   |                                                 ~~~~ ++
+LL -     let _: Option<Opcode> = (..3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (..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:64:69
@@ -140,8 +152,9 @@ LL |     let _: Option<Opcode> = (..=3).contains(&op).then_some(unsafe { std::me
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<Opcode> = (..=3).contains(&op).then(|| unsafe { std::mem::transmute(op) });
-   |                                                  ~~~~ ++
+LL -     let _: Option<Opcode> = (..=3).contains(&op).then_some(unsafe { std::mem::transmute(op) });
+LL +     let _: Option<Opcode> = (..=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:74: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:104:62
@@ -162,8 +176,9 @@ LL |     let _: Option<NonZero<u8>> = (v1 > 0).then_some(unsafe { std::mem::tran
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<NonZero<u8>> = (v1 > 0).then(|| unsafe { std::mem::transmute(v1) });
-   |                                           ~~~~ ++
+LL -     let _: Option<NonZero<u8>> = (v1 > 0).then_some(unsafe { std::mem::transmute(v1) });
+LL +     let _: Option<NonZero<u8>> = (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:111:86
@@ -173,8 +188,9 @@ LL |     let _: Option<NonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).then_some
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<NonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) });
-   |                                                                   ~~~~ ++
+LL -     let _: Option<NonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).then_some(unsafe { std::mem::transmute(v2) });
+LL +     let _: Option<NonMaxU8> = (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:118:93
@@ -184,8 +200,9 @@ LL |     let _: Option<NonZeroNonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).th
    |
 help: consider using `bool::then` to only transmute if the condition holds
    |
-LL |     let _: Option<NonZeroNonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) });
-   |                                                                          ~~~~ ++
+LL -     let _: Option<NonZeroNonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).then_some(unsafe { std::mem::transmute(v2) });
+LL +     let _: Option<NonZeroNonMaxU8> = (v2 < NonZero::new(255u8).unwrap()).then(|| unsafe { std::mem::transmute(v2) });
+   |
 
 error: aborting due to 17 previous errors
 
diff --git a/tests/ui/elidable_lifetime_names.fixed b/tests/ui/elidable_lifetime_names.fixed
new file mode 100644
index 00000000000..abeee5c4cef
--- /dev/null
+++ b/tests/ui/elidable_lifetime_names.fixed
@@ -0,0 +1,194 @@
+#![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)]
+
+type Ref<'r> = &'r u8;
+
+// No error; same lifetime on two params.
+fn lifetime_param_1<'a>(_x: Ref<'a>, _y: &'a u8) {}
+
+//~v ERROR: could be elided: 'a, 'b
+fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {}
+
+// No error; bounded lifetime.
+fn lifetime_param_3<'a, 'b: 'a>(_x: Ref<'a>, _y: &'b u8) {}
+
+// No error; bounded lifetime.
+fn lifetime_param_4<'a, 'b>(_x: Ref<'a>, _y: &'b u8)
+where
+    'b: 'a,
+{
+}
+
+struct Lt<'a, I: 'static> {
+    x: &'a I,
+}
+
+// No error; fn bound references `'a`.
+fn fn_bound<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
+where
+    F: Fn(Lt<'a, I>) -> Lt<'a, I>,
+{
+    unreachable!()
+}
+
+//~v ERROR: could be elided: 'a
+fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I>
+where
+    for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>,
+{
+    unreachable!()
+}
+
+struct Foo<'a>(&'a u8);
+
+//~v ERROR: could be elided: 'a
+fn struct_with_lt(_foo: Foo<'_>) -> &str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (named on the reference, anonymous on `Foo`).
+fn struct_with_lt2<'a>(_foo: &'a Foo) -> &'a str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (anonymous on the reference, named on `Foo`).
+fn struct_with_lt3<'a>(_foo: &Foo<'a>) -> &'a str {
+    unimplemented!()
+}
+
+//~v ERROR: could be elided: 'b
+fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str {
+    unimplemented!()
+}
+
+type FooAlias<'a> = Foo<'a>;
+
+//~v ERROR: could be elided: 'a
+fn alias_with_lt(_foo: FooAlias<'_>) -> &str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (named on the reference, anonymous on `FooAlias`).
+fn alias_with_lt2<'a>(_foo: &'a FooAlias) -> &'a str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (anonymous on the reference, named on `FooAlias`).
+fn alias_with_lt3<'a>(_foo: &FooAlias<'a>) -> &'a str {
+    unimplemented!()
+}
+
+//~v ERROR: could be elided: 'b
+fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str {
+    unimplemented!()
+}
+
+// Issue #3284: give hint regarding lifetime in return type.
+struct Cow<'a> {
+    x: &'a str,
+}
+
+//~v ERROR: could be elided: 'a
+fn out_return_type_lts(e: &str) -> Cow<'_> {
+    unimplemented!()
+}
+
+mod issue2944 {
+    trait Foo {}
+    struct Bar;
+    struct Baz<'a> {
+        bar: &'a Bar,
+    }
+
+    //~v ERROR: could be elided: 'a
+    impl Foo for Baz<'_> {}
+    impl Bar {
+        //~v ERROR: could be elided: 'a
+        fn baz(&self) -> impl Foo + '_ {
+            Baz { bar: self }
+        }
+    }
+}
+
+mod issue13923 {
+    struct Py<'py> {
+        data: &'py str,
+    }
+
+    enum Content<'t, 'py> {
+        Py(Py<'py>),
+        T1(&'t str),
+        T2(&'t str),
+    }
+
+    enum ContentString<'t> {
+        T1(&'t str),
+        T2(&'t str),
+    }
+
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` cannot be elided
+        fn map_content1(self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(content) => Content::T2(f(content)),
+            }
+        }
+    }
+
+    //~v ERROR: could be elided: 'py
+    impl<'t> ContentString<'t> {
+        // `'py` can be elided because of `&self`
+        fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(content) => Content::T2(f(content)),
+            }
+        }
+    }
+
+    //~v ERROR: could be elided: 'py
+    impl<'t> ContentString<'t> {
+        // `'py` can be elided because of `&'_ self`
+        fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(content) => Content::T2(f(content)),
+            }
+        }
+    }
+
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` should not be elided as the default lifetime, even if working, could be named as `'t`
+        fn map_content4(self, f: impl FnOnce(&'t str) -> &'t str, o: &'t str) -> Content<'t, 'py> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(_) => Content::T2(o),
+            }
+        }
+    }
+
+    //~v ERROR: could be elided: 'py
+    impl<'t> ContentString<'t> {
+        // `'py` can be elided because of `&Self`
+        fn map_content5(
+            self: std::pin::Pin<&Self>,
+            f: impl FnOnce(&'t str) -> &'t str,
+            o: &'t str,
+        ) -> Content<'t, '_> {
+            match *self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(_) => Content::T2(o),
+            }
+        }
+    }
+
+    struct Cx<'a, 'b> {
+        a: &'a u32,
+        b: &'b u32,
+    }
+
+    // `'c` cannot be elided because we have several input lifetimes
+    fn one_explicit<'b>(x: Cx<'_, 'b>) -> &'b u32 {
+        x.b
+    }
+}
diff --git a/tests/ui/elidable_lifetime_names.rs b/tests/ui/elidable_lifetime_names.rs
new file mode 100644
index 00000000000..fae3577a8e9
--- /dev/null
+++ b/tests/ui/elidable_lifetime_names.rs
@@ -0,0 +1,194 @@
+#![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)]
+
+type Ref<'r> = &'r u8;
+
+// No error; same lifetime on two params.
+fn lifetime_param_1<'a>(_x: Ref<'a>, _y: &'a u8) {}
+
+//~v ERROR: could be elided: 'a, 'b
+fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
+
+// No error; bounded lifetime.
+fn lifetime_param_3<'a, 'b: 'a>(_x: Ref<'a>, _y: &'b u8) {}
+
+// No error; bounded lifetime.
+fn lifetime_param_4<'a, 'b>(_x: Ref<'a>, _y: &'b u8)
+where
+    'b: 'a,
+{
+}
+
+struct Lt<'a, I: 'static> {
+    x: &'a I,
+}
+
+// No error; fn bound references `'a`.
+fn fn_bound<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
+where
+    F: Fn(Lt<'a, I>) -> Lt<'a, I>,
+{
+    unreachable!()
+}
+
+//~v ERROR: could be elided: 'a
+fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
+where
+    for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>,
+{
+    unreachable!()
+}
+
+struct Foo<'a>(&'a u8);
+
+//~v ERROR: could be elided: 'a
+fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (named on the reference, anonymous on `Foo`).
+fn struct_with_lt2<'a>(_foo: &'a Foo) -> &'a str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (anonymous on the reference, named on `Foo`).
+fn struct_with_lt3<'a>(_foo: &Foo<'a>) -> &'a str {
+    unimplemented!()
+}
+
+//~v ERROR: could be elided: 'b
+fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
+    unimplemented!()
+}
+
+type FooAlias<'a> = Foo<'a>;
+
+//~v ERROR: could be elided: 'a
+fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (named on the reference, anonymous on `FooAlias`).
+fn alias_with_lt2<'a>(_foo: &'a FooAlias) -> &'a str {
+    unimplemented!()
+}
+
+// No warning; two input lifetimes (anonymous on the reference, named on `FooAlias`).
+fn alias_with_lt3<'a>(_foo: &FooAlias<'a>) -> &'a str {
+    unimplemented!()
+}
+
+//~v ERROR: could be elided: 'b
+fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
+    unimplemented!()
+}
+
+// Issue #3284: give hint regarding lifetime in return type.
+struct Cow<'a> {
+    x: &'a str,
+}
+
+//~v ERROR: could be elided: 'a
+fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
+    unimplemented!()
+}
+
+mod issue2944 {
+    trait Foo {}
+    struct Bar;
+    struct Baz<'a> {
+        bar: &'a Bar,
+    }
+
+    //~v ERROR: could be elided: 'a
+    impl<'a> Foo for Baz<'a> {}
+    impl Bar {
+        //~v ERROR: could be elided: 'a
+        fn baz<'a>(&'a self) -> impl Foo + 'a {
+            Baz { bar: self }
+        }
+    }
+}
+
+mod issue13923 {
+    struct Py<'py> {
+        data: &'py str,
+    }
+
+    enum Content<'t, 'py> {
+        Py(Py<'py>),
+        T1(&'t str),
+        T2(&'t str),
+    }
+
+    enum ContentString<'t> {
+        T1(&'t str),
+        T2(&'t str),
+    }
+
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` cannot be elided
+        fn map_content1(self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(content) => Content::T2(f(content)),
+            }
+        }
+    }
+
+    //~v ERROR: could be elided: 'py
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` can be elided because of `&self`
+        fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(content) => Content::T2(f(content)),
+            }
+        }
+    }
+
+    //~v ERROR: could be elided: 'py
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` can be elided because of `&'_ self`
+        fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(content) => Content::T2(f(content)),
+            }
+        }
+    }
+
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` should not be elided as the default lifetime, even if working, could be named as `'t`
+        fn map_content4(self, f: impl FnOnce(&'t str) -> &'t str, o: &'t str) -> Content<'t, 'py> {
+            match self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(_) => Content::T2(o),
+            }
+        }
+    }
+
+    //~v ERROR: could be elided: 'py
+    impl<'t, 'py> ContentString<'t> {
+        // `'py` can be elided because of `&Self`
+        fn map_content5(
+            self: std::pin::Pin<&Self>,
+            f: impl FnOnce(&'t str) -> &'t str,
+            o: &'t str,
+        ) -> Content<'t, 'py> {
+            match *self {
+                Self::T1(content) => Content::T1(f(content)),
+                Self::T2(_) => Content::T2(o),
+            }
+        }
+    }
+
+    struct Cx<'a, 'b> {
+        a: &'a u32,
+        b: &'b u32,
+    }
+
+    // `'c` cannot be elided because we have several input lifetimes
+    fn one_explicit<'b>(x: Cx<'_, 'b>) -> &'b u32 {
+        x.b
+    }
+}
diff --git a/tests/ui/elidable_lifetime_names.stderr b/tests/ui/elidable_lifetime_names.stderr
new file mode 100644
index 00000000000..a60dfc69756
--- /dev/null
+++ b/tests/ui/elidable_lifetime_names.stderr
@@ -0,0 +1,162 @@
+error: the following explicit lifetimes could be elided: 'a, 'b
+  --> tests/ui/elidable_lifetime_names.rs:9:21
+   |
+LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
+   |                     ^^  ^^          ^^        ^^
+   |
+   = note: `-D clippy::elidable-lifetime-names` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::elidable_lifetime_names)]`
+help: elide the lifetimes
+   |
+LL - fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
+LL + fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {}
+   |
+
+error: the following explicit lifetimes could be elided: 'a
+  --> tests/ui/elidable_lifetime_names.rs:34:15
+   |
+LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
+   |               ^^               ^^                   ^^
+   |
+help: elide the lifetimes
+   |
+LL - fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
+LL + fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I>
+   |
+
+error: the following explicit lifetimes could be elided: 'a
+  --> tests/ui/elidable_lifetime_names.rs:44:19
+   |
+LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
+   |                   ^^            ^^       ^^
+   |
+help: elide the lifetimes
+   |
+LL - fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
+LL + fn struct_with_lt(_foo: Foo<'_>) -> &str {
+   |
+
+error: the following explicit lifetimes could be elided: 'b
+  --> tests/ui/elidable_lifetime_names.rs:59:25
+   |
+LL | fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
+   |                         ^^                ^^
+   |
+help: elide the lifetimes
+   |
+LL - fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
+LL + fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str {
+   |
+
+error: the following explicit lifetimes could be elided: 'a
+  --> tests/ui/elidable_lifetime_names.rs:66:18
+   |
+LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
+   |                  ^^                 ^^       ^^
+   |
+help: elide the lifetimes
+   |
+LL - fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
+LL + fn alias_with_lt(_foo: FooAlias<'_>) -> &str {
+   |
+
+error: the following explicit lifetimes could be elided: 'b
+  --> tests/ui/elidable_lifetime_names.rs:81:24
+   |
+LL | fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
+   |                        ^^                     ^^
+   |
+help: elide the lifetimes
+   |
+LL - fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
+LL + fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str {
+   |
+
+error: the following explicit lifetimes could be elided: 'a
+  --> tests/ui/elidable_lifetime_names.rs:91:24
+   |
+LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
+   |                        ^^      ^^             ^^
+   |
+help: elide the lifetimes
+   |
+LL - fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
+LL + fn out_return_type_lts(e: &str) -> Cow<'_> {
+   |
+
+error: the following explicit lifetimes could be elided: 'a
+  --> tests/ui/elidable_lifetime_names.rs:103:10
+   |
+LL |     impl<'a> Foo for Baz<'a> {}
+   |          ^^              ^^
+   |
+help: elide the lifetimes
+   |
+LL -     impl<'a> Foo for Baz<'a> {}
+LL +     impl Foo for Baz<'_> {}
+   |
+
+error: the following explicit lifetimes could be elided: 'a
+  --> tests/ui/elidable_lifetime_names.rs:106:16
+   |
+LL |         fn baz<'a>(&'a self) -> impl Foo + 'a {
+   |                ^^   ^^                     ^^
+   |
+help: elide the lifetimes
+   |
+LL -         fn baz<'a>(&'a self) -> impl Foo + 'a {
+LL +         fn baz(&self) -> impl Foo + '_ {
+   |
+
+error: the following explicit lifetimes could be elided: 'py
+  --> tests/ui/elidable_lifetime_names.rs:139:14
+   |
+LL |     impl<'t, 'py> ContentString<'t> {
+   |              ^^^
+LL |         // `'py` can be elided because of `&self`
+LL |         fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
+   |                                                                                   ^^^
+   |
+help: elide the lifetimes
+   |
+LL ~     impl<'t> ContentString<'t> {
+LL |         // `'py` can be elided because of `&self`
+LL ~         fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
+   |
+
+error: the following explicit lifetimes could be elided: 'py
+  --> tests/ui/elidable_lifetime_names.rs:150:14
+   |
+LL |     impl<'t, 'py> ContentString<'t> {
+   |              ^^^
+LL |         // `'py` can be elided because of `&'_ self`
+LL |         fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
+   |                                                                                      ^^^
+   |
+help: elide the lifetimes
+   |
+LL ~     impl<'t> ContentString<'t> {
+LL |         // `'py` can be elided because of `&'_ self`
+LL ~         fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
+   |
+
+error: the following explicit lifetimes could be elided: 'py
+  --> tests/ui/elidable_lifetime_names.rs:171:14
+   |
+LL |     impl<'t, 'py> ContentString<'t> {
+   |              ^^^
+...
+LL |         ) -> Content<'t, 'py> {
+   |                          ^^^
+   |
+help: elide the lifetimes
+   |
+LL ~     impl<'t> ContentString<'t> {
+LL |         // `'py` can be elided because of `&Self`
+...
+LL |             o: &'t str,
+LL ~         ) -> Content<'t, '_> {
+   |
+
+error: aborting due to 12 previous errors
+
diff --git a/tests/ui/empty_line_after/doc_comments.1.fixed b/tests/ui/empty_line_after/doc_comments.1.fixed
index c1a15f47ba1..e4ba09ea1d4 100644
--- a/tests/ui/empty_line_after/doc_comments.1.fixed
+++ b/tests/ui/empty_line_after/doc_comments.1.fixed
@@ -1,17 +1,16 @@
 #![warn(clippy::empty_line_after_outer_attr, clippy::empty_line_after_doc_comments)]
 
+//~vvv empty_line_after_doc_comments
 /// Meant to be an
 /// inner doc comment
 /// for the crate
-//~^ empty_line_after_doc_comments
 fn first_in_crate() {}
 
 mod m {
-
+    //~vvv empty_line_after_doc_comments
     /// Meant to be an
     /// inner doc comment
     /// for the module
-    //~^ empty_line_after_doc_comments
     fn first_in_module() {}
 }
 
@@ -22,14 +21,14 @@ mod some_mod {
         fn some_noop() {}
     }
 
+    //~v empty_line_after_doc_comments
     /// # Indented
-    //~^ empty_line_after_doc_comments
     /// Blank line
     fn indented() {}
 }
 
+//~v empty_line_after_doc_comments
 /// This should produce a warning
-//~^ empty_line_after_doc_comments
 fn with_doc_and_newline() {}
 
 // This should *NOT* produce a warning
@@ -37,8 +36,8 @@ fn with_doc_and_newline() {}
 /// some comment
 fn with_no_newline_and_comment() {}
 
+//~v empty_line_after_doc_comments
 /// This doc comment should produce a warning
-//~^ empty_line_after_doc_comments
 /** This is also a doc comment and is part of the warning
  */
 #[allow(non_camel_case_types)]
@@ -47,15 +46,14 @@ fn with_no_newline_and_comment() {}
 fn three_attributes() {}
 
 mod misattributed {
-
+    //~v empty_line_after_doc_comments
     /// docs for `old_code`
-    //~^ empty_line_after_doc_comments
     // fn old_code() {}
     fn new_code() {}
 
+    //~vv empty_line_after_doc_comments
     /// Docs
     /// for OldA
-    //~^ empty_line_after_doc_comments
     // struct OldA;
     /// Docs
     /// for OldB
@@ -67,25 +65,24 @@ mod misattributed {
 }
 
 mod block_comments {
-
+    //~v empty_line_after_doc_comments
     /**
      * Meant to be inner doc comment
      */
-    //~^^^ empty_line_after_doc_comments
     fn first_in_module() {}
 
+    //~v empty_line_after_doc_comments
     /**
      * Docs for `old_code`
      */
-    //~^^^ empty_line_after_doc_comments
     /* fn old_code() {} */
     /**
      * Docs for `new_code`
      */
     fn new_code() {}
 
+    //~v empty_line_after_doc_comments
     /// Docs for `old_code2`
-    //~^ empty_line_after_doc_comments
     /* fn old_code2() {} */
     /// Docs for `new_code2`
     fn new_code2() {}
@@ -135,4 +132,14 @@ pub struct BlockComment;
 ))]
 fn empty_line_in_cfg_attr() {}
 
+trait Foo {
+    fn bar();
+}
+
+impl Foo for LineComment {
+    /// comment on assoc item
+    //~^ empty_line_after_doc_comments
+    fn bar() {}
+}
+
 fn main() {}
diff --git a/tests/ui/empty_line_after/doc_comments.2.fixed b/tests/ui/empty_line_after/doc_comments.2.fixed
index abec7b54c63..a20f9bc20eb 100644
--- a/tests/ui/empty_line_after/doc_comments.2.fixed
+++ b/tests/ui/empty_line_after/doc_comments.2.fixed
@@ -1,18 +1,17 @@
 #![warn(clippy::empty_line_after_outer_attr, clippy::empty_line_after_doc_comments)]
 
-// /// Meant to be an
-// /// inner doc comment
-// /// for the crate
-//~^ empty_line_after_doc_comments
+//~vvv empty_line_after_doc_comments
+//! Meant to be an
+//! inner doc comment
+//! for the crate
 
 fn first_in_crate() {}
 
 mod m {
-
-    // /// Meant to be an
-    // /// inner doc comment
-    // /// for the module
-    //~^ empty_line_after_doc_comments
+    //~vvv empty_line_after_doc_comments
+    //! Meant to be an
+    //! inner doc comment
+    //! for the module
 
     fn first_in_module() {}
 }
@@ -24,16 +23,15 @@ mod some_mod {
         fn some_noop() {}
     }
 
-    // /// # Indented
-    //~^ empty_line_after_doc_comments
-
+    //~v empty_line_after_doc_comments
+    /// # Indented
+    ///
     /// Blank line
     fn indented() {}
 }
 
-// /// This should produce a warning
-//~^ empty_line_after_doc_comments
-
+//~v empty_line_after_doc_comments
+/// This should produce a warning
 fn with_doc_and_newline() {}
 
 // This should *NOT* produce a warning
@@ -41,28 +39,25 @@ fn with_doc_and_newline() {}
 /// some comment
 fn with_no_newline_and_comment() {}
 
-// /// This doc comment should produce a warning
-//~^ empty_line_after_doc_comments
-
-/* This is also a doc comment and is part of the warning
+//~v empty_line_after_doc_comments
+/// This doc comment should produce a warning
+/** This is also a doc comment and is part of the warning
  */
-
 #[allow(non_camel_case_types)]
 #[allow(missing_docs)]
 #[allow(dead_code)]
 fn three_attributes() {}
 
 mod misattributed {
-
+    //~v empty_line_after_doc_comments
     // /// docs for `old_code`
-    //~^ empty_line_after_doc_comments
     // fn old_code() {}
 
     fn new_code() {}
 
+    //~vv empty_line_after_doc_comments
     // /// Docs
     // /// for OldA
-    //~^ empty_line_after_doc_comments
     // struct OldA;
 
     // /// Docs
@@ -76,18 +71,17 @@ mod misattributed {
 }
 
 mod block_comments {
-
-    /*
+    //~v empty_line_after_doc_comments
+    /*!
      * Meant to be inner doc comment
      */
-    //~^^^ empty_line_after_doc_comments
 
     fn first_in_module() {}
 
+    //~v empty_line_after_doc_comments
     /*
      * Docs for `old_code`
      */
-    //~^^^ empty_line_after_doc_comments
     /* fn old_code() {} */
 
     /**
@@ -95,8 +89,8 @@ mod block_comments {
      */
     fn new_code() {}
 
+    //~v empty_line_after_doc_comments
     // /// Docs for `old_code2`
-    //~^ empty_line_after_doc_comments
     /* fn old_code2() {} */
 
     /// Docs for `new_code2`
@@ -147,4 +141,15 @@ pub struct BlockComment;
 ))]
 fn empty_line_in_cfg_attr() {}
 
+trait Foo {
+    fn bar();
+}
+
+impl Foo for LineComment {
+    // /// comment on assoc item
+    //~^ empty_line_after_doc_comments
+
+    fn bar() {}
+}
+
 fn main() {}
diff --git a/tests/ui/empty_line_after/doc_comments.rs b/tests/ui/empty_line_after/doc_comments.rs
index d225768f612..9e3ddfd5abe 100644
--- a/tests/ui/empty_line_after/doc_comments.rs
+++ b/tests/ui/empty_line_after/doc_comments.rs
@@ -1,18 +1,17 @@
 #![warn(clippy::empty_line_after_outer_attr, clippy::empty_line_after_doc_comments)]
 
+//~vvv empty_line_after_doc_comments
 /// Meant to be an
 /// inner doc comment
 /// for the crate
-//~^ empty_line_after_doc_comments
 
 fn first_in_crate() {}
 
 mod m {
-
+    //~vvv empty_line_after_doc_comments
     /// Meant to be an
     /// inner doc comment
     /// for the module
-    //~^ empty_line_after_doc_comments
 
     fn first_in_module() {}
 }
@@ -24,15 +23,15 @@ mod some_mod {
         fn some_noop() {}
     }
 
+    //~v empty_line_after_doc_comments
     /// # Indented
-    //~^ empty_line_after_doc_comments
 
     /// Blank line
     fn indented() {}
 }
 
+//~v empty_line_after_doc_comments
 /// This should produce a warning
-//~^ empty_line_after_doc_comments
 
 fn with_doc_and_newline() {}
 
@@ -41,8 +40,8 @@ fn with_doc_and_newline() {}
 /// some comment
 fn with_no_newline_and_comment() {}
 
+//~v empty_line_after_doc_comments
 /// This doc comment should produce a warning
-//~^ empty_line_after_doc_comments
 
 /** This is also a doc comment and is part of the warning
  */
@@ -53,16 +52,15 @@ fn with_no_newline_and_comment() {}
 fn three_attributes() {}
 
 mod misattributed {
-
+    //~v empty_line_after_doc_comments
     /// docs for `old_code`
-    //~^ empty_line_after_doc_comments
     // fn old_code() {}
 
     fn new_code() {}
 
+    //~vv empty_line_after_doc_comments
     /// Docs
     /// for OldA
-    //~^ empty_line_after_doc_comments
     // struct OldA;
 
     /// Docs
@@ -76,18 +74,17 @@ mod misattributed {
 }
 
 mod block_comments {
-
+    //~v empty_line_after_doc_comments
     /**
      * Meant to be inner doc comment
      */
-    //~^^^ empty_line_after_doc_comments
 
     fn first_in_module() {}
 
+    //~v empty_line_after_doc_comments
     /**
      * Docs for `old_code`
      */
-    //~^^^ empty_line_after_doc_comments
     /* fn old_code() {} */
 
     /**
@@ -95,8 +92,8 @@ mod block_comments {
      */
     fn new_code() {}
 
+    //~v empty_line_after_doc_comments
     /// Docs for `old_code2`
-    //~^ empty_line_after_doc_comments
     /* fn old_code2() {} */
 
     /// Docs for `new_code2`
@@ -147,4 +144,15 @@ pub struct BlockComment;
 ))]
 fn empty_line_in_cfg_attr() {}
 
+trait Foo {
+    fn bar();
+}
+
+impl Foo for LineComment {
+    /// comment on assoc item
+    //~^ empty_line_after_doc_comments
+
+    fn bar() {}
+}
+
 fn main() {}
diff --git a/tests/ui/empty_line_after/doc_comments.stderr b/tests/ui/empty_line_after/doc_comments.stderr
index 9b627e8df1f..fe25ba9afcb 100644
--- a/tests/ui/empty_line_after/doc_comments.stderr
+++ b/tests/ui/empty_line_after/doc_comments.stderr
@@ -1,21 +1,20 @@
 error: empty line after doc comment
-  --> tests/ui/empty_line_after/doc_comments.rs:5:1
+  --> tests/ui/empty_line_after/doc_comments.rs:6:1
    |
 LL | / /// for the crate
 LL | |
-LL | |
    | |_^
 LL |   fn first_in_crate() {}
-   |   ------------------- the comment documents this function
+   |   ----------------- the comment documents this function
    |
    = note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `first_in_crate` comment it out
+   = help: if the empty line is unintentional, remove it
+help: if the comment should document the crate use an inner doc comment
    |
-LL ~ // /// Meant to be an
-LL ~ // /// inner doc comment
-LL ~ // /// for the crate
+LL ~ //! Meant to be an
+LL ~ //! inner doc comment
+LL ~ //! for the crate
    |
 
 error: empty line after doc comment
@@ -23,17 +22,16 @@ error: empty line after doc comment
    |
 LL | /     /// for the module
 LL | |
-LL | |
    | |_^
 LL |       fn first_in_module() {}
-   |       -------------------- the comment documents this function
+   |       ------------------ the comment documents this function
    |
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `first_in_module` comment it out
+   = help: if the empty line is unintentional, remove it
+help: if the comment should document the parent module use an inner doc comment
    |
-LL ~     // /// Meant to be an
-LL ~     // /// inner doc comment
-LL ~     // /// for the module
+LL ~     //! Meant to be an
+LL ~     //! inner doc comment
+LL ~     //! for the module
    |
 
 error: empty line after doc comment
@@ -41,77 +39,66 @@ error: empty line after doc comment
    |
 LL | /     /// # Indented
 LL | |
-LL | |
    | |_^
 LL |       /// Blank line
 LL |       fn indented() {}
-   |       ------------- the comment documents this function
+   |       ----------- the comment documents this function
    |
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `indented` comment it out
+   = help: if the empty line is unintentional, remove it
+help: if the documentation should include the empty line include it in the comment
+   |
+LL |     ///
    |
-LL |     // /// # Indented
-   |     ++
 
 error: empty line after doc comment
   --> tests/ui/empty_line_after/doc_comments.rs:34:1
    |
 LL | / /// This should produce a warning
 LL | |
-LL | |
    | |_^
 LL |   fn with_doc_and_newline() {}
-   |   ------------------------- the comment documents this function
-   |
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `with_doc_and_newline` comment it out
+   |   ----------------------- the comment documents this function
    |
-LL | // /// This should produce a warning
-   | ++
+   = help: if the empty line is unintentional, remove it
 
 error: empty lines after doc comment
   --> tests/ui/empty_line_after/doc_comments.rs:44:1
    |
 LL | / /// This doc comment should produce a warning
 LL | |
-LL | |
 LL | | /** This is also a doc comment and is part of the warning
 LL | |  */
 LL | |
    | |_^
 ...
 LL |   fn three_attributes() {}
-   |   --------------------- the comment documents this function
-   |
-   = help: if the empty lines are unintentional remove them
-help: if the doc comment should not document `three_attributes` comment it out
-   |
-LL ~ // /// This doc comment should produce a warning
-LL |
-LL |
-LL ~ /* This is also a doc comment and is part of the warning
+   |   ------------------- the comment documents this function
    |
+   = help: if the empty lines are unintentional, remove them
 
 error: empty line after doc comment
-  --> tests/ui/empty_line_after/doc_comments.rs:57:5
+  --> tests/ui/empty_line_after/doc_comments.rs:56:5
    |
 LL | /     /// docs for `old_code`
-...  |
+LL | |     // fn old_code() {}
 LL | |
    | |_^
 LL |       fn new_code() {}
-   |       ------------- the comment documents this function
+   |       ----------- the comment documents this function
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 help: if the doc comment should not document `new_code` comment it out
    |
 LL |     // /// docs for `old_code`
    |     ++
 
 error: empty lines after doc comment
-  --> tests/ui/empty_line_after/doc_comments.rs:64:5
+  --> tests/ui/empty_line_after/doc_comments.rs:63:5
    |
 LL | /     /// for OldA
+LL | |     // struct OldA;
+LL | |
+LL | |     /// Docs
 ...  |
 LL | |
    | |_^
@@ -119,12 +106,11 @@ LL | |
 LL |       struct Multiple;
    |       --------------- the comment documents this struct
    |
-   = help: if the empty lines are unintentional remove them
+   = help: if the empty lines are unintentional, remove them
 help: if the doc comment should not document `Multiple` comment it out
    |
 LL ~     // /// Docs
 LL ~     // /// for OldA
-LL |
 LL |     // struct OldA;
 LL |
 LL ~     // /// Docs
@@ -132,38 +118,37 @@ LL ~     // /// for OldB
    |
 
 error: empty line after doc comment
-  --> tests/ui/empty_line_after/doc_comments.rs:80:5
+  --> tests/ui/empty_line_after/doc_comments.rs:78:5
    |
 LL | /     /**
 LL | |      * Meant to be inner doc comment
 LL | |      */
 LL | |
-LL | |
    | |_^
 LL |       fn first_in_module() {}
-   |       -------------------- the comment documents this function
+   |       ------------------ the comment documents this function
    |
-   = help: if the empty line is unintentional remove it
-help: if the doc comment should not document `first_in_module` comment it out
+   = help: if the empty line is unintentional, remove it
+help: if the comment should document the parent module use an inner doc comment
    |
 LL -     /**
-LL +     /*
+LL +     /*!
    |
 
 error: empty line after doc comment
-  --> tests/ui/empty_line_after/doc_comments.rs:87:5
+  --> tests/ui/empty_line_after/doc_comments.rs:85:5
    |
 LL | /     /**
 LL | |      * Docs for `old_code`
 LL | |      */
-...  |
+LL | |     /* fn old_code() {} */
 LL | |
    | |_^
 ...
 LL |       fn new_code() {}
-   |       ------------- the comment documents this function
+   |       ----------- the comment documents this function
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 help: if the doc comment should not document `new_code` comment it out
    |
 LL -     /**
@@ -171,22 +156,37 @@ LL +     /*
    |
 
 error: empty line after doc comment
-  --> tests/ui/empty_line_after/doc_comments.rs:98:5
+  --> tests/ui/empty_line_after/doc_comments.rs:96:5
    |
 LL | /     /// Docs for `old_code2`
-LL | |
 LL | |     /* fn old_code2() {} */
 LL | |
    | |_^
 LL |       /// Docs for `new_code2`
 LL |       fn new_code2() {}
-   |       -------------- the comment documents this function
+   |       ------------ the comment documents this function
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 help: if the doc comment should not document `new_code2` comment it out
    |
 LL |     // /// Docs for `old_code2`
    |     ++
 
-error: aborting due to 10 previous errors
+error: empty line after doc comment
+  --> tests/ui/empty_line_after/doc_comments.rs:152:5
+   |
+LL | /     /// comment on assoc item
+LL | |
+LL | |
+   | |_^
+LL |       fn bar() {}
+   |       ------ the comment documents this function
+   |
+   = help: if the empty line is unintentional, remove it
+help: if the doc comment should not document `bar` comment it out
+   |
+LL |     // /// comment on assoc item
+   |     ++
+
+error: aborting due to 11 previous errors
 
diff --git a/tests/ui/empty_line_after/outer_attribute.stderr b/tests/ui/empty_line_after/outer_attribute.stderr
index a95306e2fa3..519ba6e6761 100644
--- a/tests/ui/empty_line_after/outer_attribute.stderr
+++ b/tests/ui/empty_line_after/outer_attribute.stderr
@@ -5,11 +5,11 @@ LL | / #[crate_type = "lib"]
 LL | |
    | |_^
 LL |   fn first_in_crate() {}
-   |   ------------------- the attribute applies to this function
+   |   ----------------- the attribute applies to this function
    |
    = note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_outer_attr)]`
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 help: if the attribute should apply to the crate use an inner attribute
    |
 LL | #![crate_type = "lib"]
@@ -23,9 +23,9 @@ LL | |
    | |_^
 LL |   /// some comment
 LL |   fn with_one_newline_and_comment() {}
-   |   --------------------------------- the attribute applies to this function
+   |   ------------------------------- the attribute applies to this function
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 
 error: empty line after outer attribute
   --> tests/ui/empty_line_after/outer_attribute.rs:23:1
@@ -34,9 +34,9 @@ LL | / #[inline]
 LL | |
    | |_^
 LL |   fn with_one_newline() {}
-   |   --------------------- the attribute applies to this function
+   |   ------------------- the attribute applies to this function
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 
 error: empty lines after outer attribute
   --> tests/ui/empty_line_after/outer_attribute.rs:30:5
@@ -46,9 +46,9 @@ LL | |
 LL | |
    | |_^
 LL |       fn with_two_newlines() {}
-   |       ---------------------- the attribute applies to this function
+   |       -------------------- the attribute applies to this function
    |
-   = help: if the empty lines are unintentional remove them
+   = help: if the empty lines are unintentional, remove them
 help: if the attribute should apply to the parent module use an inner attribute
    |
 LL |     #![crate_type = "lib"]
@@ -63,7 +63,7 @@ LL | |
 LL |   enum Baz {
    |   -------- the attribute applies to this enum
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 
 error: empty line after outer attribute
   --> tests/ui/empty_line_after/outer_attribute.rs:45:1
@@ -74,7 +74,7 @@ LL | |
 LL |   struct Foo {
    |   ---------- the attribute applies to this struct
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 
 error: empty line after outer attribute
   --> tests/ui/empty_line_after/outer_attribute.rs:53:1
@@ -85,7 +85,7 @@ LL | |
 LL |   mod foo {}
    |   ------- the attribute applies to this module
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 
 error: empty line after outer attribute
   --> tests/ui/empty_line_after/outer_attribute.rs:58:1
@@ -95,9 +95,9 @@ LL | | // Still lint cases where the empty line does not immediately follow the
 LL | |
    | |_^
 LL |   fn comment_before_empty_line() {}
-   |   ------------------------------ the attribute applies to this function
+   |   ---------------------------- the attribute applies to this function
    |
-   = help: if the empty line is unintentional remove it
+   = help: if the empty line is unintentional, remove it
 
 error: empty lines after outer attribute
   --> tests/ui/empty_line_after/outer_attribute.rs:64:1
@@ -107,9 +107,9 @@ LL | / #[allow(unused)]
 LL | |
    | |_^
 LL |   pub fn isolated_comment() {}
-   |   ------------------------- the attribute applies to this function
+   |   ----------------------- the attribute applies to this function
    |
-   = help: if the empty lines are unintentional remove them
+   = help: if the empty lines are unintentional, remove them
 
 error: aborting due to 9 previous errors
 
diff --git a/tests/ui/entry.fixed b/tests/ui/entry.fixed
index 9856fa9b39f..69452a8d9a6 100644
--- a/tests/ui/entry.fixed
+++ b/tests/ui/entry.fixed
@@ -195,4 +195,35 @@ fn issue12489(map: &mut HashMap<u64, u64>) -> Option<()> {
     Some(())
 }
 
+mod issue13934 {
+    use std::collections::HashMap;
+
+    struct Member {}
+
+    pub struct Foo {
+        members: HashMap<u8, Member>,
+    }
+
+    impl Foo {
+        pub fn should_also_not_cause_lint(&mut self, input: u8) {
+            if self.members.contains_key(&input) {
+                todo!();
+            } else {
+                self.other();
+                self.members.insert(input, Member {});
+            }
+        }
+
+        fn other(&self) {}
+    }
+}
+
+fn issue11976() {
+    let mut hashmap = std::collections::HashMap::new();
+    if !hashmap.contains_key(&0) {
+        let _ = || hashmap.get(&0);
+        hashmap.insert(0, 0);
+    }
+}
+
 fn main() {}
diff --git a/tests/ui/entry.rs b/tests/ui/entry.rs
index bb8ebb4eac0..3578324f01c 100644
--- a/tests/ui/entry.rs
+++ b/tests/ui/entry.rs
@@ -201,4 +201,35 @@ fn issue12489(map: &mut HashMap<u64, u64>) -> Option<()> {
     Some(())
 }
 
+mod issue13934 {
+    use std::collections::HashMap;
+
+    struct Member {}
+
+    pub struct Foo {
+        members: HashMap<u8, Member>,
+    }
+
+    impl Foo {
+        pub fn should_also_not_cause_lint(&mut self, input: u8) {
+            if self.members.contains_key(&input) {
+                todo!();
+            } else {
+                self.other();
+                self.members.insert(input, Member {});
+            }
+        }
+
+        fn other(&self) {}
+    }
+}
+
+fn issue11976() {
+    let mut hashmap = std::collections::HashMap::new();
+    if !hashmap.contains_key(&0) {
+        let _ = || hashmap.get(&0);
+        hashmap.insert(0, 0);
+    }
+}
+
 fn main() {}
diff --git a/tests/ui/entry_unfixable.rs b/tests/ui/entry_unfixable.rs
new file mode 100644
index 00000000000..dbdacf95056
--- /dev/null
+++ b/tests/ui/entry_unfixable.rs
@@ -0,0 +1,94 @@
+#![allow(unused, clippy::needless_pass_by_value, clippy::collapsible_if)]
+#![warn(clippy::map_entry)]
+//@no-rustfix
+
+use std::collections::HashMap;
+use std::hash::Hash;
+
+macro_rules! m {
+    ($e:expr) => {{ $e }};
+}
+
+macro_rules! insert {
+    ($map:expr, $key:expr, $val:expr) => {
+        $map.insert($key, $val)
+    };
+}
+
+mod issue13306 {
+    use std::collections::HashMap;
+
+    struct Env {
+        enclosing: Option<Box<Env>>,
+        values: HashMap<String, usize>,
+    }
+
+    impl Env {
+        fn assign(&mut self, name: String, value: usize) -> bool {
+            if !self.values.contains_key(&name) {
+                //~^ map_entry
+                self.values.insert(name, value);
+                true
+            } else if let Some(enclosing) = &mut self.enclosing {
+                enclosing.assign(name, value)
+            } else {
+                false
+            }
+        }
+    }
+}
+
+fn issue9925(mut hm: HashMap<String, bool>) {
+    let key = "hello".to_string();
+    if hm.contains_key(&key) {
+        //~^ map_entry
+        let bval = hm.get_mut(&key).unwrap();
+        *bval = false;
+    } else {
+        hm.insert(key, true);
+    }
+}
+
+mod issue9470 {
+    use std::collections::HashMap;
+    use std::sync::Mutex;
+
+    struct Interner(i32);
+
+    impl Interner {
+        const fn new() -> Self {
+            Interner(0)
+        }
+
+        fn resolve(&self, name: String) -> Option<String> {
+            todo!()
+        }
+    }
+
+    static INTERNER: Mutex<Interner> = Mutex::new(Interner::new());
+
+    struct VM {
+        stack: Vec<i32>,
+        globals: HashMap<String, i32>,
+    }
+
+    impl VM {
+        fn stack_top(&self) -> &i32 {
+            self.stack.last().unwrap()
+        }
+
+        fn resolve(&mut self, name: String, value: i32) -> Result<(), String> {
+            if self.globals.contains_key(&name) {
+                //~^ map_entry
+                self.globals.insert(name, value);
+            } else {
+                let interner = INTERNER.lock().unwrap();
+                return Err(interner.resolve(name).unwrap().to_owned());
+            }
+
+            Ok(())
+        }
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/entry_unfixable.stderr b/tests/ui/entry_unfixable.stderr
new file mode 100644
index 00000000000..9f9956d351b
--- /dev/null
+++ b/tests/ui/entry_unfixable.stderr
@@ -0,0 +1,41 @@
+error: usage of `contains_key` followed by `insert` on a `HashMap`
+  --> tests/ui/entry_unfixable.rs:28:13
+   |
+LL | /             if !self.values.contains_key(&name) {
+LL | |
+LL | |                 self.values.insert(name, value);
+LL | |                 true
+...  |
+LL | |                 false
+LL | |             }
+   | |_____________^
+   |
+   = note: `-D clippy::map-entry` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::map_entry)]`
+
+error: usage of `contains_key` followed by `insert` on a `HashMap`
+  --> tests/ui/entry_unfixable.rs:43:5
+   |
+LL | /     if hm.contains_key(&key) {
+LL | |
+LL | |         let bval = hm.get_mut(&key).unwrap();
+LL | |         *bval = false;
+LL | |     } else {
+LL | |         hm.insert(key, true);
+LL | |     }
+   | |_____^
+
+error: usage of `contains_key` followed by `insert` on a `HashMap`
+  --> tests/ui/entry_unfixable.rs:81:13
+   |
+LL | /             if self.globals.contains_key(&name) {
+LL | |
+LL | |                 self.globals.insert(name, value);
+LL | |             } else {
+LL | |                 let interner = INTERNER.lock().unwrap();
+LL | |                 return Err(interner.resolve(name).unwrap().to_owned());
+LL | |             }
+   | |_____________^
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/excessive_precision.stderr b/tests/ui/excessive_precision.stderr
index 09fe3de4993..934a367e106 100644
--- a/tests/ui/excessive_precision.stderr
+++ b/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:22: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:24: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:26: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:31: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:35: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:47: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:49: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:51: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:62:36
@@ -107,8 +116,9 @@ LL |     let bad_vec32: Vec<f32> = vec![0.123_456_789];
    |
 help: consider changing the type or truncating it to
    |
-LL |     let bad_vec32: Vec<f32> = vec![0.123_456_79];
-   |                                    ~~~~~~~~~~~~
+LL -     let bad_vec32: Vec<f32> = vec![0.123_456_789];
+LL +     let bad_vec32: Vec<f32> = vec![0.123_456_79];
+   |
 
 error: float has excessive precision
   --> tests/ui/excessive_precision.rs:64:36
@@ -118,8 +128,9 @@ LL |     let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_789];
    |
 help: consider changing the type or truncating it to
    |
-LL |     let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_78];
-   |                                    ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_789];
+LL +     let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_78];
+   |
 
 error: float has excessive precision
   --> tests/ui/excessive_precision.rs:69: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:73: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:83: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:87: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:98: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/tests/ui/fn_to_numeric_cast_any.stderr b/tests/ui/fn_to_numeric_cast_any.stderr
index 0a98952faef..58fac2d406a 100644
--- a/tests/ui/fn_to_numeric_cast_any.stderr
+++ b/tests/ui/fn_to_numeric_cast_any.stderr
@@ -9,7 +9,7 @@ LL |     let _ = foo as i8;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as i8;
-   |             ~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `i16`
   --> tests/ui/fn_to_numeric_cast_any.rs:26:13
@@ -20,7 +20,7 @@ LL |     let _ = foo as i16;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as i16;
-   |             ~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `i32`
   --> tests/ui/fn_to_numeric_cast_any.rs:29:13
@@ -31,7 +31,7 @@ LL |     let _ = foo as i32;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as i32;
-   |             ~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `i64`
   --> tests/ui/fn_to_numeric_cast_any.rs:32:13
@@ -42,7 +42,7 @@ LL |     let _ = foo as i64;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as i64;
-   |             ~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `i128`
   --> tests/ui/fn_to_numeric_cast_any.rs:35:13
@@ -53,7 +53,7 @@ LL |     let _ = foo as i128;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as i128;
-   |             ~~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `isize`
   --> tests/ui/fn_to_numeric_cast_any.rs:38:13
@@ -64,7 +64,7 @@ LL |     let _ = foo as isize;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as isize;
-   |             ~~~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `u8`
   --> tests/ui/fn_to_numeric_cast_any.rs:41:13
@@ -75,7 +75,7 @@ LL |     let _ = foo as u8;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as u8;
-   |             ~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `u16`
   --> tests/ui/fn_to_numeric_cast_any.rs:44:13
@@ -86,7 +86,7 @@ LL |     let _ = foo as u16;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as u16;
-   |             ~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `u32`
   --> tests/ui/fn_to_numeric_cast_any.rs:47:13
@@ -97,7 +97,7 @@ LL |     let _ = foo as u32;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as u32;
-   |             ~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `u64`
   --> tests/ui/fn_to_numeric_cast_any.rs:50:13
@@ -108,7 +108,7 @@ LL |     let _ = foo as u64;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as u64;
-   |             ~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `u128`
   --> tests/ui/fn_to_numeric_cast_any.rs:53:13
@@ -119,7 +119,7 @@ LL |     let _ = foo as u128;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as u128;
-   |             ~~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `foo` to `usize`
   --> tests/ui/fn_to_numeric_cast_any.rs:56:13
@@ -130,7 +130,7 @@ LL |     let _ = foo as usize;
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as usize;
-   |             ~~~~~~~~~~~~~~
+   |                ++
 
 error: casting function pointer `Struct::static_method` to `usize`
   --> tests/ui/fn_to_numeric_cast_any.rs:61:13
@@ -141,7 +141,7 @@ LL |     let _ = Struct::static_method as usize;
 help: did you mean to invoke the function?
    |
 LL |     let _ = Struct::static_method() as usize;
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   |                                  ++
 
 error: casting function pointer `f` to `usize`
   --> tests/ui/fn_to_numeric_cast_any.rs:66:5
@@ -152,7 +152,7 @@ LL |     f as usize
 help: did you mean to invoke the function?
    |
 LL |     f() as usize
-   |
+   |      ++
 
 error: casting function pointer `T::static_method` to `usize`
   --> tests/ui/fn_to_numeric_cast_any.rs:71:5
@@ -163,7 +163,7 @@ LL |     T::static_method as usize
 help: did you mean to invoke the function?
    |
 LL |     T::static_method() as usize
-   |
+   |                     ++
 
 error: casting function pointer `(clos as fn(u32) -> u32)` to `usize`
   --> tests/ui/fn_to_numeric_cast_any.rs:78:13
@@ -174,7 +174,7 @@ 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;
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   |                                     ++
 
 error: casting function pointer `foo` to `*const ()`
   --> tests/ui/fn_to_numeric_cast_any.rs:83:13
@@ -185,7 +185,7 @@ LL |     let _ = foo as *const ();
 help: did you mean to invoke the function?
    |
 LL |     let _ = foo() as *const ();
-   |             ~~~~~~~~~~~~~~~~~~
+   |                ++
 
 error: aborting due to 17 previous errors
 
diff --git a/tests/ui/for_kv_map.stderr b/tests/ui/for_kv_map.stderr
index 878c4353219..0bd474a1068 100644
--- a/tests/ui/for_kv_map.stderr
+++ b/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:26: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:33: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:41: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:49: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/tests/ui/format_args_unfixable.rs b/tests/ui/format_args_unfixable.rs
index 08cd7dbe54f..9e1d6a649c3 100644
--- a/tests/ui/format_args_unfixable.rs
+++ b/tests/ui/format_args_unfixable.rs
@@ -2,7 +2,7 @@
 #![allow(unused)]
 #![allow(clippy::assertions_on_constants, clippy::eq_op, clippy::uninlined_format_args)]
 
-use std::io::{Error, ErrorKind, Write, stdout};
+use std::io::{Error, Write, stdout};
 use std::ops::Deref;
 use std::panic::Location;
 
@@ -20,7 +20,7 @@ macro_rules! my_other_macro {
 }
 
 fn main() {
-    let error = Error::new(ErrorKind::Other, "bad thing");
+    let error = Error::other("bad thing");
     let x = 'x';
 
     println!("error: {}", format!("something failed at {}", Location::caller()));
@@ -115,7 +115,7 @@ macro_rules! my_println2_args {
 }
 
 fn test2() {
-    let error = Error::new(ErrorKind::Other, "bad thing");
+    let error = Error::other("bad thing");
 
     // None of these should be linted without the config change
     my_println2!(true, "error: {}", format!("something failed at {}", Location::caller()));
@@ -145,7 +145,7 @@ macro_rules! usr_println {
 }
 
 fn user_format() {
-    let error = Error::new(ErrorKind::Other, "bad thing");
+    let error = Error::other("bad thing");
     let x = 'x';
 
     usr_println!(true, "error: {}", format!("boom at {}", Location::caller()));
diff --git a/tests/ui/four_forward_slashes.stderr b/tests/ui/four_forward_slashes.stderr
index 4ac5d13c4fa..95c860b29fb 100644
--- a/tests/ui/four_forward_slashes.stderr
+++ b/tests/ui/four_forward_slashes.stderr
@@ -10,6 +10,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 -
 LL + /// whoops
    |
 
@@ -24,6 +26,8 @@ LL | | fn b() {}
    |
 help: make this a doc comment by removing one `/`
    |
+LL - //// whoops
+LL -
 LL + /// whoops
    |
 
@@ -54,6 +58,8 @@ LL | | fn g() {}
    |
 help: make this a doc comment by removing one `/`
    |
+LL - //// between attributes
+LL -
 LL + /// between attributes
    |
 
@@ -67,6 +73,8 @@ LL | | fn h() {}
    |
 help: make this a doc comment by removing one `/`
    |
+LL -     //// not very start of contents
+LL -
 LL + /// not very start of contents
    |
 
diff --git a/tests/ui/four_forward_slashes_first_line.stderr b/tests/ui/four_forward_slashes_first_line.stderr
index 3cb95797319..6fcd3e2c1b7 100644
--- a/tests/ui/four_forward_slashes_first_line.stderr
+++ b/tests/ui/four_forward_slashes_first_line.stderr
@@ -10,6 +10,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 -
 LL + /// borked doc comment on the first line. doesn't combust!
    |
 
diff --git a/tests/ui/from_over_into.fixed b/tests/ui/from_over_into.fixed
index 7d6780a0e02..7229e5a2d35 100644
--- a/tests/ui/from_over_into.fixed
+++ b/tests/ui/from_over_into.fixed
@@ -105,4 +105,15 @@ fn issue_12138() {
     }
 }
 
+fn issue_112502() {
+    struct MyInt(i64);
+
+    impl From<MyInt> for i64 {
+        //~^ from_over_into
+        fn from(val: MyInt) -> Self {
+            val.0
+        }
+    }
+}
+
 fn main() {}
diff --git a/tests/ui/from_over_into.rs b/tests/ui/from_over_into.rs
index 387ddde359c..9c75969c5c1 100644
--- a/tests/ui/from_over_into.rs
+++ b/tests/ui/from_over_into.rs
@@ -105,4 +105,15 @@ fn issue_12138() {
     }
 }
 
+fn issue_112502() {
+    struct MyInt(i64);
+
+    impl Into<i64> for MyInt {
+        //~^ from_over_into
+        fn into(self: MyInt) -> i64 {
+            self.0
+        }
+    }
+}
+
 fn main() {}
diff --git a/tests/ui/from_over_into.stderr b/tests/ui/from_over_into.stderr
index a564bccbaf7..fe779544dd5 100644
--- a/tests/ui/from_over_into.stderr
+++ b/tests/ui/from_over_into.stderr
@@ -107,5 +107,21 @@ LL |
 LL ~         fn from(val: Hello) {}
    |
 
-error: aborting due to 7 previous errors
+error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
+  --> tests/ui/from_over_into.rs:111:5
+   |
+LL |     impl Into<i64> for MyInt {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
+           https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
+help: replace the `Into` implementation with `From<issue_112502::MyInt>`
+   |
+LL ~     impl From<MyInt> for i64 {
+LL |
+LL ~         fn from(val: MyInt) -> Self {
+LL ~             val.0
+   |
+
+error: aborting due to 8 previous errors
 
diff --git a/tests/ui/get_unwrap.stderr b/tests/ui/get_unwrap.stderr
index f663362dbb3..72a575654af 100644
--- a/tests/ui/get_unwrap.stderr
+++ b/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:40: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:43: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:46: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:49: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:52: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:58: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:65: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:68: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:71: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:74: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:88: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:91: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:108: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:112: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:130: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/tests/ui/ifs_same_cond.rs b/tests/ui/ifs_same_cond.rs
index 6ecb7cb1eba..ebc3acb1b77 100644
--- a/tests/ui/ifs_same_cond.rs
+++ b/tests/ui/ifs_same_cond.rs
@@ -1,10 +1,5 @@
 #![warn(clippy::ifs_same_cond)]
-#![allow(
-    clippy::if_same_then_else,
-    clippy::comparison_chain,
-    clippy::needless_if,
-    clippy::needless_else
-)] // all empty blocks
+#![allow(clippy::if_same_then_else, clippy::needless_if, clippy::needless_else)] // all empty blocks
 
 fn ifs_same_cond() {
     let a = 0;
diff --git a/tests/ui/ifs_same_cond.stderr b/tests/ui/ifs_same_cond.stderr
index 81fbb921e84..df21e6f1b82 100644
--- a/tests/ui/ifs_same_cond.stderr
+++ b/tests/ui/ifs_same_cond.stderr
@@ -1,11 +1,11 @@
 error: this `if` has the same condition as a previous `if`
-  --> tests/ui/ifs_same_cond.rs:14:15
+  --> tests/ui/ifs_same_cond.rs:9:15
    |
 LL |     } else if b {
    |               ^
    |
 note: same as this
-  --> tests/ui/ifs_same_cond.rs:13:8
+  --> tests/ui/ifs_same_cond.rs:8:8
    |
 LL |     if b {
    |        ^
@@ -13,37 +13,37 @@ LL |     if b {
    = help: to override `-D warnings` add `#[allow(clippy::ifs_same_cond)]`
 
 error: this `if` has the same condition as a previous `if`
-  --> tests/ui/ifs_same_cond.rs:19:15
+  --> tests/ui/ifs_same_cond.rs:14:15
    |
 LL |     } else if a == 1 {
    |               ^^^^^^
    |
 note: same as this
-  --> tests/ui/ifs_same_cond.rs:18:8
+  --> tests/ui/ifs_same_cond.rs:13:8
    |
 LL |     if a == 1 {
    |        ^^^^^^
 
 error: this `if` has the same condition as a previous `if`
-  --> tests/ui/ifs_same_cond.rs:25:15
+  --> tests/ui/ifs_same_cond.rs:20:15
    |
 LL |     } else if 2 * a == 1 {
    |               ^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/ifs_same_cond.rs:23:8
+  --> tests/ui/ifs_same_cond.rs:18:8
    |
 LL |     if 2 * a == 1 {
    |        ^^^^^^^^^^
 
 error: this `if` has the same condition as a previous `if`
-  --> tests/ui/ifs_same_cond.rs:58:15
+  --> tests/ui/ifs_same_cond.rs:53:15
    |
 LL |     } else if a.contains("ah") {
    |               ^^^^^^^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/ifs_same_cond.rs:57:8
+  --> tests/ui/ifs_same_cond.rs:52:8
    |
 LL |     if a.contains("ah") {
    |        ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/implicit_hasher.stderr b/tests/ui/implicit_hasher.stderr
index a4b2b5066da..6735998ed65 100644
--- a/tests/ui/implicit_hasher.stderr
+++ b/tests/ui/implicit_hasher.stderr
@@ -83,7 +83,7 @@ LL | pub fn map(map: &mut HashMap<i32, i32>) {}
 help: add a type parameter for `BuildHasher`
    |
 LL | pub fn map<S: ::std::hash::BuildHasher>(map: &mut HashMap<i32, i32, S>) {}
-   |           +++++++++++++++++++++++++++++           ~~~~~~~~~~~~~~~~~~~~
+   |           +++++++++++++++++++++++++++++                           +++
 
 error: parameter of type `HashSet` should be generalized over different hashers
   --> tests/ui/implicit_hasher.rs:76:22
@@ -94,7 +94,7 @@ LL | pub fn set(set: &mut HashSet<i32>) {}
 help: add a type parameter for `BuildHasher`
    |
 LL | pub fn set<S: ::std::hash::BuildHasher>(set: &mut HashSet<i32, S>) {}
-   |           +++++++++++++++++++++++++++++           ~~~~~~~~~~~~~~~
+   |           +++++++++++++++++++++++++++++                      +++
 
 error: impl for `HashMap` should be generalized over different hashers
   --> tests/ui/implicit_hasher.rs:83:43
@@ -120,7 +120,7 @@ LL | pub async fn election_vote(_data: HashMap<i32, i32>) {}
 help: add a type parameter for `BuildHasher`
    |
 LL | pub async fn election_vote<S: ::std::hash::BuildHasher>(_data: HashMap<i32, i32, S>) {}
-   |                           +++++++++++++++++++++++++++++        ~~~~~~~~~~~~~~~~~~~~
+   |                           +++++++++++++++++++++++++++++                        +++
 
 error: aborting due to 9 previous errors
 
diff --git a/tests/ui/implicit_return.stderr b/tests/ui/implicit_return.stderr
index 940324c2549..02044df47ac 100644
--- a/tests/ui/implicit_return.stderr
+++ b/tests/ui/implicit_return.stderr
@@ -9,7 +9,7 @@ LL |     true
 help: add `return` as shown
    |
 LL |     return true
-   |
+   |     ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:20:15
@@ -20,7 +20,7 @@ LL |     if true { true } else { false }
 help: add `return` as shown
    |
 LL |     if true { return true } else { false }
-   |               ~~~~~~~~~~~
+   |               ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:20:29
@@ -31,7 +31,7 @@ LL |     if true { true } else { false }
 help: add `return` as shown
    |
 LL |     if true { true } else { return false }
-   |                             ~~~~~~~~~~~~
+   |                             ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:28:17
@@ -42,7 +42,7 @@ LL |         true => false,
 help: add `return` as shown
    |
 LL |         true => return false,
-   |                 ~~~~~~~~~~~~
+   |                 ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:30:20
@@ -53,7 +53,7 @@ LL |         false => { true },
 help: add `return` as shown
    |
 LL |         false => { return true },
-   |                    ~~~~~~~~~~~
+   |                    ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:44:9
@@ -63,8 +63,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:52:13
@@ -74,8 +75,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:61:13
@@ -85,8 +87,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:80:18
@@ -97,7 +100,7 @@ LL |     let _ = || { true };
 help: add `return` as shown
    |
 LL |     let _ = || { return true };
-   |                  ~~~~~~~~~~~
+   |                  ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:82:16
@@ -108,7 +111,7 @@ LL |     let _ = || true;
 help: add `return` as shown
    |
 LL |     let _ = || return true;
-   |                ~~~~~~~~~~~
+   |                ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:91:5
@@ -119,7 +122,7 @@ LL |     format!("test {}", "test")
 help: add `return` as shown
    |
 LL |     return format!("test {}", "test")
-   |
+   |     ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:101:5
@@ -130,7 +133,7 @@ LL |     m!(true, false)
 help: add `return` as shown
    |
 LL |     return m!(true, false)
-   |
+   |     ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:108:13
@@ -140,8 +143,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:114:17
@@ -151,8 +155,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:130:5
@@ -164,10 +169,8 @@ LL | |     }
    |
 help: add `return` as shown
    |
-LL ~     return loop {
-LL +         m!(true);
-LL +     }
-   |
+LL |     return loop {
+   |     ++++++
 
 error: missing `return` statement
   --> tests/ui/implicit_return.rs:145:5
@@ -178,7 +181,7 @@ LL |     true
 help: add `return` as shown
    |
 LL |     return true
-   |
+   |     ++++++
 
 error: aborting due to 16 previous errors
 
diff --git a/tests/ui/implicit_saturating_sub.fixed b/tests/ui/implicit_saturating_sub.fixed
index 136238f9eca..1aab6c54407 100644
--- a/tests/ui/implicit_saturating_sub.fixed
+++ b/tests/ui/implicit_saturating_sub.fixed
@@ -228,3 +228,27 @@ fn regression_13524(a: usize, b: usize, c: bool) -> usize {
         123
     } else { b.saturating_sub(a) }
 }
+
+fn with_side_effect(a: u64) -> u64 {
+    println!("a = {a}");
+    a
+}
+
+fn arbitrary_expression() {
+    let (a, b) = (15u64, 20u64);
+
+    let _ = (a * 2).saturating_sub(b);
+    //~^ implicit_saturating_sub
+
+    let _ = a.saturating_sub(b * 2);
+    //~^ implicit_saturating_sub
+
+    let _ = a.saturating_sub(b * 2);
+    //~^ implicit_saturating_sub
+
+    let _ = if with_side_effect(a) > a {
+        with_side_effect(a) - a
+    } else {
+        0
+    };
+}
diff --git a/tests/ui/implicit_saturating_sub.rs b/tests/ui/implicit_saturating_sub.rs
index 140cf033860..7ca57a2902d 100644
--- a/tests/ui/implicit_saturating_sub.rs
+++ b/tests/ui/implicit_saturating_sub.rs
@@ -302,3 +302,27 @@ fn regression_13524(a: usize, b: usize, c: bool) -> usize {
         b - a
     }
 }
+
+fn with_side_effect(a: u64) -> u64 {
+    println!("a = {a}");
+    a
+}
+
+fn arbitrary_expression() {
+    let (a, b) = (15u64, 20u64);
+
+    let _ = if a * 2 > b { a * 2 - b } else { 0 };
+    //~^ implicit_saturating_sub
+
+    let _ = if a > b * 2 { a - b * 2 } else { 0 };
+    //~^ implicit_saturating_sub
+
+    let _ = if a < b * 2 { 0 } else { a - b * 2 };
+    //~^ implicit_saturating_sub
+
+    let _ = if with_side_effect(a) > a {
+        with_side_effect(a) - a
+    } else {
+        0
+    };
+}
diff --git a/tests/ui/implicit_saturating_sub.stderr b/tests/ui/implicit_saturating_sub.stderr
index f9c94d3ad84..0c225856fd0 100644
--- a/tests/ui/implicit_saturating_sub.stderr
+++ b/tests/ui/implicit_saturating_sub.stderr
@@ -220,5 +220,23 @@ LL | |         b - a
 LL | |     }
    | |_____^ help: replace it with: `{ b.saturating_sub(a) }`
 
-error: aborting due to 24 previous errors
+error: manual arithmetic check found
+  --> tests/ui/implicit_saturating_sub.rs:314:13
+   |
+LL |     let _ = if a * 2 > b { a * 2 - b } else { 0 };
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `(a * 2).saturating_sub(b)`
+
+error: manual arithmetic check found
+  --> tests/ui/implicit_saturating_sub.rs:317:13
+   |
+LL |     let _ = if a > b * 2 { a - b * 2 } else { 0 };
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b * 2)`
+
+error: manual arithmetic check found
+  --> tests/ui/implicit_saturating_sub.rs:320:13
+   |
+LL |     let _ = if a < b * 2 { 0 } else { a - b * 2 };
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `a.saturating_sub(b * 2)`
+
+error: aborting due to 27 previous errors
 
diff --git a/tests/ui/incompatible_msrv.rs b/tests/ui/incompatible_msrv.rs
index b4fea4cae5e..99101b2bb8f 100644
--- a/tests/ui/incompatible_msrv.rs
+++ b/tests/ui/incompatible_msrv.rs
@@ -1,5 +1,6 @@
 #![warn(clippy::incompatible_msrv)]
 #![feature(custom_inner_attributes)]
+#![feature(panic_internals)]
 #![clippy::msrv = "1.3.0"]
 
 use std::collections::HashMap;
@@ -34,4 +35,42 @@ async fn issue12273(v: impl Future<Output = ()>) {
     v.await;
 }
 
+fn core_special_treatment(p: bool) {
+    // Do not lint code coming from `core` macros expanding into `core` function calls
+    if p {
+        panic!("foo"); // Do not lint
+    }
+
+    // But still lint code calling `core` functions directly
+    if p {
+        core::panicking::panic("foo");
+        //~^ ERROR: is `1.3.0` but this item is stable since `1.6.0`
+    }
+
+    // Lint code calling `core` from non-`core` macros
+    macro_rules! my_panic {
+        ($msg:expr) => {
+            core::panicking::panic($msg)
+        }; //~^ ERROR: is `1.3.0` but this item is stable since `1.6.0`
+    }
+    my_panic!("foo");
+
+    // Lint even when the macro comes from `core` and calls `core` functions
+    assert!(core::panicking::panic("out of luck"));
+    //~^ ERROR: is `1.3.0` but this item is stable since `1.6.0`
+}
+
+#[clippy::msrv = "1.26.0"]
+fn lang_items() {
+    // Do not lint lang items. `..=` will expand into `RangeInclusive::new()`, which was introduced
+    // in Rust 1.27.0.
+    let _ = 1..=3;
+}
+
+#[clippy::msrv = "1.80.0"]
+fn issue14212() {
+    let _ = std::iter::repeat_n((), 5);
+    //~^ ERROR: is `1.80.0` but this item is stable since `1.82.0`
+}
+
 fn main() {}
diff --git a/tests/ui/incompatible_msrv.stderr b/tests/ui/incompatible_msrv.stderr
index 56c9eae5aaf..5ea2bb9cc58 100644
--- a/tests/ui/incompatible_msrv.stderr
+++ b/tests/ui/incompatible_msrv.stderr
@@ -1,5 +1,5 @@
 error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.10.0`
-  --> tests/ui/incompatible_msrv.rs:13:39
+  --> tests/ui/incompatible_msrv.rs:14:39
    |
 LL |     assert_eq!(map.entry("poneyland").key(), &"poneyland");
    |                                       ^^^^^
@@ -8,16 +8,45 @@ LL |     assert_eq!(map.entry("poneyland").key(), &"poneyland");
    = help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]`
 
 error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.12.0`
-  --> tests/ui/incompatible_msrv.rs:17:11
+  --> tests/ui/incompatible_msrv.rs:18:11
    |
 LL |         v.into_key();
    |           ^^^^^^^^^^
 
 error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.4.0`
-  --> tests/ui/incompatible_msrv.rs:21:5
+  --> tests/ui/incompatible_msrv.rs:22:5
    |
 LL |     sleep(Duration::new(1, 0));
    |     ^^^^^
 
-error: aborting due to 3 previous errors
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.6.0`
+  --> tests/ui/incompatible_msrv.rs:46:9
+   |
+LL |         core::panicking::panic("foo");
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.6.0`
+  --> tests/ui/incompatible_msrv.rs:53:13
+   |
+LL |             core::panicking::panic($msg)
+   |             ^^^^^^^^^^^^^^^^^^^^^^
+...
+LL |     my_panic!("foo");
+   |     ---------------- in this macro invocation
+   |
+   = note: this error originates in the macro `my_panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.6.0`
+  --> tests/ui/incompatible_msrv.rs:59:13
+   |
+LL |     assert!(core::panicking::panic("out of luck"));
+   |             ^^^^^^^^^^^^^^^^^^^^^^
+
+error: current MSRV (Minimum Supported Rust Version) is `1.80.0` but this item is stable since `1.82.0`
+  --> tests/ui/incompatible_msrv.rs:72:13
+   |
+LL |     let _ = std::iter::repeat_n((), 5);
+   |             ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 7 previous errors
 
diff --git a/tests/ui/io_other_error.fixed b/tests/ui/io_other_error.fixed
new file mode 100644
index 00000000000..ce7e8ef281f
--- /dev/null
+++ b/tests/ui/io_other_error.fixed
@@ -0,0 +1,60 @@
+#![warn(clippy::io_other_error)]
+use std::fmt;
+
+#[derive(Debug)]
+struct E;
+
+impl std::error::Error for E {}
+impl fmt::Display for E {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("E")
+    }
+}
+
+macro_rules! o {
+    {} => { std::io::ErrorKind::Other };
+}
+
+macro_rules! e {
+    { $kind:expr } => { std::io::Error::new($kind, E) };
+}
+
+fn main() {
+    let _err = std::io::Error::other(E);
+    //~^ ERROR: this can be `std::io::Error::other(_)`
+    let other = std::io::ErrorKind::Other;
+    let _err = std::io::Error::other(E);
+    //~^ ERROR: this can be `std::io::Error::other(_)`
+
+    // not other
+    let _err = std::io::Error::new(std::io::ErrorKind::TimedOut, E);
+
+    // from expansion
+    let _err = e!(other);
+    let _err = std::io::Error::new(o!(), E);
+    let _err = e!(o!());
+
+    paths::short();
+    under_msrv();
+}
+
+mod paths {
+    use std::io::{self, Error, ErrorKind};
+
+    pub fn short() {
+        let _err = Error::other(super::E);
+        //~^ ERROR: this can be `std::io::Error::other(_)`
+        let _err = io::Error::other(super::E);
+        //~^ ERROR: this can be `std::io::Error::other(_)`
+    }
+}
+
+#[clippy::msrv = "1.73"]
+fn under_msrv() {
+    let _err = std::io::Error::new(std::io::ErrorKind::Other, E);
+}
+
+pub fn issue14346(x: i32) -> std::io::Error {
+    std::io::Error::other(format!("{x}"))
+    //~^ ERROR: this can be `std::io::Error::other(_)`
+}
diff --git a/tests/ui/io_other_error.rs b/tests/ui/io_other_error.rs
new file mode 100644
index 00000000000..b66e7f88ab1
--- /dev/null
+++ b/tests/ui/io_other_error.rs
@@ -0,0 +1,60 @@
+#![warn(clippy::io_other_error)]
+use std::fmt;
+
+#[derive(Debug)]
+struct E;
+
+impl std::error::Error for E {}
+impl fmt::Display for E {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("E")
+    }
+}
+
+macro_rules! o {
+    {} => { std::io::ErrorKind::Other };
+}
+
+macro_rules! e {
+    { $kind:expr } => { std::io::Error::new($kind, E) };
+}
+
+fn main() {
+    let _err = std::io::Error::new(std::io::ErrorKind::Other, E);
+    //~^ ERROR: this can be `std::io::Error::other(_)`
+    let other = std::io::ErrorKind::Other;
+    let _err = std::io::Error::new(other, E);
+    //~^ ERROR: this can be `std::io::Error::other(_)`
+
+    // not other
+    let _err = std::io::Error::new(std::io::ErrorKind::TimedOut, E);
+
+    // from expansion
+    let _err = e!(other);
+    let _err = std::io::Error::new(o!(), E);
+    let _err = e!(o!());
+
+    paths::short();
+    under_msrv();
+}
+
+mod paths {
+    use std::io::{self, Error, ErrorKind};
+
+    pub fn short() {
+        let _err = Error::new(ErrorKind::Other, super::E);
+        //~^ ERROR: this can be `std::io::Error::other(_)`
+        let _err = io::Error::new(io::ErrorKind::Other, super::E);
+        //~^ ERROR: this can be `std::io::Error::other(_)`
+    }
+}
+
+#[clippy::msrv = "1.73"]
+fn under_msrv() {
+    let _err = std::io::Error::new(std::io::ErrorKind::Other, E);
+}
+
+pub fn issue14346(x: i32) -> std::io::Error {
+    std::io::Error::new(std::io::ErrorKind::Other, format!("{x}"))
+    //~^ ERROR: this can be `std::io::Error::other(_)`
+}
diff --git a/tests/ui/io_other_error.stderr b/tests/ui/io_other_error.stderr
new file mode 100644
index 00000000000..b37e3d15064
--- /dev/null
+++ b/tests/ui/io_other_error.stderr
@@ -0,0 +1,64 @@
+error: this can be `std::io::Error::other(_)`
+  --> tests/ui/io_other_error.rs:23:16
+   |
+LL |     let _err = std::io::Error::new(std::io::ErrorKind::Other, E);
+   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::io-other-error` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::io_other_error)]`
+help: use `std::io::Error::other`
+   |
+LL -     let _err = std::io::Error::new(std::io::ErrorKind::Other, E);
+LL +     let _err = std::io::Error::other(E);
+   |
+
+error: this can be `std::io::Error::other(_)`
+  --> tests/ui/io_other_error.rs:26:16
+   |
+LL |     let _err = std::io::Error::new(other, E);
+   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `std::io::Error::other`
+   |
+LL -     let _err = std::io::Error::new(other, E);
+LL +     let _err = std::io::Error::other(E);
+   |
+
+error: this can be `std::io::Error::other(_)`
+  --> tests/ui/io_other_error.rs:45:20
+   |
+LL |         let _err = Error::new(ErrorKind::Other, super::E);
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `std::io::Error::other`
+   |
+LL -         let _err = Error::new(ErrorKind::Other, super::E);
+LL +         let _err = Error::other(super::E);
+   |
+
+error: this can be `std::io::Error::other(_)`
+  --> tests/ui/io_other_error.rs:47:20
+   |
+LL |         let _err = io::Error::new(io::ErrorKind::Other, super::E);
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `std::io::Error::other`
+   |
+LL -         let _err = io::Error::new(io::ErrorKind::Other, super::E);
+LL +         let _err = io::Error::other(super::E);
+   |
+
+error: this can be `std::io::Error::other(_)`
+  --> tests/ui/io_other_error.rs:58:5
+   |
+LL |     std::io::Error::new(std::io::ErrorKind::Other, format!("{x}"))
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `std::io::Error::other`
+   |
+LL -     std::io::Error::new(std::io::ErrorKind::Other, format!("{x}"))
+LL +     std::io::Error::other(format!("{x}"))
+   |
+
+error: aborting due to 5 previous errors
+
diff --git a/tests/ui/iter_nth.stderr b/tests/ui/iter_nth.stderr
index ae6e66f8cbf..76ddfd9684e 100644
--- a/tests/ui/iter_nth.stderr
+++ b/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:36: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:38: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:40: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:46: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:50: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:54: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:59: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/tests/ui/join_absolute_paths.stderr b/tests/ui/join_absolute_paths.stderr
index e7fd5508823..300946bf3b5 100644
--- a/tests/ui/join_absolute_paths.stderr
+++ b/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/tests/ui/large_enum_variant.32bit.stderr b/tests/ui/large_enum_variant.32bit.stderr
index 7f66207ce79..80ca5daa1d5 100644
--- a/tests/ui/large_enum_variant.32bit.stderr
+++ b/tests/ui/large_enum_variant.32bit.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<[i32; 8000]>),
-   |       ~~~~~~~~~~~~~~~~
+LL -     B([i32; 8000]),
+LL +     B(Box<[i32; 8000]>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:38:1
@@ -31,8 +32,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     ContainingLargeEnum(Box<LargeEnum>),
-   |                         ~~~~~~~~~~~~~~
+LL -     ContainingLargeEnum(LargeEnum),
+LL +     ContainingLargeEnum(Box<LargeEnum>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:44:1
@@ -49,8 +51,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:51:1
@@ -66,8 +69,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:57:1
@@ -83,8 +87,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:74:1
@@ -101,8 +106,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:81:1
@@ -118,8 +124,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:87:1
@@ -135,8 +142,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     B(Box<Struct2>),
-   |       ~~~~~~~~~~~~
+LL -     B(Struct2),
+LL +     B(Box<Struct2>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:93:1
@@ -152,8 +160,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     B(Box<Struct2>),
-   |       ~~~~~~~~~~~~
+LL -     B(Struct2),
+LL +     B(Box<Struct2>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:99:1
@@ -169,8 +178,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     B(Box<Struct2>),
-   |       ~~~~~~~~~~~~
+LL -     B(Struct2),
+LL +     B(Box<Struct2>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:115:1
@@ -255,8 +265,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:159:1
@@ -272,8 +283,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Large(Box<[Foo<u64>; 64]>),
-   |           ~~~~~~~~~~~~~~~~~~~
+LL -     Large([Foo<u64>; 64]),
+LL +     Large(Box<[Foo<u64>; 64]>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:170:1
@@ -289,8 +301,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Error(Box<PossiblyLargeEnumWithConst<256>>),
-   |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     Error(PossiblyLargeEnumWithConst<256>),
+LL +     Error(Box<PossiblyLargeEnumWithConst<256>>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:176:1
@@ -306,8 +319,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Large(Box<[u64; 64]>),
-   |           ~~~~~~~~~~~~~~
+LL -     Large([u64; 64]),
+LL +     Large(Box<[u64; 64]>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:187:1
@@ -323,8 +337,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Error(Box<WithRecursionAndGenerics<u64>>),
-   |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     Error(WithRecursionAndGenerics<u64>),
+LL +     Error(Box<WithRecursionAndGenerics<u64>>),
+   |
 
 error: aborting due to 18 previous errors
 
diff --git a/tests/ui/large_enum_variant.64bit.stderr b/tests/ui/large_enum_variant.64bit.stderr
index dbc4c125e61..559bdf2a2f5 100644
--- a/tests/ui/large_enum_variant.64bit.stderr
+++ b/tests/ui/large_enum_variant.64bit.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<[i32; 8000]>),
-   |       ~~~~~~~~~~~~~~~~
+LL -     B([i32; 8000]),
+LL +     B(Box<[i32; 8000]>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:38:1
@@ -31,8 +32,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     ContainingLargeEnum(Box<LargeEnum>),
-   |                         ~~~~~~~~~~~~~~
+LL -     ContainingLargeEnum(LargeEnum),
+LL +     ContainingLargeEnum(Box<LargeEnum>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:44:1
@@ -49,8 +51,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:51:1
@@ -66,8 +69,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:57:1
@@ -83,8 +87,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:74:1
@@ -101,8 +106,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:81:1
@@ -118,8 +124,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:87:1
@@ -135,8 +142,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     B(Box<Struct2>),
-   |       ~~~~~~~~~~~~
+LL -     B(Struct2),
+LL +     B(Box<Struct2>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:93:1
@@ -152,8 +160,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     B(Box<Struct2>),
-   |       ~~~~~~~~~~~~
+LL -     B(Struct2),
+LL +     B(Box<Struct2>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:99:1
@@ -169,8 +178,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     B(Box<Struct2>),
-   |       ~~~~~~~~~~~~
+LL -     B(Struct2),
+LL +     B(Box<Struct2>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:115:1
@@ -255,8 +265,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:159:1
@@ -272,8 +283,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Large(Box<[Foo<u64>; 64]>),
-   |           ~~~~~~~~~~~~~~~~~~~
+LL -     Large([Foo<u64>; 64]),
+LL +     Large(Box<[Foo<u64>; 64]>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:170:1
@@ -289,8 +301,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Error(Box<PossiblyLargeEnumWithConst<256>>),
-   |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     Error(PossiblyLargeEnumWithConst<256>),
+LL +     Error(Box<PossiblyLargeEnumWithConst<256>>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:176:1
@@ -306,8 +319,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Large(Box<[u64; 64]>),
-   |           ~~~~~~~~~~~~~~
+LL -     Large([u64; 64]),
+LL +     Large(Box<[u64; 64]>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:187:1
@@ -323,8 +337,9 @@ LL | | }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |     Error(Box<WithRecursionAndGenerics<u64>>),
-   |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     Error(WithRecursionAndGenerics<u64>),
+LL +     Error(Box<WithRecursionAndGenerics<u64>>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:223:5
@@ -340,8 +355,9 @@ LL | |     }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |         BigBoi(Box<PublishWithBytes>),
-   |                ~~~~~~~~~~~~~~~~~~~~~
+LL -         BigBoi(PublishWithBytes),
+LL +         BigBoi(Box<PublishWithBytes>),
+   |
 
 error: large size difference between variants
   --> tests/ui/large_enum_variant.rs:229:5
@@ -357,8 +373,9 @@ LL | |     }
    |
 help: consider boxing the large fields to reduce the total size of the enum
    |
-LL |         BigBoi(Box<PublishWithVec>),
-   |                ~~~~~~~~~~~~~~~~~~~
+LL -         BigBoi(PublishWithVec),
+LL +         BigBoi(Box<PublishWithVec>),
+   |
 
 error: aborting due to 20 previous errors
 
diff --git a/tests/ui/legacy_numeric_constants.stderr b/tests/ui/legacy_numeric_constants.stderr
index af9b003ed54..4d69b8165a3 100644
--- a/tests/ui/legacy_numeric_constants.stderr
+++ b/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:35: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:38: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:41: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:44: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:47:5
@@ -64,7 +69,7 @@ LL |     MAX;
 help: use the associated constant instead
    |
 LL |     u32::MAX;
-   |     ~~~~~~~~
+   |     +++++
 
 error: usage of a legacy numeric method
   --> tests/ui/legacy_numeric_constants.rs:50:10
@@ -74,8 +79,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:53:9
@@ -85,8 +91,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:56:9
@@ -96,8 +103,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:59:5
@@ -107,8 +115,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:62:27
@@ -118,8 +127,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:65:26
@@ -129,8 +139,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:68:5
@@ -140,8 +151,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:18:25
@@ -155,8 +167,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:82:14
@@ -166,8 +179,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:116:5
@@ -177,8 +191,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/tests/ui/literals.rs b/tests/ui/literals.rs
index d21d49310a0..ba343a8f62f 100644
--- a/tests/ui/literals.rs
+++ b/tests/ui/literals.rs
@@ -30,6 +30,10 @@ fn main() {
     //~^ separated_literal_suffix
     //~| mixed_case_hex_literals
 
+    let fail2 = 0xab_CD_isize;
+    //~^ separated_literal_suffix
+    //~| mixed_case_hex_literals
+
     let fail_multi_zero = 000_123usize;
     //~^ unseparated_literal_suffix
     //~| zero_prefixed_literal
diff --git a/tests/ui/literals.stderr b/tests/ui/literals.stderr
index dcee7169c0a..6bfeb91625b 100644
--- a/tests/ui/literals.stderr
+++ b/tests/ui/literals.stderr
@@ -25,6 +25,7 @@ error: inconsistent casing in hexadecimal literal
 LL |     let fail1 = 0xabCD;
    |                 ^^^^^^
    |
+   = help: consider using `0xabcd` or `0xABCD`
    = note: `-D clippy::mixed-case-hex-literals` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::mixed_case_hex_literals)]`
 
@@ -39,6 +40,8 @@ error: inconsistent casing in hexadecimal literal
    |
 LL |     let fail2 = 0xabCD_u32;
    |                 ^^^^^^^^^^
+   |
+   = help: consider using `0xabcd_u32` or `0xABCD_u32`
 
 error: integer type suffix should not be separated by an underscore
   --> tests/ui/literals.rs:29:17
@@ -51,9 +54,25 @@ error: inconsistent casing in hexadecimal literal
    |
 LL |     let fail2 = 0xabCD_isize;
    |                 ^^^^^^^^^^^^
+   |
+   = help: consider using `0xabcd_isize` or `0xABCD_isize`
+
+error: integer type suffix should not be separated by an underscore
+  --> tests/ui/literals.rs:33:17
+   |
+LL |     let fail2 = 0xab_CD_isize;
+   |                 ^^^^^^^^^^^^^ help: remove the underscore: `0xab_CDisize`
+
+error: inconsistent casing in hexadecimal literal
+  --> tests/ui/literals.rs:33:17
+   |
+LL |     let fail2 = 0xab_CD_isize;
+   |                 ^^^^^^^^^^^^^
+   |
+   = help: consider using `0xab_cd_isize` or `0xAB_CD_isize`
 
 error: integer type suffix should be separated by an underscore
-  --> tests/ui/literals.rs:33:27
+  --> tests/ui/literals.rs:37:27
    |
 LL |     let fail_multi_zero = 000_123usize;
    |                           ^^^^^^^^^^^^ help: add an underscore: `000_123_usize`
@@ -62,7 +81,7 @@ LL |     let fail_multi_zero = 000_123usize;
    = help: to override `-D warnings` add `#[allow(clippy::unseparated_literal_suffix)]`
 
 error: this is a decimal constant
-  --> tests/ui/literals.rs:33:27
+  --> tests/ui/literals.rs:37:27
    |
 LL |     let fail_multi_zero = 000_123usize;
    |                           ^^^^^^^^^^^^
@@ -71,42 +90,45 @@ 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:38:16
+  --> tests/ui/literals.rs:42:16
    |
 LL |     let ok10 = 0_i64;
    |                ^^^^^ help: remove the underscore: `0i64`
 
 error: this is a decimal constant
-  --> tests/ui/literals.rs:41:17
+  --> tests/ui/literals.rs:45:17
    |
 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;
-   |                 ~~~~~
+   |                  +
 
 error: integer type suffix should not be separated by an underscore
-  --> tests/ui/literals.rs:51:16
+  --> tests/ui/literals.rs:55:16
    |
 LL |     let ok17 = 0x123_4567_8901_usize;
    |                ^^^^^^^^^^^^^^^^^^^^^ help: remove the underscore: `0x123_4567_8901usize`
 
 error: digits grouped inconsistently by underscores
-  --> tests/ui/literals.rs:56:18
+  --> tests/ui/literals.rs:60:18
    |
 LL |     let fail19 = 12_3456_21;
    |                  ^^^^^^^^^^ help: consider: `12_345_621`
@@ -115,19 +137,19 @@ LL |     let fail19 = 12_3456_21;
    = help: to override `-D warnings` add `#[allow(clippy::inconsistent_digit_grouping)]`
 
 error: digits grouped inconsistently by underscores
-  --> tests/ui/literals.rs:59:18
+  --> tests/ui/literals.rs:63:18
    |
 LL |     let fail22 = 3__4___23;
    |                  ^^^^^^^^^ help: consider: `3_423`
 
 error: digits grouped inconsistently by underscores
-  --> tests/ui/literals.rs:62:18
+  --> tests/ui/literals.rs:66:18
    |
 LL |     let fail23 = 3__16___23;
    |                  ^^^^^^^^^^ help: consider: `31_623`
 
 error: digits of hex, binary or octal literal not in groups of equal size
-  --> tests/ui/literals.rs:65:18
+  --> tests/ui/literals.rs:69:18
    |
 LL |     let fail24 = 0xAB_ABC_AB;
    |                  ^^^^^^^^^^^ help: consider: `0x0ABA_BCAB`
@@ -136,37 +158,40 @@ LL |     let fail24 = 0xAB_ABC_AB;
    = help: to override `-D warnings` add `#[allow(clippy::unusual_byte_groupings)]`
 
 error: this is a decimal constant
-  --> tests/ui/literals.rs:75:13
+  --> tests/ui/literals.rs:79:13
    |
 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:78:13
+  --> tests/ui/literals.rs:82:13
    |
 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:81:13
+  --> tests/ui/literals.rs:85:13
    |
 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
+error: aborting due to 22 previous errors
 
diff --git a/tests/ui/lossy_float_literal.stderr b/tests/ui/lossy_float_literal.stderr
index a83f9a7aa24..33b650b19c8 100644
--- a/tests/ui/lossy_float_literal.stderr
+++ b/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:16: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:18: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:20: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:22: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:24: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:27: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:29: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:31: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:33: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:35: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/tests/ui/manual_arithmetic_check-2.rs b/tests/ui/manual_arithmetic_check-2.rs
index 749d15f1cbd..b094b2021b3 100644
--- a/tests/ui/manual_arithmetic_check-2.rs
+++ b/tests/ui/manual_arithmetic_check-2.rs
@@ -24,6 +24,15 @@ fn main() {
     let result = if b <= a { 0 } else { a - b };
     //~^ inverted_saturating_sub
 
+    let result = if b * 2 <= a { 0 } else { a - b * 2 };
+    //~^ inverted_saturating_sub
+
+    let result = if b <= a * 2 { 0 } else { a * 2 - b };
+    //~^ inverted_saturating_sub
+
+    let result = if b + 3 <= a + 2 { 0 } else { (a + 2) - (b + 3) };
+    //~^ inverted_saturating_sub
+
     let af = 12f32;
     let bf = 13f32;
     // Should not lint!
diff --git a/tests/ui/manual_arithmetic_check-2.stderr b/tests/ui/manual_arithmetic_check-2.stderr
index 8841210befd..fb0f0da772c 100644
--- a/tests/ui/manual_arithmetic_check-2.stderr
+++ b/tests/ui/manual_arithmetic_check-2.stderr
@@ -71,5 +71,41 @@ note: this subtraction underflows when `a < b`
 LL |     let result = if b <= a { 0 } else { a - b };
    |                                         ^^^^^
 
-error: aborting due to 6 previous errors
+error: inverted arithmetic check before subtraction
+  --> tests/ui/manual_arithmetic_check-2.rs:27:27
+   |
+LL |     let result = if b * 2 <= a { 0 } else { a - b * 2 };
+   |                           ^^                --------- help: try replacing it with: `b * 2 - a`
+   |
+note: this subtraction underflows when `a < b * 2`
+  --> tests/ui/manual_arithmetic_check-2.rs:27:45
+   |
+LL |     let result = if b * 2 <= a { 0 } else { a - b * 2 };
+   |                                             ^^^^^^^^^
+
+error: inverted arithmetic check before subtraction
+  --> tests/ui/manual_arithmetic_check-2.rs:30:23
+   |
+LL |     let result = if b <= a * 2 { 0 } else { a * 2 - b };
+   |                       ^^                    --------- help: try replacing it with: `b - a * 2`
+   |
+note: this subtraction underflows when `a * 2 < b`
+  --> tests/ui/manual_arithmetic_check-2.rs:30:45
+   |
+LL |     let result = if b <= a * 2 { 0 } else { a * 2 - b };
+   |                                             ^^^^^^^^^
+
+error: inverted arithmetic check before subtraction
+  --> tests/ui/manual_arithmetic_check-2.rs:33:27
+   |
+LL |     let result = if b + 3 <= a + 2 { 0 } else { (a + 2) - (b + 3) };
+   |                           ^^                    ----------------- help: try replacing it with: `b + 3 - (a + 2)`
+   |
+note: this subtraction underflows when `a + 2 < b + 3`
+  --> tests/ui/manual_arithmetic_check-2.rs:33:49
+   |
+LL |     let result = if b + 3 <= a + 2 { 0 } else { (a + 2) - (b + 3) };
+   |                                                 ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 9 previous errors
 
diff --git a/tests/ui/manual_assert.edition2018.stderr b/tests/ui/manual_assert.edition2018.stderr
index f9fa8cf04d9..8cedf2c6863 100644
--- a/tests/ui/manual_assert.edition2018.stderr
+++ b/tests/ui/manual_assert.edition2018.stderr
@@ -11,7 +11,11 @@ LL | |     }
    = help: to override `-D warnings` add `#[allow(clippy::manual_assert)]`
 help: try instead
    |
-LL |     assert!(a.is_empty(), "qaqaq{:?}", a);
+LL -     if !a.is_empty() {
+LL -
+LL -         panic!("qaqaq{:?}", a);
+LL -     }
+LL +     assert!(a.is_empty(), "qaqaq{:?}", a);
    |
 
 error: only a `panic!` in `if`-then statement
@@ -25,7 +29,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(a.is_empty(), "qwqwq");
+LL -     if !a.is_empty() {
+LL -
+LL -         panic!("qwqwq");
+LL -     }
+LL +     assert!(a.is_empty(), "qwqwq");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -39,7 +47,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!b.is_empty(), "panic1");
+LL -     if b.is_empty() {
+LL -
+LL -         panic!("panic1");
+LL -     }
+LL +     assert!(!b.is_empty(), "panic1");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -53,7 +65,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(b.is_empty() && a.is_empty()), "panic2");
+LL -     if b.is_empty() && a.is_empty() {
+LL -
+LL -         panic!("panic2");
+LL -     }
+LL +     assert!(!(b.is_empty() && a.is_empty()), "panic2");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -67,7 +83,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(a.is_empty() && !b.is_empty()), "panic3");
+LL -     if a.is_empty() && !b.is_empty() {
+LL -
+LL -         panic!("panic3");
+LL -     }
+LL +     assert!(!(a.is_empty() && !b.is_empty()), "panic3");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -81,7 +101,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(b.is_empty() || a.is_empty()), "panic4");
+LL -     if b.is_empty() || a.is_empty() {
+LL -
+LL -         panic!("panic4");
+LL -     }
+LL +     assert!(!(b.is_empty() || a.is_empty()), "panic4");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -95,7 +119,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(a.is_empty() || !b.is_empty()), "panic5");
+LL -     if a.is_empty() || !b.is_empty() {
+LL -
+LL -         panic!("panic5");
+LL -     }
+LL +     assert!(!(a.is_empty() || !b.is_empty()), "panic5");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -109,7 +137,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!a.is_empty(), "with expansion {}", one!());
+LL -     if a.is_empty() {
+LL -
+LL -         panic!("with expansion {}", one!())
+LL -     }
+LL +     assert!(!a.is_empty(), "with expansion {}", one!());
    |
 
 error: only a `panic!` in `if`-then statement
@@ -126,7 +158,16 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(a > 2), "panic with comment");
+LL -     if a > 2 {
+LL -
+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
@@ -141,8 +182,12 @@ LL | |         };
    |
 help: try instead
    |
-LL |         const BAR: () = assert!(!(N == 0), );
-   |                         ~~~~~~~~~~~~~~~~~~~~
+LL -         const BAR: () = if N == 0 {
+LL -
+LL -             panic!()
+LL -         };
+LL +         const BAR: () = assert!(!(N == 0), );
+   |
 
 error: aborting due to 10 previous errors
 
diff --git a/tests/ui/manual_assert.edition2021.stderr b/tests/ui/manual_assert.edition2021.stderr
index f9fa8cf04d9..8cedf2c6863 100644
--- a/tests/ui/manual_assert.edition2021.stderr
+++ b/tests/ui/manual_assert.edition2021.stderr
@@ -11,7 +11,11 @@ LL | |     }
    = help: to override `-D warnings` add `#[allow(clippy::manual_assert)]`
 help: try instead
    |
-LL |     assert!(a.is_empty(), "qaqaq{:?}", a);
+LL -     if !a.is_empty() {
+LL -
+LL -         panic!("qaqaq{:?}", a);
+LL -     }
+LL +     assert!(a.is_empty(), "qaqaq{:?}", a);
    |
 
 error: only a `panic!` in `if`-then statement
@@ -25,7 +29,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(a.is_empty(), "qwqwq");
+LL -     if !a.is_empty() {
+LL -
+LL -         panic!("qwqwq");
+LL -     }
+LL +     assert!(a.is_empty(), "qwqwq");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -39,7 +47,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!b.is_empty(), "panic1");
+LL -     if b.is_empty() {
+LL -
+LL -         panic!("panic1");
+LL -     }
+LL +     assert!(!b.is_empty(), "panic1");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -53,7 +65,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(b.is_empty() && a.is_empty()), "panic2");
+LL -     if b.is_empty() && a.is_empty() {
+LL -
+LL -         panic!("panic2");
+LL -     }
+LL +     assert!(!(b.is_empty() && a.is_empty()), "panic2");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -67,7 +83,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(a.is_empty() && !b.is_empty()), "panic3");
+LL -     if a.is_empty() && !b.is_empty() {
+LL -
+LL -         panic!("panic3");
+LL -     }
+LL +     assert!(!(a.is_empty() && !b.is_empty()), "panic3");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -81,7 +101,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(b.is_empty() || a.is_empty()), "panic4");
+LL -     if b.is_empty() || a.is_empty() {
+LL -
+LL -         panic!("panic4");
+LL -     }
+LL +     assert!(!(b.is_empty() || a.is_empty()), "panic4");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -95,7 +119,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(a.is_empty() || !b.is_empty()), "panic5");
+LL -     if a.is_empty() || !b.is_empty() {
+LL -
+LL -         panic!("panic5");
+LL -     }
+LL +     assert!(!(a.is_empty() || !b.is_empty()), "panic5");
    |
 
 error: only a `panic!` in `if`-then statement
@@ -109,7 +137,11 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!a.is_empty(), "with expansion {}", one!());
+LL -     if a.is_empty() {
+LL -
+LL -         panic!("with expansion {}", one!())
+LL -     }
+LL +     assert!(!a.is_empty(), "with expansion {}", one!());
    |
 
 error: only a `panic!` in `if`-then statement
@@ -126,7 +158,16 @@ LL | |     }
    |
 help: try instead
    |
-LL |     assert!(!(a > 2), "panic with comment");
+LL -     if a > 2 {
+LL -
+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
@@ -141,8 +182,12 @@ LL | |         };
    |
 help: try instead
    |
-LL |         const BAR: () = assert!(!(N == 0), );
-   |                         ~~~~~~~~~~~~~~~~~~~~
+LL -         const BAR: () = if N == 0 {
+LL -
+LL -             panic!()
+LL -         };
+LL +         const BAR: () = assert!(!(N == 0), );
+   |
 
 error: aborting due to 10 previous errors
 
diff --git a/tests/ui/manual_async_fn.stderr b/tests/ui/manual_async_fn.stderr
index 5d063e550f2..54a9b1d40a1 100644
--- a/tests/ui/manual_async_fn.stderr
+++ b/tests/ui/manual_async_fn.stderr
@@ -8,8 +8,9 @@ LL | fn fut() -> impl Future<Output = i32> {
    = 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 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - fn fut() -> impl Future<Output = i32> {
+LL + async fn fut() -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:12:1
@@ -19,8 +20,9 @@ LL | fn fut2() ->impl Future<Output = i32> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn fut2() -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - fn fut2() ->impl Future<Output = i32> {
+LL + async fn fut2() -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:18:1
@@ -30,8 +32,9 @@ LL | fn fut3()-> impl Future<Output = i32> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn fut3() -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - fn fut3()-> impl Future<Output = i32> {
+LL + async fn fut3() -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:23:1
@@ -41,8 +44,9 @@ LL | fn empty_fut() -> impl Future<Output = ()> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn empty_fut() {}
-   | ~~~~~~~~~~~~~~~~~~~~ ~~
+LL - fn empty_fut() -> impl Future<Output = ()> {
+LL + async fn empty_fut() {}
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:29:1
@@ -52,8 +56,9 @@ LL | fn empty_fut2() ->impl Future<Output = ()> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn empty_fut2() {}
-   | ~~~~~~~~~~~~~~~~~~~~~ ~~
+LL - fn empty_fut2() ->impl Future<Output = ()> {
+LL + async fn empty_fut2() {}
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:35:1
@@ -63,8 +68,9 @@ LL | fn empty_fut3()-> impl Future<Output = ()> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn empty_fut3() {}
-   | ~~~~~~~~~~~~~~~~~~~~~ ~~
+LL - fn empty_fut3()-> impl Future<Output = ()> {
+LL + async fn empty_fut3() {}
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:40:1
@@ -74,8 +80,9 @@ LL | fn core_fut() -> impl core::future::Future<Output = i32> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn core_fut() -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - fn core_fut() -> impl core::future::Future<Output = i32> {
+LL + async fn core_fut() -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:63:5
@@ -108,8 +115,9 @@ LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn elided(_: &i32) -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - fn elided(_: &i32) -> impl Future<Output = i32> + '_ {
+LL + async fn elided(_: &i32) -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:110:1
@@ -119,8 +127,9 @@ LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> +
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b {
+LL + async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:140:1
@@ -130,8 +139,9 @@ LL | pub fn issue_10450() -> impl Future<Output = i32> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | pub async fn issue_10450() -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - pub fn issue_10450() -> impl Future<Output = i32> {
+LL + pub async fn issue_10450() -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:145:1
@@ -141,8 +151,9 @@ LL | pub(crate) fn issue_10450_2() -> impl Future<Output = i32> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | pub(crate) async fn issue_10450_2() -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - pub(crate) fn issue_10450_2() -> impl Future<Output = i32> {
+LL + pub(crate) async fn issue_10450_2() -> i32 { 42 }
+   |
 
 error: this function can be simplified using the `async fn` syntax
   --> tests/ui/manual_async_fn.rs:150:1
@@ -152,8 +163,9 @@ LL | pub(self) fn issue_10450_3() -> impl Future<Output = i32> {
    |
 help: make the function `async` and return the output of the future directly
    |
-LL | pub(self) async fn issue_10450_3() -> i32 { 42 }
-   | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
+LL - pub(self) fn issue_10450_3() -> impl Future<Output = i32> {
+LL + pub(self) async fn issue_10450_3() -> i32 { 42 }
+   |
 
 error: aborting due to 13 previous errors
 
diff --git a/tests/ui/manual_bits.stderr b/tests/ui/manual_bits.stderr
index a50975ed474..44c4cf9239c 100644
--- a/tests/ui/manual_bits.stderr
+++ b/tests/ui/manual_bits.stderr
@@ -1,4 +1,4 @@
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:14:5
    |
 LL |     size_of::<i8>() * 8;
@@ -7,169 +7,169 @@ LL |     size_of::<i8>() * 8;
    = note: `-D clippy::manual-bits` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::manual_bits)]`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:16:5
    |
 LL |     size_of::<i16>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:18:5
    |
 LL |     size_of::<i32>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:20:5
    |
 LL |     size_of::<i64>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:22:5
    |
 LL |     size_of::<i128>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:24:5
    |
 LL |     size_of::<isize>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:27:5
    |
 LL |     size_of::<u8>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:29:5
    |
 LL |     size_of::<u16>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:31:5
    |
 LL |     size_of::<u32>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:33:5
    |
 LL |     size_of::<u64>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:35:5
    |
 LL |     size_of::<u128>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:37:5
    |
 LL |     size_of::<usize>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:40:5
    |
 LL |     8 * size_of::<i8>();
    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `i8::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:42:5
    |
 LL |     8 * size_of::<i16>();
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i16::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:44:5
    |
 LL |     8 * size_of::<i32>();
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i32::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:46:5
    |
 LL |     8 * size_of::<i64>();
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `i64::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:48:5
    |
 LL |     8 * size_of::<i128>();
    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `i128::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:50:5
    |
 LL |     8 * size_of::<isize>();
    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `isize::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:53:5
    |
 LL |     8 * size_of::<u8>();
    |     ^^^^^^^^^^^^^^^^^^^ help: consider using: `u8::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:55:5
    |
 LL |     8 * size_of::<u16>();
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u16::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:57:5
    |
 LL |     8 * size_of::<u32>();
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:59:5
    |
 LL |     8 * size_of::<u64>();
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u64::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:61:5
    |
 LL |     8 * size_of::<u128>();
    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:63:5
    |
 LL |     8 * size_of::<usize>();
    |     ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `usize::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:74:5
    |
 LL |     size_of::<Word>() * 8;
    |     ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `Word::BITS as usize`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:79:18
    |
 LL |     let _: u32 = (size_of::<u128>() * 8) as u32;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:81:18
    |
 LL |     let _: u32 = (size_of::<u128>() * 8).try_into().unwrap();
    |                  ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `u128::BITS`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:83:13
    |
 LL |     let _ = (size_of::<u128>() * 8).pow(5);
    |             ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(u128::BITS as usize)`
 
-error: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
+error: usage of `size_of::<T>()` to obtain the size of `T` in bits
   --> tests/ui/manual_bits.rs:85:14
    |
 LL |     let _ = &(size_of::<u128>() * 8);
diff --git a/tests/ui/manual_flatten.stderr b/tests/ui/manual_flatten.stderr
index 564c0eba826..5ab25658017 100644
--- a/tests/ui/manual_flatten.stderr
+++ b/tests/ui/manual_flatten.stderr
@@ -197,12 +197,9 @@ LL | |         }
    | |_________^
 help: try
    |
-LL ~     for n in vec![
-LL +
-LL + 
-LL +         Some(1),
-LL +         Some(2),
-LL +         Some(3)
+LL |     for n in vec![
+...
+LL |         Some(3)
 LL ~     ].iter().flatten() {
    |
 
diff --git a/tests/ui/manual_float_methods.stderr b/tests/ui/manual_float_methods.stderr
index d2ed5064217..352c879c87d 100644
--- a/tests/ui/manual_float_methods.stderr
+++ b/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:28: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:33: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: manually checking if a float is infinite
   --> tests/ui/manual_float_methods.rs:50:12
diff --git a/tests/ui/manual_ignore_case_cmp.stderr b/tests/ui/manual_ignore_case_cmp.stderr
index 14cd8cfc173..47378a65799 100644
--- a/tests/ui/manual_ignore_case_cmp.stderr
+++ b/tests/ui/manual_ignore_case_cmp.stderr
@@ -11,8 +11,9 @@ LL | #![deny(clippy::manual_ignore_case_cmp)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     if a.eq_ignore_ascii_case(b) {
-   |        ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     if a.to_ascii_lowercase() == b.to_ascii_lowercase() {
+LL +     if a.eq_ignore_ascii_case(b) {
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:13:8
@@ -22,8 +23,9 @@ LL |     if a.to_ascii_uppercase() == b.to_ascii_uppercase() {
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     if a.eq_ignore_ascii_case(b) {
-   |        ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     if a.to_ascii_uppercase() == b.to_ascii_uppercase() {
+LL +     if a.eq_ignore_ascii_case(b) {
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:17:13
@@ -33,8 +35,9 @@ LL |     let r = a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     let r = a.eq_ignore_ascii_case(b);
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let r = a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     let r = a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:19:18
@@ -44,8 +47,9 @@ LL |     let r = r || a.to_ascii_uppercase() == b.to_ascii_uppercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     let r = r || a.eq_ignore_ascii_case(b);
-   |                  ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let r = r || a.to_ascii_uppercase() == b.to_ascii_uppercase();
+LL +     let r = r || a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:21:10
@@ -55,8 +59,9 @@ LL |     r && a.to_ascii_lowercase() == b.to_uppercase().to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     r && a.eq_ignore_ascii_case(&b.to_uppercase());
-   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     r && a.to_ascii_lowercase() == b.to_uppercase().to_ascii_lowercase();
+LL +     r && a.eq_ignore_ascii_case(&b.to_uppercase());
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:24:8
@@ -66,8 +71,9 @@ LL |     if a.to_ascii_lowercase() != b.to_ascii_lowercase() {
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     if !a.eq_ignore_ascii_case(b) {
-   |        ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     if a.to_ascii_lowercase() != b.to_ascii_lowercase() {
+LL +     if !a.eq_ignore_ascii_case(b) {
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:28:8
@@ -77,8 +83,9 @@ LL |     if a.to_ascii_uppercase() != b.to_ascii_uppercase() {
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     if !a.eq_ignore_ascii_case(b) {
-   |        ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     if a.to_ascii_uppercase() != b.to_ascii_uppercase() {
+LL +     if !a.eq_ignore_ascii_case(b) {
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:32:13
@@ -88,8 +95,9 @@ LL |     let r = a.to_ascii_lowercase() != b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     let r = !a.eq_ignore_ascii_case(b);
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let r = a.to_ascii_lowercase() != b.to_ascii_lowercase();
+LL +     let r = !a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:34:18
@@ -99,8 +107,9 @@ LL |     let r = r || a.to_ascii_uppercase() != b.to_ascii_uppercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     let r = r || !a.eq_ignore_ascii_case(b);
-   |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let r = r || a.to_ascii_uppercase() != b.to_ascii_uppercase();
+LL +     let r = r || !a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:36:10
@@ -110,8 +119,9 @@ LL |     r && a.to_ascii_lowercase() != b.to_uppercase().to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     r && !a.eq_ignore_ascii_case(&b.to_uppercase());
-   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     r && a.to_ascii_lowercase() != b.to_uppercase().to_ascii_lowercase();
+LL +     r && !a.eq_ignore_ascii_case(&b.to_uppercase());
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:48:5
@@ -121,8 +131,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:52:5
@@ -132,8 +143,9 @@ LL |     a.to_ascii_lowercase() == 'a';
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(&'a');
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == 'a';
+LL +     a.eq_ignore_ascii_case(&'a');
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:54:5
@@ -143,8 +155,9 @@ LL |     'a' == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     'a'.eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     'a' == b.to_ascii_lowercase();
+LL +     'a'.eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:58:5
@@ -154,8 +167,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:60:5
@@ -165,8 +179,9 @@ LL |     a.to_ascii_lowercase() == b'a';
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(&b'a');
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b'a';
+LL +     a.eq_ignore_ascii_case(&b'a');
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:62:5
@@ -176,8 +191,9 @@ LL |     b'a' == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b'a'.eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b'a' == b.to_ascii_lowercase();
+LL +     b'a'.eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:66:5
@@ -187,8 +203,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:68:5
@@ -198,8 +215,9 @@ LL |     a.to_uppercase().to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.to_uppercase().eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_uppercase().to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.to_uppercase().eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:70:5
@@ -209,8 +227,9 @@ LL |     a.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == "a";
+LL +     a.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:72:5
@@ -220,8 +239,9 @@ LL |     "a" == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == b.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:76:5
@@ -231,8 +251,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:78:5
@@ -242,8 +263,9 @@ LL |     a.to_uppercase().to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.to_uppercase().eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_uppercase().to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.to_uppercase().eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:80:5
@@ -253,8 +275,9 @@ LL |     a.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == "a";
+LL +     a.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:82:5
@@ -264,8 +287,9 @@ LL |     "a" == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == b.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:86:5
@@ -275,8 +299,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:88:5
@@ -286,8 +311,9 @@ LL |     a.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == "a";
+LL +     a.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:90:5
@@ -297,8 +323,9 @@ LL |     "a" == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == b.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:94:5
@@ -308,8 +335,9 @@ LL |     a.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == "a";
+LL +     a.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:96:5
@@ -319,8 +347,9 @@ LL |     "a" == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == b.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:100:5
@@ -330,8 +359,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:102:5
@@ -341,8 +371,9 @@ LL |     a.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == "a";
+LL +     a.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:104:5
@@ -352,8 +383,9 @@ LL |     "a" == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == b.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:107:5
@@ -363,8 +395,9 @@ LL |     b.to_ascii_lowercase() == a.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b.eq_ignore_ascii_case(&a);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b.to_ascii_lowercase() == a.to_ascii_lowercase();
+LL +     b.eq_ignore_ascii_case(&a);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:109:5
@@ -374,8 +407,9 @@ LL |     b.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b.to_ascii_lowercase() == "a";
+LL +     b.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:111:5
@@ -385,8 +419,9 @@ LL |     "a" == a.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(&a);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == a.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(&a);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:115:5
@@ -396,8 +431,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:117:5
@@ -407,8 +443,9 @@ LL |     a.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == "a";
+LL +     a.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:119:5
@@ -418,8 +455,9 @@ LL |     "a" == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == b.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:122:5
@@ -429,8 +467,9 @@ LL |     b.to_ascii_lowercase() == a.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b.eq_ignore_ascii_case(&a);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b.to_ascii_lowercase() == a.to_ascii_lowercase();
+LL +     b.eq_ignore_ascii_case(&a);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:124:5
@@ -440,8 +479,9 @@ LL |     b.to_ascii_lowercase() == "a";
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b.eq_ignore_ascii_case("a");
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b.to_ascii_lowercase() == "a";
+LL +     b.eq_ignore_ascii_case("a");
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:126:5
@@ -451,8 +491,9 @@ LL |     "a" == a.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     "a".eq_ignore_ascii_case(&a);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     "a" == a.to_ascii_lowercase();
+LL +     "a".eq_ignore_ascii_case(&a);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:130:5
@@ -462,8 +503,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:134:5
@@ -473,8 +515,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(&b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(&b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:138:5
@@ -484,8 +527,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:140:5
@@ -495,8 +539,9 @@ LL |     b.to_ascii_lowercase() == a.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b.eq_ignore_ascii_case(&a);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b.to_ascii_lowercase() == a.to_ascii_lowercase();
+LL +     b.eq_ignore_ascii_case(&a);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:144:5
@@ -506,8 +551,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:148:5
@@ -517,8 +563,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:152:5
@@ -528,8 +575,9 @@ LL |     a.to_ascii_lowercase() == b.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     a.eq_ignore_ascii_case(b);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     a.to_ascii_lowercase() == b.to_ascii_lowercase();
+LL +     a.eq_ignore_ascii_case(b);
+   |
 
 error: manual case-insensitive ASCII comparison
   --> tests/ui/manual_ignore_case_cmp.rs:154:5
@@ -539,8 +587,9 @@ LL |     b.to_ascii_lowercase() == a.to_ascii_lowercase();
    |
 help: consider using `.eq_ignore_ascii_case()` instead
    |
-LL |     b.eq_ignore_ascii_case(a);
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     b.to_ascii_lowercase() == a.to_ascii_lowercase();
+LL +     b.eq_ignore_ascii_case(a);
+   |
 
 error: aborting due to 49 previous errors
 
diff --git a/tests/ui/manual_is_ascii_check.stderr b/tests/ui/manual_is_ascii_check.stderr
index cbb7aa2205b..9fd7f457b42 100644
--- a/tests/ui/manual_is_ascii_check.stderr
+++ b/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:107: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:109:26
@@ -181,8 +183,9 @@ LL |     let digits: Vec<&char> = ['1', 'A'].iter().take_while(|c| ('0'..='9').c
    |
 help: try
    |
-LL |     let digits: Vec<&char> = ['1', 'A'].iter().take_while(|c: &&char| c.is_ascii_digit()).collect();
-   |                                                            ~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
+LL -     let digits: Vec<&char> = ['1', 'A'].iter().take_while(|c| ('0'..='9').contains(c)).collect();
+LL +     let digits: Vec<&char> = ['1', 'A'].iter().take_while(|c: &&char| c.is_ascii_digit()).collect();
+   |
 
 error: manual check for common ascii range
   --> tests/ui/manual_is_ascii_check.rs:116:71
@@ -192,8 +195,9 @@ LL |     let digits: Vec<&mut char> = ['1', 'A'].iter_mut().take_while(|c| ('0'.
    |
 help: try
    |
-LL |     let digits: Vec<&mut char> = ['1', 'A'].iter_mut().take_while(|c: &&mut char| c.is_ascii_digit()).collect();
-   |                                                                    ~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
+LL -     let digits: Vec<&mut char> = ['1', 'A'].iter_mut().take_while(|c| ('0'..='9').contains(c)).collect();
+LL +     let digits: Vec<&mut char> = ['1', 'A'].iter_mut().take_while(|c: &&mut char| c.is_ascii_digit()).collect();
+   |
 
 error: aborting due to 29 previous errors
 
diff --git a/tests/ui/manual_let_else.rs b/tests/ui/manual_let_else.rs
index d2350d97ed0..a753566b34c 100644
--- a/tests/ui/manual_let_else.rs
+++ b/tests/ui/manual_let_else.rs
@@ -480,3 +480,37 @@ fn issue12337() {
         //~^ manual_let_else
     };
 }
+
+mod issue13768 {
+    enum Foo {
+        Str(String),
+        None,
+    }
+
+    fn foo(value: Foo) {
+        let signature = match value {
+            //~^ manual_let_else
+            Foo::Str(ref val) => val,
+            _ => {
+                println!("No signature found");
+                return;
+            },
+        };
+    }
+
+    enum Bar {
+        Str { inner: String },
+        None,
+    }
+
+    fn bar(mut value: Bar) {
+        let signature = match value {
+            //~^ manual_let_else
+            Bar::Str { ref mut inner } => inner,
+            _ => {
+                println!("No signature found");
+                return;
+            },
+        };
+    }
+}
diff --git a/tests/ui/manual_let_else.stderr b/tests/ui/manual_let_else.stderr
index 8f5cba64d54..ef042192114 100644
--- a/tests/ui/manual_let_else.stderr
+++ b/tests/ui/manual_let_else.stderr
@@ -489,5 +489,45 @@ error: this could be rewritten as `let...else`
 LL |         let v = if let Some(v_some) = g() { v_some } else { return };
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some(v) = g() else { return };`
 
-error: aborting due to 31 previous errors
+error: this could be rewritten as `let...else`
+  --> tests/ui/manual_let_else.rs:491:9
+   |
+LL | /         let signature = match value {
+LL | |
+LL | |             Foo::Str(ref val) => val,
+LL | |             _ => {
+...  |
+LL | |             },
+LL | |         };
+   | |__________^
+   |
+help: consider writing
+   |
+LL ~         let Foo::Str(ref signature) = value else {
+LL +                 println!("No signature found");
+LL +                 return;
+LL +             };
+   |
+
+error: this could be rewritten as `let...else`
+  --> tests/ui/manual_let_else.rs:507:9
+   |
+LL | /         let signature = match value {
+LL | |
+LL | |             Bar::Str { ref mut inner } => inner,
+LL | |             _ => {
+...  |
+LL | |             },
+LL | |         };
+   | |__________^
+   |
+help: consider writing
+   |
+LL ~         let Bar::Str { inner: ref mut signature } = value else {
+LL +                 println!("No signature found");
+LL +                 return;
+LL +             };
+   |
+
+error: aborting due to 33 previous errors
 
diff --git a/tests/ui/manual_midpoint.fixed b/tests/ui/manual_midpoint.fixed
new file mode 100644
index 00000000000..63116ced843
--- /dev/null
+++ b/tests/ui/manual_midpoint.fixed
@@ -0,0 +1,74 @@
+#![warn(clippy::manual_midpoint)]
+
+macro_rules! mac {
+    ($a: expr, $b: expr) => {
+        ($a + $b) / 2
+    };
+}
+
+macro_rules! add {
+    ($a: expr, $b: expr) => {
+        ($a + $b)
+    };
+}
+
+macro_rules! two {
+    () => {
+        2
+    };
+}
+
+#[clippy::msrv = "1.84"]
+fn older_msrv() {
+    let a: u32 = 10;
+    let _ = (a + 5) / 2;
+}
+
+#[clippy::msrv = "1.85"]
+fn main() {
+    let a: u32 = 10;
+    let _ = u32::midpoint(a, 5); //~ ERROR: manual implementation of `midpoint`
+
+    let f: f32 = 10.0;
+    let _ = f32::midpoint(f, 5.0); //~ ERROR: manual implementation of `midpoint`
+
+    let _: u32 = 5 + u32::midpoint(8, 8) + 2; //~ ERROR: manual implementation of `midpoint`
+    let _: u32 = const { u32::midpoint(8, 8) }; //~ ERROR: manual implementation of `midpoint`
+    let _: f64 = const { f64::midpoint(8.0f64, 8.) }; //~ ERROR: manual implementation of `midpoint`
+    let _: u32 = u32::midpoint(u32::default(), u32::default()); //~ ERROR: manual implementation of `midpoint`
+    let _: u32 = u32::midpoint(two!(), two!()); //~ ERROR: manual implementation of `midpoint`
+
+    // Do not lint in presence of an addition with more than 2 operands
+    let _: u32 = (10 + 20 + 30) / 2;
+
+    // Do not lint if whole or part is coming from a macro
+    let _ = mac!(10, 20);
+    let _: u32 = add!(10u32, 20u32) / 2;
+    let _: u32 = (10 + 20) / two!();
+
+    // Do not lint if a literal is not present
+    let _ = (f + 5.0) / (1.0 + 1.0);
+
+    // Do not lint on signed integer types
+    let i: i32 = 10;
+    let _ = (i + 5) / 2;
+
+    // Do not lint on (x+1)/2 or (1+x)/2 as this looks more like a `div_ceil()` operation
+    let _ = (i + 1) / 2;
+    let _ = (1 + i) / 2;
+
+    // But if we see (x+1.0)/2.0 or (x+1.0)/2.0, it is probably a midpoint operation
+    let _ = f32::midpoint(f, 1.0); //~ ERROR: manual implementation of `midpoint`
+    let _ = f32::midpoint(1.0, f); //~ ERROR: manual implementation of `midpoint`
+}
+
+#[clippy::msrv = "1.86"]
+fn older_signed_midpoint(i: i32) {
+    // Do not lint
+    let _ = (i + 10) / 2;
+}
+
+#[clippy::msrv = "1.87"]
+fn signed_midpoint(i: i32) {
+    let _ = i32::midpoint(i, 10); //~ ERROR: manual implementation of `midpoint`
+}
diff --git a/tests/ui/manual_midpoint.rs b/tests/ui/manual_midpoint.rs
new file mode 100644
index 00000000000..47f1b88c78c
--- /dev/null
+++ b/tests/ui/manual_midpoint.rs
@@ -0,0 +1,74 @@
+#![warn(clippy::manual_midpoint)]
+
+macro_rules! mac {
+    ($a: expr, $b: expr) => {
+        ($a + $b) / 2
+    };
+}
+
+macro_rules! add {
+    ($a: expr, $b: expr) => {
+        ($a + $b)
+    };
+}
+
+macro_rules! two {
+    () => {
+        2
+    };
+}
+
+#[clippy::msrv = "1.84"]
+fn older_msrv() {
+    let a: u32 = 10;
+    let _ = (a + 5) / 2;
+}
+
+#[clippy::msrv = "1.85"]
+fn main() {
+    let a: u32 = 10;
+    let _ = (a + 5) / 2; //~ ERROR: manual implementation of `midpoint`
+
+    let f: f32 = 10.0;
+    let _ = (f + 5.0) / 2.0; //~ ERROR: manual implementation of `midpoint`
+
+    let _: u32 = 5 + (8 + 8) / 2 + 2; //~ ERROR: manual implementation of `midpoint`
+    let _: u32 = const { (8 + 8) / 2 }; //~ ERROR: manual implementation of `midpoint`
+    let _: f64 = const { (8.0f64 + 8.) / 2. }; //~ ERROR: manual implementation of `midpoint`
+    let _: u32 = (u32::default() + u32::default()) / 2; //~ ERROR: manual implementation of `midpoint`
+    let _: u32 = (two!() + two!()) / 2; //~ ERROR: manual implementation of `midpoint`
+
+    // Do not lint in presence of an addition with more than 2 operands
+    let _: u32 = (10 + 20 + 30) / 2;
+
+    // Do not lint if whole or part is coming from a macro
+    let _ = mac!(10, 20);
+    let _: u32 = add!(10u32, 20u32) / 2;
+    let _: u32 = (10 + 20) / two!();
+
+    // Do not lint if a literal is not present
+    let _ = (f + 5.0) / (1.0 + 1.0);
+
+    // Do not lint on signed integer types
+    let i: i32 = 10;
+    let _ = (i + 5) / 2;
+
+    // Do not lint on (x+1)/2 or (1+x)/2 as this looks more like a `div_ceil()` operation
+    let _ = (i + 1) / 2;
+    let _ = (1 + i) / 2;
+
+    // But if we see (x+1.0)/2.0 or (x+1.0)/2.0, it is probably a midpoint operation
+    let _ = (f + 1.0) / 2.0; //~ ERROR: manual implementation of `midpoint`
+    let _ = (1.0 + f) / 2.0; //~ ERROR: manual implementation of `midpoint`
+}
+
+#[clippy::msrv = "1.86"]
+fn older_signed_midpoint(i: i32) {
+    // Do not lint
+    let _ = (i + 10) / 2;
+}
+
+#[clippy::msrv = "1.87"]
+fn signed_midpoint(i: i32) {
+    let _ = (i + 10) / 2; //~ ERROR: manual implementation of `midpoint`
+}
diff --git a/tests/ui/manual_midpoint.stderr b/tests/ui/manual_midpoint.stderr
new file mode 100644
index 00000000000..3d588e2114d
--- /dev/null
+++ b/tests/ui/manual_midpoint.stderr
@@ -0,0 +1,65 @@
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:30:13
+   |
+LL |     let _ = (a + 5) / 2;
+   |             ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(a, 5)`
+   |
+   = note: `-D clippy::manual-midpoint` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::manual_midpoint)]`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:33:13
+   |
+LL |     let _ = (f + 5.0) / 2.0;
+   |             ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(f, 5.0)`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:35:22
+   |
+LL |     let _: u32 = 5 + (8 + 8) / 2 + 2;
+   |                      ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(8, 8)`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:36:26
+   |
+LL |     let _: u32 = const { (8 + 8) / 2 };
+   |                          ^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(8, 8)`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:37:26
+   |
+LL |     let _: f64 = const { (8.0f64 + 8.) / 2. };
+   |                          ^^^^^^^^^^^^^^^^^^ help: use `f64::midpoint` instead: `f64::midpoint(8.0f64, 8.)`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:38:18
+   |
+LL |     let _: u32 = (u32::default() + u32::default()) / 2;
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(u32::default(), u32::default())`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:39:18
+   |
+LL |     let _: u32 = (two!() + two!()) / 2;
+   |                  ^^^^^^^^^^^^^^^^^^^^^ help: use `u32::midpoint` instead: `u32::midpoint(two!(), two!())`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:61:13
+   |
+LL |     let _ = (f + 1.0) / 2.0;
+   |             ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(f, 1.0)`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:62:13
+   |
+LL |     let _ = (1.0 + f) / 2.0;
+   |             ^^^^^^^^^^^^^^^ help: use `f32::midpoint` instead: `f32::midpoint(1.0, f)`
+
+error: manual implementation of `midpoint` which can overflow
+  --> tests/ui/manual_midpoint.rs:73:13
+   |
+LL |     let _ = (i + 10) / 2;
+   |             ^^^^^^^^^^^^ help: use `i32::midpoint` instead: `i32::midpoint(i, 10)`
+
+error: aborting due to 10 previous errors
+
diff --git a/tests/ui/manual_ok_err.fixed b/tests/ui/manual_ok_err.fixed
index e7e0464c478..bc169b64be9 100644
--- a/tests/ui/manual_ok_err.fixed
+++ b/tests/ui/manual_ok_err.fixed
@@ -89,3 +89,12 @@ const fn cf(x: Result<u32, &'static str>) -> Option<u32> {
         Err(_) => None,
     }
 }
+
+fn issue14239() {
+    let _ = if false {
+        None
+    } else {
+        "1".parse::<u8>().ok()
+    };
+    //~^^^^^ manual_ok_err
+}
diff --git a/tests/ui/manual_ok_err.rs b/tests/ui/manual_ok_err.rs
index 77300b7af53..03c730d4b4e 100644
--- a/tests/ui/manual_ok_err.rs
+++ b/tests/ui/manual_ok_err.rs
@@ -125,3 +125,14 @@ const fn cf(x: Result<u32, &'static str>) -> Option<u32> {
         Err(_) => None,
     }
 }
+
+fn issue14239() {
+    let _ = if false {
+        None
+    } else if let Ok(n) = "1".parse::<u8>() {
+        Some(n)
+    } else {
+        None
+    };
+    //~^^^^^ manual_ok_err
+}
diff --git a/tests/ui/manual_ok_err.stderr b/tests/ui/manual_ok_err.stderr
index f10f52cc4c9..13fceacda10 100644
--- a/tests/ui/manual_ok_err.stderr
+++ b/tests/ui/manual_ok_err.stderr
@@ -93,5 +93,23 @@ LL | |         _ => None,
 LL | |     };
    | |_____^ help: replace with: `(-S).ok()`
 
-error: aborting due to 8 previous errors
+error: manual implementation of `ok`
+  --> tests/ui/manual_ok_err.rs:132:12
+   |
+LL |       } else if let Ok(n) = "1".parse::<u8>() {
+   |  ____________^
+LL | |         Some(n)
+LL | |     } else {
+LL | |         None
+LL | |     };
+   | |_____^
+   |
+help: replace with
+   |
+LL ~     } else {
+LL +         "1".parse::<u8>().ok()
+LL ~     };
+   |
+
+error: aborting due to 9 previous errors
 
diff --git a/tests/ui/manual_slice_fill.fixed b/tests/ui/manual_slice_fill.fixed
index 80e271117fc..bba863247f5 100644
--- a/tests/ui/manual_slice_fill.fixed
+++ b/tests/ui/manual_slice_fill.fixed
@@ -115,3 +115,11 @@ fn issue_14192() {
         tmp[0] = i;
     }
 }
+
+fn issue14189() {
+    // Should not lint because `!*b` is not constant
+    let mut tmp = vec![1, 2, 3];
+    for b in &mut tmp {
+        *b = !*b;
+    }
+}
diff --git a/tests/ui/manual_slice_fill.rs b/tests/ui/manual_slice_fill.rs
index f758f47bbcb..44c60dc40f0 100644
--- a/tests/ui/manual_slice_fill.rs
+++ b/tests/ui/manual_slice_fill.rs
@@ -128,3 +128,11 @@ fn issue_14192() {
         tmp[0] = i;
     }
 }
+
+fn issue14189() {
+    // Should not lint because `!*b` is not constant
+    let mut tmp = vec![1, 2, 3];
+    for b in &mut tmp {
+        *b = !*b;
+    }
+}
diff --git a/tests/ui/manual_strip.rs b/tests/ui/manual_strip.rs
index ce53c99e6b5..086b75a3987 100644
--- a/tests/ui/manual_strip.rs
+++ b/tests/ui/manual_strip.rs
@@ -74,6 +74,23 @@ fn main() {
     if s3.starts_with("ab") {
         s4[2..].to_string();
     }
+
+    // Don't propose to reuse the `stripped` identifier as it is overriden
+    if s.starts_with("ab") {
+        let stripped = &s["ab".len()..];
+        //~^ ERROR: stripping a prefix manually
+        let stripped = format!("{stripped}-");
+        println!("{stripped}{}", &s["ab".len()..]);
+    }
+
+    // Don't propose to reuse the `stripped` identifier as it is mutable
+    if s.starts_with("ab") {
+        let mut stripped = &s["ab".len()..];
+        //~^ ERROR: stripping a prefix manually
+        stripped = "";
+        let stripped = format!("{stripped}-");
+        println!("{stripped}{}", &s["ab".len()..]);
+    }
 }
 
 #[clippy::msrv = "1.44"]
diff --git a/tests/ui/manual_strip.stderr b/tests/ui/manual_strip.stderr
index 41d15da610c..a323ef700e7 100644
--- a/tests/ui/manual_strip.stderr
+++ b/tests/ui/manual_strip.stderr
@@ -138,13 +138,54 @@ LL ~         <stripped>.to_uppercase();
    |
 
 error: stripping a prefix manually
-  --> tests/ui/manual_strip.rs:91:9
+  --> tests/ui/manual_strip.rs:80:24
+   |
+LL |         let stripped = &s["ab".len()..];
+   |                        ^^^^^^^^^^^^^^^^
+   |
+note: the prefix was tested here
+  --> tests/ui/manual_strip.rs:79:5
+   |
+LL |     if s.starts_with("ab") {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+help: try using the `strip_prefix` method
+   |
+LL ~     if let Some(<stripped>) = s.strip_prefix("ab") {
+LL ~         let stripped = <stripped>;
+LL |
+LL |         let stripped = format!("{stripped}-");
+LL ~         println!("{stripped}{}", <stripped>);
+   |
+
+error: stripping a prefix manually
+  --> tests/ui/manual_strip.rs:88:28
+   |
+LL |         let mut stripped = &s["ab".len()..];
+   |                            ^^^^^^^^^^^^^^^^
+   |
+note: the prefix was tested here
+  --> tests/ui/manual_strip.rs:87:5
+   |
+LL |     if s.starts_with("ab") {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+help: try using the `strip_prefix` method
+   |
+LL ~     if let Some(<stripped>) = s.strip_prefix("ab") {
+LL ~         let mut stripped = <stripped>;
+LL |
+LL |         stripped = "";
+LL |         let stripped = format!("{stripped}-");
+LL ~         println!("{stripped}{}", <stripped>);
+   |
+
+error: stripping a prefix manually
+  --> tests/ui/manual_strip.rs:108:9
    |
 LL |         s[1..].to_string();
    |         ^^^^^^
    |
 note: the prefix was tested here
-  --> tests/ui/manual_strip.rs:90:5
+  --> tests/ui/manual_strip.rs:107:5
    |
 LL |     if s.starts_with('a') {
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -154,5 +195,5 @@ LL ~     if let Some(<stripped>) = s.strip_prefix('a') {
 LL ~         <stripped>.to_string();
    |
 
-error: aborting due to 8 previous errors
+error: aborting due to 10 previous errors
 
diff --git a/tests/ui/manual_strip_fixable.fixed b/tests/ui/manual_strip_fixable.fixed
new file mode 100644
index 00000000000..75a3f1645de
--- /dev/null
+++ b/tests/ui/manual_strip_fixable.fixed
@@ -0,0 +1,15 @@
+#![warn(clippy::manual_strip)]
+
+fn main() {
+    let s = "abc";
+
+    if let Some(stripped) = s.strip_prefix("ab") {
+        //~^ ERROR: stripping a prefix manually
+        println!("{stripped}{}", stripped);
+    }
+
+    if let Some(stripped) = s.strip_suffix("bc") {
+        //~^ ERROR: stripping a suffix manually
+        println!("{stripped}{}", stripped);
+    }
+}
diff --git a/tests/ui/manual_strip_fixable.rs b/tests/ui/manual_strip_fixable.rs
new file mode 100644
index 00000000000..5080068449e
--- /dev/null
+++ b/tests/ui/manual_strip_fixable.rs
@@ -0,0 +1,17 @@
+#![warn(clippy::manual_strip)]
+
+fn main() {
+    let s = "abc";
+
+    if s.starts_with("ab") {
+        let stripped = &s["ab".len()..];
+        //~^ ERROR: stripping a prefix manually
+        println!("{stripped}{}", &s["ab".len()..]);
+    }
+
+    if s.ends_with("bc") {
+        let stripped = &s[..s.len() - "bc".len()];
+        //~^ ERROR: stripping a suffix manually
+        println!("{stripped}{}", &s[..s.len() - "bc".len()]);
+    }
+}
diff --git a/tests/ui/manual_strip_fixable.stderr b/tests/ui/manual_strip_fixable.stderr
new file mode 100644
index 00000000000..1c276e5d8fd
--- /dev/null
+++ b/tests/ui/manual_strip_fixable.stderr
@@ -0,0 +1,40 @@
+error: stripping a prefix manually
+  --> tests/ui/manual_strip_fixable.rs:7:24
+   |
+LL |         let stripped = &s["ab".len()..];
+   |                        ^^^^^^^^^^^^^^^^
+   |
+note: the prefix was tested here
+  --> tests/ui/manual_strip_fixable.rs:6:5
+   |
+LL |     if s.starts_with("ab") {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+   = note: `-D clippy::manual-strip` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::manual_strip)]`
+help: try using the `strip_prefix` method
+   |
+LL ~     if let Some(stripped) = s.strip_prefix("ab") {
+LL ~
+LL ~         println!("{stripped}{}", stripped);
+   |
+
+error: stripping a suffix manually
+  --> tests/ui/manual_strip_fixable.rs:13:24
+   |
+LL |         let stripped = &s[..s.len() - "bc".len()];
+   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the suffix was tested here
+  --> tests/ui/manual_strip_fixable.rs:12:5
+   |
+LL |     if s.ends_with("bc") {
+   |     ^^^^^^^^^^^^^^^^^^^^^
+help: try using the `strip_suffix` method
+   |
+LL ~     if let Some(stripped) = s.strip_suffix("bc") {
+LL ~
+LL ~         println!("{stripped}{}", stripped);
+   |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/map_all_any_identity.stderr b/tests/ui/map_all_any_identity.stderr
index 869d81a73d6..24df97d883a 100644
--- a/tests/ui/map_all_any_identity.stderr
+++ b/tests/ui/map_all_any_identity.stderr
@@ -8,8 +8,9 @@ LL |     let _ = ["foo"].into_iter().map(|s| s == "foo").any(|a| a);
    = help: to override `-D warnings` add `#[allow(clippy::map_all_any_identity)]`
 help: use `.any(...)` instead
    |
-LL |     let _ = ["foo"].into_iter().any(|s| s == "foo");
-   |                                 ~~~~~~~~~~~~~~~~~~~
+LL -     let _ = ["foo"].into_iter().map(|s| s == "foo").any(|a| a);
+LL +     let _ = ["foo"].into_iter().any(|s| s == "foo");
+   |
 
 error: usage of `.map(...).all(identity)`
   --> tests/ui/map_all_any_identity.rs:7:33
@@ -19,8 +20,9 @@ LL |     let _ = ["foo"].into_iter().map(|s| s == "foo").all(std::convert::ident
    |
 help: use `.all(...)` instead
    |
-LL |     let _ = ["foo"].into_iter().all(|s| s == "foo");
-   |                                 ~~~~~~~~~~~~~~~~~~~
+LL -     let _ = ["foo"].into_iter().map(|s| s == "foo").all(std::convert::identity);
+LL +     let _ = ["foo"].into_iter().all(|s| s == "foo");
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/map_with_unused_argument_over_ranges.stderr b/tests/ui/map_with_unused_argument_over_ranges.stderr
index ed905b6591c..e5c93ceac02 100644
--- a/tests/ui/map_with_unused_argument_over_ranges.stderr
+++ b/tests/ui/map_with_unused_argument_over_ranges.stderr
@@ -68,8 +68,9 @@ LL |     (0..10).map(|_| 3);
    |
 help: remove the explicit range and use `repeat_n`
    |
-LL |     std::iter::repeat_n(3, 10);
-   |     ~~~~~~~~~~~~~~~~~~~ ~~~~~
+LL -     (0..10).map(|_| 3);
+LL +     std::iter::repeat_n(3, 10);
+   |
 
 error: map of a closure that does not depend on its parameter over a range
   --> tests/ui/map_with_unused_argument_over_ranges.rs:37:5
@@ -218,8 +219,9 @@ LL |     (0..10).map(|_| 3);
    |
 help: remove the explicit range and use `repeat` and `take`
    |
-LL |     std::iter::repeat(3).take(10);
-   |     ~~~~~~~~~~~~~~~~~ ~ +++++++++
+LL -     (0..10).map(|_| 3);
+LL +     std::iter::repeat(3).take(10);
+   |
 
 error: aborting due to 18 previous errors
 
diff --git a/tests/ui/map_with_unused_argument_over_ranges_nostd.stderr b/tests/ui/map_with_unused_argument_over_ranges_nostd.stderr
index d47f3d09175..975ded83560 100644
--- a/tests/ui/map_with_unused_argument_over_ranges_nostd.stderr
+++ b/tests/ui/map_with_unused_argument_over_ranges_nostd.stderr
@@ -8,8 +8,9 @@ LL |     let _: Vec<_> = (0..10).map(|_| 3 + 1).collect();
    = help: to override `-D warnings` add `#[allow(clippy::map_with_unused_argument_over_ranges)]`
 help: remove the explicit range and use `repeat_n`
    |
-LL |     let _: Vec<_> = core::iter::repeat_n(3 + 1, 10).collect();
-   |                     ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
+LL -     let _: Vec<_> = (0..10).map(|_| 3 + 1).collect();
+LL +     let _: Vec<_> = core::iter::repeat_n(3 + 1, 10).collect();
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/match_result_ok.stderr b/tests/ui/match_result_ok.stderr
index ccdf5323075..822cc4de77f 100644
--- a/tests/ui/match_result_ok.stderr
+++ b/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:24: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:51: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/tests/ui/match_str_case_mismatch.stderr b/tests/ui/match_str_case_mismatch.stderr
index ea461eb510f..8068edfff94 100644
--- a/tests/ui/match_str_case_mismatch.stderr
+++ b/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:123: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:136: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:148: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:159: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:170: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:186: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/tests/ui/methods.rs b/tests/ui/methods.rs
index 85a4d59e5ca..76b0d131dd4 100644
--- a/tests/ui/methods.rs
+++ b/tests/ui/methods.rs
@@ -11,6 +11,7 @@
     clippy::new_without_default,
     clippy::needless_pass_by_value,
     clippy::needless_lifetimes,
+    clippy::elidable_lifetime_names,
     clippy::print_stdout,
     clippy::must_use_candidate,
     clippy::use_self,
diff --git a/tests/ui/methods.stderr b/tests/ui/methods.stderr
index 30e8d0794f7..353b999d7da 100644
--- a/tests/ui/methods.stderr
+++ b/tests/ui/methods.stderr
@@ -1,5 +1,5 @@
 error: methods called `new` usually return `Self`
-  --> tests/ui/methods.rs:103:5
+  --> tests/ui/methods.rs:104:5
    |
 LL | /     fn new() -> i32 {
 LL | |
@@ -11,7 +11,7 @@ LL | |     }
    = help: to override `-D warnings` add `#[allow(clippy::new_ret_no_self)]`
 
 error: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
-  --> tests/ui/methods.rs:125:13
+  --> tests/ui/methods.rs:126:13
    |
 LL |       let _ = v.iter().filter(|&x| {
    |  _____________^
diff --git a/tests/ui/mixed_attributes_style/auxiliary/submodule.rs b/tests/ui/mixed_attributes_style/auxiliary/submodule.rs
index 61615c5d3a6..43d22940415 100644
--- a/tests/ui/mixed_attributes_style/auxiliary/submodule.rs
+++ b/tests/ui/mixed_attributes_style/auxiliary/submodule.rs
@@ -3,8 +3,6 @@
 #![allow(dead_code)]
 
 #[allow(unused)]
-//~^ mixed_attributes_style
-
 mod foo {
     #![allow(dead_code)]
 }
diff --git a/tests/ui/mixed_attributes_style/global_allow.rs b/tests/ui/mixed_attributes_style/global_allow.rs
index c68a5462afe..19a45e720a6 100644
--- a/tests/ui/mixed_attributes_style/global_allow.rs
+++ b/tests/ui/mixed_attributes_style/global_allow.rs
@@ -1,6 +1,5 @@
-//@error-in-other-file:
-//@no-rustfix
-// issue 12436
+// https://github.com/rust-lang/rust-clippy/issues/12436
+//@check-pass
 #![allow(clippy::mixed_attributes_style)]
 
 #[path = "auxiliary/submodule.rs"]
diff --git a/tests/ui/mixed_attributes_style/global_allow.stderr b/tests/ui/mixed_attributes_style/global_allow.stderr
deleted file mode 100644
index 5fc1d2ac0c3..00000000000
--- a/tests/ui/mixed_attributes_style/global_allow.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: empty line after outer attribute
-  --> tests/ui/mixed_attributes_style/auxiliary/submodule.rs:5:1
-   |
-LL | / #[allow(unused)]
-LL | |
-LL | |
-   | |_^
-LL |   mod foo {
-   |   ------- the attribute applies to this module
-   |
-   = note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_outer_attr)]`
-   = help: if the empty line is unintentional remove it
-help: if the attribute should apply to the parent module use an inner attribute
-   |
-LL | #![allow(unused)]
-   |  +
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/mixed_attributes_style/mod_declaration.rs b/tests/ui/mixed_attributes_style/mod_declaration.rs
index f2aad9a21e9..8cef6a80048 100644
--- a/tests/ui/mixed_attributes_style/mod_declaration.rs
+++ b/tests/ui/mixed_attributes_style/mod_declaration.rs
@@ -1,4 +1,3 @@
-//@error-in-other-file: empty line after outer attribute
 //@error-in-other-file: item has both inner and outer attributes
 //@no-rustfix
 #[path = "auxiliary/submodule.rs"] // don't lint.
diff --git a/tests/ui/mixed_attributes_style/mod_declaration.stderr b/tests/ui/mixed_attributes_style/mod_declaration.stderr
index 13ec97fbc1a..1239742a05b 100644
--- a/tests/ui/mixed_attributes_style/mod_declaration.stderr
+++ b/tests/ui/mixed_attributes_style/mod_declaration.stderr
@@ -2,8 +2,6 @@ error: item has both inner and outer attributes
   --> tests/ui/mixed_attributes_style/auxiliary/submodule.rs:5:1
    |
 LL | / #[allow(unused)]
-LL | |
-LL | |
 LL | | mod foo {
 LL | |     #![allow(dead_code)]
    | |________________________^
@@ -11,23 +9,5 @@ LL | |     #![allow(dead_code)]
    = note: `-D clippy::mixed-attributes-style` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::mixed_attributes_style)]`
 
-error: empty line after outer attribute
-  --> tests/ui/mixed_attributes_style/auxiliary/submodule.rs:5:1
-   |
-LL | / #[allow(unused)]
-LL | |
-LL | |
-   | |_^
-LL |   mod foo {
-   |   ------- the attribute applies to this module
-   |
-   = note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_outer_attr)]`
-   = help: if the empty line is unintentional remove it
-help: if the attribute should apply to the parent module use an inner attribute
-   |
-LL | #![allow(unused)]
-   |  +
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
diff --git a/tests/ui/msrv_attributes_without_early_lints.rs b/tests/ui/msrv_attributes_without_early_lints.rs
new file mode 100644
index 00000000000..dcef1a485fc
--- /dev/null
+++ b/tests/ui/msrv_attributes_without_early_lints.rs
@@ -0,0 +1,14 @@
+//@check-pass
+
+#![allow(clippy::all, clippy::pedantic, clippy::restriction, clippy::nursery)]
+#![forbid(clippy::ptr_as_ptr)]
+
+/// MSRV checking in late passes skips checking the parent nodes if no early pass sees a
+/// `#[clippy::msrv]` attribute
+///
+/// Here we ensure that even if all early passes are allowed (above) the attribute is still detected
+/// in late lints such as `clippy::ptr_as_ptr`
+#[clippy::msrv = "1.37"]
+fn f(p: *const i32) {
+    let _ = p as *const i64;
+}
diff --git a/tests/ui/must_use_unit.fixed b/tests/ui/must_use_unit.fixed
index 5a8603ceb56..683754a98c8 100644
--- a/tests/ui/must_use_unit.fixed
+++ b/tests/ui/must_use_unit.fixed
@@ -26,11 +26,3 @@ fn main() {
         fn foo() {}
     );
 }
-
-#[cfg_attr(all(), deprecated)]
-fn issue_12320() {}
-//~^ must_use_unit
-
-#[cfg_attr(all(), deprecated, doc = "foo")]
-fn issue_12320_2() {}
-//~^ must_use_unit
diff --git a/tests/ui/must_use_unit.rs b/tests/ui/must_use_unit.rs
index ab2764841cb..519b8fa3682 100644
--- a/tests/ui/must_use_unit.rs
+++ b/tests/ui/must_use_unit.rs
@@ -29,11 +29,3 @@ fn main() {
         fn foo() {}
     );
 }
-
-#[cfg_attr(all(), must_use, deprecated)]
-fn issue_12320() {}
-//~^ must_use_unit
-
-#[cfg_attr(all(), deprecated, doc = "foo", must_use)]
-fn issue_12320_2() {}
-//~^ must_use_unit
diff --git a/tests/ui/must_use_unit.stderr b/tests/ui/must_use_unit.stderr
index 3df9738a969..8f2af0cbd29 100644
--- a/tests/ui/must_use_unit.stderr
+++ b/tests/ui/must_use_unit.stderr
@@ -25,21 +25,5 @@ LL | #[must_use = "With note"]
 LL | pub fn must_use_with_note() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: this unit-returning function has a `#[must_use]` attribute
-  --> tests/ui/must_use_unit.rs:34:1
-   |
-LL | #[cfg_attr(all(), must_use, deprecated)]
-   |                   -------------------- help: change these attributes to: `deprecated`
-LL | fn issue_12320() {}
-   | ^^^^^^^^^^^^^^^^
-
-error: this unit-returning function has a `#[must_use]` attribute
-  --> tests/ui/must_use_unit.rs:38:1
-   |
-LL | #[cfg_attr(all(), deprecated, doc = "foo", must_use)]
-   |                   --------------------------------- help: change these attributes to: `deprecated, doc = "foo"`
-LL | fn issue_12320_2() {}
-   | ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 5 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/must_use_unit_unfixable.rs b/tests/ui/must_use_unit_unfixable.rs
new file mode 100644
index 00000000000..0dba7996bac
--- /dev/null
+++ b/tests/ui/must_use_unit_unfixable.rs
@@ -0,0 +1,11 @@
+//@no-rustfix
+
+#[cfg_attr(all(), must_use, deprecated)]
+fn issue_12320() {}
+//~^ must_use_unit
+
+#[cfg_attr(all(), deprecated, doc = "foo", must_use)]
+fn issue_12320_2() {}
+//~^ must_use_unit
+
+fn main() {}
diff --git a/tests/ui/must_use_unit_unfixable.stderr b/tests/ui/must_use_unit_unfixable.stderr
new file mode 100644
index 00000000000..087682199af
--- /dev/null
+++ b/tests/ui/must_use_unit_unfixable.stderr
@@ -0,0 +1,28 @@
+error: this unit-returning function has a `#[must_use]` attribute
+  --> tests/ui/must_use_unit_unfixable.rs:4:1
+   |
+LL | fn issue_12320() {}
+   | ^^^^^^^^^^^^^^^^
+   |
+help: remove `must_use`
+  --> tests/ui/must_use_unit_unfixable.rs:3:19
+   |
+LL | #[cfg_attr(all(), must_use, deprecated)]
+   |                   ^^^^^^^^
+   = note: `-D clippy::must-use-unit` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::must_use_unit)]`
+
+error: this unit-returning function has a `#[must_use]` attribute
+  --> tests/ui/must_use_unit_unfixable.rs:8:1
+   |
+LL | fn issue_12320_2() {}
+   | ^^^^^^^^^^^^^^^^^^
+   |
+help: remove `must_use`
+  --> tests/ui/must_use_unit_unfixable.rs:7:44
+   |
+LL | #[cfg_attr(all(), deprecated, doc = "foo", must_use)]
+   |                                            ^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/needless_borrow_pat.stderr b/tests/ui/needless_borrow_pat.stderr
index 018e74a4f11..25c570eb7ff 100644
--- a/tests/ui/needless_borrow_pat.stderr
+++ b/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:73:14
@@ -73,8 +74,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:128:21
diff --git a/tests/ui/needless_collect.fixed b/tests/ui/needless_collect.fixed
index bad8c307586..6551fa56b42 100644
--- a/tests/ui/needless_collect.fixed
+++ b/tests/ui/needless_collect.fixed
@@ -98,6 +98,29 @@ fn main() {
     let mut out = vec![];
     values.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
     let _y = values.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>(); // this is fine
+
+    // Don't write a warning if we call `clone()` on the iterator
+    // https://github.com/rust-lang/rust-clippy/issues/13430
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let _cloned = my_collection.into_iter().clone();
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let my_iter = my_collection.into_iter();
+    let _cloned = my_iter.clone();
+    // Same for `as_slice()`, for same reason.
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let _sliced = my_collection.into_iter().as_slice();
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let my_iter = my_collection.into_iter();
+    let _sliced = my_iter.as_slice();
+    // Assignment outside of main scope
+    {
+        let x;
+        {
+            let xxx: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+            x = xxx.into_iter();
+            for i in x.as_slice() {}
+        }
+    }
 }
 
 fn foo(_: impl IntoIterator<Item = usize>) {}
diff --git a/tests/ui/needless_collect.rs b/tests/ui/needless_collect.rs
index 3dfb5194f40..973c41c6875 100644
--- a/tests/ui/needless_collect.rs
+++ b/tests/ui/needless_collect.rs
@@ -98,6 +98,29 @@ fn main() {
     let mut out = vec![];
     values.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
     let _y = values.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>(); // this is fine
+
+    // Don't write a warning if we call `clone()` on the iterator
+    // https://github.com/rust-lang/rust-clippy/issues/13430
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let _cloned = my_collection.into_iter().clone();
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let my_iter = my_collection.into_iter();
+    let _cloned = my_iter.clone();
+    // Same for `as_slice()`, for same reason.
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let _sliced = my_collection.into_iter().as_slice();
+    let my_collection: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+    let my_iter = my_collection.into_iter();
+    let _sliced = my_iter.as_slice();
+    // Assignment outside of main scope
+    {
+        let x;
+        {
+            let xxx: Vec<()> = vec![()].into_iter().map(|()| {}).collect();
+            x = xxx.into_iter();
+            for i in x.as_slice() {}
+        }
+    }
 }
 
 fn foo(_: impl IntoIterator<Item = usize>) {}
diff --git a/tests/ui/needless_for_each_unfixable.stderr b/tests/ui/needless_for_each_unfixable.stderr
index 7e42bd133f0..3a3a240c5a3 100644
--- a/tests/ui/needless_for_each_unfixable.stderr
+++ b/tests/ui/needless_for_each_unfixable.stderr
@@ -25,8 +25,9 @@ LL +     }
    |
 help: ...and replace `return` with `continue`
    |
-LL |             continue;
-   |             ~~~~~~~~
+LL -             return;
+LL +             continue;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/needless_lifetimes.fixed b/tests/ui/needless_lifetimes.fixed
index 283635d42de..d59393fb3f3 100644
--- a/tests/ui/needless_lifetimes.fixed
+++ b/tests/ui/needless_lifetimes.fixed
@@ -1,6 +1,6 @@
 //@aux-build:proc_macros.rs
 
-#![warn(clippy::needless_lifetimes)]
+#![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)]
 #![allow(
     unused,
     clippy::boxed_local,
@@ -101,44 +101,6 @@ where
     Ok(x)
 }
 
-type Ref<'r> = &'r u8;
-
-// No error; same lifetime on two params.
-fn lifetime_param_1<'a>(_x: Ref<'a>, _y: &'a u8) {}
-
-fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {}
-//~^ needless_lifetimes
-
-// No error; bounded lifetime.
-fn lifetime_param_3<'a, 'b: 'a>(_x: Ref<'a>, _y: &'b u8) {}
-
-// No error; bounded lifetime.
-fn lifetime_param_4<'a, 'b>(_x: Ref<'a>, _y: &'b u8)
-where
-    'b: 'a,
-{
-}
-
-struct Lt<'a, I: 'static> {
-    x: &'a I,
-}
-
-// No error; fn bound references `'a`.
-fn fn_bound<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
-where
-    F: Fn(Lt<'a, I>) -> Lt<'a, I>,
-{
-    unreachable!()
-}
-
-fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I>
-//~^ needless_lifetimes
-where
-    for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>,
-{
-    unreachable!()
-}
-
 // No error; see below.
 fn fn_bound_3<'a, F: FnOnce(&'a i32)>(x: &'a i32, f: F) {
     f(x);
@@ -203,30 +165,6 @@ fn already_elided<'a>(_: &u8, _: &'a u8) -> &'a u8 {
     unimplemented!()
 }
 
-fn struct_with_lt(_foo: Foo<'_>) -> &str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (named on the reference, anonymous on `Foo`).
-fn struct_with_lt2<'a>(_foo: &'a Foo) -> &'a str {
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (anonymous on the reference, named on `Foo`).
-fn struct_with_lt3<'a>(_foo: &Foo<'a>) -> &'a str {
-    unimplemented!()
-}
-
-// Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
-// valid:
-//   fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str
-//                                         ^^
-fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
 // Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
 // valid:
 //   fn struct_with_lt4b<'b>(_foo: &Foo<'b>) -> &'b str
@@ -254,30 +192,6 @@ fn trait_obj_elided2(_arg: &dyn Drop) -> &str {
 
 type FooAlias<'a> = Foo<'a>;
 
-fn alias_with_lt(_foo: FooAlias<'_>) -> &str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (named on the reference, anonymous on `FooAlias`).
-fn alias_with_lt2<'a>(_foo: &'a FooAlias) -> &'a str {
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (anonymous on the reference, named on `FooAlias`).
-fn alias_with_lt3<'a>(_foo: &FooAlias<'a>) -> &'a str {
-    unimplemented!()
-}
-
-// Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
-// valid:
-//   fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str
-//                                             ^^
-fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
 // Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
 // valid:
 //   fn alias_with_lt4b<'b>(_foo: &FooAlias<'b>) -> &'b str
@@ -329,15 +243,6 @@ fn test<'a>(x: &'a [u8]) -> u8 {
     *y
 }
 
-// Issue #3284: give hint regarding lifetime in return type.
-struct Cow<'a> {
-    x: &'a str,
-}
-fn out_return_type_lts(e: &str) -> Cow<'_> {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
 // Make sure we still warn on implementations
 mod issue4291 {
     trait BadTrait {
@@ -351,23 +256,6 @@ mod issue4291 {
     }
 }
 
-mod issue2944 {
-    trait Foo {}
-    struct Bar;
-    struct Baz<'a> {
-        bar: &'a Bar,
-    }
-
-    impl Foo for Baz<'_> {}
-    //~^ needless_lifetimes
-    impl Bar {
-        fn baz(&self) -> impl Foo + '_ {
-            //~^ needless_lifetimes
-            Baz { bar: self }
-        }
-    }
-}
-
 mod nested_elision_sites {
     // issue #issue2944
 
@@ -646,89 +534,4 @@ mod issue13749bis {
     impl<'a, T: 'a> Generic<T> {}
 }
 
-mod issue13923 {
-    struct Py<'py> {
-        data: &'py str,
-    }
-
-    enum Content<'t, 'py> {
-        Py(Py<'py>),
-        T1(&'t str),
-        T2(&'t str),
-    }
-
-    enum ContentString<'t> {
-        T1(&'t str),
-        T2(&'t str),
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        // `'py` cannot be elided
-        fn map_content1(self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(content) => Content::T2(f(content)),
-            }
-        }
-    }
-
-    impl<'t> ContentString<'t> {
-        //~^ needless_lifetimes
-        // `'py` can be elided because of `&self`
-        fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(content) => Content::T2(f(content)),
-            }
-        }
-    }
-
-    impl<'t> ContentString<'t> {
-        //~^ needless_lifetimes
-        // `'py` can be elided because of `&'_ self`
-        fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(content) => Content::T2(f(content)),
-            }
-        }
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        // `'py` should not be elided as the default lifetime, even if working, could be named as `'t`
-        fn map_content4(self, f: impl FnOnce(&'t str) -> &'t str, o: &'t str) -> Content<'t, 'py> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(_) => Content::T2(o),
-            }
-        }
-    }
-
-    impl<'t> ContentString<'t> {
-        //~^ needless_lifetimes
-        // `'py` can be elided because of `&Self`
-        fn map_content5(
-            self: std::pin::Pin<&Self>,
-            f: impl FnOnce(&'t str) -> &'t str,
-            o: &'t str,
-        ) -> Content<'t, '_> {
-            match *self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(_) => Content::T2(o),
-            }
-        }
-    }
-
-    struct Cx<'a, 'b> {
-        a: &'a u32,
-        b: &'b u32,
-    }
-
-    // `'c` cannot be elided because we have several input lifetimes
-    fn one_explicit<'b>(x: Cx<'_, 'b>) -> &'b u32 {
-        x.b
-        //~^ needless_borrow
-    }
-}
-
 fn main() {}
diff --git a/tests/ui/needless_lifetimes.rs b/tests/ui/needless_lifetimes.rs
index 2853870473d..e24907ab5fc 100644
--- a/tests/ui/needless_lifetimes.rs
+++ b/tests/ui/needless_lifetimes.rs
@@ -1,6 +1,6 @@
 //@aux-build:proc_macros.rs
 
-#![warn(clippy::needless_lifetimes)]
+#![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)]
 #![allow(
     unused,
     clippy::boxed_local,
@@ -101,44 +101,6 @@ where
     Ok(x)
 }
 
-type Ref<'r> = &'r u8;
-
-// No error; same lifetime on two params.
-fn lifetime_param_1<'a>(_x: Ref<'a>, _y: &'a u8) {}
-
-fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
-//~^ needless_lifetimes
-
-// No error; bounded lifetime.
-fn lifetime_param_3<'a, 'b: 'a>(_x: Ref<'a>, _y: &'b u8) {}
-
-// No error; bounded lifetime.
-fn lifetime_param_4<'a, 'b>(_x: Ref<'a>, _y: &'b u8)
-where
-    'b: 'a,
-{
-}
-
-struct Lt<'a, I: 'static> {
-    x: &'a I,
-}
-
-// No error; fn bound references `'a`.
-fn fn_bound<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
-where
-    F: Fn(Lt<'a, I>) -> Lt<'a, I>,
-{
-    unreachable!()
-}
-
-fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
-//~^ needless_lifetimes
-where
-    for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>,
-{
-    unreachable!()
-}
-
 // No error; see below.
 fn fn_bound_3<'a, F: FnOnce(&'a i32)>(x: &'a i32, f: F) {
     f(x);
@@ -203,30 +165,6 @@ fn already_elided<'a>(_: &u8, _: &'a u8) -> &'a u8 {
     unimplemented!()
 }
 
-fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (named on the reference, anonymous on `Foo`).
-fn struct_with_lt2<'a>(_foo: &'a Foo) -> &'a str {
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (anonymous on the reference, named on `Foo`).
-fn struct_with_lt3<'a>(_foo: &Foo<'a>) -> &'a str {
-    unimplemented!()
-}
-
-// Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
-// valid:
-//   fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str
-//                                         ^^
-fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
 // Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
 // valid:
 //   fn struct_with_lt4b<'b>(_foo: &Foo<'b>) -> &'b str
@@ -254,30 +192,6 @@ fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
 
 type FooAlias<'a> = Foo<'a>;
 
-fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (named on the reference, anonymous on `FooAlias`).
-fn alias_with_lt2<'a>(_foo: &'a FooAlias) -> &'a str {
-    unimplemented!()
-}
-
-// No warning; two input lifetimes (anonymous on the reference, named on `FooAlias`).
-fn alias_with_lt3<'a>(_foo: &FooAlias<'a>) -> &'a str {
-    unimplemented!()
-}
-
-// Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
-// valid:
-//   fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str
-//                                             ^^
-fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
 // Warning; two input lifetimes, but the output lifetime is not elided, i.e., the following is
 // valid:
 //   fn alias_with_lt4b<'b>(_foo: &FooAlias<'b>) -> &'b str
@@ -329,15 +243,6 @@ fn test<'a>(x: &'a [u8]) -> u8 {
     *y
 }
 
-// Issue #3284: give hint regarding lifetime in return type.
-struct Cow<'a> {
-    x: &'a str,
-}
-fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
-    //~^ needless_lifetimes
-    unimplemented!()
-}
-
 // Make sure we still warn on implementations
 mod issue4291 {
     trait BadTrait {
@@ -351,23 +256,6 @@ mod issue4291 {
     }
 }
 
-mod issue2944 {
-    trait Foo {}
-    struct Bar;
-    struct Baz<'a> {
-        bar: &'a Bar,
-    }
-
-    impl<'a> Foo for Baz<'a> {}
-    //~^ needless_lifetimes
-    impl Bar {
-        fn baz<'a>(&'a self) -> impl Foo + 'a {
-            //~^ needless_lifetimes
-            Baz { bar: self }
-        }
-    }
-}
-
 mod nested_elision_sites {
     // issue #issue2944
 
@@ -646,89 +534,4 @@ mod issue13749bis {
     impl<'a, T: 'a> Generic<T> {}
 }
 
-mod issue13923 {
-    struct Py<'py> {
-        data: &'py str,
-    }
-
-    enum Content<'t, 'py> {
-        Py(Py<'py>),
-        T1(&'t str),
-        T2(&'t str),
-    }
-
-    enum ContentString<'t> {
-        T1(&'t str),
-        T2(&'t str),
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        // `'py` cannot be elided
-        fn map_content1(self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(content) => Content::T2(f(content)),
-            }
-        }
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        //~^ needless_lifetimes
-        // `'py` can be elided because of `&self`
-        fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(content) => Content::T2(f(content)),
-            }
-        }
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        //~^ needless_lifetimes
-        // `'py` can be elided because of `&'_ self`
-        fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(content) => Content::T2(f(content)),
-            }
-        }
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        // `'py` should not be elided as the default lifetime, even if working, could be named as `'t`
-        fn map_content4(self, f: impl FnOnce(&'t str) -> &'t str, o: &'t str) -> Content<'t, 'py> {
-            match self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(_) => Content::T2(o),
-            }
-        }
-    }
-
-    impl<'t, 'py> ContentString<'t> {
-        //~^ needless_lifetimes
-        // `'py` can be elided because of `&Self`
-        fn map_content5(
-            self: std::pin::Pin<&Self>,
-            f: impl FnOnce(&'t str) -> &'t str,
-            o: &'t str,
-        ) -> Content<'t, 'py> {
-            match *self {
-                Self::T1(content) => Content::T1(f(content)),
-                Self::T2(_) => Content::T2(o),
-            }
-        }
-    }
-
-    struct Cx<'a, 'b> {
-        a: &'a u32,
-        b: &'b u32,
-    }
-
-    // `'c` cannot be elided because we have several input lifetimes
-    fn one_explicit<'b>(x: Cx<'_, 'b>) -> &'b u32 {
-        &x.b
-        //~^ needless_borrow
-    }
-}
-
 fn main() {}
diff --git a/tests/ui/needless_lifetimes.stderr b/tests/ui/needless_lifetimes.stderr
index b1d1c88a296..138d0498c43 100644
--- a/tests/ui/needless_lifetimes.stderr
+++ b/tests/ui/needless_lifetimes.stderr
@@ -108,32 +108,8 @@ LL - fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
 LL + fn where_clause_without_lt<T>(x: &u8, _y: u8) -> Result<&u8, ()>
    |
 
-error: the following explicit lifetimes could be elided: 'a, 'b
-  --> tests/ui/needless_lifetimes.rs:109:21
-   |
-LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
-   |                     ^^  ^^          ^^        ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
-LL + fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {}
-   |
-
-error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:134:15
-   |
-LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
-   |               ^^               ^^                   ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
-LL + fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I>
-   |
-
 error: the following explicit lifetimes could be elided: 's
-  --> tests/ui/needless_lifetimes.rs:165:21
+  --> tests/ui/needless_lifetimes.rs:127:21
    |
 LL |     fn self_and_out<'s>(&'s self) -> &'s u8 {
    |                     ^^   ^^           ^^
@@ -145,7 +121,7 @@ LL +     fn self_and_out(&self) -> &u8 {
    |
 
 error: the following explicit lifetimes could be elided: 't
-  --> tests/ui/needless_lifetimes.rs:173:30
+  --> tests/ui/needless_lifetimes.rs:135:30
    |
 LL |     fn self_and_in_out_1<'s, 't>(&'s self, _x: &'t u8) -> &'s u8 {
    |                              ^^                 ^^
@@ -157,7 +133,7 @@ LL +     fn self_and_in_out_1<'s>(&'s self, _x: &u8) -> &'s u8 {
    |
 
 error: the following explicit lifetimes could be elided: 's
-  --> tests/ui/needless_lifetimes.rs:181:26
+  --> tests/ui/needless_lifetimes.rs:143:26
    |
 LL |     fn self_and_in_out_2<'s, 't>(&'s self, x: &'t u8) -> &'t u8 {
    |                          ^^       ^^
@@ -169,7 +145,7 @@ LL +     fn self_and_in_out_2<'t>(&self, x: &'t u8) -> &'t u8 {
    |
 
 error: the following explicit lifetimes could be elided: 's, 't
-  --> tests/ui/needless_lifetimes.rs:186:29
+  --> tests/ui/needless_lifetimes.rs:148:29
    |
 LL |     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
    |                             ^^  ^^   ^^            ^^
@@ -181,31 +157,7 @@ LL +     fn distinct_self_and_in(&self, _x: &u8) {}
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:206:19
-   |
-LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
-   |                   ^^            ^^       ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
-LL + fn struct_with_lt(_foo: Foo<'_>) -> &str {
-   |
-
-error: the following explicit lifetimes could be elided: 'b
-  --> tests/ui/needless_lifetimes.rs:225:25
-   |
-LL | fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
-   |                         ^^                ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
-LL + fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str {
-   |
-
-error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:234:21
+  --> tests/ui/needless_lifetimes.rs:172:21
    |
 LL | fn struct_with_lt4b<'a, 'b>(_foo: &'a Foo<'b>) -> &'b str {
    |                     ^^             ^^
@@ -217,7 +169,7 @@ LL + fn struct_with_lt4b<'b>(_foo: &Foo<'b>) -> &'b str {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:250:22
+  --> tests/ui/needless_lifetimes.rs:188:22
    |
 LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str {
    |                      ^^         ^^               ^^
@@ -229,31 +181,7 @@ LL + fn trait_obj_elided2(_arg: &dyn Drop) -> &str {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:257:18
-   |
-LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
-   |                  ^^                 ^^       ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
-LL + fn alias_with_lt(_foo: FooAlias<'_>) -> &str {
-   |
-
-error: the following explicit lifetimes could be elided: 'b
-  --> tests/ui/needless_lifetimes.rs:276:24
-   |
-LL | fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
-   |                        ^^                     ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
-LL + fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str {
-   |
-
-error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:285:20
+  --> tests/ui/needless_lifetimes.rs:199:20
    |
 LL | fn alias_with_lt4b<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'b str {
    |                    ^^             ^^
@@ -265,7 +193,7 @@ LL + fn alias_with_lt4b<'b>(_foo: &FooAlias<'b>) -> &'b str {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:290:30
+  --> tests/ui/needless_lifetimes.rs:204:30
    |
 LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
    |                              ^^         ^^          ^
@@ -277,7 +205,7 @@ LL + fn named_input_elided_output(_arg: &str) -> &str {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:299:19
+  --> tests/ui/needless_lifetimes.rs:213:19
    |
 LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
    |                   ^^                                ^^
@@ -289,19 +217,7 @@ LL + fn trait_bound_ok<T: WithLifetime<'static>>(_: &u8, _: T) {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:336:24
-   |
-LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
-   |                        ^^      ^^             ^^
-   |
-help: elide the lifetimes
-   |
-LL - fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
-LL + fn out_return_type_lts(e: &str) -> Cow<'_> {
-   |
-
-error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:344:24
+  --> tests/ui/needless_lifetimes.rs:249:24
    |
 LL |         fn needless_lt<'a>(x: &'a u8) {}
    |                        ^^      ^^
@@ -313,7 +229,7 @@ LL +         fn needless_lt(x: &u8) {}
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:349:24
+  --> tests/ui/needless_lifetimes.rs:254:24
    |
 LL |         fn needless_lt<'a>(_x: &'a u8) {}
    |                        ^^       ^^
@@ -325,31 +241,7 @@ LL +         fn needless_lt(_x: &u8) {}
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:361:10
-   |
-LL |     impl<'a> Foo for Baz<'a> {}
-   |          ^^              ^^
-   |
-help: elide the lifetimes
-   |
-LL -     impl<'a> Foo for Baz<'a> {}
-LL +     impl Foo for Baz<'_> {}
-   |
-
-error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:364:16
-   |
-LL |         fn baz<'a>(&'a self) -> impl Foo + 'a {
-   |                ^^   ^^                     ^^
-   |
-help: elide the lifetimes
-   |
-LL -         fn baz<'a>(&'a self) -> impl Foo + 'a {
-LL +         fn baz(&self) -> impl Foo + '_ {
-   |
-
-error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:397:55
+  --> tests/ui/needless_lifetimes.rs:285:55
    |
 LL |     fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 {
    |                                                       ^^      ^^                                    ^^
@@ -361,7 +253,7 @@ LL +     fn impl_trait_elidable_nested_anonymous_lifetimes(i: &i32, f: impl Fn(&
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:407:26
+  --> tests/ui/needless_lifetimes.rs:295:26
    |
 LL |     fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 {
    |                          ^^                           ^^                ^^
@@ -373,7 +265,7 @@ LL +     fn generics_elidable<T: Fn(&i32) -> &i32>(i: &i32, f: T) -> &i32 {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:420:30
+  --> tests/ui/needless_lifetimes.rs:308:30
    |
 LL |     fn where_clause_elidable<'a, T>(i: &'a i32, f: T) -> &'a i32
    |                              ^^         ^^                ^^
@@ -385,7 +277,7 @@ LL +     fn where_clause_elidable<T>(i: &i32, f: T) -> &i32
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:436:28
+  --> tests/ui/needless_lifetimes.rs:324:28
    |
 LL |     fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 {
    |                            ^^      ^^                               ^^
@@ -397,7 +289,7 @@ LL +     fn pointer_fn_elidable(i: &i32, f: fn(&i32) -> &i32) -> &i32 {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:450:28
+  --> tests/ui/needless_lifetimes.rs:338:28
    |
 LL |     fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 {
    |                            ^^      ^^
@@ -409,7 +301,7 @@ LL +     fn nested_fn_pointer_3(_: &i32) -> fn(fn(&i32) -> &i32) -> i32 {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:454:28
+  --> tests/ui/needless_lifetimes.rs:342:28
    |
 LL |     fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) {
    |                            ^^      ^^
@@ -421,7 +313,7 @@ LL +     fn nested_fn_pointer_4(_: &i32) -> impl Fn(fn(&i32)) {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:477:21
+  --> tests/ui/needless_lifetimes.rs:365:21
    |
 LL |         fn implicit<'a>(&'a self) -> &'a () {
    |                     ^^   ^^           ^^
@@ -433,7 +325,7 @@ LL +         fn implicit(&self) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:481:25
+  --> tests/ui/needless_lifetimes.rs:369:25
    |
 LL |         fn implicit_mut<'a>(&'a mut self) -> &'a () {
    |                         ^^   ^^               ^^
@@ -445,7 +337,7 @@ LL +         fn implicit_mut(&mut self) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:486:21
+  --> tests/ui/needless_lifetimes.rs:374:21
    |
 LL |         fn explicit<'a>(self: &'a Arc<Self>) -> &'a () {
    |                     ^^         ^^                ^^
@@ -457,7 +349,7 @@ LL +         fn explicit(self: &Arc<Self>) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:491:25
+  --> tests/ui/needless_lifetimes.rs:379:25
    |
 LL |         fn explicit_mut<'a>(self: &'a mut Rc<Self>) -> &'a () {
    |                         ^^         ^^                   ^^
@@ -469,7 +361,7 @@ LL +         fn explicit_mut(self: &mut Rc<Self>) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:504:31
+  --> tests/ui/needless_lifetimes.rs:392:31
    |
 LL |         fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
    |                               ^^                          ^^         ^^
@@ -481,7 +373,7 @@ LL +         fn lifetime_elsewhere(self: Box<Self>, here: &()) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:511:21
+  --> tests/ui/needless_lifetimes.rs:399:21
    |
 LL |         fn implicit<'a>(&'a self) -> &'a ();
    |                     ^^   ^^           ^^
@@ -493,7 +385,7 @@ LL +         fn implicit(&self) -> &();
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:513:30
+  --> tests/ui/needless_lifetimes.rs:401:30
    |
 LL |         fn implicit_provided<'a>(&'a self) -> &'a () {
    |                              ^^   ^^           ^^
@@ -505,7 +397,7 @@ LL +         fn implicit_provided(&self) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:519:21
+  --> tests/ui/needless_lifetimes.rs:407:21
    |
 LL |         fn explicit<'a>(self: &'a Arc<Self>) -> &'a ();
    |                     ^^         ^^                ^^
@@ -517,7 +409,7 @@ LL +         fn explicit(self: &Arc<Self>) -> &();
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:522:30
+  --> tests/ui/needless_lifetimes.rs:410:30
    |
 LL |         fn explicit_provided<'a>(self: &'a Arc<Self>) -> &'a () {
    |                              ^^         ^^                ^^
@@ -529,7 +421,7 @@ LL +         fn explicit_provided(self: &Arc<Self>) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:533:31
+  --> tests/ui/needless_lifetimes.rs:421:31
    |
 LL |         fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a ();
    |                               ^^                          ^^         ^^
@@ -541,7 +433,7 @@ LL +         fn lifetime_elsewhere(self: Box<Self>, here: &()) -> &();
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:535:40
+  --> tests/ui/needless_lifetimes.rs:423:40
    |
 LL |         fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () {
    |                                        ^^                          ^^         ^^
@@ -553,7 +445,7 @@ LL +         fn lifetime_elsewhere_provided(self: Box<Self>, here: &()) -> &() {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:545:12
+  --> tests/ui/needless_lifetimes.rs:433:12
    |
 LL |     fn foo<'a>(x: &'a u8, y: &'_ u8) {}
    |            ^^      ^^
@@ -565,7 +457,7 @@ LL +     fn foo(x: &u8, y: &'_ u8) {}
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:548:12
+  --> tests/ui/needless_lifetimes.rs:436:12
    |
 LL |     fn bar<'a>(x: &'a u8, y: &'_ u8, z: &'_ u8) {}
    |            ^^      ^^
@@ -577,7 +469,7 @@ LL +     fn bar(x: &u8, y: &'_ u8, z: &'_ u8) {}
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:556:18
+  --> tests/ui/needless_lifetimes.rs:444:18
    |
 LL |     fn one_input<'a>(x: &'a u8) -> &'a u8 {
    |                  ^^      ^^         ^^
@@ -589,7 +481,7 @@ LL +     fn one_input(x: &u8) -> &u8 {
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:562:42
+  --> tests/ui/needless_lifetimes.rs:450:42
    |
 LL |     fn multiple_inputs_output_not_elided<'a, 'b>(x: &'a u8, y: &'b u8, z: &'b u8) -> &'b u8 {
    |                                          ^^          ^^
@@ -601,7 +493,7 @@ LL +     fn multiple_inputs_output_not_elided<'b>(x: &u8, y: &'b u8, z: &'b u8)
    |
 
 error: the following explicit lifetimes could be elided: 'a
-  --> tests/ui/needless_lifetimes.rs:579:22
+  --> tests/ui/needless_lifetimes.rs:467:22
    |
 LL |         fn one_input<'a>(x: &'a u8) -> &'a u8 {
    |                      ^^      ^^         ^^
@@ -613,66 +505,5 @@ LL -         fn one_input<'a>(x: &'a u8) -> &'a u8 {
 LL +         fn one_input(x: &u8) -> &u8 {
    |
 
-error: the following explicit lifetimes could be elided: 'py
-  --> tests/ui/needless_lifetimes.rs:675:14
-   |
-LL |     impl<'t, 'py> ContentString<'t> {
-   |              ^^^
-...
-LL |         fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
-   |                                                                                   ^^^
-   |
-help: elide the lifetimes
-   |
-LL ~     impl<'t> ContentString<'t> {
-LL |
-LL |         // `'py` can be elided because of `&self`
-LL ~         fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
-   |
-
-error: the following explicit lifetimes could be elided: 'py
-  --> tests/ui/needless_lifetimes.rs:686:14
-   |
-LL |     impl<'t, 'py> ContentString<'t> {
-   |              ^^^
-...
-LL |         fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
-   |                                                                                      ^^^
-   |
-help: elide the lifetimes
-   |
-LL ~     impl<'t> ContentString<'t> {
-LL |
-LL |         // `'py` can be elided because of `&'_ self`
-LL ~         fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
-   |
-
-error: the following explicit lifetimes could be elided: 'py
-  --> tests/ui/needless_lifetimes.rs:707:14
-   |
-LL |     impl<'t, 'py> ContentString<'t> {
-   |              ^^^
-...
-LL |         ) -> Content<'t, 'py> {
-   |                          ^^^
-   |
-help: elide the lifetimes
-   |
-LL ~     impl<'t> ContentString<'t> {
-LL |
-...
-LL |             o: &'t str,
-LL ~         ) -> Content<'t, '_> {
-   |
-
-error: this expression creates a reference which is immediately dereferenced by the compiler
-  --> tests/ui/needless_lifetimes.rs:729:9
-   |
-LL |         &x.b
-   |         ^^^^ help: change this to: `x.b`
-   |
-   = note: `-D clippy::needless-borrow` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
-
-error: aborting due to 55 previous errors
+error: aborting due to 42 previous errors
 
diff --git a/tests/ui/needless_option_as_deref.fixed b/tests/ui/needless_option_as_deref.fixed
index 5bb0244ee09..fd639f3b57f 100644
--- a/tests/ui/needless_option_as_deref.fixed
+++ b/tests/ui/needless_option_as_deref.fixed
@@ -73,3 +73,16 @@ mod issue_non_copy_13077 {
         pub field: (),
     }
 }
+
+mod issue14148 {
+    pub trait SomeTrait {
+        fn something(&self, mut maybe_side_effect: Option<&mut String>) {
+            other(maybe_side_effect.as_deref_mut());
+            other(maybe_side_effect);
+        }
+    }
+
+    fn other(_maybe_side_effect: Option<&mut String>) {
+        unimplemented!()
+    }
+}
diff --git a/tests/ui/needless_option_as_deref.rs b/tests/ui/needless_option_as_deref.rs
index 9cd8afe0bc7..cbf7935794b 100644
--- a/tests/ui/needless_option_as_deref.rs
+++ b/tests/ui/needless_option_as_deref.rs
@@ -73,3 +73,16 @@ mod issue_non_copy_13077 {
         pub field: (),
     }
 }
+
+mod issue14148 {
+    pub trait SomeTrait {
+        fn something(&self, mut maybe_side_effect: Option<&mut String>) {
+            other(maybe_side_effect.as_deref_mut());
+            other(maybe_side_effect);
+        }
+    }
+
+    fn other(_maybe_side_effect: Option<&mut String>) {
+        unimplemented!()
+    }
+}
diff --git a/tests/ui/needless_pass_by_value.rs b/tests/ui/needless_pass_by_value.rs
index 885fb409417..aef7fff2870 100644
--- a/tests/ui/needless_pass_by_value.rs
+++ b/tests/ui/needless_pass_by_value.rs
@@ -189,6 +189,42 @@ struct Obj(String);
 
 fn prefix_test(_unused_with_prefix: Obj) {}
 
+// Regression test for <https://github.com/rust-lang/rust-clippy/issues/13744>.
+// It's more idiomatic to write `Option<&T>` rather than `&Option<T>`.
+fn option_inner_ref(x: Option<String>) {
+    //~^ ERROR: this argument is passed by value, but not consumed in the function body
+    assert!(x.is_some());
+}
+
+mod non_standard {
+    #[derive(Debug)]
+    pub struct Option<T>(T);
+}
+
+fn non_standard_option(x: non_standard::Option<String>) {
+    //~^ needless_pass_by_value
+    dbg!(&x);
+}
+
+fn option_by_name(x: Option<std::option::Option<core::option::Option<non_standard::Option<String>>>>) {
+    //~^ needless_pass_by_value
+    dbg!(&x);
+}
+
+type OptStr = Option<String>;
+
+fn non_option(x: OptStr) {
+    //~^ needless_pass_by_value
+    dbg!(&x);
+}
+
+type Opt<T> = Option<T>;
+
+fn non_option_either(x: Opt<String>) {
+    //~^ needless_pass_by_value
+    dbg!(&x);
+}
+
 fn main() {
     // This should not cause an ICE either
     // https://github.com/rust-lang/rust-clippy/issues/3144
diff --git a/tests/ui/needless_pass_by_value.stderr b/tests/ui/needless_pass_by_value.stderr
index 47e00868821..e4381d1db53 100644
--- a/tests/ui/needless_pass_by_value.stderr
+++ b/tests/ui/needless_pass_by_value.stderr
@@ -17,43 +17,78 @@ error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:35:22
    |
 LL | fn bar(x: String, y: Wrapper) {
-   |                      ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
+   |                      ^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn bar(x: String, y: &Wrapper) {
+   |                      +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:44:71
    |
 LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
-   |                                                                       ^ help: consider taking a reference instead: `&V`
+   |                                                                       ^
+   |
+help: consider taking a reference instead
+   |
+LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: &V) {
+   |                                                                       +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:58:18
    |
 LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
-   |                  ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn test_match(x: Option<Option<&String>>, y: Option<Option<String>>) {
+   |                                +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:73:24
    |
 LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
-   |                        ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
+   |                        ^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn test_destructure(x: &Wrapper, y: Wrapper, z: Wrapper) {
+   |                        +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:73:36
    |
 LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
-   |                                    ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
+   |                                    ^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
+   |                                    +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:92:49
    |
 LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: T, serializable: S) {}
-   |                                                 ^ help: consider taking a reference instead: `&T`
+   |                                                 ^
+   |
+help: consider taking a reference instead
+   |
+LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: &T, serializable: S) {}
+   |                                                 +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:95:18
    |
 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
-   |                  ^^^^^^ help: consider taking a reference instead: `&String`
+   |                  ^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn issue_2114(s: &String, t: String, u: Vec<i32>, v: Vec<i32>) {
+   |                  +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:95:29
@@ -63,18 +98,25 @@ LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
    |
 help: consider changing the type to
    |
-LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
-   |                             ~~~~
+LL - fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
+LL + fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
+   |
 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:95:40
    |
 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
-   |                                        ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
+   |                                        ^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn issue_2114(s: String, t: String, u: &Vec<i32>, v: Vec<i32>) {
+   |                                        +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:95:53
@@ -84,12 +126,14 @@ LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
    |
 help: consider changing the type to
    |
-LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
-   |                                                     ~~~~~~
+LL - fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
+LL + fn issue_2114(s: String, t: String, u: Vec<i32>, 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:113:12
@@ -101,79 +145,175 @@ error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:115:12
    |
 LL |         t: String,
-   |            ^^^^^^ help: consider taking a reference instead: `&String`
+   |            ^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL |         t: &String,
+   |            +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:125:23
    |
 LL |     fn baz(&self, uu: U, ss: Self) {}
-   |                       ^ help: consider taking a reference instead: `&U`
+   |                       ^
+   |
+help: consider taking a reference instead
+   |
+LL |     fn baz(&self, uu: &U, ss: Self) {}
+   |                       +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:125:30
    |
 LL |     fn baz(&self, uu: U, ss: Self) {}
-   |                              ^^^^ help: consider taking a reference instead: `&Self`
+   |                              ^^^^
+   |
+help: consider taking a reference instead
+   |
+LL |     fn baz(&self, uu: U, ss: &Self) {}
+   |                              +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:149:24
    |
 LL | fn bar_copy(x: u32, y: CopyWrapper) {
-   |                        ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
+   |                        ^^^^^^^^^^^
    |
 help: or consider marking this type as `Copy`
   --> tests/ui/needless_pass_by_value.rs:147:1
    |
 LL | struct CopyWrapper(u32);
    | ^^^^^^^^^^^^^^^^^^
+help: consider taking a reference instead
+   |
+LL | fn bar_copy(x: u32, y: &CopyWrapper) {
+   |                        +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:157:29
    |
 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
-   |                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
+   |                             ^^^^^^^^^^^
    |
 help: or consider marking this type as `Copy`
   --> tests/ui/needless_pass_by_value.rs:147:1
    |
 LL | struct CopyWrapper(u32);
    | ^^^^^^^^^^^^^^^^^^
+help: consider taking a reference instead
+   |
+LL | fn test_destructure_copy(x: &CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
+   |                             +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:157:45
    |
 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
-   |                                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
+   |                                             ^^^^^^^^^^^
    |
 help: or consider marking this type as `Copy`
   --> tests/ui/needless_pass_by_value.rs:147:1
    |
 LL | struct CopyWrapper(u32);
    | ^^^^^^^^^^^^^^^^^^
+help: consider taking a reference instead
+   |
+LL | fn test_destructure_copy(x: CopyWrapper, y: &CopyWrapper, z: CopyWrapper) {
+   |                                             +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:157:61
    |
 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
-   |                                                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
+   |                                                             ^^^^^^^^^^^
    |
 help: or consider marking this type as `Copy`
   --> tests/ui/needless_pass_by_value.rs:147:1
    |
 LL | struct CopyWrapper(u32);
    | ^^^^^^^^^^^^^^^^^^
+help: consider taking a reference instead
+   |
+LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: &CopyWrapper) {
+   |                                                             +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:173:40
    |
 LL | fn some_fun<'b, S: Bar<'b, ()>>(items: S) {}
-   |                                        ^ help: consider taking a reference instead: `&S`
+   |                                        ^
+   |
+help: consider taking a reference instead
+   |
+LL | fn some_fun<'b, S: Bar<'b, ()>>(items: &S) {}
+   |                                        +
 
 error: this argument is passed by value, but not consumed in the function body
   --> tests/ui/needless_pass_by_value.rs:179:20
    |
 LL | fn more_fun(items: impl Club<'static, i32>) {}
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn more_fun(items: &impl Club<'static, i32>) {}
+   |                    +
+
+error: this argument is passed by value, but not consumed in the function body
+  --> tests/ui/needless_pass_by_value.rs:194:24
+   |
+LL | fn option_inner_ref(x: Option<String>) {
+   |                        ^^^^^^^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn option_inner_ref(x: Option<&String>) {
+   |                               +
+
+error: this argument is passed by value, but not consumed in the function body
+  --> tests/ui/needless_pass_by_value.rs:204:27
+   |
+LL | fn non_standard_option(x: non_standard::Option<String>) {
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn non_standard_option(x: &non_standard::Option<String>) {
+   |                           +
+
+error: this argument is passed by value, but not consumed in the function body
+  --> tests/ui/needless_pass_by_value.rs:209:22
+   |
+LL | fn option_by_name(x: Option<std::option::Option<core::option::Option<non_standard::Option<String>>>>) {
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn option_by_name(x: Option<std::option::Option<core::option::Option<&non_standard::Option<String>>>>) {
+   |                                                                      +
+
+error: this argument is passed by value, but not consumed in the function body
+  --> tests/ui/needless_pass_by_value.rs:216:18
+   |
+LL | fn non_option(x: OptStr) {
+   |                  ^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn non_option(x: &OptStr) {
+   |                  +
+
+error: this argument is passed by value, but not consumed in the function body
+  --> tests/ui/needless_pass_by_value.rs:223:25
+   |
+LL | fn non_option_either(x: Opt<String>) {
+   |                         ^^^^^^^^^^^
+   |
+help: consider taking a reference instead
+   |
+LL | fn non_option_either(x: &Opt<String>) {
+   |                         +
 
-error: aborting due to 22 previous errors
+error: aborting due to 27 previous errors
 
diff --git a/tests/ui/needless_range_loop.stderr b/tests/ui/needless_range_loop.stderr
index 86c2b550b07..23c085f9d3b 100644
--- a/tests/ui/needless_range_loop.stderr
+++ b/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 <item> in &vec {
-   |         ~~~~~~    ~~~~
+LL -     for i in 0..vec.len() {
+LL +     for <item> in &vec {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop.rs:27:14
@@ -19,8 +20,9 @@ LL |     for i in 0..vec.len() {
    |
 help: consider using an iterator
    |
-LL |     for <item> in &vec {
-   |         ~~~~~~    ~~~~
+LL -     for i in 0..vec.len() {
+LL +     for <item> in &vec {
+   |
 
 error: the loop variable `j` is only used to index `STATIC`
   --> tests/ui/needless_range_loop.rs:34:14
@@ -30,8 +32,9 @@ LL |     for j in 0..4 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in &STATIC {
-   |         ~~~~~~    ~~~~~~~
+LL -     for j in 0..4 {
+LL +     for <item> in &STATIC {
+   |
 
 error: the loop variable `j` is only used to index `CONST`
   --> tests/ui/needless_range_loop.rs:40:14
@@ -41,8 +44,9 @@ LL |     for j in 0..4 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in &CONST {
-   |         ~~~~~~    ~~~~~~
+LL -     for j in 0..4 {
+LL +     for <item> in &CONST {
+   |
 
 error: the loop variable `i` is used to index `vec`
   --> tests/ui/needless_range_loop.rs:46:14
@@ -52,8 +56,9 @@ LL |     for i in 0..vec.len() {
    |
 help: consider using an iterator and enumerate()
    |
-LL |     for (i, <item>) in vec.iter().enumerate() {
-   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 0..vec.len() {
+LL +     for (i, <item>) in vec.iter().enumerate() {
+   |
 
 error: the loop variable `i` is only used to index `vec2`
   --> tests/ui/needless_range_loop.rs:56:14
@@ -63,8 +68,9 @@ LL |     for i in 0..vec.len() {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec2.iter().take(vec.len()) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 0..vec.len() {
+LL +     for <item> in vec2.iter().take(vec.len()) {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop.rs:62:14
@@ -74,8 +80,9 @@ LL |     for i in 5..vec.len() {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter().skip(5) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
+LL -     for i in 5..vec.len() {
+LL +     for <item> in vec.iter().skip(5) {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop.rs:68:14
@@ -85,8 +92,9 @@ LL |     for i in 0..MAX_LEN {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter().take(MAX_LEN) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 0..MAX_LEN {
+LL +     for <item> in vec.iter().take(MAX_LEN) {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop.rs:74:14
@@ -96,8 +104,9 @@ LL |     for i in 0..=MAX_LEN {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter().take(MAX_LEN + 1) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 0..=MAX_LEN {
+LL +     for <item> in vec.iter().take(MAX_LEN + 1) {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop.rs:80:14
@@ -107,8 +116,9 @@ LL |     for i in 5..10 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter().take(10).skip(5) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 5..10 {
+LL +     for <item> in vec.iter().take(10).skip(5) {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop.rs:86:14
@@ -118,8 +128,9 @@ LL |     for i in 5..=10 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter().take(10 + 1).skip(5) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 5..=10 {
+LL +     for <item> in vec.iter().take(10 + 1).skip(5) {
+   |
 
 error: the loop variable `i` is used to index `vec`
   --> tests/ui/needless_range_loop.rs:92:14
@@ -129,8 +140,9 @@ LL |     for i in 5..vec.len() {
    |
 help: consider using an iterator and enumerate()
    |
-LL |     for (i, <item>) in vec.iter().enumerate().skip(5) {
-   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 5..vec.len() {
+LL +     for (i, <item>) in vec.iter().enumerate().skip(5) {
+   |
 
 error: the loop variable `i` is used to index `vec`
   --> tests/ui/needless_range_loop.rs:98:14
@@ -140,8 +152,9 @@ LL |     for i in 5..10 {
    |
 help: consider using an iterator and enumerate()
    |
-LL |     for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
-   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 5..10 {
+LL +     for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
+   |
 
 error: the loop variable `i` is used to index `vec`
   --> tests/ui/needless_range_loop.rs:105:14
@@ -151,8 +164,9 @@ LL |     for i in 0..vec.len() {
    |
 help: consider using an iterator and enumerate()
    |
-LL |     for (i, <item>) in vec.iter_mut().enumerate() {
-   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 0..vec.len() {
+LL +     for (i, <item>) in vec.iter_mut().enumerate() {
+   |
 
 error: aborting due to 14 previous errors
 
diff --git a/tests/ui/needless_range_loop2.stderr b/tests/ui/needless_range_loop2.stderr
index 0531e8e8f85..cb979b3f3c2 100644
--- a/tests/ui/needless_range_loop2.stderr
+++ b/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 <item> in ns.iter().take(10).skip(3) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in 3..10 {
+LL +     for <item> 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 <item> in &mut ms {
-   |         ~~~~~~    ~~~~~~~
+LL -     for i in 0..ms.len() {
+LL +     for <item> in &mut ms {
+   |
 
 error: the loop variable `i` is only used to index `ms`
   --> tests/ui/needless_range_loop2.rs:42:14
@@ -30,8 +32,9 @@ LL |     for i in 0..ms.len() {
    |
 help: consider using an iterator
    |
-LL |     for <item> in &mut ms {
-   |         ~~~~~~    ~~~~~~~
+LL -     for i in 0..ms.len() {
+LL +     for <item> in &mut ms {
+   |
 
 error: the loop variable `i` is only used to index `vec`
   --> tests/ui/needless_range_loop2.rs:68:14
@@ -41,8 +44,9 @@ LL |     for i in x..x + 4 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter_mut().skip(x).take(4) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in x..x + 4 {
+LL +     for <item> 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:77:14
@@ -52,8 +56,9 @@ LL |     for i in x..=x + 4 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in vec.iter_mut().skip(x).take(4 + 1) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     for i in x..=x + 4 {
+LL +     for <item> 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:85:14
@@ -63,8 +68,9 @@ LL |     for i in 0..3 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in &arr {
-   |         ~~~~~~    ~~~~
+LL -     for i in 0..3 {
+LL +     for <item> in &arr {
+   |
 
 error: the loop variable `i` is only used to index `arr`
   --> tests/ui/needless_range_loop2.rs:91:14
@@ -74,8 +80,9 @@ LL |     for i in 0..2 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in arr.iter().take(2) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
+LL -     for i in 0..2 {
+LL +     for <item> in arr.iter().take(2) {
+   |
 
 error: the loop variable `i` is only used to index `arr`
   --> tests/ui/needless_range_loop2.rs:97:14
@@ -85,8 +92,9 @@ LL |     for i in 1..3 {
    |
 help: consider using an iterator
    |
-LL |     for <item> in arr.iter().skip(1) {
-   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
+LL -     for i in 1..3 {
+LL +     for <item> in arr.iter().skip(1) {
+   |
 
 error: aborting due to 8 previous errors
 
diff --git a/tests/ui/needless_return.fixed b/tests/ui/needless_return.fixed
index efc073ebe87..ad625ad6d50 100644
--- a/tests/ui/needless_return.fixed
+++ b/tests/ui/needless_return.fixed
@@ -6,7 +6,8 @@
     clippy::single_match,
     clippy::needless_bool,
     clippy::equatable_if_let,
-    clippy::needless_else
+    clippy::needless_else,
+    clippy::missing_safety_doc
 )]
 #![warn(clippy::needless_return)]
 
@@ -442,3 +443,12 @@ fn b(x: Option<u8>) -> Option<u8> {
         },
     }
 }
+
+unsafe fn todo() -> *const u8 {
+    todo!()
+}
+
+pub unsafe fn issue_12157() -> *const i32 {
+    (unsafe { todo() } as *const i32)
+    //~^ needless_return
+}
diff --git a/tests/ui/needless_return.rs b/tests/ui/needless_return.rs
index 283d86f25fe..41d7e5bdd50 100644
--- a/tests/ui/needless_return.rs
+++ b/tests/ui/needless_return.rs
@@ -6,7 +6,8 @@
     clippy::single_match,
     clippy::needless_bool,
     clippy::equatable_if_let,
-    clippy::needless_else
+    clippy::needless_else,
+    clippy::missing_safety_doc
 )]
 #![warn(clippy::needless_return)]
 
@@ -451,3 +452,12 @@ fn b(x: Option<u8>) -> Option<u8> {
         },
     }
 }
+
+unsafe fn todo() -> *const u8 {
+    todo!()
+}
+
+pub unsafe fn issue_12157() -> *const i32 {
+    return unsafe { todo() } as *const i32;
+    //~^ needless_return
+}
diff --git a/tests/ui/needless_return.stderr b/tests/ui/needless_return.stderr
index 3865a7fea6b..80863b9b62b 100644
--- a/tests/ui/needless_return.stderr
+++ b/tests/ui/needless_return.stderr
@@ -1,5 +1,5 @@
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:29:5
+  --> tests/ui/needless_return.rs:30:5
    |
 LL |     return true;
    |     ^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL +     true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:34:5
+  --> tests/ui/needless_return.rs:35:5
    |
 LL |     return true;
    |     ^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL +     true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:40:5
+  --> tests/ui/needless_return.rs:41:5
    |
 LL |     return true;;;
    |     ^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL +     true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:46:5
+  --> tests/ui/needless_return.rs:47:5
    |
 LL |     return true;; ; ;
    |     ^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL +     true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:52:9
+  --> tests/ui/needless_return.rs:53:9
    |
 LL |         return true;
    |         ^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL +         true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:55:9
+  --> tests/ui/needless_return.rs:56:9
    |
 LL |         return false;
    |         ^^^^^^^^^^^^
@@ -73,18 +73,19 @@ LL +         false
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:62:17
+  --> tests/ui/needless_return.rs:63:17
    |
 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:65:13
+  --> tests/ui/needless_return.rs:66:13
    |
 LL |             return true;
    |             ^^^^^^^^^^^
@@ -96,7 +97,7 @@ LL +             true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:73:9
+  --> tests/ui/needless_return.rs:74:9
    |
 LL |         return true;
    |         ^^^^^^^^^^^
@@ -108,18 +109,19 @@ LL +         true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:76:16
+  --> tests/ui/needless_return.rs:77:16
    |
 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:81:5
+  --> tests/ui/needless_return.rs:82:5
    |
 LL |     return the_answer!();
    |     ^^^^^^^^^^^^^^^^^^^^
@@ -131,7 +133,7 @@ LL +     the_answer!()
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:85:21
+  --> tests/ui/needless_return.rs:86:21
    |
 LL |   fn test_void_fun() {
    |  _____________________^
@@ -146,7 +148,7 @@ LL + fn test_void_fun() {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:91:11
+  --> tests/ui/needless_return.rs:92:11
    |
 LL |       if b {
    |  ___________^
@@ -161,7 +163,7 @@ LL +     if b {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:94:13
+  --> tests/ui/needless_return.rs:95:13
    |
 LL |       } else {
    |  _____________^
@@ -176,18 +178,19 @@ LL +     } else {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:103:14
+  --> tests/ui/needless_return.rs:104:14
    |
 LL |         _ => return,
    |              ^^^^^^
    |
 help: replace `return` with a unit value
    |
-LL |         _ => (),
-   |              ~~
+LL -         _ => return,
+LL +         _ => (),
+   |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:112:24
+  --> tests/ui/needless_return.rs:113:24
    |
 LL |               let _ = 42;
    |  ________________________^
@@ -202,18 +205,19 @@ LL +             let _ = 42;
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:116:14
+  --> tests/ui/needless_return.rs:117:14
    |
 LL |         _ => return,
    |              ^^^^^^
    |
 help: replace `return` with a unit value
    |
-LL |         _ => (),
-   |              ~~
+LL -         _ => return,
+LL +         _ => (),
+   |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:130:9
+  --> tests/ui/needless_return.rs:131:9
    |
 LL |         return String::from("test");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -225,7 +229,7 @@ LL +         String::from("test")
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:133:9
+  --> tests/ui/needless_return.rs:134:9
    |
 LL |         return String::new();
    |         ^^^^^^^^^^^^^^^^^^^^
@@ -237,18 +241,19 @@ LL +         String::new()
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:156:32
+  --> tests/ui/needless_return.rs:157:32
    |
 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:161:21
+  --> tests/ui/needless_return.rs:162:21
    |
 LL |           let _ = || {
    |  _____________________^
@@ -263,29 +268,31 @@ LL +         let _ = || {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:165:20
+  --> tests/ui/needless_return.rs:166:20
    |
 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:172:32
+  --> tests/ui/needless_return.rs:173:32
    |
 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:182:5
+  --> tests/ui/needless_return.rs:183:5
    |
 LL |     return true;
    |     ^^^^^^^^^^^
@@ -297,7 +304,7 @@ LL +     true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:187:5
+  --> tests/ui/needless_return.rs:188:5
    |
 LL |     return true;
    |     ^^^^^^^^^^^
@@ -309,7 +316,7 @@ LL +     true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:193:9
+  --> tests/ui/needless_return.rs:194:9
    |
 LL |         return true;
    |         ^^^^^^^^^^^
@@ -321,7 +328,7 @@ LL +         true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:196:9
+  --> tests/ui/needless_return.rs:197:9
    |
 LL |         return false;
    |         ^^^^^^^^^^^^
@@ -333,18 +340,19 @@ LL +         false
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:203:17
+  --> tests/ui/needless_return.rs:204:17
    |
 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:206:13
+  --> tests/ui/needless_return.rs:207:13
    |
 LL |             return true;
    |             ^^^^^^^^^^^
@@ -356,7 +364,7 @@ LL +             true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:214:9
+  --> tests/ui/needless_return.rs:215:9
    |
 LL |         return true;
    |         ^^^^^^^^^^^
@@ -368,18 +376,19 @@ LL +         true
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:217:16
+  --> tests/ui/needless_return.rs:218:16
    |
 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:222:5
+  --> tests/ui/needless_return.rs:223:5
    |
 LL |     return the_answer!();
    |     ^^^^^^^^^^^^^^^^^^^^
@@ -391,7 +400,7 @@ LL +     the_answer!()
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:226:33
+  --> tests/ui/needless_return.rs:227:33
    |
 LL |   async fn async_test_void_fun() {
    |  _________________________________^
@@ -406,7 +415,7 @@ LL + async fn async_test_void_fun() {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:232:11
+  --> tests/ui/needless_return.rs:233:11
    |
 LL |       if b {
    |  ___________^
@@ -421,7 +430,7 @@ LL +     if b {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:235:13
+  --> tests/ui/needless_return.rs:236:13
    |
 LL |       } else {
    |  _____________^
@@ -436,18 +445,19 @@ LL +     } else {
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:244:14
+  --> tests/ui/needless_return.rs:245:14
    |
 LL |         _ => return,
    |              ^^^^^^
    |
 help: replace `return` with a unit value
    |
-LL |         _ => (),
-   |              ~~
+LL -         _ => return,
+LL +         _ => (),
+   |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:258:9
+  --> tests/ui/needless_return.rs:259:9
    |
 LL |         return String::from("test");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -459,7 +469,7 @@ LL +         String::from("test")
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:261:9
+  --> tests/ui/needless_return.rs:262:9
    |
 LL |         return String::new();
    |         ^^^^^^^^^^^^^^^^^^^^
@@ -471,7 +481,7 @@ LL +         String::new()
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:278:5
+  --> tests/ui/needless_return.rs:279:5
    |
 LL |     return format!("Hello {}", "world!");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -483,7 +493,7 @@ LL +     format!("Hello {}", "world!")
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:320:9
+  --> tests/ui/needless_return.rs:321:9
    |
 LL |         return true;
    |         ^^^^^^^^^^^
@@ -498,7 +508,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:323:9
+  --> tests/ui/needless_return.rs:324:9
    |
 LL |         return false;
    |         ^^^^^^^^^^^^
@@ -511,7 +521,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:331:13
+  --> tests/ui/needless_return.rs:332:13
    |
 LL |             return 10;
    |             ^^^^^^^^^
@@ -526,7 +536,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:335:13
+  --> tests/ui/needless_return.rs:336:13
    |
 LL |             return 100;
    |             ^^^^^^^^^^
@@ -540,7 +550,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:344:9
+  --> tests/ui/needless_return.rs:345:9
    |
 LL |         return 0;
    |         ^^^^^^^^
@@ -553,7 +563,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:352:13
+  --> tests/ui/needless_return.rs:353:13
    |
 LL |             return *(x as *const isize);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -569,7 +579,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:355:13
+  --> tests/ui/needless_return.rs:356:13
    |
 LL |             return !*(x as *const isize);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -583,7 +593,7 @@ LL ~     }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:363:20
+  --> tests/ui/needless_return.rs:364:20
    |
 LL |           let _ = 42;
    |  ____________________^
@@ -598,7 +608,7 @@ LL +         let _ = 42;
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:370:20
+  --> tests/ui/needless_return.rs:371:20
    |
 LL |         let _ = 42; return;
    |                    ^^^^^^^
@@ -610,7 +620,7 @@ LL +         let _ = 42;
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:383:9
+  --> tests/ui/needless_return.rs:384:9
    |
 LL |         return Ok(format!("ok!"));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -622,7 +632,7 @@ LL +         Ok(format!("ok!"))
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:386:9
+  --> tests/ui/needless_return.rs:387:9
    |
 LL |         return Err(format!("err!"));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -634,7 +644,7 @@ LL +         Err(format!("err!"))
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:393:9
+  --> tests/ui/needless_return.rs:394:9
    |
 LL |         return if true { 1 } else { 2 };
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -646,7 +656,7 @@ LL +         if true { 1 } else { 2 }
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:398:9
+  --> tests/ui/needless_return.rs:399:9
    |
 LL |         return if b1 { 0 } else { 1 } | if b2 { 2 } else { 3 } | if b3 { 4 } else { 5 };
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -658,7 +668,7 @@ LL +         (if b1 { 0 } else { 1 } | if b2 { 2 } else { 3 } | if b3 { 4 } else
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:420:5
+  --> tests/ui/needless_return.rs:421:5
    |
 LL |     return { "a".to_string() } + "b" + { "c" };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -670,7 +680,7 @@ LL +     ({ "a".to_string() } + "b" + { "c" })
    |
 
 error: unneeded `return` statement
-  --> tests/ui/needless_return.rs:425:5
+  --> tests/ui/needless_return.rs:426:5
    |
 LL |     return "".split("").next().unwrap().to_string();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -681,5 +691,17 @@ LL -     return "".split("").next().unwrap().to_string();
 LL +     "".split("").next().unwrap().to_string()
    |
 
-error: aborting due to 54 previous errors
+error: unneeded `return` statement
+  --> tests/ui/needless_return.rs:461:5
+   |
+LL |     return unsafe { todo() } as *const i32;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: remove `return` and wrap the sequence with parentheses
+   |
+LL -     return unsafe { todo() } as *const i32;
+LL +     (unsafe { todo() } as *const i32)
+   |
+
+error: aborting due to 55 previous errors
 
diff --git a/tests/ui/never_loop.stderr b/tests/ui/never_loop.stderr
index 72bf8da51df..f6d6d109542 100644
--- a/tests/ui/never_loop.stderr
+++ b/tests/ui/never_loop.stderr
@@ -62,8 +62,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:173:5
@@ -129,8 +130,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:388:13
diff --git a/tests/ui/non_canonical_partial_ord_impl.stderr b/tests/ui/non_canonical_partial_ord_impl.stderr
index 12e6bdc7add..86845df4ea9 100644
--- a/tests/ui/non_canonical_partial_ord_impl.stderr
+++ b/tests/ui/non_canonical_partial_ord_impl.stderr
@@ -27,8 +27,9 @@ LL | | }
    |
 help: change this to
    |
-LL |     fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
-   |                           ~~~~~                             ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     fn partial_cmp(&self, _: &Self) -> Option<Ordering> {
+LL +     fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.stderr b/tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.stderr
index f956f4b8d52..333052ae1c1 100644
--- a/tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.stderr
+++ b/tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.stderr
@@ -8,8 +8,9 @@ LL | static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
    = help: to override `-D warnings` add `#[allow(clippy::non_std_lazy_statics)]`
 help: use `std::sync::LazyLock` instead
    |
-LL | static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
-   |                  ~~~~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~~~~~~~~~
+LL - static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
+LL + static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
+   |
 
 error: this type has been superceded by `LazyLock` in the standard library
   --> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:13:18
@@ -19,8 +20,9 @@ LL | static LAZY_BAR: Lazy<String> = Lazy::new(|| {
    |
 help: use `std::sync::LazyLock` instead
    |
-LL | static LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
-   |                  ~~~~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~~~~~~~~~
+LL - static LAZY_BAR: Lazy<String> = Lazy::new(|| {
+LL + static LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
+   |
 
 error: this type has been superceded by `LazyLock` in the standard library
   --> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:18:18
@@ -30,8 +32,9 @@ LL | static LAZY_BAZ: Lazy<String> = { Lazy::new(|| "baz".to_uppercase()) };
    |
 help: use `std::sync::LazyLock` instead
    |
-LL | static LAZY_BAZ: std::sync::LazyLock<String> = { std::sync::LazyLock::new(|| "baz".to_uppercase()) };
-   |                  ~~~~~~~~~~~~~~~~~~~             ~~~~~~~~~~~~~~~~~~~~~~~~
+LL - static LAZY_BAZ: Lazy<String> = { Lazy::new(|| "baz".to_uppercase()) };
+LL + static LAZY_BAZ: std::sync::LazyLock<String> = { std::sync::LazyLock::new(|| "baz".to_uppercase()) };
+   |
 
 error: this type has been superceded by `LazyLock` in the standard library
   --> tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs:20:18
diff --git a/tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.stderr b/tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.stderr
index 66dc435f982..216190ae4ca 100644
--- a/tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.stderr
+++ b/tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.stderr
@@ -37,8 +37,9 @@ LL |     static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
    |
 help: use `std::sync::LazyLock` instead
    |
-LL |     static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
-   |                      ~~~~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     static LAZY_FOO: Lazy<String> = Lazy::new(|| "foo".to_uppercase());
+LL +     static LAZY_FOO: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "foo".to_uppercase());
+   |
 
 error: this type has been superceded by `LazyLock` in the standard library
   --> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:13:26
@@ -48,8 +49,9 @@ LL |     static mut LAZY_BAR: Lazy<String> = Lazy::new(|| "bar".to_uppercase());
    |
 help: use `std::sync::LazyLock` instead
    |
-LL |     static mut LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "bar".to_uppercase());
-   |                          ~~~~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     static mut LAZY_BAR: Lazy<String> = Lazy::new(|| "bar".to_uppercase());
+LL +     static mut LAZY_BAR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "bar".to_uppercase());
+   |
 
 error: this type has been superceded by `LazyLock` in the standard library
   --> tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs:15:26
@@ -59,8 +61,9 @@ LL |     static mut LAZY_BAZ: Lazy<String> = Lazy::new(|| "baz".to_uppercase());
    |
 help: use `std::sync::LazyLock` instead
    |
-LL |     static mut LAZY_BAZ: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "baz".to_uppercase());
-   |                          ~~~~~~~~~~~~~~~~~~~           ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     static mut LAZY_BAZ: Lazy<String> = Lazy::new(|| "baz".to_uppercase());
+LL +     static mut LAZY_BAZ: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| "baz".to_uppercase());
+   |
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/nonminimal_bool.stderr b/tests/ui/nonminimal_bool.stderr
index 06d3615c6e2..336cce40abf 100644
--- a/tests/ui/nonminimal_bool.stderr
+++ b/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:50: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:53: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:56: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:59: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:90:8
diff --git a/tests/ui/obfuscated_if_else.fixed b/tests/ui/obfuscated_if_else.fixed
index b7a9cc83647..66f5070787b 100644
--- a/tests/ui/obfuscated_if_else.fixed
+++ b/tests/ui/obfuscated_if_else.fixed
@@ -1,5 +1,10 @@
 #![warn(clippy::obfuscated_if_else)]
-#![allow(clippy::unnecessary_lazy_evaluations, clippy::unit_arg, clippy::unused_unit)]
+#![allow(
+    clippy::unnecessary_lazy_evaluations,
+    clippy::unit_arg,
+    clippy::unused_unit,
+    clippy::unwrap_or_default
+)]
 
 fn main() {
     if true { "a" } else { "b" };
@@ -24,6 +29,23 @@ fn main() {
 
     if true { () } else { a += 2 };
     //~^ obfuscated_if_else
+
+    let mut n = 1;
+    if true { n = 1 } else { n = 2 };
+    //~^ obfuscated_if_else
+    if true { 1 } else { n * 2 };
+    //~^ obfuscated_if_else
+    if true { n += 1 } else { () };
+    //~^ obfuscated_if_else
+
+    let _ = if true { 1 } else { n * 2 };
+    //~^ obfuscated_if_else
+
+    if true { 1 } else { Default::default() };
+    //~^ obfuscated_if_else
+
+    let partial = true.then_some(1);
+    partial.unwrap_or_else(|| n * 2); // not lint
 }
 
 fn issue11141() {
diff --git a/tests/ui/obfuscated_if_else.rs b/tests/ui/obfuscated_if_else.rs
index a6470fedd5c..4efd740eb60 100644
--- a/tests/ui/obfuscated_if_else.rs
+++ b/tests/ui/obfuscated_if_else.rs
@@ -1,5 +1,10 @@
 #![warn(clippy::obfuscated_if_else)]
-#![allow(clippy::unnecessary_lazy_evaluations, clippy::unit_arg, clippy::unused_unit)]
+#![allow(
+    clippy::unnecessary_lazy_evaluations,
+    clippy::unit_arg,
+    clippy::unused_unit,
+    clippy::unwrap_or_default
+)]
 
 fn main() {
     true.then_some("a").unwrap_or("b");
@@ -24,6 +29,23 @@ fn main() {
 
     true.then_some(()).unwrap_or(a += 2);
     //~^ obfuscated_if_else
+
+    let mut n = 1;
+    true.then(|| n = 1).unwrap_or_else(|| n = 2);
+    //~^ obfuscated_if_else
+    true.then_some(1).unwrap_or_else(|| n * 2);
+    //~^ obfuscated_if_else
+    true.then_some(n += 1).unwrap_or_else(|| ());
+    //~^ obfuscated_if_else
+
+    let _ = true.then_some(1).unwrap_or_else(|| n * 2);
+    //~^ obfuscated_if_else
+
+    true.then_some(1).unwrap_or_else(Default::default);
+    //~^ obfuscated_if_else
+
+    let partial = true.then_some(1);
+    partial.unwrap_or_else(|| n * 2); // not lint
 }
 
 fn issue11141() {
diff --git a/tests/ui/obfuscated_if_else.stderr b/tests/ui/obfuscated_if_else.stderr
index 84caa848ece..d676c256695 100644
--- a/tests/ui/obfuscated_if_else.stderr
+++ b/tests/ui/obfuscated_if_else.stderr
@@ -1,5 +1,5 @@
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:5:5
+  --> tests/ui/obfuscated_if_else.rs:10:5
    |
 LL |     true.then_some("a").unwrap_or("b");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { "a" } else { "b" }`
@@ -8,82 +8,112 @@ LL |     true.then_some("a").unwrap_or("b");
    = help: to override `-D warnings` add `#[allow(clippy::obfuscated_if_else)]`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:8:5
+  --> tests/ui/obfuscated_if_else.rs:13:5
    |
 LL |     true.then(|| "a").unwrap_or("b");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { "a" } else { "b" }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:12:5
+  --> tests/ui/obfuscated_if_else.rs:17:5
    |
 LL |     (a == 1).then_some("a").unwrap_or("b");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if a == 1 { "a" } else { "b" }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:15:5
+  --> tests/ui/obfuscated_if_else.rs:20:5
    |
 LL |     (a == 1).then(|| "a").unwrap_or("b");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if a == 1 { "a" } else { "b" }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:22:5
+  --> tests/ui/obfuscated_if_else.rs:27:5
    |
 LL |     true.then_some(a += 1).unwrap_or(());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { a += 1 } else { () }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:25:5
+  --> tests/ui/obfuscated_if_else.rs:30:5
    |
 LL |     true.then_some(()).unwrap_or(a += 2);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { () } else { a += 2 }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:31:13
+  --> tests/ui/obfuscated_if_else.rs:34:5
+   |
+LL |     true.then(|| n = 1).unwrap_or_else(|| n = 2);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { n = 1 } else { n = 2 }`
+
+error: this method chain can be written more clearly with `if .. else ..`
+  --> tests/ui/obfuscated_if_else.rs:36:5
+   |
+LL |     true.then_some(1).unwrap_or_else(|| n * 2);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 1 } else { n * 2 }`
+
+error: this method chain can be written more clearly with `if .. else ..`
+  --> tests/ui/obfuscated_if_else.rs:38:5
+   |
+LL |     true.then_some(n += 1).unwrap_or_else(|| ());
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { n += 1 } else { () }`
+
+error: this method chain can be written more clearly with `if .. else ..`
+  --> tests/ui/obfuscated_if_else.rs:41:13
+   |
+LL |     let _ = true.then_some(1).unwrap_or_else(|| n * 2);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 1 } else { n * 2 }`
+
+error: this method chain can be written more clearly with `if .. else ..`
+  --> tests/ui/obfuscated_if_else.rs:44:5
+   |
+LL |     true.then_some(1).unwrap_or_else(Default::default);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 1 } else { Default::default() }`
+
+error: this method chain can be written more clearly with `if .. else ..`
+  --> tests/ui/obfuscated_if_else.rs:53:13
    |
 LL |     let _ = true.then_some(40).unwrap_or(17) | 2;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(if true { 40 } else { 17 })`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:35:13
+  --> tests/ui/obfuscated_if_else.rs:57:13
    |
 LL |     let _ = true.then_some(30).unwrap_or(17) | true.then_some(2).unwrap_or(3) | true.then_some(10).unwrap_or(1);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(if true { 30 } else { 17 })`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:35:48
+  --> tests/ui/obfuscated_if_else.rs:57:48
    |
 LL |     let _ = true.then_some(30).unwrap_or(17) | true.then_some(2).unwrap_or(3) | true.then_some(10).unwrap_or(1);
    |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 2 } else { 3 }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:35:81
+  --> tests/ui/obfuscated_if_else.rs:57:81
    |
 LL |     let _ = true.then_some(30).unwrap_or(17) | true.then_some(2).unwrap_or(3) | true.then_some(10).unwrap_or(1);
    |                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 10 } else { 1 }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:41:17
+  --> tests/ui/obfuscated_if_else.rs:63:17
    |
 LL |     let _ = 2 | true.then_some(40).unwrap_or(17);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 40 } else { 17 }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:45:13
+  --> tests/ui/obfuscated_if_else.rs:67:13
    |
 LL |     let _ = true.then_some(42).unwrap_or(17) as u8;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { 42 } else { 17 }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:49:14
+  --> tests/ui/obfuscated_if_else.rs:71:14
    |
 LL |     let _ = *true.then_some(&42).unwrap_or(&17);
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { &42 } else { &17 }`
 
 error: this method chain can be written more clearly with `if .. else ..`
-  --> tests/ui/obfuscated_if_else.rs:53:14
+  --> tests/ui/obfuscated_if_else.rs:75:14
    |
 LL |     let _ = *true.then_some(&42).unwrap_or(&17) as u8;
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { &42 } else { &17 }`
 
-error: aborting due to 14 previous errors
+error: aborting due to 19 previous errors
 
diff --git a/tests/ui/octal_escapes.stderr b/tests/ui/octal_escapes.stderr
index 024308cbf42..5271c13c08b 100644
--- a/tests/ui/octal_escapes.stderr
+++ b/tests/ui/octal_escapes.stderr
@@ -9,12 +9,13 @@ 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";
-   |                  ~~~~~~
+   |                   ++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:7:19
@@ -24,12 +25,13 @@ 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";
-   |                   ~~~~~~
+   |                    ++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:9:20
@@ -39,12 +41,13 @@ 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";
-   |                    ~~~~~~
+   |                     ++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:12:18
@@ -54,12 +57,13 @@ 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";
-   |                  ~~~~~~
+   |                   ++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:14:20
@@ -70,11 +74,11 @@ LL |     let _bad5 = "\0\03";
 help: if an octal escape is intended, use a hex escape instead
    |
 LL |     let _bad5 = "\0\x03";
-   |                    ~~~~
+   |                     +
 help: if a null escape is intended, disambiguate using
    |
 LL |     let _bad5 = "\0\x0003";
-   |                    ~~~~~~
+   |                     +++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:16:23
@@ -84,12 +88,13 @@ 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";
-   |                       ~~~~~~
+   |                        ++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:16:27
@@ -99,12 +104,13 @@ 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";
-   |                           ~~~~~~
+   |                            ++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:20:31
@@ -115,11 +121,11 @@ 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";
-   |                               ~~~~
+   |                                +
 help: if a null escape is intended, disambiguate using
    |
 LL |     let _bad7 = "EvenMoreText-\x0001\02-ShortEscapes";
-   |                               ~~~~~~
+   |                                +++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:20:34
@@ -130,11 +136,11 @@ 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";
-   |                                  ~~~~
+   |                                   +
 help: if a null escape is intended, disambiguate using
    |
 LL |     let _bad7 = "EvenMoreText-\01\x0002-ShortEscapes";
-   |                                  ~~~~~~
+   |                                   +++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:24:19
@@ -145,11 +151,11 @@ LL |     let _bad8 = "锈\01锈";
 help: if an octal escape is intended, use a hex escape instead
    |
 LL |     let _bad8 = "锈\x01锈";
-   |                    ~~~~
+   |                     +
 help: if a null escape is intended, disambiguate using
    |
 LL |     let _bad8 = "锈\x0001锈";
-   |                    ~~~~~~
+   |                     +++
 
 error: octal-looking escape in a literal
   --> tests/ui/octal_escapes.rs:26:19
@@ -159,12 +165,13 @@ 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锈";
-   |                    ~~~~~~
+   |                     ++
 
 error: aborting due to 11 previous errors
 
diff --git a/tests/ui/op_ref.stderr b/tests/ui/op_ref.stderr
index f3fb3920ee1..51c2963a9ee 100644
--- a/tests/ui/op_ref.stderr
+++ b/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:57:13
diff --git a/tests/ui/option_as_ref_cloned.stderr b/tests/ui/option_as_ref_cloned.stderr
index d0f5747420b..9f650b90d53 100644
--- a/tests/ui/option_as_ref_cloned.stderr
+++ b/tests/ui/option_as_ref_cloned.stderr
@@ -8,8 +8,9 @@ LL |     let _: Option<String> = 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<String> = x.clone();
-   |                               ~~~~~
+LL -     let _: Option<String> = x.as_ref().cloned();
+LL +     let _: Option<String> = x.clone();
+   |
 
 error: cloning an `Option<_>` using `.as_mut().cloned()`
   --> tests/ui/option_as_ref_cloned.rs:9:31
@@ -19,8 +20,9 @@ LL |     let _: Option<String> = x.as_mut().cloned();
    |
 help: this can be written more concisely by cloning the `Option<_>` directly
    |
-LL |     let _: Option<String> = x.clone();
-   |                               ~~~~~
+LL -     let _: Option<String> = x.as_mut().cloned();
+LL +     let _: Option<String> = x.clone();
+   |
 
 error: cloning an `Option<_>` using `.as_ref().cloned()`
   --> tests/ui/option_as_ref_cloned.rs:13: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/tests/ui/option_if_let_else.fixed b/tests/ui/option_if_let_else.fixed
index 56b313244e3..ee309889601 100644
--- a/tests/ui/option_if_let_else.fixed
+++ b/tests/ui/option_if_let_else.fixed
@@ -4,6 +4,7 @@
     clippy::equatable_if_let,
     clippy::let_unit_value,
     clippy::redundant_locals,
+    clippy::manual_midpoint,
     clippy::manual_unwrap_or_default,
     clippy::manual_unwrap_or
 )]
@@ -267,3 +268,23 @@ fn issue11893() {
         panic!("Haven't thought about this condition.");
     }
 }
+
+mod issue13964 {
+    #[derive(Debug)]
+    struct A(Option<String>);
+
+    fn foo(a: A) {
+        let _ = match a.0 {
+            Some(x) => x,
+            None => panic!("{a:?} is invalid."),
+        };
+    }
+
+    fn bar(a: A) {
+        let _ = if let Some(x) = a.0 {
+            x
+        } else {
+            panic!("{a:?} is invalid.")
+        };
+    }
+}
diff --git a/tests/ui/option_if_let_else.rs b/tests/ui/option_if_let_else.rs
index 4a4bb141ed5..525a5df4371 100644
--- a/tests/ui/option_if_let_else.rs
+++ b/tests/ui/option_if_let_else.rs
@@ -4,6 +4,7 @@
     clippy::equatable_if_let,
     clippy::let_unit_value,
     clippy::redundant_locals,
+    clippy::manual_midpoint,
     clippy::manual_unwrap_or_default,
     clippy::manual_unwrap_or
 )]
@@ -330,3 +331,23 @@ fn issue11893() {
         panic!("Haven't thought about this condition.");
     }
 }
+
+mod issue13964 {
+    #[derive(Debug)]
+    struct A(Option<String>);
+
+    fn foo(a: A) {
+        let _ = match a.0 {
+            Some(x) => x,
+            None => panic!("{a:?} is invalid."),
+        };
+    }
+
+    fn bar(a: A) {
+        let _ = if let Some(x) = a.0 {
+            x
+        } else {
+            panic!("{a:?} is invalid.")
+        };
+    }
+}
diff --git a/tests/ui/option_if_let_else.stderr b/tests/ui/option_if_let_else.stderr
index f872ac99184..9eb41f81a53 100644
--- a/tests/ui/option_if_let_else.stderr
+++ b/tests/ui/option_if_let_else.stderr
@@ -1,5 +1,5 @@
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:12:5
+  --> tests/ui/option_if_let_else.rs:13:5
    |
 LL | /     if let Some(x) = string {
 LL | |
@@ -13,19 +13,19 @@ LL | |     }
    = help: to override `-D warnings` add `#[allow(clippy::option_if_let_else)]`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:31:13
+  --> tests/ui/option_if_let_else.rs:32:13
    |
 LL |     let _ = if let Some(s) = *string { s.len() } else { 0 };
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `string.map_or(0, |s| s.len())`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:33:13
+  --> tests/ui/option_if_let_else.rs:34:13
    |
 LL |     let _ = if let Some(s) = &num { s } else { &0 };
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.as_ref().map_or(&0, |s| s)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:35:13
+  --> tests/ui/option_if_let_else.rs:36:13
    |
 LL |       let _ = if let Some(s) = &mut num {
    |  _____________^
@@ -47,13 +47,13 @@ LL ~     });
    |
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:42:13
+  --> tests/ui/option_if_let_else.rs:43:13
    |
 LL |     let _ = if let Some(ref s) = num { s } else { &0 };
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.as_ref().map_or(&0, |s| s)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:44:13
+  --> tests/ui/option_if_let_else.rs:45:13
    |
 LL |       let _ = if let Some(mut s) = num {
    |  _____________^
@@ -75,7 +75,7 @@ LL ~     });
    |
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:51:13
+  --> tests/ui/option_if_let_else.rs:52:13
    |
 LL |       let _ = if let Some(ref mut s) = num {
    |  _____________^
@@ -97,7 +97,7 @@ LL ~     });
    |
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:61:5
+  --> tests/ui/option_if_let_else.rs:62:5
    |
 LL | /     if let Some(x) = arg {
 LL | |
@@ -118,7 +118,7 @@ LL +     })
    |
 
 error: use Option::map_or_else instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:75:13
+  --> tests/ui/option_if_let_else.rs:76:13
    |
 LL |       let _ = if let Some(x) = arg {
    |  _____________^
@@ -131,7 +131,7 @@ LL | |     };
    | |_____^ help: try: `arg.map_or_else(side_effect, |x| x)`
 
 error: use Option::map_or_else instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:85:13
+  --> tests/ui/option_if_let_else.rs:86:13
    |
 LL |       let _ = if let Some(x) = arg {
    |  _____________^
@@ -154,7 +154,7 @@ LL ~     }, |x| x * x * x * x);
    |
 
 error: use Option::map_or_else instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:119:13
+  --> tests/ui/option_if_let_else.rs:120:13
    |
 LL | /             if let Some(idx) = s.find('.') {
 LL | |
@@ -165,7 +165,7 @@ LL | |             }
    | |_____________^ help: try: `s.find('.').map_or_else(|| vec![s.to_string()], |idx| vec![s[..idx].to_string(), s[idx..].to_string()])`
 
 error: use Option::map_or_else instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:131:5
+  --> tests/ui/option_if_let_else.rs:132:5
    |
 LL | /     if let Ok(binding) = variable {
 LL | |
@@ -189,13 +189,13 @@ LL +     })
    |
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:156:13
+  --> tests/ui/option_if_let_else.rs:157:13
    |
 LL |     let _ = if let Some(x) = optional { x + 2 } else { 5 };
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `optional.map_or(5, |x| x + 2)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:167:13
+  --> tests/ui/option_if_let_else.rs:168:13
    |
 LL |       let _ = if let Some(x) = Some(0) {
    |  _____________^
@@ -217,13 +217,13 @@ LL ~         });
    |
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:196:13
+  --> tests/ui/option_if_let_else.rs:197:13
    |
 LL |     let _ = if let Some(x) = Some(0) { s.len() + x } else { s.len() };
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(0).map_or(s.len(), |x| s.len() + x)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:201:13
+  --> tests/ui/option_if_let_else.rs:202:13
    |
 LL |       let _ = if let Some(x) = Some(0) {
    |  _____________^
@@ -245,7 +245,7 @@ LL ~     });
    |
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:241:13
+  --> tests/ui/option_if_let_else.rs:242:13
    |
 LL |       let _ = match s {
    |  _____________^
@@ -256,7 +256,7 @@ LL | |     };
    | |_____^ help: try: `s.map_or(1, |string| string.len())`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:246:13
+  --> tests/ui/option_if_let_else.rs:247:13
    |
 LL |       let _ = match Some(10) {
    |  _____________^
@@ -267,7 +267,7 @@ LL | |     };
    | |_____^ help: try: `Some(10).map_or(5, |a| a + 1)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:253:13
+  --> tests/ui/option_if_let_else.rs:254:13
    |
 LL |       let _ = match res {
    |  _____________^
@@ -278,7 +278,7 @@ LL | |     };
    | |_____^ help: try: `res.map_or(1, |a| a + 1)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:258:13
+  --> tests/ui/option_if_let_else.rs:259:13
    |
 LL |       let _ = match res {
    |  _____________^
@@ -289,13 +289,13 @@ LL | |     };
    | |_____^ help: try: `res.map_or(1, |a| a + 1)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:263:13
+  --> tests/ui/option_if_let_else.rs:264:13
    |
 LL |     let _ = if let Ok(a) = res { a + 1 } else { 5 };
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `res.map_or(5, |a| a + 1)`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:281:17
+  --> tests/ui/option_if_let_else.rs:282:17
    |
 LL |           let _ = match initial {
    |  _________________^
@@ -306,7 +306,7 @@ LL | |         };
    | |_________^ help: try: `initial.as_ref().map_or(42, |value| do_something(value))`
 
 error: use Option::map_or instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:289:17
+  --> tests/ui/option_if_let_else.rs:290:17
    |
 LL |           let _ = match initial {
    |  _________________^
@@ -317,7 +317,7 @@ LL | |         };
    | |_________^ help: try: `initial.as_mut().map_or(42, |value| do_something2(value))`
 
 error: use Option::map_or_else instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:313:24
+  --> tests/ui/option_if_let_else.rs:314:24
    |
 LL |       let mut _hashmap = if let Some(hm) = &opt {
    |  ________________________^
@@ -329,7 +329,7 @@ LL | |     };
    | |_____^ help: try: `opt.as_ref().map_or_else(HashMap::new, |hm| hm.clone())`
 
 error: use Option::map_or_else instead of an if let/else
-  --> tests/ui/option_if_let_else.rs:320:19
+  --> tests/ui/option_if_let_else.rs:321:19
    |
 LL |     let mut _hm = if let Some(hm) = &opt { hm.clone() } else { new_map!() };
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.as_ref().map_or_else(|| new_map!(), |hm| hm.clone())`
diff --git a/tests/ui/owned_cow.fixed b/tests/ui/owned_cow.fixed
new file mode 100644
index 00000000000..b62e9107a56
--- /dev/null
+++ b/tests/ui/owned_cow.fixed
@@ -0,0 +1,23 @@
+#![warn(clippy::owned_cow)]
+
+use std::borrow::Cow;
+use std::ffi::{CString, OsString};
+use std::path::PathBuf;
+
+fn main() {
+    let x: Cow<'static, str> = Cow::Owned(String::from("Hi!"));
+    //~^ ERROR: needlessly owned Cow type
+    let y: Cow<'_, [u8]> = Cow::Owned(vec![]);
+    //~^ ERROR: needlessly owned Cow type
+    let z: Cow<'_, [_]> = Cow::Owned(vec![2_i32]);
+    //~^ ERROR: needlessly owned Cow type
+    let o: Cow<'_, std::ffi::OsStr> = Cow::Owned(OsString::new());
+    //~^ ERROR: needlessly owned Cow type
+    let c: Cow<'_, std::ffi::CStr> = Cow::Owned(CString::new("").unwrap());
+    //~^ ERROR: needlessly owned Cow type
+    let p: Cow<'_, std::path::Path> = Cow::Owned(PathBuf::new());
+    //~^ ERROR: needlessly owned Cow type
+
+    // false positive: borrowed type
+    let b: Cow<'_, str> = Cow::Borrowed("Hi!");
+}
diff --git a/tests/ui/owned_cow.rs b/tests/ui/owned_cow.rs
new file mode 100644
index 00000000000..0e0f14711b7
--- /dev/null
+++ b/tests/ui/owned_cow.rs
@@ -0,0 +1,23 @@
+#![warn(clippy::owned_cow)]
+
+use std::borrow::Cow;
+use std::ffi::{CString, OsString};
+use std::path::PathBuf;
+
+fn main() {
+    let x: Cow<'static, String> = Cow::Owned(String::from("Hi!"));
+    //~^ ERROR: needlessly owned Cow type
+    let y: Cow<'_, Vec<u8>> = Cow::Owned(vec![]);
+    //~^ ERROR: needlessly owned Cow type
+    let z: Cow<'_, Vec<_>> = Cow::Owned(vec![2_i32]);
+    //~^ ERROR: needlessly owned Cow type
+    let o: Cow<'_, OsString> = Cow::Owned(OsString::new());
+    //~^ ERROR: needlessly owned Cow type
+    let c: Cow<'_, CString> = Cow::Owned(CString::new("").unwrap());
+    //~^ ERROR: needlessly owned Cow type
+    let p: Cow<'_, PathBuf> = Cow::Owned(PathBuf::new());
+    //~^ ERROR: needlessly owned Cow type
+
+    // false positive: borrowed type
+    let b: Cow<'_, str> = Cow::Borrowed("Hi!");
+}
diff --git a/tests/ui/owned_cow.stderr b/tests/ui/owned_cow.stderr
new file mode 100644
index 00000000000..8985d6db623
--- /dev/null
+++ b/tests/ui/owned_cow.stderr
@@ -0,0 +1,41 @@
+error: needlessly owned Cow type
+  --> tests/ui/owned_cow.rs:8:25
+   |
+LL |     let x: Cow<'static, String> = Cow::Owned(String::from("Hi!"));
+   |                         ^^^^^^ help: use: `str`
+   |
+   = note: `-D clippy::owned-cow` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::owned_cow)]`
+
+error: needlessly owned Cow type
+  --> tests/ui/owned_cow.rs:10:20
+   |
+LL |     let y: Cow<'_, Vec<u8>> = Cow::Owned(vec![]);
+   |                    ^^^^^^^ help: use: `[u8]`
+
+error: needlessly owned Cow type
+  --> tests/ui/owned_cow.rs:12:20
+   |
+LL |     let z: Cow<'_, Vec<_>> = Cow::Owned(vec![2_i32]);
+   |                    ^^^^^^ help: use: `[_]`
+
+error: needlessly owned Cow type
+  --> tests/ui/owned_cow.rs:14:20
+   |
+LL |     let o: Cow<'_, OsString> = Cow::Owned(OsString::new());
+   |                    ^^^^^^^^ help: use: `std::ffi::OsStr`
+
+error: needlessly owned Cow type
+  --> tests/ui/owned_cow.rs:16:20
+   |
+LL |     let c: Cow<'_, CString> = Cow::Owned(CString::new("").unwrap());
+   |                    ^^^^^^^ help: use: `std::ffi::CStr`
+
+error: needlessly owned Cow type
+  --> tests/ui/owned_cow.rs:18:20
+   |
+LL |     let p: Cow<'_, PathBuf> = Cow::Owned(PathBuf::new());
+   |                    ^^^^^^^ help: use: `std::path::Path`
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/ptr_eq.fixed b/tests/ui/ptr_eq.fixed
index 1ccd2c2237d..df6305ed497 100644
--- a/tests/ui/ptr_eq.fixed
+++ b/tests/ui/ptr_eq.fixed
@@ -20,8 +20,10 @@ fn main() {
     //~^ ptr_eq
     let _ = std::ptr::eq(a, b);
     //~^ ptr_eq
-    let _ = a.as_ptr() == b as *const _;
-    let _ = a.as_ptr() == b.as_ptr();
+    let _ = std::ptr::eq(a.as_ptr(), b as *const _);
+    //~^ ptr_eq
+    let _ = std::ptr::eq(a.as_ptr(), b.as_ptr());
+    //~^ ptr_eq
 
     // Do not lint
 
@@ -31,9 +33,22 @@ fn main() {
     let a = &mut [1, 2, 3];
     let b = &mut [1, 2, 3];
 
-    let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _;
-    let _ = a.as_mut_ptr() == b.as_mut_ptr();
+    let _ = std::ptr::eq(a.as_mut_ptr(), b as *mut [i32] as *mut _);
+    //~^ ptr_eq
+    let _ = std::ptr::eq(a.as_mut_ptr(), b.as_mut_ptr());
+    //~^ ptr_eq
 
     let _ = a == b;
     let _ = core::ptr::eq(a, b);
+
+    let (x, y) = (&0u32, &mut 1u32);
+    let _ = std::ptr::eq(x, y);
+    //~^ ptr_eq
+
+    let _ = !std::ptr::eq(x, y);
+    //~^ ptr_eq
+
+    #[allow(clippy::eq_op)]
+    let _issue14337 = std::ptr::eq(main as *const (), main as *const ());
+    //~^ ptr_eq
 }
diff --git a/tests/ui/ptr_eq.rs b/tests/ui/ptr_eq.rs
index 0bc58a57fa5..0ed0ff0d137 100644
--- a/tests/ui/ptr_eq.rs
+++ b/tests/ui/ptr_eq.rs
@@ -21,7 +21,9 @@ fn main() {
     let _ = a as *const _ == b as *const _;
     //~^ ptr_eq
     let _ = a.as_ptr() == b as *const _;
+    //~^ ptr_eq
     let _ = a.as_ptr() == b.as_ptr();
+    //~^ ptr_eq
 
     // Do not lint
 
@@ -32,8 +34,21 @@ fn main() {
     let b = &mut [1, 2, 3];
 
     let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _;
+    //~^ ptr_eq
     let _ = a.as_mut_ptr() == b.as_mut_ptr();
+    //~^ ptr_eq
 
     let _ = a == b;
     let _ = core::ptr::eq(a, b);
+
+    let (x, y) = (&0u32, &mut 1u32);
+    let _ = x as *const u32 == y as *mut u32 as *const u32;
+    //~^ ptr_eq
+
+    let _ = x as *const u32 != y as *mut u32 as *const u32;
+    //~^ ptr_eq
+
+    #[allow(clippy::eq_op)]
+    let _issue14337 = main as *const () == main as *const ();
+    //~^ ptr_eq
 }
diff --git a/tests/ui/ptr_eq.stderr b/tests/ui/ptr_eq.stderr
index 8e8b34f26ff..33190df284a 100644
--- a/tests/ui/ptr_eq.stderr
+++ b/tests/ui/ptr_eq.stderr
@@ -13,5 +13,47 @@ error: use `std::ptr::eq` when comparing raw pointers
 LL |     let _ = a as *const _ == b as *const _;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(a, b)`
 
-error: aborting due to 2 previous errors
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:23:13
+   |
+LL |     let _ = a.as_ptr() == b as *const _;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(a.as_ptr(), b as *const _)`
+
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:25:13
+   |
+LL |     let _ = a.as_ptr() == b.as_ptr();
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(a.as_ptr(), b.as_ptr())`
+
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:36:13
+   |
+LL |     let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(a.as_mut_ptr(), b as *mut [i32] as *mut _)`
+
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:38:13
+   |
+LL |     let _ = a.as_mut_ptr() == b.as_mut_ptr();
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(a.as_mut_ptr(), b.as_mut_ptr())`
+
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:45:13
+   |
+LL |     let _ = x as *const u32 == y as *mut u32 as *const u32;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(x, y)`
+
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:48:13
+   |
+LL |     let _ = x as *const u32 != y as *mut u32 as *const u32;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!std::ptr::eq(x, y)`
+
+error: use `std::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq.rs:52:23
+   |
+LL |     let _issue14337 = main as *const () == main as *const ();
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(main as *const (), main as *const ())`
+
+error: aborting due to 9 previous errors
 
diff --git a/tests/ui/ptr_eq_no_std.fixed b/tests/ui/ptr_eq_no_std.fixed
index b3e82fae38f..d8ee4ea88f8 100644
--- a/tests/ui/ptr_eq_no_std.fixed
+++ b/tests/ui/ptr_eq_no_std.fixed
@@ -32,8 +32,10 @@ fn main() {
     //~^ ptr_eq
     let _ = core::ptr::eq(a, b);
     //~^ ptr_eq
-    let _ = a.as_ptr() == b as *const _;
-    let _ = a.as_ptr() == b.as_ptr();
+    let _ = core::ptr::eq(a.as_ptr(), b as *const _);
+    //~^ ptr_eq
+    let _ = core::ptr::eq(a.as_ptr(), b.as_ptr());
+    //~^ ptr_eq
 
     // Do not lint
 
@@ -43,8 +45,10 @@ fn main() {
     let a = &mut [1, 2, 3];
     let b = &mut [1, 2, 3];
 
-    let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _;
-    let _ = a.as_mut_ptr() == b.as_mut_ptr();
+    let _ = core::ptr::eq(a.as_mut_ptr(), b as *mut [i32] as *mut _);
+    //~^ ptr_eq
+    let _ = core::ptr::eq(a.as_mut_ptr(), b.as_mut_ptr());
+    //~^ ptr_eq
 
     let _ = a == b;
     let _ = core::ptr::eq(a, b);
diff --git a/tests/ui/ptr_eq_no_std.rs b/tests/ui/ptr_eq_no_std.rs
index ba78f5ee5f8..a236314c29b 100644
--- a/tests/ui/ptr_eq_no_std.rs
+++ b/tests/ui/ptr_eq_no_std.rs
@@ -33,7 +33,9 @@ fn main() {
     let _ = a as *const _ == b as *const _;
     //~^ ptr_eq
     let _ = a.as_ptr() == b as *const _;
+    //~^ ptr_eq
     let _ = a.as_ptr() == b.as_ptr();
+    //~^ ptr_eq
 
     // Do not lint
 
@@ -44,7 +46,9 @@ fn main() {
     let b = &mut [1, 2, 3];
 
     let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _;
+    //~^ ptr_eq
     let _ = a.as_mut_ptr() == b.as_mut_ptr();
+    //~^ ptr_eq
 
     let _ = a == b;
     let _ = core::ptr::eq(a, b);
diff --git a/tests/ui/ptr_eq_no_std.stderr b/tests/ui/ptr_eq_no_std.stderr
index 8c7b1ff7666..5b8135dc8e8 100644
--- a/tests/ui/ptr_eq_no_std.stderr
+++ b/tests/ui/ptr_eq_no_std.stderr
@@ -13,5 +13,29 @@ error: use `core::ptr::eq` when comparing raw pointers
 LL |     let _ = a as *const _ == b as *const _;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(a, b)`
 
-error: aborting due to 2 previous errors
+error: use `core::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq_no_std.rs:35:13
+   |
+LL |     let _ = a.as_ptr() == b as *const _;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(a.as_ptr(), b as *const _)`
+
+error: use `core::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq_no_std.rs:37:13
+   |
+LL |     let _ = a.as_ptr() == b.as_ptr();
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(a.as_ptr(), b.as_ptr())`
+
+error: use `core::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq_no_std.rs:48:13
+   |
+LL |     let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(a.as_mut_ptr(), b as *mut [i32] as *mut _)`
+
+error: use `core::ptr::eq` when comparing raw pointers
+  --> tests/ui/ptr_eq_no_std.rs:50:13
+   |
+LL |     let _ = a.as_mut_ptr() == b.as_mut_ptr();
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(a.as_mut_ptr(), b.as_mut_ptr())`
+
+error: aborting due to 6 previous errors
 
diff --git a/tests/ui/question_mark.fixed b/tests/ui/question_mark.fixed
index 8dfef3202be..fff41f57828 100644
--- a/tests/ui/question_mark.fixed
+++ b/tests/ui/question_mark.fixed
@@ -375,3 +375,58 @@ fn issue12412(foo: &Foo, bar: &Bar) -> Option<()> {
     //~^^^ question_mark
     Some(())
 }
+
+struct StructWithOptionString {
+    opt_x: Option<String>,
+}
+
+struct WrapperStructWithString(String);
+
+#[allow(clippy::disallowed_names)]
+fn issue_13417(foo: &mut StructWithOptionString) -> Option<String> {
+    let x = foo.opt_x.as_ref()?;
+    //~^^^ question_mark
+    let opt_y = Some(x.clone());
+    std::mem::replace(&mut foo.opt_x, opt_y)
+}
+
+#[allow(clippy::disallowed_names)]
+fn issue_13417_mut(foo: &mut StructWithOptionString) -> Option<String> {
+    let x = foo.opt_x.as_mut()?;
+    //~^^^ question_mark
+    let opt_y = Some(x.clone());
+    std::mem::replace(&mut foo.opt_x, opt_y)
+}
+
+#[allow(clippy::disallowed_names)]
+#[allow(unused)]
+fn issue_13417_weirder(foo: &mut StructWithOptionString, mut bar: Option<WrapperStructWithString>) -> Option<()> {
+    let x @ y = foo.opt_x.as_ref()?;
+    //~^^^ question_mark
+    let x @ &WrapperStructWithString(_) = bar.as_ref()?;
+    //~^^^ question_mark
+    let x @ &mut WrapperStructWithString(_) = bar.as_mut()?;
+    //~^^^ question_mark
+    Some(())
+}
+
+#[clippy::msrv = "1.12"]
+fn msrv_1_12(arg: Option<i32>) -> Option<i32> {
+    if arg.is_none() {
+        return None;
+    }
+    let val = match arg {
+        Some(val) => val,
+        None => return None,
+    };
+    println!("{}", val);
+    Some(val)
+}
+
+#[clippy::msrv = "1.13"]
+fn msrv_1_13(arg: Option<i32>) -> Option<i32> {
+    arg?;
+    let val = arg?;
+    println!("{}", val);
+    Some(val)
+}
diff --git a/tests/ui/question_mark.rs b/tests/ui/question_mark.rs
index fffaa803f39..c71c8ee984e 100644
--- a/tests/ui/question_mark.rs
+++ b/tests/ui/question_mark.rs
@@ -452,3 +452,75 @@ fn issue12412(foo: &Foo, bar: &Bar) -> Option<()> {
     //~^^^ question_mark
     Some(())
 }
+
+struct StructWithOptionString {
+    opt_x: Option<String>,
+}
+
+struct WrapperStructWithString(String);
+
+#[allow(clippy::disallowed_names)]
+fn issue_13417(foo: &mut StructWithOptionString) -> Option<String> {
+    let Some(ref x) = foo.opt_x else {
+        return None;
+    };
+    //~^^^ question_mark
+    let opt_y = Some(x.clone());
+    std::mem::replace(&mut foo.opt_x, opt_y)
+}
+
+#[allow(clippy::disallowed_names)]
+fn issue_13417_mut(foo: &mut StructWithOptionString) -> Option<String> {
+    let Some(ref mut x) = foo.opt_x else {
+        return None;
+    };
+    //~^^^ question_mark
+    let opt_y = Some(x.clone());
+    std::mem::replace(&mut foo.opt_x, opt_y)
+}
+
+#[allow(clippy::disallowed_names)]
+#[allow(unused)]
+fn issue_13417_weirder(foo: &mut StructWithOptionString, mut bar: Option<WrapperStructWithString>) -> Option<()> {
+    let Some(ref x @ ref y) = foo.opt_x else {
+        return None;
+    };
+    //~^^^ question_mark
+    let Some(ref x @ WrapperStructWithString(_)) = bar else {
+        return None;
+    };
+    //~^^^ question_mark
+    let Some(ref mut x @ WrapperStructWithString(_)) = bar else {
+        return None;
+    };
+    //~^^^ question_mark
+    Some(())
+}
+
+#[clippy::msrv = "1.12"]
+fn msrv_1_12(arg: Option<i32>) -> Option<i32> {
+    if arg.is_none() {
+        return None;
+    }
+    let val = match arg {
+        Some(val) => val,
+        None => return None,
+    };
+    println!("{}", val);
+    Some(val)
+}
+
+#[clippy::msrv = "1.13"]
+fn msrv_1_13(arg: Option<i32>) -> Option<i32> {
+    if arg.is_none() {
+        //~^ question_mark
+        return None;
+    }
+    let val = match arg {
+        //~^ question_mark
+        Some(val) => val,
+        None => return None,
+    };
+    println!("{}", val);
+    Some(val)
+}
diff --git a/tests/ui/question_mark.stderr b/tests/ui/question_mark.stderr
index c4db0fbc302..183b8866a74 100644
--- a/tests/ui/question_mark.stderr
+++ b/tests/ui/question_mark.stderr
@@ -215,5 +215,65 @@ LL | |         return None;
 LL | |     };
    | |______^ help: replace it with: `let v = bar.foo.owned.clone()?;`
 
-error: aborting due to 22 previous errors
+error: this `let...else` may be rewritten with the `?` operator
+  --> tests/ui/question_mark.rs:464:5
+   |
+LL | /     let Some(ref x) = foo.opt_x else {
+LL | |         return None;
+LL | |     };
+   | |______^ help: replace it with: `let x = foo.opt_x.as_ref()?;`
+
+error: this `let...else` may be rewritten with the `?` operator
+  --> tests/ui/question_mark.rs:474:5
+   |
+LL | /     let Some(ref mut x) = foo.opt_x else {
+LL | |         return None;
+LL | |     };
+   | |______^ help: replace it with: `let x = foo.opt_x.as_mut()?;`
+
+error: this `let...else` may be rewritten with the `?` operator
+  --> tests/ui/question_mark.rs:485:5
+   |
+LL | /     let Some(ref x @ ref y) = foo.opt_x else {
+LL | |         return None;
+LL | |     };
+   | |______^ help: replace it with: `let x @ y = foo.opt_x.as_ref()?;`
+
+error: this `let...else` may be rewritten with the `?` operator
+  --> tests/ui/question_mark.rs:489:5
+   |
+LL | /     let Some(ref x @ WrapperStructWithString(_)) = bar else {
+LL | |         return None;
+LL | |     };
+   | |______^ help: replace it with: `let x @ &WrapperStructWithString(_) = bar.as_ref()?;`
+
+error: this `let...else` may be rewritten with the `?` operator
+  --> tests/ui/question_mark.rs:493:5
+   |
+LL | /     let Some(ref mut x @ WrapperStructWithString(_)) = bar else {
+LL | |         return None;
+LL | |     };
+   | |______^ help: replace it with: `let x @ &mut WrapperStructWithString(_) = bar.as_mut()?;`
+
+error: this block may be rewritten with the `?` operator
+  --> tests/ui/question_mark.rs:515:5
+   |
+LL | /     if arg.is_none() {
+LL | |
+LL | |         return None;
+LL | |     }
+   | |_____^ help: replace it with: `arg?;`
+
+error: this `match` expression can be replaced with `?`
+  --> tests/ui/question_mark.rs:519:15
+   |
+LL |       let val = match arg {
+   |  _______________^
+LL | |
+LL | |         Some(val) => val,
+LL | |         None => return None,
+LL | |     };
+   | |_____^ help: try instead: `arg?`
+
+error: aborting due to 29 previous errors
 
diff --git a/tests/ui/redundant_guards.stderr b/tests/ui/redundant_guards.stderr
index 2a3d8901066..cb7b9b119e2 100644
--- a/tests/ui/redundant_guards.stderr
+++ b/tests/ui/redundant_guards.stderr
@@ -44,8 +44,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:54:20
diff --git a/tests/ui/ref_binding_to_reference.stderr b/tests/ui/ref_binding_to_reference.stderr
index d245355c139..c1adfab12bc 100644
--- a/tests/ui/ref_binding_to_reference.stderr
+++ b/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:37:14
@@ -35,8 +36,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/tests/ui/ref_option/ref_option.all.stderr b/tests/ui/ref_option/ref_option.all.stderr
index 7eb42554874..bd43c28336e 100644
--- a/tests/ui/ref_option/ref_option.all.stderr
+++ b/tests/ui/ref_option/ref_option.all.stderr
@@ -57,8 +57,9 @@ LL | fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
    |
 help: change this to
    |
-LL | fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
-   |                   ~~~~~~~~~~~~~~~     ~~~~~~~~~~~~~~~~
+LL - fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
+LL + fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
+   |
 
 error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
   --> tests/ui/ref_option/ref_option.rs:24:1
@@ -88,8 +89,9 @@ LL | pub fn pub_mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
    |
 help: change this to
    |
-LL | pub fn pub_mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
-   |                           ~~~~~~~~~~~~~~~     ~~~~~~~~~~~~~~~~
+LL - pub fn pub_mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
+LL + pub fn pub_mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
+   |
 
 error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
   --> tests/ui/ref_option/ref_option.rs:35:5
diff --git a/tests/ui/ref_option/ref_option.private.stderr b/tests/ui/ref_option/ref_option.private.stderr
index f608092161b..88c65e429d8 100644
--- a/tests/ui/ref_option/ref_option.private.stderr
+++ b/tests/ui/ref_option/ref_option.private.stderr
@@ -57,8 +57,9 @@ LL | fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
    |
 help: change this to
    |
-LL | fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
-   |                   ~~~~~~~~~~~~~~~     ~~~~~~~~~~~~~~~~
+LL - fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
+LL + fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
+   |
 
 error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
   --> tests/ui/ref_option/ref_option.rs:24:1
diff --git a/tests/ui/repeat_vec_with_capacity.fixed b/tests/ui/repeat_vec_with_capacity.fixed
index 5c6736a9a4e..8a3b0b4f193 100644
--- a/tests/ui/repeat_vec_with_capacity.fixed
+++ b/tests/ui/repeat_vec_with_capacity.fixed
@@ -37,3 +37,8 @@ fn main() {
         from_macro!(Vec::<()>::with_capacity(42));
     }
 }
+
+#[clippy::msrv = "1.27.0"]
+fn msrv_check() {
+    std::iter::repeat(Vec::<()>::with_capacity(42));
+}
diff --git a/tests/ui/repeat_vec_with_capacity.rs b/tests/ui/repeat_vec_with_capacity.rs
index 2646794822c..011202d8475 100644
--- a/tests/ui/repeat_vec_with_capacity.rs
+++ b/tests/ui/repeat_vec_with_capacity.rs
@@ -37,3 +37,8 @@ fn main() {
         from_macro!(Vec::<()>::with_capacity(42));
     }
 }
+
+#[clippy::msrv = "1.27.0"]
+fn msrv_check() {
+    std::iter::repeat(Vec::<()>::with_capacity(42));
+}
diff --git a/tests/ui/repeat_vec_with_capacity.stderr b/tests/ui/repeat_vec_with_capacity.stderr
index 43027c9cb89..05513a8859a 100644
--- a/tests/ui/repeat_vec_with_capacity.stderr
+++ b/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::<Vec<_>>();
-   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -         vec![Vec::<()>::with_capacity(42); 123];
+LL +         (0..123).map(|_| Vec::<()>::with_capacity(42)).collect::<Vec<_>>();
+   |
 
 error: repeating `Vec::with_capacity` using `vec![x; n]`, which does not retain capacity
   --> tests/ui/repeat_vec_with_capacity.rs:12: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::<Vec<_>>();
-   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -         vec![Vec::<()>::with_capacity(42); n];
+LL +         (0..n).map(|_| Vec::<()>::with_capacity(42)).collect::<Vec<_>>();
+   |
 
 error: repeating `Vec::with_capacity` using `iter::repeat`, which does not retain capacity
   --> tests/ui/repeat_vec_with_capacity.rs:27: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/tests/ui/repeat_vec_with_capacity_nostd.stderr b/tests/ui/repeat_vec_with_capacity_nostd.stderr
index 39364d09b96..092167485ce 100644
--- a/tests/ui/repeat_vec_with_capacity_nostd.stderr
+++ b/tests/ui/repeat_vec_with_capacity_nostd.stderr
@@ -9,8 +9,9 @@ LL |     let _: Vec<Vec<u8>> = iter::repeat(Vec::with_capacity(42)).take(123).co
    = help: to override `-D warnings` add `#[allow(clippy::repeat_vec_with_capacity)]`
 help: if you intended to create an iterator that yields `Vec`s with an initial capacity, try
    |
-LL |     let _: Vec<Vec<u8>> = core::iter::repeat_with(|| Vec::with_capacity(42)).take(123).collect();
-   |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _: Vec<Vec<u8>> = iter::repeat(Vec::with_capacity(42)).take(123).collect();
+LL +     let _: Vec<Vec<u8>> = core::iter::repeat_with(|| Vec::with_capacity(42)).take(123).collect();
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/reversed_empty_ranges_fixable.stderr b/tests/ui/reversed_empty_ranges_fixable.stderr
index 706413726a1..3fadc4c169f 100644
--- a/tests/ui/reversed_empty_ranges_fixable.stderr
+++ b/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:11:13
@@ -19,8 +20,9 @@ LL |     let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>(
    |
 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::<Vec<_>>();
-   |             ~~~~~~~~~~~~~~~~~~
+LL -     let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
+LL +     let _ = (21..ANSWER).rev().filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
+   |
 
 error: this range is empty so it will yield no values
   --> tests/ui/reversed_empty_ranges_fixable.rs:14: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:16: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/tests/ui/reversed_empty_ranges_loops_fixable.stderr b/tests/ui/reversed_empty_ranges_loops_fixable.stderr
index 0c05f351b46..eadd9d3675e 100644
--- a/tests/ui/reversed_empty_ranges_loops_fixable.stderr
+++ b/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:12: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:17: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:37: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:43: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:48: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/tests/ui/same_functions_in_if_condition.rs b/tests/ui/same_functions_in_if_condition.rs
index b7ed3aab004..a98b73c9e1c 100644
--- a/tests/ui/same_functions_in_if_condition.rs
+++ b/tests/ui/same_functions_in_if_condition.rs
@@ -3,12 +3,7 @@
 // ifs_same_cond warning is different from `ifs_same_cond`.
 // clippy::if_same_then_else, clippy::comparison_chain -- all empty blocks
 #![allow(incomplete_features)]
-#![allow(
-    clippy::comparison_chain,
-    clippy::if_same_then_else,
-    clippy::ifs_same_cond,
-    clippy::uninlined_format_args
-)]
+#![allow(clippy::if_same_then_else, clippy::ifs_same_cond, clippy::uninlined_format_args)]
 
 use std::marker::ConstParamTy;
 
diff --git a/tests/ui/same_functions_in_if_condition.stderr b/tests/ui/same_functions_in_if_condition.stderr
index 6cd4f96c13e..35dcbadce59 100644
--- a/tests/ui/same_functions_in_if_condition.stderr
+++ b/tests/ui/same_functions_in_if_condition.stderr
@@ -1,11 +1,11 @@
 error: this `if` has the same function call as a previous `if`
-  --> tests/ui/same_functions_in_if_condition.rs:39:15
+  --> tests/ui/same_functions_in_if_condition.rs:34:15
    |
 LL |     } else if function() {
    |               ^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/same_functions_in_if_condition.rs:38:8
+  --> tests/ui/same_functions_in_if_condition.rs:33:8
    |
 LL |     if function() {
    |        ^^^^^^^^^^
@@ -16,61 +16,61 @@ LL | #![deny(clippy::same_functions_in_if_condition)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> tests/ui/same_functions_in_if_condition.rs:44:15
+  --> tests/ui/same_functions_in_if_condition.rs:39:15
    |
 LL |     } else if fn_arg(a) {
    |               ^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/same_functions_in_if_condition.rs:43:8
+  --> tests/ui/same_functions_in_if_condition.rs:38:8
    |
 LL |     if fn_arg(a) {
    |        ^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> tests/ui/same_functions_in_if_condition.rs:49:15
+  --> tests/ui/same_functions_in_if_condition.rs:44:15
    |
 LL |     } else if obj.method() {
    |               ^^^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/same_functions_in_if_condition.rs:48:8
+  --> tests/ui/same_functions_in_if_condition.rs:43:8
    |
 LL |     if obj.method() {
    |        ^^^^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> tests/ui/same_functions_in_if_condition.rs:54:15
+  --> tests/ui/same_functions_in_if_condition.rs:49:15
    |
 LL |     } else if obj.method_arg(a) {
    |               ^^^^^^^^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/same_functions_in_if_condition.rs:53:8
+  --> tests/ui/same_functions_in_if_condition.rs:48:8
    |
 LL |     if obj.method_arg(a) {
    |        ^^^^^^^^^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> tests/ui/same_functions_in_if_condition.rs:60:15
+  --> tests/ui/same_functions_in_if_condition.rs:55:15
    |
 LL |     } else if v.pop().is_none() {
    |               ^^^^^^^^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/same_functions_in_if_condition.rs:59:8
+  --> tests/ui/same_functions_in_if_condition.rs:54:8
    |
 LL |     if v.pop().is_none() {
    |        ^^^^^^^^^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> tests/ui/same_functions_in_if_condition.rs:65:15
+  --> tests/ui/same_functions_in_if_condition.rs:60:15
    |
 LL |     } else if v.len() == 42 {
    |               ^^^^^^^^^^^^^
    |
 note: same as this
-  --> tests/ui/same_functions_in_if_condition.rs:64:8
+  --> tests/ui/same_functions_in_if_condition.rs:59:8
    |
 LL |     if v.len() == 42 {
    |        ^^^^^^^^^^^^^
diff --git a/tests/ui/single_match.fixed b/tests/ui/single_match.fixed
index c6ffe93eb7a..0e198ec7934 100644
--- a/tests/ui/single_match.fixed
+++ b/tests/ui/single_match.fixed
@@ -1,3 +1,4 @@
+//@require-annotations-for-level: WARN
 #![warn(clippy::single_match)]
 #![allow(
     unused,
@@ -18,13 +19,9 @@ fn single_match() {
     //~^^^^^^ single_match
 
     let x = Some(1u8);
-    match x {
-        // Note the missing block braces.
-        // We suggest `if let Some(y) = x { .. }` because the macro
-        // is expanded before we can do anything.
-        Some(y) => println!("{:?}", y),
-        _ => (),
-    }
+    if let Some(y) = x { println!("{:?}", y) }
+    //~^^^^^^^ single_match
+    //~| NOTE: you might want to preserve the comments from inside the `match`
 
     let z = (1u8, 1u8);
     if let (2..=3, 7..=9) = z { dummy() };
@@ -358,21 +355,14 @@ fn irrefutable_match() {
 
     let mut x = vec![1i8];
 
-    // Should not lint.
-    match x.pop() {
-        // bla
-        Some(u) => println!("{u}"),
-        // more comments!
-        None => {},
-    }
-    // Should not lint.
-    match x.pop() {
-        // bla
-        Some(u) => {
-            // bla
-            println!("{u}");
-        },
+    if let Some(u) = x.pop() { println!("{u}") }
+    //~^^^^^^ single_match
+    //~| NOTE: you might want to preserve the comments from inside the `match`
+
+    if let Some(u) = x.pop() {
         // bla
-        None => {},
+        println!("{u}");
     }
+    //~^^^^^^^^^ single_match
+    //~| NOTE: you might want to preserve the comments from inside the `match`
 }
diff --git a/tests/ui/single_match.rs b/tests/ui/single_match.rs
index dc758fa4281..fcac65f8aaf 100644
--- a/tests/ui/single_match.rs
+++ b/tests/ui/single_match.rs
@@ -1,3 +1,4 @@
+//@require-annotations-for-level: WARN
 #![warn(clippy::single_match)]
 #![allow(
     unused,
@@ -28,6 +29,8 @@ fn single_match() {
         Some(y) => println!("{:?}", y),
         _ => (),
     }
+    //~^^^^^^^ single_match
+    //~| NOTE: you might want to preserve the comments from inside the `match`
 
     let z = (1u8, 1u8);
     match z {
@@ -437,14 +440,15 @@ fn irrefutable_match() {
 
     let mut x = vec![1i8];
 
-    // Should not lint.
     match x.pop() {
         // bla
         Some(u) => println!("{u}"),
         // more comments!
         None => {},
     }
-    // Should not lint.
+    //~^^^^^^ single_match
+    //~| NOTE: you might want to preserve the comments from inside the `match`
+
     match x.pop() {
         // bla
         Some(u) => {
@@ -454,4 +458,6 @@ fn irrefutable_match() {
         // bla
         None => {},
     }
+    //~^^^^^^^^^ single_match
+    //~| NOTE: you might want to preserve the comments from inside the `match`
 }
diff --git a/tests/ui/single_match.stderr b/tests/ui/single_match.stderr
index c8829695948..2467423b9c1 100644
--- a/tests/ui/single_match.stderr
+++ b/tests/ui/single_match.stderr
@@ -1,5 +1,5 @@
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:15:5
+  --> tests/ui/single_match.rs:16:5
    |
 LL | /     match x {
 LL | |         Some(y) => {
@@ -19,7 +19,18 @@ LL ~     };
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:33:5
+  --> tests/ui/single_match.rs:25:5
+   |
+LL | /     match x {
+...  |
+LL | |         _ => (),
+LL | |     }
+   | |_____^ help: try: `if let Some(y) = x { println!("{:?}", y) }`
+   |
+   = note: you might want to preserve the comments from inside the `match`
+
+error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
+  --> tests/ui/single_match.rs:36:5
    |
 LL | /     match z {
 LL | |         (2..=3, 7..=9) => dummy(),
@@ -28,7 +39,7 @@ LL | |     };
    | |_____^ help: try: `if let (2..=3, 7..=9) = z { dummy() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:63:5
+  --> tests/ui/single_match.rs:66:5
    |
 LL | /     match x {
 LL | |         Some(y) => dummy(),
@@ -37,7 +48,7 @@ LL | |     };
    | |_____^ help: try: `if let Some(y) = x { dummy() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:69:5
+  --> tests/ui/single_match.rs:72:5
    |
 LL | /     match y {
 LL | |         Ok(y) => dummy(),
@@ -46,7 +57,7 @@ LL | |     };
    | |_____^ help: try: `if let Ok(y) = y { dummy() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:77:5
+  --> tests/ui/single_match.rs:80:5
    |
 LL | /     match c {
 LL | |         Cow::Borrowed(..) => dummy(),
@@ -55,7 +66,7 @@ LL | |     };
    | |_____^ help: try: `if let Cow::Borrowed(..) = c { dummy() }`
 
 error: you seem to be trying to use `match` for an equality check. Consider using `if`
-  --> tests/ui/single_match.rs:99:5
+  --> tests/ui/single_match.rs:102:5
    |
 LL | /     match x {
 LL | |         "test" => println!(),
@@ -64,7 +75,7 @@ LL | |     }
    | |_____^ help: try: `if x == "test" { println!() }`
 
 error: you seem to be trying to use `match` for an equality check. Consider using `if`
-  --> tests/ui/single_match.rs:113:5
+  --> tests/ui/single_match.rs:116:5
    |
 LL | /     match x {
 LL | |         Foo::A => println!(),
@@ -73,7 +84,7 @@ LL | |     }
    | |_____^ help: try: `if x == Foo::A { println!() }`
 
 error: you seem to be trying to use `match` for an equality check. Consider using `if`
-  --> tests/ui/single_match.rs:120:5
+  --> tests/ui/single_match.rs:123:5
    |
 LL | /     match x {
 LL | |         FOO_C => println!(),
@@ -82,7 +93,7 @@ LL | |     }
    | |_____^ help: try: `if x == FOO_C { println!() }`
 
 error: you seem to be trying to use `match` for an equality check. Consider using `if`
-  --> tests/ui/single_match.rs:126:5
+  --> tests/ui/single_match.rs:129:5
    |
 LL | /     match &&x {
 LL | |         Foo::A => println!(),
@@ -91,7 +102,7 @@ LL | |     }
    | |_____^ help: try: `if x == Foo::A { println!() }`
 
 error: you seem to be trying to use `match` for an equality check. Consider using `if`
-  --> tests/ui/single_match.rs:133:5
+  --> tests/ui/single_match.rs:136:5
    |
 LL | /     match &x {
 LL | |         Foo::A => println!(),
@@ -100,7 +111,7 @@ LL | |     }
    | |_____^ help: try: `if x == &Foo::A { println!() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:151:5
+  --> tests/ui/single_match.rs:154:5
    |
 LL | /     match x {
 LL | |         Bar::A => println!(),
@@ -109,7 +120,7 @@ LL | |     }
    | |_____^ help: try: `if let Bar::A = x { println!() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:160:5
+  --> tests/ui/single_match.rs:163:5
    |
 LL | /     match x {
 LL | |         None => println!(),
@@ -118,7 +129,7 @@ LL | |     };
    | |_____^ help: try: `if let None = x { println!() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:183:5
+  --> tests/ui/single_match.rs:186:5
    |
 LL | /     match x {
 LL | |         (Some(_), _) => {},
@@ -127,7 +138,7 @@ LL | |     }
    | |_____^ help: try: `if let (Some(_), _) = x {}`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:190:5
+  --> tests/ui/single_match.rs:193:5
    |
 LL | /     match x {
 LL | |         (Some(E::V), _) => todo!(),
@@ -136,7 +147,7 @@ LL | |     }
    | |_____^ help: try: `if let (Some(E::V), _) = x { todo!() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:197:5
+  --> tests/ui/single_match.rs:200:5
    |
 LL | /     match (Some(42), Some(E::V), Some(42)) {
 LL | |         (.., Some(E::V), _) => {},
@@ -145,7 +156,7 @@ LL | |     }
    | |_____^ help: try: `if let (.., Some(E::V), _) = (Some(42), Some(E::V), Some(42)) {}`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:270:5
+  --> tests/ui/single_match.rs:273:5
    |
 LL | /     match bar {
 LL | |         Some(v) => unsafe {
@@ -165,7 +176,7 @@ LL +     } }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:279:5
+  --> tests/ui/single_match.rs:282:5
    |
 LL | /     match bar {
 LL | |         #[rustfmt::skip]
@@ -187,7 +198,7 @@ LL +     }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:360:5
+  --> tests/ui/single_match.rs:363:5
    |
 LL | /     match Ok::<_, u32>(Some(A)) {
 LL | |         Ok(Some(A)) => println!(),
@@ -196,7 +207,7 @@ LL | |     }
    | |_____^ help: try: `if let Ok(Some(A)) = Ok::<_, u32>(Some(A)) { println!() }`
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match.rs:376:5
+  --> tests/ui/single_match.rs:379:5
    |
 LL | /     match &Some(A) {
 LL | |         Some(A | B) => println!(),
@@ -205,7 +216,7 @@ LL | |     }
    | |_____^ help: try: `if let Some(A | B) = &Some(A) { println!() }`
 
 error: you seem to be trying to use `match` for an equality check. Consider using `if`
-  --> tests/ui/single_match.rs:384:5
+  --> tests/ui/single_match.rs:387:5
    |
 LL | /     match &s[0..3] {
 LL | |         b"foo" => println!(),
@@ -214,7 +225,7 @@ LL | |     }
    | |_____^ help: try: `if &s[0..3] == b"foo" { println!() }`
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match.rs:398:5
+  --> tests/ui/single_match.rs:401:5
    |
 LL | /     match DATA {
 LL | |         DATA => println!(),
@@ -223,7 +234,7 @@ LL | |     }
    | |_____^ help: try: `println!();`
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match.rs:404:5
+  --> tests/ui/single_match.rs:407:5
    |
 LL | /     match CONST_I32 {
 LL | |         CONST_I32 => println!(),
@@ -232,7 +243,7 @@ LL | |     }
    | |_____^ help: try: `println!();`
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match.rs:411:5
+  --> tests/ui/single_match.rs:414:5
    |
 LL | /     match i {
 LL | |         i => {
@@ -252,7 +263,7 @@ LL +     }
    |
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match.rs:420:5
+  --> tests/ui/single_match.rs:423:5
    |
 LL | /     match i {
 LL | |         i => {},
@@ -261,7 +272,7 @@ LL | |     }
    | |_____^ help: `match` expression can be removed
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match.rs:426:5
+  --> tests/ui/single_match.rs:429:5
    |
 LL | /     match i {
 LL | |         i => (),
@@ -270,7 +281,7 @@ LL | |     }
    | |_____^ help: `match` expression can be removed
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match.rs:432:5
+  --> tests/ui/single_match.rs:435:5
    |
 LL | /     match CONST_I32 {
 LL | |         CONST_I32 => println!(),
@@ -278,5 +289,37 @@ LL | |         _ => {},
 LL | |     }
    | |_____^ help: try: `println!();`
 
-error: aborting due to 26 previous errors
+error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
+  --> tests/ui/single_match.rs:443:5
+   |
+LL | /     match x.pop() {
+LL | |         // bla
+LL | |         Some(u) => println!("{u}"),
+...  |
+LL | |     }
+   | |_____^ help: try: `if let Some(u) = x.pop() { println!("{u}") }`
+   |
+   = note: you might want to preserve the comments from inside the `match`
+
+error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
+  --> tests/ui/single_match.rs:452:5
+   |
+LL | /     match x.pop() {
+LL | |         // bla
+LL | |         Some(u) => {
+...  |
+LL | |         None => {},
+LL | |     }
+   | |_____^
+   |
+   = note: you might want to preserve the comments from inside the `match`
+help: try
+   |
+LL ~     if let Some(u) = x.pop() {
+LL +         // bla
+LL +         println!("{u}");
+LL +     }
+   |
+
+error: aborting due to 29 previous errors
 
diff --git a/tests/ui/single_match_else.fixed b/tests/ui/single_match_else.fixed
index 64782bf62a7..fde13fb90db 100644
--- a/tests/ui/single_match_else.fixed
+++ b/tests/ui/single_match_else.fixed
@@ -1,4 +1,5 @@
 //@aux-build: proc_macros.rs
+//@require-annotations-for-level: WARN
 
 #![warn(clippy::single_match_else)]
 #![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)]
@@ -90,6 +91,13 @@ fn main() {
     }
     //~^^^^^^^ single_match_else
 
+    if let Some(a) = Some(1) { println!("${:?}", a) } else {
+        println!("else block");
+        return;
+    }
+    //~^^^^^^^^ single_match_else
+    //~| NOTE: you might want to preserve the comments from inside the `match`
+
     // lint here
     use std::convert::Infallible;
     if let Ok(a) = Result::<i32, &Infallible>::Ok(1) { println!("${:?}", a) } else {
diff --git a/tests/ui/single_match_else.rs b/tests/ui/single_match_else.rs
index 3f86f4d5180..ca282200067 100644
--- a/tests/ui/single_match_else.rs
+++ b/tests/ui/single_match_else.rs
@@ -1,4 +1,5 @@
 //@aux-build: proc_macros.rs
+//@require-annotations-for-level: WARN
 
 #![warn(clippy::single_match_else)]
 #![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)]
@@ -99,6 +100,17 @@ fn main() {
     }
     //~^^^^^^^ single_match_else
 
+    match Some(1) {
+        Some(a) => println!("${:?}", a),
+        // This is an inner comment
+        None => {
+            println!("else block");
+            return;
+        },
+    }
+    //~^^^^^^^^ single_match_else
+    //~| NOTE: you might want to preserve the comments from inside the `match`
+
     // lint here
     use std::convert::Infallible;
     match Result::<i32, &Infallible>::Ok(1) {
diff --git a/tests/ui/single_match_else.stderr b/tests/ui/single_match_else.stderr
index 7d4ba5fb75e..570480f9a3f 100644
--- a/tests/ui/single_match_else.stderr
+++ b/tests/ui/single_match_else.stderr
@@ -1,5 +1,5 @@
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:17:13
+  --> tests/ui/single_match_else.rs:18:13
    |
 LL |       let _ = match ExprNode::Butterflies {
    |  _____________^
@@ -22,7 +22,7 @@ LL ~     };
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:83:5
+  --> tests/ui/single_match_else.rs:84:5
    |
 LL | /     match Some(1) {
 LL | |         Some(a) => println!("${:?}", a),
@@ -42,7 +42,7 @@ LL +     }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:93:5
+  --> tests/ui/single_match_else.rs:94:5
    |
 LL | /     match Some(1) {
 LL | |         Some(a) => println!("${:?}", a),
@@ -62,7 +62,28 @@ LL +     }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:104:5
+  --> tests/ui/single_match_else.rs:103:5
+   |
+LL | /     match Some(1) {
+LL | |         Some(a) => println!("${:?}", a),
+LL | |         // This is an inner comment
+LL | |         None => {
+...  |
+LL | |         },
+LL | |     }
+   | |_____^
+   |
+   = note: you might want to preserve the comments from inside the `match`
+help: try
+   |
+LL ~     if let Some(a) = Some(1) { println!("${:?}", a) } else {
+LL +         println!("else block");
+LL +         return;
+LL +     }
+   |
+
+error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
+  --> tests/ui/single_match_else.rs:116:5
    |
 LL | /     match Result::<i32, &Infallible>::Ok(1) {
 LL | |         Ok(a) => println!("${:?}", a),
@@ -81,7 +102,7 @@ LL +     }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:114:5
+  --> tests/ui/single_match_else.rs:126:5
    |
 LL | /     match Cow::from("moo") {
 LL | |         Cow::Owned(a) => println!("${:?}", a),
@@ -100,7 +121,7 @@ LL +     }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:125:5
+  --> tests/ui/single_match_else.rs:137:5
    |
 LL | /     match bar {
 LL | |         Some(v) => unsafe {
@@ -123,7 +144,7 @@ LL +     }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:137:5
+  --> tests/ui/single_match_else.rs:149:5
    |
 LL | /     match bar {
 LL | |         Some(v) => {
@@ -147,7 +168,7 @@ LL +     } }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:150:5
+  --> tests/ui/single_match_else.rs:162:5
    |
 LL | /     match bar {
 LL | |         Some(v) => unsafe {
@@ -171,7 +192,7 @@ LL +     } }
    |
 
 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
-  --> tests/ui/single_match_else.rs:163:5
+  --> tests/ui/single_match_else.rs:175:5
    |
 LL | /     match bar {
 LL | |         #[rustfmt::skip]
@@ -196,7 +217,7 @@ LL +     }
    |
 
 error: this pattern is irrefutable, `match` is useless
-  --> tests/ui/single_match_else.rs:213:5
+  --> tests/ui/single_match_else.rs:225:5
    |
 LL | /     match ExprNode::Butterflies {
 LL | |         ExprNode::Butterflies => Some(&NODE),
@@ -207,5 +228,5 @@ LL | |         },
 LL | |     }
    | |_____^ help: try: `Some(&NODE)`
 
-error: aborting due to 10 previous errors
+error: aborting due to 11 previous errors
 
diff --git a/tests/ui/single_range_in_vec_init.stderr b/tests/ui/single_range_in_vec_init.stderr
index 48f5a94826c..a99127a7606 100644
--- a/tests/ui/single_range_in_vec_init.stderr
+++ b/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::<std::vec::Vec<i32>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     [0..200];
+LL +     (0..200).collect::<std::vec::Vec<i32>>();
+   |
 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:28: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::<std::vec::Vec<i32>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     vec![0..200];
+LL +     (0..200).collect::<std::vec::Vec<i32>>();
+   |
 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:30:5
@@ -38,12 +42,14 @@ LL |     [0u8..200];
    |
 help: if you wanted a `Vec` that contains the entire range, try
    |
-LL |     (0u8..200).collect::<std::vec::Vec<u8>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     [0u8..200];
+LL +     (0u8..200).collect::<std::vec::Vec<u8>>();
+   |
 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:32:5
@@ -53,12 +59,14 @@ LL |     [0usize..200];
    |
 help: if you wanted a `Vec` that contains the entire range, try
    |
-LL |     (0usize..200).collect::<std::vec::Vec<usize>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     [0usize..200];
+LL +     (0usize..200).collect::<std::vec::Vec<usize>>();
+   |
 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:34:5
@@ -68,12 +76,14 @@ LL |     [0..200usize];
    |
 help: if you wanted a `Vec` that contains the entire range, try
    |
-LL |     (0..200usize).collect::<std::vec::Vec<usize>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     [0..200usize];
+LL +     (0..200usize).collect::<std::vec::Vec<usize>>();
+   |
 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:36: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::<std::vec::Vec<u8>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     vec![0u8..200];
+LL +     (0u8..200).collect::<std::vec::Vec<u8>>();
+   |
 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:38: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::<std::vec::Vec<usize>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     vec![0usize..200];
+LL +     (0usize..200).collect::<std::vec::Vec<usize>>();
+   |
 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:40: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::<std::vec::Vec<usize>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     vec![0..200usize];
+LL +     (0..200usize).collect::<std::vec::Vec<usize>>();
+   |
 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:43:5
@@ -128,8 +144,9 @@ LL |     [0..200isize];
    |
 help: if you wanted a `Vec` that contains the entire range, try
    |
-LL |     (0..200isize).collect::<std::vec::Vec<isize>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     [0..200isize];
+LL +     (0..200isize).collect::<std::vec::Vec<isize>>();
+   |
 
 error: a `Vec` of `Range` that is only one element
   --> tests/ui/single_range_in_vec_init.rs:45: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::<std::vec::Vec<isize>>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     vec![0..200isize];
+LL +     (0..200isize).collect::<std::vec::Vec<isize>>();
+   |
 
 error: aborting due to 10 previous errors
 
diff --git a/tests/ui/size_of_ref.stderr b/tests/ui/size_of_ref.stderr
index 6ac0b0dd2f0..46af9f55dea 100644
--- a/tests/ui/size_of_ref.stderr
+++ b/tests/ui/size_of_ref.stderr
@@ -1,28 +1,28 @@
-error: argument to `std::mem::size_of_val()` is a reference to a reference
+error: argument to `size_of_val()` is a reference to a reference
   --> tests/ui/size_of_ref.rs:13:5
    |
 LL |     size_of_val(&&x);
    |     ^^^^^^^^^^^^^^^^
    |
-   = help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type
+   = help: dereference the argument to `size_of_val()` to get the size of the value instead of the size of the reference-type
    = note: `-D clippy::size-of-ref` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::size_of_ref)]`
 
-error: argument to `std::mem::size_of_val()` is a reference to a reference
+error: argument to `size_of_val()` is a reference to a reference
   --> tests/ui/size_of_ref.rs:16:5
    |
 LL |     size_of_val(&y);
    |     ^^^^^^^^^^^^^^^
    |
-   = help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type
+   = help: dereference the argument to `size_of_val()` to get the size of the value instead of the size of the reference-type
 
-error: argument to `std::mem::size_of_val()` is a reference to a reference
+error: argument to `size_of_val()` is a reference to a reference
   --> tests/ui/size_of_ref.rs:28:9
    |
 LL |         std::mem::size_of_val(&self) + (std::mem::size_of::<u8>() * self.data.capacity())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type
+   = help: dereference the argument to `size_of_val()` to get the size of the value instead of the size of the reference-type
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/string_lit_chars_any.stderr b/tests/ui/string_lit_chars_any.stderr
index b6bfb8d4b79..3ba447b3c36 100644
--- a/tests/ui/string_lit_chars_any.stderr
+++ b/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:20: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:22: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:24: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:27: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/tests/ui/string_to_string.rs b/tests/ui/string_to_string.rs
index 94174e1253b..7c5bd8a897b 100644
--- a/tests/ui/string_to_string.rs
+++ b/tests/ui/string_to_string.rs
@@ -1,8 +1,21 @@
 #![warn(clippy::string_to_string)]
-#![allow(clippy::redundant_clone)]
+#![allow(clippy::redundant_clone, clippy::unnecessary_literal_unwrap)]
 
 fn main() {
     let mut message = String::from("Hello");
     let mut v = message.to_string();
     //~^ string_to_string
+
+    let variable1 = String::new();
+    let v = &variable1;
+    let variable2 = Some(v);
+    let _ = variable2.map(|x| {
+        println!();
+        x.to_string()
+    });
+    //~^^ string_to_string
+
+    let x = Some(String::new());
+    let _ = x.unwrap_or_else(|| v.to_string());
+    //~^ string_to_string
 }
diff --git a/tests/ui/string_to_string.stderr b/tests/ui/string_to_string.stderr
index ae80597d1f8..99eea06f18e 100644
--- a/tests/ui/string_to_string.stderr
+++ b/tests/ui/string_to_string.stderr
@@ -8,5 +8,21 @@ LL |     let mut v = message.to_string();
    = note: `-D clippy::string-to-string` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::string_to_string)]`
 
-error: aborting due to 1 previous error
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string.rs:14:9
+   |
+LL |         x.to_string()
+   |         ^^^^^^^^^^^^^
+   |
+   = help: consider using `.clone()`
+
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string.rs:19:33
+   |
+LL |     let _ = x.unwrap_or_else(|| v.to_string());
+   |                                 ^^^^^^^^^^^^^
+   |
+   = help: consider using `.clone()`
+
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/string_to_string_in_map.fixed b/tests/ui/string_to_string_in_map.fixed
new file mode 100644
index 00000000000..efc085539f1
--- /dev/null
+++ b/tests/ui/string_to_string_in_map.fixed
@@ -0,0 +1,20 @@
+#![deny(clippy::string_to_string)]
+#![allow(clippy::unnecessary_literal_unwrap, clippy::useless_vec, clippy::iter_cloned_collect)]
+
+fn main() {
+    let variable1 = String::new();
+    let v = &variable1;
+    let variable2 = Some(v);
+    let _ = variable2.cloned();
+    //~^ string_to_string
+    let _ = variable2.cloned();
+    //~^ string_to_string
+    #[rustfmt::skip]
+    let _ = variable2.cloned();
+    //~^ string_to_string
+
+    let _ = vec![String::new()].iter().cloned().collect::<Vec<_>>();
+    //~^ string_to_string
+    let _ = vec![String::new()].iter().cloned().collect::<Vec<_>>();
+    //~^ string_to_string
+}
diff --git a/tests/ui/string_to_string_in_map.rs b/tests/ui/string_to_string_in_map.rs
new file mode 100644
index 00000000000..5bf1d7ba5a2
--- /dev/null
+++ b/tests/ui/string_to_string_in_map.rs
@@ -0,0 +1,20 @@
+#![deny(clippy::string_to_string)]
+#![allow(clippy::unnecessary_literal_unwrap, clippy::useless_vec, clippy::iter_cloned_collect)]
+
+fn main() {
+    let variable1 = String::new();
+    let v = &variable1;
+    let variable2 = Some(v);
+    let _ = variable2.map(String::to_string);
+    //~^ string_to_string
+    let _ = variable2.map(|x| x.to_string());
+    //~^ string_to_string
+    #[rustfmt::skip]
+    let _ = variable2.map(|x| { x.to_string() });
+    //~^ string_to_string
+
+    let _ = vec![String::new()].iter().map(String::to_string).collect::<Vec<_>>();
+    //~^ string_to_string
+    let _ = vec![String::new()].iter().map(|x| x.to_string()).collect::<Vec<_>>();
+    //~^ string_to_string
+}
diff --git a/tests/ui/string_to_string_in_map.stderr b/tests/ui/string_to_string_in_map.stderr
new file mode 100644
index 00000000000..35aeed656ee
--- /dev/null
+++ b/tests/ui/string_to_string_in_map.stderr
@@ -0,0 +1,38 @@
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string_in_map.rs:8:23
+   |
+LL |     let _ = variable2.map(String::to_string);
+   |                       ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
+   |
+note: the lint level is defined here
+  --> tests/ui/string_to_string_in_map.rs:1:9
+   |
+LL | #![deny(clippy::string_to_string)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string_in_map.rs:10:23
+   |
+LL |     let _ = variable2.map(|x| x.to_string());
+   |                       ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
+
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string_in_map.rs:13:23
+   |
+LL |     let _ = variable2.map(|x| { x.to_string() });
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
+
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string_in_map.rs:16:40
+   |
+LL |     let _ = vec![String::new()].iter().map(String::to_string).collect::<Vec<_>>();
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
+
+error: `to_string()` called on a `String`
+  --> tests/ui/string_to_string_in_map.rs:18:40
+   |
+LL |     let _ = vec![String::new()].iter().map(|x| x.to_string()).collect::<Vec<_>>();
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
+
+error: aborting due to 5 previous errors
+
diff --git a/tests/ui/struct_fields.rs b/tests/ui/struct_fields.rs
index 3dce530efff..e7ff2e6573b 100644
--- a/tests/ui/struct_fields.rs
+++ b/tests/ui/struct_fields.rs
@@ -344,4 +344,31 @@ struct Use {
     //~^ struct_field_names
 }
 
+// should lint on private fields of public structs (renaming them is not breaking-exported-api)
+pub struct PubStructFieldNamedAfterStruct {
+    pub_struct_field_named_after_struct: bool,
+    //~^ ERROR: field name starts with the struct's name
+    other1: bool,
+    other2: bool,
+}
+pub struct PubStructFieldPrefix {
+    //~^ ERROR: all fields have the same prefix: `field`
+    field_foo: u8,
+    field_bar: u8,
+    field_baz: u8,
+}
+// ...but should not lint on structs with public fields.
+pub struct PubStructPubAndPrivateFields {
+    /// One could argue that this field should be linted, but currently, any public field stops all
+    /// checking.
+    pub_struct_pub_and_private_fields_1: bool,
+    pub pub_struct_pub_and_private_fields_2: bool,
+}
+// nor on common prefixes if one of the involved fields is public
+pub struct PubStructPubAndPrivateFieldPrefix {
+    pub field_foo: u8,
+    field_bar: u8,
+    field_baz: u8,
+}
+
 fn main() {}
diff --git a/tests/ui/struct_fields.stderr b/tests/ui/struct_fields.stderr
index 79186cc1cfd..a5ff1b12590 100644
--- a/tests/ui/struct_fields.stderr
+++ b/tests/ui/struct_fields.stderr
@@ -281,5 +281,24 @@ error: field name starts with the struct's name
 LL |     use_baz: bool,
    |     ^^^^^^^^^^^^^
 
-error: aborting due to 24 previous errors
+error: field name starts with the struct's name
+  --> tests/ui/struct_fields.rs:349:5
+   |
+LL |     pub_struct_field_named_after_struct: bool,
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: all fields have the same prefix: `field`
+  --> tests/ui/struct_fields.rs:354:1
+   |
+LL | / pub struct PubStructFieldPrefix {
+LL | |
+LL | |     field_foo: u8,
+LL | |     field_bar: u8,
+LL | |     field_baz: u8,
+LL | | }
+   | |_^
+   |
+   = help: remove the prefixes
+
+error: aborting due to 26 previous errors
 
diff --git a/tests/ui/suspicious_command_arg_space.stderr b/tests/ui/suspicious_command_arg_space.stderr
index 6fd07d07d7b..8952a3ffe4b 100644
--- a/tests/ui/suspicious_command_arg_space.stderr
+++ b/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:7: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/tests/ui/suspicious_doc_comments.fixed b/tests/ui/suspicious_doc_comments.fixed
index 0c878afc66e..3696b0e066d 100644
--- a/tests/ui/suspicious_doc_comments.fixed
+++ b/tests/ui/suspicious_doc_comments.fixed
@@ -1,5 +1,6 @@
 #![allow(unused)]
 #![warn(clippy::suspicious_doc_comments)]
+#![allow(clippy::empty_line_after_doc_comments)]
 
 //! Real module documentation.
 //! Fake module documentation.
diff --git a/tests/ui/suspicious_doc_comments.rs b/tests/ui/suspicious_doc_comments.rs
index d89fe4f1bec..4107f5526d1 100644
--- a/tests/ui/suspicious_doc_comments.rs
+++ b/tests/ui/suspicious_doc_comments.rs
@@ -1,5 +1,6 @@
 #![allow(unused)]
 #![warn(clippy::suspicious_doc_comments)]
+#![allow(clippy::empty_line_after_doc_comments)]
 
 //! Real module documentation.
 ///! Fake module documentation.
diff --git a/tests/ui/suspicious_doc_comments.stderr b/tests/ui/suspicious_doc_comments.stderr
index 61363ff9bd2..df04d08537c 100644
--- a/tests/ui/suspicious_doc_comments.stderr
+++ b/tests/ui/suspicious_doc_comments.stderr
@@ -1,5 +1,5 @@
 error: this is an outer doc comment and does not apply to the parent module or crate
-  --> tests/ui/suspicious_doc_comments.rs:5:1
+  --> tests/ui/suspicious_doc_comments.rs:6:1
    |
 LL | ///! Fake module documentation.
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,22 +8,24 @@ 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
-  --> tests/ui/suspicious_doc_comments.rs:10:5
+  --> tests/ui/suspicious_doc_comments.rs:11:5
    |
 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
-  --> tests/ui/suspicious_doc_comments.rs:23:5
+  --> tests/ui/suspicious_doc_comments.rs:24:5
    |
 LL | /     /**! This module contains useful functions.
 LL | |      */
@@ -36,7 +38,7 @@ LL +      */
    |
 
 error: this is an outer doc comment and does not apply to the parent module or crate
-  --> tests/ui/suspicious_doc_comments.rs:38:5
+  --> tests/ui/suspicious_doc_comments.rs:39:5
    |
 LL | /     ///! This module
 LL | |
@@ -53,7 +55,7 @@ LL ~     //! useful functions.
    |
 
 error: this is an outer doc comment and does not apply to the parent module or crate
-  --> tests/ui/suspicious_doc_comments.rs:47:5
+  --> tests/ui/suspicious_doc_comments.rs:48:5
    |
 LL | /     ///! a
 LL | |
@@ -68,18 +70,19 @@ LL ~     //! b
    |
 
 error: this is an outer doc comment and does not apply to the parent module or crate
-  --> tests/ui/suspicious_doc_comments.rs:56:5
+  --> tests/ui/suspicious_doc_comments.rs:57:5
    |
 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
-  --> tests/ui/suspicious_doc_comments.rs:63:5
+  --> tests/ui/suspicious_doc_comments.rs:64:5
    |
 LL | /     ///! a
 ...  |
@@ -95,25 +98,27 @@ LL ~     //! b
    |
 
 error: this is an outer doc comment and does not apply to the parent module or crate
-  --> tests/ui/suspicious_doc_comments.rs:76:5
+  --> tests/ui/suspicious_doc_comments.rs:77:5
    |
 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
-  --> tests/ui/suspicious_doc_comments.rs:84:5
+  --> tests/ui/suspicious_doc_comments.rs:85:5
    |
 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/tests/ui/suspicious_doc_comments_unfixable.rs b/tests/ui/suspicious_doc_comments_unfixable.rs
index e526de5ca2c..17c7cc15b17 100644
--- a/tests/ui/suspicious_doc_comments_unfixable.rs
+++ b/tests/ui/suspicious_doc_comments_unfixable.rs
@@ -1,4 +1,4 @@
-#![allow(unused)]
+#![allow(unused, clippy::empty_line_after_doc_comments)]
 #![warn(clippy::suspicious_doc_comments)]
 //@no-rustfix
 ///! a
diff --git a/tests/ui/suspicious_else_formatting.rs b/tests/ui/suspicious_else_formatting.rs
index 7e57684bd43..28a3b551116 100644
--- a/tests/ui/suspicious_else_formatting.rs
+++ b/tests/ui/suspicious_else_formatting.rs
@@ -99,10 +99,11 @@ fn main() {
     // Almost Allman style braces. Lint these.
     if foo() {
     }
+
     else
     {
-
     }
+    //~^^^^^ suspicious_else_formatting
 
     if foo() {
     }
diff --git a/tests/ui/suspicious_else_formatting.stderr b/tests/ui/suspicious_else_formatting.stderr
index cf2788b67d0..affd20b22d9 100644
--- a/tests/ui/suspicious_else_formatting.stderr
+++ b/tests/ui/suspicious_else_formatting.stderr
@@ -64,7 +64,19 @@ LL | |     if foo() { // the span of the above error should continue here
    = note: to remove this lint, remove the `else` or remove the new line between `else` and `if`
 
 error: this is an `else {..}` but the formatting might hide it
-  --> tests/ui/suspicious_else_formatting.rs:108:6
+  --> tests/ui/suspicious_else_formatting.rs:101:6
+   |
+LL |       }
+   |  ______^
+LL | |
+LL | |     else
+LL | |     {
+   | |____^
+   |
+   = note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}`
+
+error: this is an `else {..}` but the formatting might hide it
+  --> tests/ui/suspicious_else_formatting.rs:109:6
    |
 LL |       }
    |  ______^
@@ -75,5 +87,5 @@ LL | |     {
    |
    = note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}`
 
-error: aborting due to 8 previous errors
+error: aborting due to 9 previous errors
 
diff --git a/tests/ui/suspicious_operation_groupings.fixed b/tests/ui/suspicious_operation_groupings.fixed
index 37054222bd6..fa680e537d3 100644
--- a/tests/ui/suspicious_operation_groupings.fixed
+++ b/tests/ui/suspicious_operation_groupings.fixed
@@ -1,7 +1,7 @@
 //@compile-flags: -Zdeduplicate-diagnostics=yes
 
 #![warn(clippy::suspicious_operation_groupings)]
-#![allow(dead_code, unused_parens, clippy::eq_op)]
+#![allow(dead_code, unused_parens, clippy::eq_op, clippy::manual_midpoint)]
 
 struct Vec3 {
     x: f64,
diff --git a/tests/ui/suspicious_operation_groupings.rs b/tests/ui/suspicious_operation_groupings.rs
index f4d1c3c70b5..4ffee640e8b 100644
--- a/tests/ui/suspicious_operation_groupings.rs
+++ b/tests/ui/suspicious_operation_groupings.rs
@@ -1,7 +1,7 @@
 //@compile-flags: -Zdeduplicate-diagnostics=yes
 
 #![warn(clippy::suspicious_operation_groupings)]
-#![allow(dead_code, unused_parens, clippy::eq_op)]
+#![allow(dead_code, unused_parens, clippy::eq_op, clippy::manual_midpoint)]
 
 struct Vec3 {
     x: f64,
diff --git a/tests/ui/suspicious_to_owned.stderr b/tests/ui/suspicious_to_owned.stderr
index cc6f5b7d3a5..f90bea5fb8f 100644
--- a/tests/ui/suspicious_to_owned.stderr
+++ b/tests/ui/suspicious_to_owned.stderr
@@ -9,11 +9,12 @@ LL |     let _ = cow.to_owned();
 help: depending on intent, either make the Cow an Owned variant
    |
 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
@@ -24,11 +25,12 @@ LL |     let _ = cow.to_owned();
 help: depending on intent, either make the Cow an Owned variant
    |
 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<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
   --> tests/ui/suspicious_to_owned.rs:41:13
@@ -39,11 +41,12 @@ LL |     let _ = cow.to_owned();
 help: depending on intent, either make the Cow an Owned variant
    |
 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:53:13
@@ -54,11 +57,12 @@ LL |     let _ = cow.to_owned();
 help: depending on intent, either make the Cow an Owned variant
    |
 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:69:13
diff --git a/tests/ui/suspicious_xor_used_as_pow.stderr b/tests/ui/suspicious_xor_used_as_pow.stderr
index 0913154a26e..efeafdb94ac 100644
--- a/tests/ui/suspicious_xor_used_as_pow.stderr
+++ b/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:24: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:27: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:30: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:33: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:36: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/tests/ui/too_long_first_doc_paragraph-fix.stderr b/tests/ui/too_long_first_doc_paragraph-fix.stderr
index d6255ea2029..bc2fbc2d14d 100644
--- a/tests/ui/too_long_first_doc_paragraph-fix.stderr
+++ b/tests/ui/too_long_first_doc_paragraph-fix.stderr
@@ -13,8 +13,8 @@ LL | | /// 200 characters so I needed to write something longeeeeeeer.
    = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
 help: add an empty line
    |
-LL ~ /// A very short summary.
-LL +
+LL | /// A very short summary.
+LL |
 LL + ///
 LL +
    |
diff --git a/tests/ui/too_long_first_doc_paragraph.rs b/tests/ui/too_long_first_doc_paragraph.rs
index 2321e228866..49420841c88 100644
--- a/tests/ui/too_long_first_doc_paragraph.rs
+++ b/tests/ui/too_long_first_doc_paragraph.rs
@@ -61,6 +61,13 @@ pub union Union2 {
 /// gravida non lacinia at, rhoncus eu lacus.
 fn f() {}
 
+#[rustfmt::skip]
+/// Some function. This doc-string paragraph is too long. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+//~^ too_long_first_doc_paragraph
+///
+/// Here's a second paragraph. It would be preferable to put the details here.
+pub fn issue_14274() {}
+
 fn main() {
     // test code goes here
 }
diff --git a/tests/ui/too_long_first_doc_paragraph.stderr b/tests/ui/too_long_first_doc_paragraph.stderr
index 2d4abaa9d63..f3f182aa542 100644
--- a/tests/ui/too_long_first_doc_paragraph.stderr
+++ b/tests/ui/too_long_first_doc_paragraph.stderr
@@ -13,9 +13,9 @@ LL | |     //! 200 characters so I needed to write something longeeeeeeer.
    = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
 help: add an empty line
    |
-LL ~     //! A very short summary.
-LL +
-LL +     //!
+LL |     //! A very short summary.
+LL |
+LL ~     //!
 LL +
 LL ~     //! A much longer explanation that goes into a lot more detail about
    |
@@ -39,5 +39,14 @@ LL | | /// a dolor in, pellentesque aliquet enim. Cras nec maximus sem. Mauris a
 LL | | /// gravida non lacinia at, rhoncus eu lacus.
    | |_^
 
-error: aborting due to 3 previous errors
+error: first doc comment paragraph is too long
+  --> tests/ui/too_long_first_doc_paragraph.rs:65:1
+   |
+LL | / /// Some function. This doc-string paragraph is too long. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lore...
+LL | |
+LL | | ///
+LL | | /// Here's a second paragraph. It would be preferable to put the details here.
+   | |_^
+
+error: aborting due to 4 previous errors
 
diff --git a/tests/ui/transmute_ptr_to_ptr.stderr b/tests/ui/transmute_ptr_to_ptr.stderr
index 0ff1cd3c090..c8db4fe214f 100644
--- a/tests/ui/transmute_ptr_to_ptr.stderr
+++ b/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::<f32>();
-   |                             ~~~~~~~~~~~~~~~~~
+LL -         let _: *const f32 = transmute(ptr);
+LL +         let _: *const f32 = ptr.cast::<f32>();
+   |
 
 error: transmute from a pointer to a pointer
   --> tests/ui/transmute_ptr_to_ptr.rs:35:27
@@ -19,8 +20,9 @@ LL |         let _: *mut f32 = transmute(mut_ptr);
    |
 help: use `pointer::cast` instead
    |
-LL |         let _: *mut f32 = mut_ptr.cast::<f32>();
-   |                           ~~~~~~~~~~~~~~~~~~~~~
+LL -         let _: *mut f32 = transmute(mut_ptr);
+LL +         let _: *mut f32 = mut_ptr.cast::<f32>();
+   |
 
 error: transmute from a reference to a reference
   --> tests/ui/transmute_ptr_to_ptr.rs:39: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:60: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:72: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:87: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:95:28
@@ -104,8 +110,9 @@ LL |         let _: *const i8 = transmute(ptr);
    |
 help: use `pointer::cast` instead
    |
-LL |         let _: *const i8 = ptr.cast::<i8>();
-   |                            ~~~~~~~~~~~~~~~~
+LL -         let _: *const i8 = transmute(ptr);
+LL +         let _: *const i8 = ptr.cast::<i8>();
+   |
 
 error: transmute from a pointer to a pointer
   --> tests/ui/transmute_ptr_to_ptr.rs:103: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:105: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:113: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:115: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/tests/ui/transmutes_expressible_as_ptr_casts.stderr b/tests/ui/transmutes_expressible_as_ptr_casts.stderr
index 1dab24a78d8..7746f087cc7 100644
--- a/tests/ui/transmutes_expressible_as_ptr_casts.stderr
+++ b/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::<i8>() };
-   |                                      ~~~~~~~~~~~~~~~~~~~~
+LL -     let _ptr_i8_transmute = unsafe { transmute::<*const i32, *const i8>(ptr_i32) };
+LL +     let _ptr_i8_transmute = unsafe { ptr_i32.cast::<i8>() };
+   |
 
 error: transmute from a pointer to a pointer
   --> tests/ui/transmutes_expressible_as_ptr_casts.rs:29: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:36:50
diff --git a/tests/ui/unit_arg.stderr b/tests/ui/unit_arg.stderr
index 2ddb28bd4cc..6c333d9792d 100644
--- a/tests/ui/unit_arg.stderr
+++ b/tests/ui/unit_arg.stderr
@@ -11,7 +11,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 `()`
    |
@@ -46,7 +47,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 `()`
    |
@@ -69,7 +71,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 `()`
    |
@@ -105,7 +108,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 `()`
    |
@@ -132,11 +136,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/tests/ui/unknown_clippy_lints.stderr b/tests/ui/unknown_clippy_lints.stderr
index 96a35312755..592fdfbebd4 100644
--- a/tests/ui/unknown_clippy_lints.stderr
+++ b/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:19: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/tests/ui/unnecessary_lazy_eval.stderr b/tests/ui/unnecessary_lazy_eval.stderr
index d1bb08ccead..75a06a419c7 100644
--- a/tests/ui/unnecessary_lazy_eval.stderr
+++ b/tests/ui/unnecessary_lazy_eval.stderr
@@ -8,8 +8,9 @@ LL |     let _ = opt.unwrap_or_else(|| 2);
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`
 help: use `unwrap_or` instead
    |
-LL |     let _ = opt.unwrap_or(2);
-   |                 ~~~~~~~~~~~~
+LL -     let _ = opt.unwrap_or_else(|| 2);
+LL +     let _ = opt.unwrap_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:85:13
@@ -19,8 +20,9 @@ LL |     let _ = opt.unwrap_or_else(|| astronomers_pi);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = opt.unwrap_or(astronomers_pi);
-   |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = opt.unwrap_or_else(|| astronomers_pi);
+LL +     let _ = opt.unwrap_or(astronomers_pi);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:87:13
@@ -30,8 +32,9 @@ LL |     let _ = opt.unwrap_or_else(|| ext_str.some_field);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = opt.unwrap_or(ext_str.some_field);
-   |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = opt.unwrap_or_else(|| ext_str.some_field);
+LL +     let _ = opt.unwrap_or(ext_str.some_field);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:90:13
@@ -41,8 +44,9 @@ LL |     let _ = opt.and_then(|_| ext_opt);
    |
 help: use `and` instead
    |
-LL |     let _ = opt.and(ext_opt);
-   |                 ~~~~~~~~~~~~
+LL -     let _ = opt.and_then(|_| ext_opt);
+LL +     let _ = opt.and(ext_opt);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:92:13
@@ -52,8 +56,9 @@ LL |     let _ = opt.or_else(|| ext_opt);
    |
 help: use `or` instead
    |
-LL |     let _ = opt.or(ext_opt);
-   |                 ~~~~~~~~~~~
+LL -     let _ = opt.or_else(|| ext_opt);
+LL +     let _ = opt.or(ext_opt);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:94:13
@@ -63,8 +68,9 @@ LL |     let _ = opt.or_else(|| None);
    |
 help: use `or` instead
    |
-LL |     let _ = opt.or(None);
-   |                 ~~~~~~~~
+LL -     let _ = opt.or_else(|| None);
+LL +     let _ = opt.or(None);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:96:13
@@ -74,8 +80,9 @@ LL |     let _ = opt.get_or_insert_with(|| 2);
    |
 help: use `get_or_insert` instead
    |
-LL |     let _ = opt.get_or_insert(2);
-   |                 ~~~~~~~~~~~~~~~~
+LL -     let _ = opt.get_or_insert_with(|| 2);
+LL +     let _ = opt.get_or_insert(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:98:13
@@ -85,8 +92,9 @@ LL |     let _ = opt.ok_or_else(|| 2);
    |
 help: use `ok_or` instead
    |
-LL |     let _ = opt.ok_or(2);
-   |                 ~~~~~~~~
+LL -     let _ = opt.ok_or_else(|| 2);
+LL +     let _ = opt.ok_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:100:13
@@ -96,8 +104,9 @@ LL |     let _ = nested_tuple_opt.unwrap_or_else(|| Some((1, 2)));
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = nested_tuple_opt.unwrap_or(Some((1, 2)));
-   |                              ~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = nested_tuple_opt.unwrap_or_else(|| Some((1, 2)));
+LL +     let _ = nested_tuple_opt.unwrap_or(Some((1, 2)));
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:102:13
@@ -107,8 +116,9 @@ LL |     let _ = cond.then(|| astronomers_pi);
    |
 help: use `then_some` instead
    |
-LL |     let _ = cond.then_some(astronomers_pi);
-   |                  ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = cond.then(|| astronomers_pi);
+LL +     let _ = cond.then_some(astronomers_pi);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:104:13
@@ -118,8 +128,9 @@ LL |     let _ = true.then(|| -> _ {});
    |
 help: use `then_some` instead
    |
-LL |     let _ = true.then_some({});
-   |                  ~~~~~~~~~~~~~
+LL -     let _ = true.then(|| -> _ {});
+LL +     let _ = true.then_some({});
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:106:13
@@ -129,8 +140,9 @@ LL |     let _ = true.then(|| {});
    |
 help: use `then_some` instead
    |
-LL |     let _ = true.then_some({});
-   |                  ~~~~~~~~~~~~~
+LL -     let _ = true.then(|| {});
+LL +     let _ = true.then_some({});
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:111:13
@@ -140,8 +152,9 @@ LL |     let _ = Some(1).unwrap_or_else(|| *r);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Some(1).unwrap_or(*r);
-   |                     ~~~~~~~~~~~~~
+LL -     let _ = Some(1).unwrap_or_else(|| *r);
+LL +     let _ = Some(1).unwrap_or(*r);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:114:13
@@ -151,8 +164,9 @@ LL |     let _ = Some(1).unwrap_or_else(|| *b);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Some(1).unwrap_or(*b);
-   |                     ~~~~~~~~~~~~~
+LL -     let _ = Some(1).unwrap_or_else(|| *b);
+LL +     let _ = Some(1).unwrap_or(*b);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:117:13
@@ -162,8 +176,9 @@ LL |     let _ = Some(1).as_ref().unwrap_or_else(|| &r);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Some(1).as_ref().unwrap_or(&r);
-   |                              ~~~~~~~~~~~~~
+LL -     let _ = Some(1).as_ref().unwrap_or_else(|| &r);
+LL +     let _ = Some(1).as_ref().unwrap_or(&r);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:119:13
@@ -173,8 +188,9 @@ LL |     let _ = Some(1).as_ref().unwrap_or_else(|| &b);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Some(1).as_ref().unwrap_or(&b);
-   |                              ~~~~~~~~~~~~~
+LL -     let _ = Some(1).as_ref().unwrap_or_else(|| &b);
+LL +     let _ = Some(1).as_ref().unwrap_or(&b);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:123:13
@@ -184,8 +200,9 @@ LL |     let _ = Some(10).unwrap_or_else(|| 2);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Some(10).unwrap_or(2);
-   |                      ~~~~~~~~~~~~
+LL -     let _ = Some(10).unwrap_or_else(|| 2);
+LL +     let _ = Some(10).unwrap_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:125:13
@@ -195,8 +212,9 @@ LL |     let _ = Some(10).and_then(|_| ext_opt);
    |
 help: use `and` instead
    |
-LL |     let _ = Some(10).and(ext_opt);
-   |                      ~~~~~~~~~~~~
+LL -     let _ = Some(10).and_then(|_| ext_opt);
+LL +     let _ = Some(10).and(ext_opt);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:127:28
@@ -206,8 +224,9 @@ LL |     let _: Option<usize> = None.or_else(|| ext_opt);
    |
 help: use `or` instead
    |
-LL |     let _: Option<usize> = None.or(ext_opt);
-   |                                 ~~~~~~~~~~~
+LL -     let _: Option<usize> = None.or_else(|| ext_opt);
+LL +     let _: Option<usize> = None.or(ext_opt);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:129:13
@@ -217,8 +236,9 @@ LL |     let _ = None.get_or_insert_with(|| 2);
    |
 help: use `get_or_insert` instead
    |
-LL |     let _ = None.get_or_insert(2);
-   |                  ~~~~~~~~~~~~~~~~
+LL -     let _ = None.get_or_insert_with(|| 2);
+LL +     let _ = None.get_or_insert(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:131:35
@@ -228,8 +248,9 @@ LL |     let _: Result<usize, usize> = None.ok_or_else(|| 2);
    |
 help: use `ok_or` instead
    |
-LL |     let _: Result<usize, usize> = None.ok_or(2);
-   |                                        ~~~~~~~~
+LL -     let _: Result<usize, usize> = None.ok_or_else(|| 2);
+LL +     let _: Result<usize, usize> = None.ok_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:133:28
@@ -239,8 +260,9 @@ LL |     let _: Option<usize> = None.or_else(|| None);
    |
 help: use `or` instead
    |
-LL |     let _: Option<usize> = None.or(None);
-   |                                 ~~~~~~~~
+LL -     let _: Option<usize> = None.or_else(|| None);
+LL +     let _: Option<usize> = None.or(None);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:137:13
@@ -250,8 +272,9 @@ LL |     let _ = deep.0.unwrap_or_else(|| 2);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = deep.0.unwrap_or(2);
-   |                    ~~~~~~~~~~~~
+LL -     let _ = deep.0.unwrap_or_else(|| 2);
+LL +     let _ = deep.0.unwrap_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:139:13
@@ -261,8 +284,9 @@ LL |     let _ = deep.0.and_then(|_| ext_opt);
    |
 help: use `and` instead
    |
-LL |     let _ = deep.0.and(ext_opt);
-   |                    ~~~~~~~~~~~~
+LL -     let _ = deep.0.and_then(|_| ext_opt);
+LL +     let _ = deep.0.and(ext_opt);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:141:13
@@ -272,8 +296,9 @@ LL |     let _ = deep.0.or_else(|| None);
    |
 help: use `or` instead
    |
-LL |     let _ = deep.0.or(None);
-   |                    ~~~~~~~~
+LL -     let _ = deep.0.or_else(|| None);
+LL +     let _ = deep.0.or(None);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:143:13
@@ -283,8 +308,9 @@ LL |     let _ = deep.0.get_or_insert_with(|| 2);
    |
 help: use `get_or_insert` instead
    |
-LL |     let _ = deep.0.get_or_insert(2);
-   |                    ~~~~~~~~~~~~~~~~
+LL -     let _ = deep.0.get_or_insert_with(|| 2);
+LL +     let _ = deep.0.get_or_insert(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:145:13
@@ -294,8 +320,9 @@ LL |     let _ = deep.0.ok_or_else(|| 2);
    |
 help: use `ok_or` instead
    |
-LL |     let _ = deep.0.ok_or(2);
-   |                    ~~~~~~~~
+LL -     let _ = deep.0.ok_or_else(|| 2);
+LL +     let _ = deep.0.ok_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:177:28
@@ -305,8 +332,9 @@ LL |     let _: Option<usize> = None.or_else(|| Some(3));
    |
 help: use `or` instead
    |
-LL |     let _: Option<usize> = None.or(Some(3));
-   |                                 ~~~~~~~~~~~
+LL -     let _: Option<usize> = None.or_else(|| Some(3));
+LL +     let _: Option<usize> = None.or(Some(3));
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:179:13
@@ -316,8 +344,9 @@ LL |     let _ = deep.0.or_else(|| Some(3));
    |
 help: use `or` instead
    |
-LL |     let _ = deep.0.or(Some(3));
-   |                    ~~~~~~~~~~~
+LL -     let _ = deep.0.or_else(|| Some(3));
+LL +     let _ = deep.0.or(Some(3));
+   |
 
 error: unnecessary closure used to substitute value for `Option::None`
   --> tests/ui/unnecessary_lazy_eval.rs:181:13
@@ -327,8 +356,9 @@ LL |     let _ = opt.or_else(|| Some(3));
    |
 help: use `or` instead
    |
-LL |     let _ = opt.or(Some(3));
-   |                 ~~~~~~~~~~~
+LL -     let _ = opt.or_else(|| Some(3));
+LL +     let _ = opt.or(Some(3));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:188:13
@@ -338,8 +368,9 @@ LL |     let _ = res2.unwrap_or_else(|_| 2);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = res2.unwrap_or(2);
-   |                  ~~~~~~~~~~~~
+LL -     let _ = res2.unwrap_or_else(|_| 2);
+LL +     let _ = res2.unwrap_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:190:13
@@ -349,8 +380,9 @@ LL |     let _ = res2.unwrap_or_else(|_| astronomers_pi);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = res2.unwrap_or(astronomers_pi);
-   |                  ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = res2.unwrap_or_else(|_| astronomers_pi);
+LL +     let _ = res2.unwrap_or(astronomers_pi);
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:192:13
@@ -360,8 +392,9 @@ LL |     let _ = res2.unwrap_or_else(|_| ext_str.some_field);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = res2.unwrap_or(ext_str.some_field);
-   |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = res2.unwrap_or_else(|_| ext_str.some_field);
+LL +     let _ = res2.unwrap_or(ext_str.some_field);
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:215:35
@@ -371,8 +404,9 @@ LL |     let _: Result<usize, usize> = res.and_then(|_| Err(2));
    |
 help: use `and` instead
    |
-LL |     let _: Result<usize, usize> = res.and(Err(2));
-   |                                       ~~~~~~~~~~~
+LL -     let _: Result<usize, usize> = res.and_then(|_| Err(2));
+LL +     let _: Result<usize, usize> = res.and(Err(2));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:217:35
@@ -382,8 +416,9 @@ LL |     let _: Result<usize, usize> = res.and_then(|_| Err(astronomers_pi));
    |
 help: use `and` instead
    |
-LL |     let _: Result<usize, usize> = res.and(Err(astronomers_pi));
-   |                                       ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _: Result<usize, usize> = res.and_then(|_| Err(astronomers_pi));
+LL +     let _: Result<usize, usize> = res.and(Err(astronomers_pi));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:219:35
@@ -393,8 +428,9 @@ LL |     let _: Result<usize, usize> = res.and_then(|_| Err(ext_str.some_field))
    |
 help: use `and` instead
    |
-LL |     let _: Result<usize, usize> = res.and(Err(ext_str.some_field));
-   |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _: Result<usize, usize> = res.and_then(|_| Err(ext_str.some_field));
+LL +     let _: Result<usize, usize> = res.and(Err(ext_str.some_field));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:222:35
@@ -404,8 +440,9 @@ LL |     let _: Result<usize, usize> = res.or_else(|_| Ok(2));
    |
 help: use `or` instead
    |
-LL |     let _: Result<usize, usize> = res.or(Ok(2));
-   |                                       ~~~~~~~~~
+LL -     let _: Result<usize, usize> = res.or_else(|_| Ok(2));
+LL +     let _: Result<usize, usize> = res.or(Ok(2));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:224:35
@@ -415,8 +452,9 @@ LL |     let _: Result<usize, usize> = res.or_else(|_| Ok(astronomers_pi));
    |
 help: use `or` instead
    |
-LL |     let _: Result<usize, usize> = res.or(Ok(astronomers_pi));
-   |                                       ~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _: Result<usize, usize> = res.or_else(|_| Ok(astronomers_pi));
+LL +     let _: Result<usize, usize> = res.or(Ok(astronomers_pi));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:226:35
@@ -426,8 +464,9 @@ LL |     let _: Result<usize, usize> = res.or_else(|_| Ok(ext_str.some_field));
    |
 help: use `or` instead
    |
-LL |     let _: Result<usize, usize> = res.or(Ok(ext_str.some_field));
-   |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _: Result<usize, usize> = res.or_else(|_| Ok(ext_str.some_field));
+LL +     let _: Result<usize, usize> = res.or(Ok(ext_str.some_field));
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval.rs:228:35
@@ -440,8 +479,9 @@ LL | |     or_else(|_| Ok(ext_str.some_field));
    |
 help: use `or` instead
    |
-LL |     or(Ok(ext_str.some_field));
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     or_else(|_| Ok(ext_str.some_field));
+LL +     or(Ok(ext_str.some_field));
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:259:14
@@ -451,8 +491,9 @@ LL |     let _x = false.then(|| i32::MAX + 1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MAX + 1);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MAX + 1);
+LL +     let _x = false.then_some(i32::MAX + 1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:261:14
@@ -462,8 +503,9 @@ LL |     let _x = false.then(|| i32::MAX * 2);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MAX * 2);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MAX * 2);
+LL +     let _x = false.then_some(i32::MAX * 2);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:263:14
@@ -473,8 +515,9 @@ LL |     let _x = false.then(|| i32::MAX - 1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MAX - 1);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MAX - 1);
+LL +     let _x = false.then_some(i32::MAX - 1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:265:14
@@ -484,8 +527,9 @@ LL |     let _x = false.then(|| i32::MIN - 1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MIN - 1);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MIN - 1);
+LL +     let _x = false.then_some(i32::MIN - 1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:267:14
@@ -495,8 +539,9 @@ LL |     let _x = false.then(|| (1 + 2 * 3 - 2 / 3 + 9) << 2);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some((1 + 2 * 3 - 2 / 3 + 9) << 2);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| (1 + 2 * 3 - 2 / 3 + 9) << 2);
+LL +     let _x = false.then_some((1 + 2 * 3 - 2 / 3 + 9) << 2);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:269:14
@@ -506,8 +551,9 @@ LL |     let _x = false.then(|| 255u8 << 7);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(255u8 << 7);
-   |                    ~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 255u8 << 7);
+LL +     let _x = false.then_some(255u8 << 7);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:271:14
@@ -517,8 +563,9 @@ LL |     let _x = false.then(|| 255u8 << 8);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(255u8 << 8);
-   |                    ~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 255u8 << 8);
+LL +     let _x = false.then_some(255u8 << 8);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:273:14
@@ -528,8 +575,9 @@ LL |     let _x = false.then(|| 255u8 >> 8);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(255u8 >> 8);
-   |                    ~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 255u8 >> 8);
+LL +     let _x = false.then_some(255u8 >> 8);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:276:14
@@ -539,8 +587,9 @@ LL |     let _x = false.then(|| i32::MAX + -1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MAX + -1);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MAX + -1);
+LL +     let _x = false.then_some(i32::MAX + -1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:278:14
@@ -550,8 +599,9 @@ LL |     let _x = false.then(|| -i32::MAX);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(-i32::MAX);
-   |                    ~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| -i32::MAX);
+LL +     let _x = false.then_some(-i32::MAX);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:280:14
@@ -561,8 +611,9 @@ LL |     let _x = false.then(|| -i32::MIN);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(-i32::MIN);
-   |                    ~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| -i32::MIN);
+LL +     let _x = false.then_some(-i32::MIN);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:283:14
@@ -572,8 +623,9 @@ LL |     let _x = false.then(|| 255 >> -7);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(255 >> -7);
-   |                    ~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 255 >> -7);
+LL +     let _x = false.then_some(255 >> -7);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:285:14
@@ -583,8 +635,9 @@ LL |     let _x = false.then(|| 255 << -1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(255 << -1);
-   |                    ~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 255 << -1);
+LL +     let _x = false.then_some(255 << -1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:287:14
@@ -594,8 +647,9 @@ LL |     let _x = false.then(|| 1 / 0);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(1 / 0);
-   |                    ~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 1 / 0);
+LL +     let _x = false.then_some(1 / 0);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:289:14
@@ -605,8 +659,9 @@ LL |     let _x = false.then(|| x << -1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(x << -1);
-   |                    ~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| x << -1);
+LL +     let _x = false.then_some(x << -1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:291:14
@@ -616,8 +671,9 @@ LL |     let _x = false.then(|| x << 2);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(x << 2);
-   |                    ~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| x << 2);
+LL +     let _x = false.then_some(x << 2);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:301:14
@@ -627,8 +683,9 @@ LL |     let _x = false.then(|| x / 0);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(x / 0);
-   |                    ~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| x / 0);
+LL +     let _x = false.then_some(x / 0);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:303:14
@@ -638,8 +695,9 @@ LL |     let _x = false.then(|| x % 0);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(x % 0);
-   |                    ~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| x % 0);
+LL +     let _x = false.then_some(x % 0);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:306:14
@@ -649,8 +707,9 @@ LL |     let _x = false.then(|| 1 / -1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(1 / -1);
-   |                    ~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 1 / -1);
+LL +     let _x = false.then_some(1 / -1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:308:14
@@ -660,8 +719,9 @@ LL |     let _x = false.then(|| i32::MIN / -1);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MIN / -1);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MIN / -1);
+LL +     let _x = false.then_some(i32::MIN / -1);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:311:14
@@ -671,8 +731,9 @@ LL |     let _x = false.then(|| i32::MIN / 0);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(i32::MIN / 0);
-   |                    ~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| i32::MIN / 0);
+LL +     let _x = false.then_some(i32::MIN / 0);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:313:14
@@ -682,8 +743,9 @@ LL |     let _x = false.then(|| 4 / 2);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(4 / 2);
-   |                    ~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| 4 / 2);
+LL +     let _x = false.then_some(4 / 2);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval.rs:321:14
@@ -693,8 +755,9 @@ LL |     let _x = false.then(|| f1 + f2);
    |
 help: use `then_some` instead
    |
-LL |     let _x = false.then_some(f1 + f2);
-   |                    ~~~~~~~~~~~~~~~~~~
+LL -     let _x = false.then(|| f1 + f2);
+LL +     let _x = false.then_some(f1 + f2);
+   |
 
 error: aborting due to 63 previous errors
 
diff --git a/tests/ui/unnecessary_lazy_eval_unfixable.stderr b/tests/ui/unnecessary_lazy_eval_unfixable.stderr
index 0a62b312f71..5174acc1e9f 100644
--- a/tests/ui/unnecessary_lazy_eval_unfixable.stderr
+++ b/tests/ui/unnecessary_lazy_eval_unfixable.stderr
@@ -8,8 +8,9 @@ LL |     let _ = Ok(1).unwrap_or_else(|()| 2);
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`
 help: use `unwrap_or` instead
    |
-LL |     let _ = Ok(1).unwrap_or(2);
-   |                   ~~~~~~~~~~~~
+LL -     let _ = Ok(1).unwrap_or_else(|()| 2);
+LL +     let _ = Ok(1).unwrap_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval_unfixable.rs:19:13
@@ -19,8 +20,9 @@ LL |     let _ = Ok(1).unwrap_or_else(|e::E| 2);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Ok(1).unwrap_or(2);
-   |                   ~~~~~~~~~~~~
+LL -     let _ = Ok(1).unwrap_or_else(|e::E| 2);
+LL +     let _ = Ok(1).unwrap_or(2);
+   |
 
 error: unnecessary closure used to substitute value for `Result::Err`
   --> tests/ui/unnecessary_lazy_eval_unfixable.rs:22:13
@@ -30,8 +32,9 @@ LL |     let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
    |
 help: use `unwrap_or` instead
    |
-LL |     let _ = Ok(1).unwrap_or(2);
-   |                   ~~~~~~~~~~~~
+LL -     let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
+LL +     let _ = Ok(1).unwrap_or(2);
+   |
 
 error: unnecessary closure used with `bool::then`
   --> tests/ui/unnecessary_lazy_eval_unfixable.rs:32:13
@@ -41,8 +44,9 @@ LL |     let _ = true.then(|| -> &[u8] { &[] });
    |
 help: use `then_some` instead
    |
-LL |     let _ = true.then_some({ &[] });
-   |                  ~~~~~~~~~~~~~~~~~~
+LL -     let _ = true.then(|| -> &[u8] { &[] });
+LL +     let _ = true.then_some({ &[] });
+   |
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/unnecessary_literal_unwrap.stderr b/tests/ui/unnecessary_literal_unwrap.stderr
index 7d6e096a1c9..cd90763263e 100644
--- a/tests/ui/unnecessary_literal_unwrap.stderr
+++ b/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:28: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:43: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:62: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:65: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:71: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:76: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:82: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:85: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:91: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:96:16
diff --git a/tests/ui/unnecessary_map_or.stderr b/tests/ui/unnecessary_map_or.stderr
index fb469e1f472..0f9466a6a6b 100644
--- a/tests/ui/unnecessary_map_or.stderr
+++ b/tests/ui/unnecessary_map_or.stderr
@@ -8,8 +8,9 @@ LL |     let _ = Some(5).map_or(false, |n| n == 5);
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
 help: use a standard comparison instead
    |
-LL |     let _ = Some(5) == Some(5);
-   |             ~~~~~~~~~~~~~~~~~~
+LL -     let _ = Some(5).map_or(false, |n| n == 5);
+LL +     let _ = Some(5) == Some(5);
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:15:13
@@ -19,8 +20,9 @@ LL |     let _ = Some(5).map_or(true, |n| n != 5);
    |
 help: use a standard comparison instead
    |
-LL |     let _ = Some(5) != Some(5);
-   |             ~~~~~~~~~~~~~~~~~~
+LL -     let _ = Some(5).map_or(true, |n| n != 5);
+LL +     let _ = Some(5) != Some(5);
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:17:13
@@ -35,8 +37,13 @@ LL | |     });
    |
 help: use a standard comparison instead
    |
-LL |     let _ = Some(5) == Some(5);
-   |             ~~~~~~~~~~~~~~~~~~
+LL -     let _ = Some(5).map_or(false, |n| {
+LL -
+LL -         let _ = 1;
+LL -         n == 5
+LL -     });
+LL +     let _ = Some(5) == Some(5);
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:22:13
@@ -123,8 +130,9 @@ LL |     let _ = Ok::<i32, i32>(5).map_or(false, |n| n == 5);
    |
 help: use a standard comparison instead
    |
-LL |     let _ = Ok::<i32, i32>(5) == Ok(5);
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = Ok::<i32, i32>(5).map_or(false, |n| n == 5);
+LL +     let _ = Ok::<i32, i32>(5) == Ok(5);
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:39:13
@@ -134,8 +142,9 @@ LL |     let _ = Some(5).map_or(false, |n| n == 5).then(|| 1);
    |
 help: use a standard comparison instead
    |
-LL |     let _ = (Some(5) == Some(5)).then(|| 1);
-   |             ~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = Some(5).map_or(false, |n| n == 5).then(|| 1);
+LL +     let _ = (Some(5) == Some(5)).then(|| 1);
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:41:13
@@ -169,8 +178,9 @@ LL |     let _ = !Some(5).map_or(false, |n| n == 5);
    |
 help: use a standard comparison instead
    |
-LL |     let _ = !(Some(5) == Some(5));
-   |              ~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = !Some(5).map_or(false, |n| n == 5);
+LL +     let _ = !(Some(5) == Some(5));
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:47:13
@@ -180,8 +190,9 @@ LL |     let _ = Some(5).map_or(false, |n| n == 5) || false;
    |
 help: use a standard comparison instead
    |
-LL |     let _ = (Some(5) == Some(5)) || false;
-   |             ~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = Some(5).map_or(false, |n| n == 5) || false;
+LL +     let _ = (Some(5) == Some(5)) || false;
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:49:13
@@ -191,8 +202,9 @@ LL |     let _ = Some(5).map_or(false, |n| n == 5) as usize;
    |
 help: use a standard comparison instead
    |
-LL |     let _ = (Some(5) == Some(5)) as usize;
-   |             ~~~~~~~~~~~~~~~~~~~~
+LL -     let _ = Some(5).map_or(false, |n| n == 5) as usize;
+LL +     let _ = (Some(5) == Some(5)) as usize;
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:74:13
@@ -250,8 +262,9 @@ LL |     let _ = r.map_or(false, |x| x == 8);
    |
 help: use a standard comparison instead
    |
-LL |     let _ = r == Ok(8);
-   |             ~~~~~~~~~~
+LL -     let _ = r.map_or(false, |x| x == 8);
+LL +     let _ = r == Ok(8);
+   |
 
 error: this `map_or` can be simplified
   --> tests/ui/unnecessary_map_or.rs:111:5
diff --git a/tests/ui/unnecessary_os_str_debug_formatting.rs b/tests/ui/unnecessary_os_str_debug_formatting.rs
new file mode 100644
index 00000000000..12663ec9a52
--- /dev/null
+++ b/tests/ui/unnecessary_os_str_debug_formatting.rs
@@ -0,0 +1,22 @@
+#![warn(clippy::unnecessary_debug_formatting)]
+
+use std::ffi::{OsStr, OsString};
+
+fn main() {
+    let os_str = OsStr::new("abc");
+    let os_string = os_str.to_os_string();
+
+    // negative tests
+    println!("{}", os_str.display());
+    println!("{}", os_string.display());
+
+    // positive tests
+    println!("{:?}", os_str); //~ unnecessary_debug_formatting
+    println!("{:?}", os_string); //~ unnecessary_debug_formatting
+
+    println!("{os_str:?}"); //~ unnecessary_debug_formatting
+    println!("{os_string:?}"); //~ unnecessary_debug_formatting
+
+    let _: String = format!("{:?}", os_str); //~ unnecessary_debug_formatting
+    let _: String = format!("{:?}", os_string); //~ unnecessary_debug_formatting
+}
diff --git a/tests/ui/unnecessary_os_str_debug_formatting.stderr b/tests/ui/unnecessary_os_str_debug_formatting.stderr
new file mode 100644
index 00000000000..001309ab817
--- /dev/null
+++ b/tests/ui/unnecessary_os_str_debug_formatting.stderr
@@ -0,0 +1,58 @@
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_os_str_debug_formatting.rs:14:22
+   |
+LL |     println!("{:?}", os_str);
+   |                      ^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_str.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+   = note: `-D clippy::unnecessary-debug-formatting` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_debug_formatting)]`
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_os_str_debug_formatting.rs:15:22
+   |
+LL |     println!("{:?}", os_string);
+   |                      ^^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_string.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_os_str_debug_formatting.rs:17:16
+   |
+LL |     println!("{os_str:?}");
+   |                ^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_str.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_os_str_debug_formatting.rs:18:16
+   |
+LL |     println!("{os_string:?}");
+   |                ^^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_string.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `format!` args
+  --> tests/ui/unnecessary_os_str_debug_formatting.rs:20:37
+   |
+LL |     let _: String = format!("{:?}", os_str);
+   |                                     ^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_str.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `format!` args
+  --> tests/ui/unnecessary_os_str_debug_formatting.rs:21:37
+   |
+LL |     let _: String = format!("{:?}", os_string);
+   |                                     ^^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_string.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/unnecessary_path_debug_formatting.rs b/tests/ui/unnecessary_path_debug_formatting.rs
new file mode 100644
index 00000000000..f14f6085c9a
--- /dev/null
+++ b/tests/ui/unnecessary_path_debug_formatting.rs
@@ -0,0 +1,49 @@
+#![warn(clippy::unnecessary_debug_formatting)]
+
+use std::ffi::{OsStr, OsString};
+use std::ops::Deref;
+use std::path::{Path, PathBuf};
+
+struct DerefPath<'a> {
+    path: &'a Path,
+}
+
+impl Deref for DerefPath<'_> {
+    type Target = Path;
+    fn deref(&self) -> &Self::Target {
+        self.path
+    }
+}
+
+fn main() {
+    let path = Path::new("/a/b/c");
+    let path_buf = path.to_path_buf();
+    let os_str = OsStr::new("abc");
+    let os_string = os_str.to_os_string();
+
+    // negative tests
+    println!("{}", path.display());
+    println!("{}", path_buf.display());
+
+    // positive tests
+    println!("{:?}", os_str); //~ unnecessary_debug_formatting
+    println!("{:?}", os_string); //~ unnecessary_debug_formatting
+
+    println!("{:?}", path); //~ unnecessary_debug_formatting
+    println!("{:?}", path_buf); //~ unnecessary_debug_formatting
+
+    println!("{path:?}"); //~ unnecessary_debug_formatting
+    println!("{path_buf:?}"); //~ unnecessary_debug_formatting
+
+    let _: String = format!("{:?}", path); //~ unnecessary_debug_formatting
+    let _: String = format!("{:?}", path_buf); //~ unnecessary_debug_formatting
+
+    let deref_path = DerefPath { path };
+    println!("{:?}", &*deref_path); //~ unnecessary_debug_formatting
+}
+
+#[test]
+fn issue_14345() {
+    let input = std::path::Path::new("/foo/bar");
+    assert!(input.ends_with("baz"), "{input:?}");
+}
diff --git a/tests/ui/unnecessary_path_debug_formatting.stderr b/tests/ui/unnecessary_path_debug_formatting.stderr
new file mode 100644
index 00000000000..f12fa72c84b
--- /dev/null
+++ b/tests/ui/unnecessary_path_debug_formatting.stderr
@@ -0,0 +1,85 @@
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:29:22
+   |
+LL |     println!("{:?}", os_str);
+   |                      ^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_str.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+   = note: `-D clippy::unnecessary-debug-formatting` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_debug_formatting)]`
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:30:22
+   |
+LL |     println!("{:?}", os_string);
+   |                      ^^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `os_string.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:32:22
+   |
+LL |     println!("{:?}", path);
+   |                      ^^^^
+   |
+   = help: use `Display` formatting and change this to `path.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:33:22
+   |
+LL |     println!("{:?}", path_buf);
+   |                      ^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `path_buf.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:35:16
+   |
+LL |     println!("{path:?}");
+   |                ^^^^
+   |
+   = help: use `Display` formatting and change this to `path.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:36:16
+   |
+LL |     println!("{path_buf:?}");
+   |                ^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `path_buf.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `format!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:38:37
+   |
+LL |     let _: String = format!("{:?}", path);
+   |                                     ^^^^
+   |
+   = help: use `Display` formatting and change this to `path.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `format!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:39:37
+   |
+LL |     let _: String = format!("{:?}", path_buf);
+   |                                     ^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `path_buf.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: unnecessary `Debug` formatting in `println!` args
+  --> tests/ui/unnecessary_path_debug_formatting.rs:42:22
+   |
+LL |     println!("{:?}", &*deref_path);
+   |                      ^^^^^^^^^^^^
+   |
+   = help: use `Display` formatting and change this to `&*deref_path.display()`
+   = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
+
+error: aborting due to 9 previous errors
+
diff --git a/tests/ui/unnecessary_to_owned.fixed b/tests/ui/unnecessary_to_owned.fixed
index 136dafda27e..5410033dbd8 100644
--- a/tests/ui/unnecessary_to_owned.fixed
+++ b/tests/ui/unnecessary_to_owned.fixed
@@ -3,7 +3,8 @@
     clippy::needless_borrows_for_generic_args,
     clippy::ptr_arg,
     clippy::manual_async_fn,
-    clippy::needless_lifetimes
+    clippy::needless_lifetimes,
+    clippy::owned_cow
 )]
 #![warn(clippy::unnecessary_to_owned, clippy::redundant_clone)]
 
@@ -194,19 +195,11 @@ fn main() {
     //~^ unnecessary_to_owned
     let _ = slice.iter().copied();
     //~^ unnecessary_to_owned
-    let _ = [std::path::PathBuf::new()][..].iter().cloned();
-    //~^ unnecessary_to_owned
-    let _ = [std::path::PathBuf::new()][..].iter().cloned();
-    //~^ unnecessary_to_owned
 
     let _ = slice.iter().copied();
     //~^ unnecessary_to_owned
     let _ = slice.iter().copied();
     //~^ unnecessary_to_owned
-    let _ = [std::path::PathBuf::new()][..].iter().cloned();
-    //~^ unnecessary_to_owned
-    let _ = [std::path::PathBuf::new()][..].iter().cloned();
-    //~^ unnecessary_to_owned
 
     let _ = check_files(&[FileType::Account]);
 
@@ -316,19 +309,6 @@ fn get_file_path(_file_type: &FileType) -> Result<std::path::PathBuf, std::io::E
 
 fn require_string(_: &String) {}
 
-#[clippy::msrv = "1.35"]
-fn _msrv_1_35() {
-    // `copied` was stabilized in 1.36, so clippy should use `cloned`.
-    let _ = &["x"][..].iter().cloned();
-    //~^ unnecessary_to_owned
-}
-
-#[clippy::msrv = "1.36"]
-fn _msrv_1_36() {
-    let _ = &["x"][..].iter().copied();
-    //~^ unnecessary_to_owned
-}
-
 // https://github.com/rust-lang/rust-clippy/issues/8507
 mod issue_8507 {
     #![allow(dead_code)]
@@ -679,3 +659,18 @@ fn issue13624() -> impl IntoIterator {
 
     cow.into_owned().into_iter()
 }
+
+mod issue_14242 {
+    use std::rc::Rc;
+
+    #[derive(Copy, Clone)]
+    struct Foo;
+
+    fn rc_slice_provider() -> Rc<[Foo]> {
+        Rc::from([Foo])
+    }
+
+    fn iterator_provider() -> impl Iterator<Item = Foo> {
+        rc_slice_provider().to_vec().into_iter()
+    }
+}
diff --git a/tests/ui/unnecessary_to_owned.rs b/tests/ui/unnecessary_to_owned.rs
index 0948ac5de3e..0619dd4ddec 100644
--- a/tests/ui/unnecessary_to_owned.rs
+++ b/tests/ui/unnecessary_to_owned.rs
@@ -3,7 +3,8 @@
     clippy::needless_borrows_for_generic_args,
     clippy::ptr_arg,
     clippy::manual_async_fn,
-    clippy::needless_lifetimes
+    clippy::needless_lifetimes,
+    clippy::owned_cow
 )]
 #![warn(clippy::unnecessary_to_owned, clippy::redundant_clone)]
 
@@ -194,19 +195,11 @@ fn main() {
     //~^ unnecessary_to_owned
     let _ = slice.to_owned().into_iter();
     //~^ unnecessary_to_owned
-    let _ = [std::path::PathBuf::new()][..].to_vec().into_iter();
-    //~^ unnecessary_to_owned
-    let _ = [std::path::PathBuf::new()][..].to_owned().into_iter();
-    //~^ unnecessary_to_owned
 
     let _ = IntoIterator::into_iter(slice.to_vec());
     //~^ unnecessary_to_owned
     let _ = IntoIterator::into_iter(slice.to_owned());
     //~^ unnecessary_to_owned
-    let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_vec());
-    //~^ unnecessary_to_owned
-    let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_owned());
-    //~^ unnecessary_to_owned
 
     let _ = check_files(&[FileType::Account]);
 
@@ -316,19 +309,6 @@ fn get_file_path(_file_type: &FileType) -> Result<std::path::PathBuf, std::io::E
 
 fn require_string(_: &String) {}
 
-#[clippy::msrv = "1.35"]
-fn _msrv_1_35() {
-    // `copied` was stabilized in 1.36, so clippy should use `cloned`.
-    let _ = &["x"][..].to_vec().into_iter();
-    //~^ unnecessary_to_owned
-}
-
-#[clippy::msrv = "1.36"]
-fn _msrv_1_36() {
-    let _ = &["x"][..].to_vec().into_iter();
-    //~^ unnecessary_to_owned
-}
-
 // https://github.com/rust-lang/rust-clippy/issues/8507
 mod issue_8507 {
     #![allow(dead_code)]
@@ -679,3 +659,18 @@ fn issue13624() -> impl IntoIterator {
 
     cow.into_owned().into_iter()
 }
+
+mod issue_14242 {
+    use std::rc::Rc;
+
+    #[derive(Copy, Clone)]
+    struct Foo;
+
+    fn rc_slice_provider() -> Rc<[Foo]> {
+        Rc::from([Foo])
+    }
+
+    fn iterator_provider() -> impl Iterator<Item = Foo> {
+        rc_slice_provider().to_vec().into_iter()
+    }
+}
diff --git a/tests/ui/unnecessary_to_owned.stderr b/tests/ui/unnecessary_to_owned.stderr
index f8ad85dbed0..8926db34da8 100644
--- a/tests/ui/unnecessary_to_owned.stderr
+++ b/tests/ui/unnecessary_to_owned.stderr
@@ -1,11 +1,11 @@
 error: redundant clone
-  --> tests/ui/unnecessary_to_owned.rs:224:64
+  --> tests/ui/unnecessary_to_owned.rs:217:64
    |
 LL |     require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned());
    |                                                                ^^^^^^^^^^^ help: remove this
    |
 note: this value is dropped without further use
-  --> tests/ui/unnecessary_to_owned.rs:224:20
+  --> tests/ui/unnecessary_to_owned.rs:217:20
    |
 LL |     require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned());
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,55 +13,55 @@ LL |     require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned())
    = help: to override `-D warnings` add `#[allow(clippy::redundant_clone)]`
 
 error: redundant clone
-  --> tests/ui/unnecessary_to_owned.rs:226:40
+  --> tests/ui/unnecessary_to_owned.rs:219:40
    |
 LL |     require_os_str(&OsString::from("x").to_os_string());
    |                                        ^^^^^^^^^^^^^^^ help: remove this
    |
 note: this value is dropped without further use
-  --> tests/ui/unnecessary_to_owned.rs:226:21
+  --> tests/ui/unnecessary_to_owned.rs:219:21
    |
 LL |     require_os_str(&OsString::from("x").to_os_string());
    |                     ^^^^^^^^^^^^^^^^^^^
 
 error: redundant clone
-  --> tests/ui/unnecessary_to_owned.rs:228:48
+  --> tests/ui/unnecessary_to_owned.rs:221:48
    |
 LL |     require_path(&std::path::PathBuf::from("x").to_path_buf());
    |                                                ^^^^^^^^^^^^^^ help: remove this
    |
 note: this value is dropped without further use
-  --> tests/ui/unnecessary_to_owned.rs:228:19
+  --> tests/ui/unnecessary_to_owned.rs:221:19
    |
 LL |     require_path(&std::path::PathBuf::from("x").to_path_buf());
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: redundant clone
-  --> tests/ui/unnecessary_to_owned.rs:230:35
+  --> tests/ui/unnecessary_to_owned.rs:223:35
    |
 LL |     require_str(&String::from("x").to_string());
    |                                   ^^^^^^^^^^^^ help: remove this
    |
 note: this value is dropped without further use
-  --> tests/ui/unnecessary_to_owned.rs:230:18
+  --> tests/ui/unnecessary_to_owned.rs:223:18
    |
 LL |     require_str(&String::from("x").to_string());
    |                  ^^^^^^^^^^^^^^^^^
 
 error: redundant clone
-  --> tests/ui/unnecessary_to_owned.rs:232:39
+  --> tests/ui/unnecessary_to_owned.rs:225:39
    |
 LL |     require_slice(&[String::from("x")].to_owned());
    |                                       ^^^^^^^^^^^ help: remove this
    |
 note: this value is dropped without further use
-  --> tests/ui/unnecessary_to_owned.rs:232:20
+  --> tests/ui/unnecessary_to_owned.rs:225:20
    |
 LL |     require_slice(&[String::from("x")].to_owned());
    |                    ^^^^^^^^^^^^^^^^^^^
 
 error: unnecessary use of `into_owned`
-  --> tests/ui/unnecessary_to_owned.rs:64:36
+  --> tests/ui/unnecessary_to_owned.rs:65:36
    |
 LL |     require_c_str(&Cow::from(c_str).into_owned());
    |                                    ^^^^^^^^^^^^^ help: remove this
@@ -70,415 +70,391 @@ LL |     require_c_str(&Cow::from(c_str).into_owned());
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:66:19
+  --> tests/ui/unnecessary_to_owned.rs:67:19
    |
 LL |     require_c_str(&c_str.to_owned());
    |                   ^^^^^^^^^^^^^^^^^ help: use: `c_str`
 
 error: unnecessary use of `to_os_string`
-  --> tests/ui/unnecessary_to_owned.rs:69:20
+  --> tests/ui/unnecessary_to_owned.rs:70:20
    |
 LL |     require_os_str(&os_str.to_os_string());
    |                    ^^^^^^^^^^^^^^^^^^^^^^ help: use: `os_str`
 
 error: unnecessary use of `into_owned`
-  --> tests/ui/unnecessary_to_owned.rs:71:38
+  --> tests/ui/unnecessary_to_owned.rs:72:38
    |
 LL |     require_os_str(&Cow::from(os_str).into_owned());
    |                                      ^^^^^^^^^^^^^ help: remove this
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:73:20
+  --> tests/ui/unnecessary_to_owned.rs:74:20
    |
 LL |     require_os_str(&os_str.to_owned());
    |                    ^^^^^^^^^^^^^^^^^^ help: use: `os_str`
 
 error: unnecessary use of `to_path_buf`
-  --> tests/ui/unnecessary_to_owned.rs:76:18
+  --> tests/ui/unnecessary_to_owned.rs:77:18
    |
 LL |     require_path(&path.to_path_buf());
    |                  ^^^^^^^^^^^^^^^^^^^ help: use: `path`
 
 error: unnecessary use of `into_owned`
-  --> tests/ui/unnecessary_to_owned.rs:78:34
+  --> tests/ui/unnecessary_to_owned.rs:79:34
    |
 LL |     require_path(&Cow::from(path).into_owned());
    |                                  ^^^^^^^^^^^^^ help: remove this
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:80:18
+  --> tests/ui/unnecessary_to_owned.rs:81:18
    |
 LL |     require_path(&path.to_owned());
    |                  ^^^^^^^^^^^^^^^^ help: use: `path`
 
 error: unnecessary use of `to_string`
-  --> tests/ui/unnecessary_to_owned.rs:83:17
+  --> tests/ui/unnecessary_to_owned.rs:84:17
    |
 LL |     require_str(&s.to_string());
    |                 ^^^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `into_owned`
-  --> tests/ui/unnecessary_to_owned.rs:85:30
+  --> tests/ui/unnecessary_to_owned.rs:86:30
    |
 LL |     require_str(&Cow::from(s).into_owned());
    |                              ^^^^^^^^^^^^^ help: remove this
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:87:17
+  --> tests/ui/unnecessary_to_owned.rs:88:17
    |
 LL |     require_str(&s.to_owned());
    |                 ^^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_string`
-  --> tests/ui/unnecessary_to_owned.rs:89:17
+  --> tests/ui/unnecessary_to_owned.rs:90:17
    |
 LL |     require_str(&x_ref.to_string());
    |                 ^^^^^^^^^^^^^^^^^^ help: use: `x_ref.as_ref()`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:92:19
+  --> tests/ui/unnecessary_to_owned.rs:93:19
    |
 LL |     require_slice(&slice.to_vec());
    |                   ^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `into_owned`
-  --> tests/ui/unnecessary_to_owned.rs:94:36
+  --> tests/ui/unnecessary_to_owned.rs:95:36
    |
 LL |     require_slice(&Cow::from(slice).into_owned());
    |                                    ^^^^^^^^^^^^^ help: remove this
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:96:19
+  --> tests/ui/unnecessary_to_owned.rs:97:19
    |
 LL |     require_slice(&array.to_owned());
    |                   ^^^^^^^^^^^^^^^^^ help: use: `array.as_ref()`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:98:19
+  --> tests/ui/unnecessary_to_owned.rs:99:19
    |
 LL |     require_slice(&array_ref.to_owned());
    |                   ^^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref.as_ref()`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:100:19
+  --> tests/ui/unnecessary_to_owned.rs:101:19
    |
 LL |     require_slice(&slice.to_owned());
    |                   ^^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `into_owned`
-  --> tests/ui/unnecessary_to_owned.rs:104:42
+  --> tests/ui/unnecessary_to_owned.rs:105:42
    |
 LL |     require_x(&Cow::<X>::Owned(x.clone()).into_owned());
    |                                          ^^^^^^^^^^^^^ help: remove this
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:108:25
+  --> tests/ui/unnecessary_to_owned.rs:109:25
    |
 LL |     require_deref_c_str(c_str.to_owned());
    |                         ^^^^^^^^^^^^^^^^ help: use: `c_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:110:26
+  --> tests/ui/unnecessary_to_owned.rs:111:26
    |
 LL |     require_deref_os_str(os_str.to_owned());
    |                          ^^^^^^^^^^^^^^^^^ help: use: `os_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:112:24
+  --> tests/ui/unnecessary_to_owned.rs:113:24
    |
 LL |     require_deref_path(path.to_owned());
    |                        ^^^^^^^^^^^^^^^ help: use: `path`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:114:23
+  --> tests/ui/unnecessary_to_owned.rs:115:23
    |
 LL |     require_deref_str(s.to_owned());
    |                       ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:116:25
+  --> tests/ui/unnecessary_to_owned.rs:117:25
    |
 LL |     require_deref_slice(slice.to_owned());
    |                         ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:119:30
+  --> tests/ui/unnecessary_to_owned.rs:120:30
    |
 LL |     require_impl_deref_c_str(c_str.to_owned());
    |                              ^^^^^^^^^^^^^^^^ help: use: `c_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:121:31
+  --> tests/ui/unnecessary_to_owned.rs:122:31
    |
 LL |     require_impl_deref_os_str(os_str.to_owned());
    |                               ^^^^^^^^^^^^^^^^^ help: use: `os_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:123:29
+  --> tests/ui/unnecessary_to_owned.rs:124:29
    |
 LL |     require_impl_deref_path(path.to_owned());
    |                             ^^^^^^^^^^^^^^^ help: use: `path`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:125:28
+  --> tests/ui/unnecessary_to_owned.rs:126:28
    |
 LL |     require_impl_deref_str(s.to_owned());
    |                            ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:127:30
+  --> tests/ui/unnecessary_to_owned.rs:128:30
    |
 LL |     require_impl_deref_slice(slice.to_owned());
    |                              ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:130:29
+  --> tests/ui/unnecessary_to_owned.rs:131:29
    |
 LL |     require_deref_str_slice(s.to_owned(), slice.to_owned());
    |                             ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:130:43
+  --> tests/ui/unnecessary_to_owned.rs:131:43
    |
 LL |     require_deref_str_slice(s.to_owned(), slice.to_owned());
    |                                           ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:133:29
+  --> tests/ui/unnecessary_to_owned.rs:134:29
    |
 LL |     require_deref_slice_str(slice.to_owned(), s.to_owned());
    |                             ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:133:47
+  --> tests/ui/unnecessary_to_owned.rs:134:47
    |
 LL |     require_deref_slice_str(slice.to_owned(), s.to_owned());
    |                                               ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:137:26
+  --> tests/ui/unnecessary_to_owned.rs:138:26
    |
 LL |     require_as_ref_c_str(c_str.to_owned());
    |                          ^^^^^^^^^^^^^^^^ help: use: `c_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:139:27
+  --> tests/ui/unnecessary_to_owned.rs:140:27
    |
 LL |     require_as_ref_os_str(os_str.to_owned());
    |                           ^^^^^^^^^^^^^^^^^ help: use: `os_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:141:25
+  --> tests/ui/unnecessary_to_owned.rs:142:25
    |
 LL |     require_as_ref_path(path.to_owned());
    |                         ^^^^^^^^^^^^^^^ help: use: `path`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:143:24
+  --> tests/ui/unnecessary_to_owned.rs:144:24
    |
 LL |     require_as_ref_str(s.to_owned());
    |                        ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:145:24
+  --> tests/ui/unnecessary_to_owned.rs:146:24
    |
 LL |     require_as_ref_str(x.to_owned());
    |                        ^^^^^^^^^^^^ help: use: `&x`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:147:26
+  --> tests/ui/unnecessary_to_owned.rs:148:26
    |
 LL |     require_as_ref_slice(array.to_owned());
    |                          ^^^^^^^^^^^^^^^^ help: use: `array`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:149:26
+  --> tests/ui/unnecessary_to_owned.rs:150:26
    |
 LL |     require_as_ref_slice(array_ref.to_owned());
    |                          ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:151:26
+  --> tests/ui/unnecessary_to_owned.rs:152:26
    |
 LL |     require_as_ref_slice(slice.to_owned());
    |                          ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:154:31
+  --> tests/ui/unnecessary_to_owned.rs:155:31
    |
 LL |     require_impl_as_ref_c_str(c_str.to_owned());
    |                               ^^^^^^^^^^^^^^^^ help: use: `c_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:156:32
+  --> tests/ui/unnecessary_to_owned.rs:157:32
    |
 LL |     require_impl_as_ref_os_str(os_str.to_owned());
    |                                ^^^^^^^^^^^^^^^^^ help: use: `os_str`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:158:30
+  --> tests/ui/unnecessary_to_owned.rs:159:30
    |
 LL |     require_impl_as_ref_path(path.to_owned());
    |                              ^^^^^^^^^^^^^^^ help: use: `path`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:160:29
+  --> tests/ui/unnecessary_to_owned.rs:161:29
    |
 LL |     require_impl_as_ref_str(s.to_owned());
    |                             ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:162:29
+  --> tests/ui/unnecessary_to_owned.rs:163:29
    |
 LL |     require_impl_as_ref_str(x.to_owned());
    |                             ^^^^^^^^^^^^ help: use: `&x`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:164:31
+  --> tests/ui/unnecessary_to_owned.rs:165:31
    |
 LL |     require_impl_as_ref_slice(array.to_owned());
    |                               ^^^^^^^^^^^^^^^^ help: use: `array`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:166:31
+  --> tests/ui/unnecessary_to_owned.rs:167:31
    |
 LL |     require_impl_as_ref_slice(array_ref.to_owned());
    |                               ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:168:31
+  --> tests/ui/unnecessary_to_owned.rs:169:31
    |
 LL |     require_impl_as_ref_slice(slice.to_owned());
    |                               ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:171:30
+  --> tests/ui/unnecessary_to_owned.rs:172:30
    |
 LL |     require_as_ref_str_slice(s.to_owned(), array.to_owned());
    |                              ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:171:44
+  --> tests/ui/unnecessary_to_owned.rs:172:44
    |
 LL |     require_as_ref_str_slice(s.to_owned(), array.to_owned());
    |                                            ^^^^^^^^^^^^^^^^ help: use: `array`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:174:30
+  --> tests/ui/unnecessary_to_owned.rs:175:30
    |
 LL |     require_as_ref_str_slice(s.to_owned(), array_ref.to_owned());
    |                              ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:174:44
+  --> tests/ui/unnecessary_to_owned.rs:175:44
    |
 LL |     require_as_ref_str_slice(s.to_owned(), array_ref.to_owned());
    |                                            ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:177:30
+  --> tests/ui/unnecessary_to_owned.rs:178:30
    |
 LL |     require_as_ref_str_slice(s.to_owned(), slice.to_owned());
    |                              ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:177:44
+  --> tests/ui/unnecessary_to_owned.rs:178:44
    |
 LL |     require_as_ref_str_slice(s.to_owned(), slice.to_owned());
    |                                            ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:180:30
+  --> tests/ui/unnecessary_to_owned.rs:181:30
    |
 LL |     require_as_ref_slice_str(array.to_owned(), s.to_owned());
    |                              ^^^^^^^^^^^^^^^^ help: use: `array`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:180:48
+  --> tests/ui/unnecessary_to_owned.rs:181:48
    |
 LL |     require_as_ref_slice_str(array.to_owned(), s.to_owned());
    |                                                ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:183:30
+  --> tests/ui/unnecessary_to_owned.rs:184:30
    |
 LL |     require_as_ref_slice_str(array_ref.to_owned(), s.to_owned());
    |                              ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:183:52
+  --> tests/ui/unnecessary_to_owned.rs:184:52
    |
 LL |     require_as_ref_slice_str(array_ref.to_owned(), s.to_owned());
    |                                                    ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:186:30
+  --> tests/ui/unnecessary_to_owned.rs:187:30
    |
 LL |     require_as_ref_slice_str(slice.to_owned(), s.to_owned());
    |                              ^^^^^^^^^^^^^^^^ help: use: `slice`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:186:48
+  --> tests/ui/unnecessary_to_owned.rs:187:48
    |
 LL |     require_as_ref_slice_str(slice.to_owned(), s.to_owned());
    |                                                ^^^^^^^^^^^^ help: use: `s`
 
 error: unnecessary use of `to_string`
-  --> tests/ui/unnecessary_to_owned.rs:190:20
+  --> tests/ui/unnecessary_to_owned.rs:191:20
    |
 LL |     let _ = x.join(&x_ref.to_string());
    |                    ^^^^^^^^^^^^^^^^^^ help: use: `x_ref`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:193:13
+  --> tests/ui/unnecessary_to_owned.rs:194:13
    |
 LL |     let _ = slice.to_vec().into_iter();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:195:13
+  --> tests/ui/unnecessary_to_owned.rs:196:13
    |
 LL |     let _ = slice.to_owned().into_iter();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:197:13
-   |
-LL |     let _ = [std::path::PathBuf::new()][..].to_vec().into_iter();
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
-
-error: unnecessary use of `to_owned`
   --> tests/ui/unnecessary_to_owned.rs:199:13
    |
-LL |     let _ = [std::path::PathBuf::new()][..].to_owned().into_iter();
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
-
-error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:202:13
-   |
 LL |     let _ = IntoIterator::into_iter(slice.to_vec());
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:204:13
+  --> tests/ui/unnecessary_to_owned.rs:201:13
    |
 LL |     let _ = IntoIterator::into_iter(slice.to_owned());
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
 
-error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:206:13
-   |
-LL |     let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_vec());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
-
-error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:208:13
-   |
-LL |     let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_owned());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
-
 error: allocating a new `String` only to create a temporary `&str` from it
-  --> tests/ui/unnecessary_to_owned.rs:236:26
+  --> tests/ui/unnecessary_to_owned.rs:229:26
    |
 LL |     let _ref_str: &str = &String::from_utf8(slice.to_vec()).expect("not UTF-8");
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -490,7 +466,7 @@ LL +     let _ref_str: &str = core::str::from_utf8(&slice).expect("not UTF-8");
    |
 
 error: allocating a new `String` only to create a temporary `&str` from it
-  --> tests/ui/unnecessary_to_owned.rs:238:26
+  --> tests/ui/unnecessary_to_owned.rs:231:26
    |
 LL |     let _ref_str: &str = &String::from_utf8(b"foo".to_vec()).unwrap();
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -502,7 +478,7 @@ LL +     let _ref_str: &str = core::str::from_utf8(b"foo").unwrap();
    |
 
 error: allocating a new `String` only to create a temporary `&str` from it
-  --> tests/ui/unnecessary_to_owned.rs:240:26
+  --> tests/ui/unnecessary_to_owned.rs:233:26
    |
 LL |     let _ref_str: &str = &String::from_utf8(b"foo".as_slice().to_owned()).unwrap();
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -514,7 +490,7 @@ LL +     let _ref_str: &str = core::str::from_utf8(b"foo".as_slice()).unwrap();
    |
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:298:14
+  --> tests/ui/unnecessary_to_owned.rs:291:14
    |
 LL |     for t in file_types.to_vec() {
    |              ^^^^^^^^^^^^^^^^^^^
@@ -526,65 +502,53 @@ LL |
 LL ~         let path = match get_file_path(t) {
    |
 
-error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:322:14
-   |
-LL |     let _ = &["x"][..].to_vec().into_iter();
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().cloned()`
-
-error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:328:14
-   |
-LL |     let _ = &["x"][..].to_vec().into_iter();
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().copied()`
-
 error: unnecessary use of `to_string`
-  --> tests/ui/unnecessary_to_owned.rs:377:24
+  --> tests/ui/unnecessary_to_owned.rs:357:24
    |
 LL |         Box::new(build(y.to_string()))
    |                        ^^^^^^^^^^^^^ help: use: `y`
 
 error: unnecessary use of `to_string`
-  --> tests/ui/unnecessary_to_owned.rs:487:12
+  --> tests/ui/unnecessary_to_owned.rs:467:12
    |
 LL |         id("abc".to_string())
    |            ^^^^^^^^^^^^^^^^^ help: use: `"abc"`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:631:37
+  --> tests/ui/unnecessary_to_owned.rs:611:37
    |
 LL |         IntoFuture::into_future(foo([].to_vec(), &0));
    |                                     ^^^^^^^^^^^ help: use: `[]`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:642:18
+  --> tests/ui/unnecessary_to_owned.rs:622:18
    |
 LL |         s.remove(&a.to_vec());
    |                  ^^^^^^^^^^^ help: replace it with: `a`
 
 error: unnecessary use of `to_owned`
-  --> tests/ui/unnecessary_to_owned.rs:647:14
+  --> tests/ui/unnecessary_to_owned.rs:627:14
    |
 LL |     s.remove(&"b".to_owned());
    |              ^^^^^^^^^^^^^^^ help: replace it with: `"b"`
 
 error: unnecessary use of `to_string`
-  --> tests/ui/unnecessary_to_owned.rs:649:14
+  --> tests/ui/unnecessary_to_owned.rs:629:14
    |
 LL |     s.remove(&"b".to_string());
    |              ^^^^^^^^^^^^^^^^ help: replace it with: `"b"`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:655:14
+  --> tests/ui/unnecessary_to_owned.rs:635:14
    |
 LL |     s.remove(&["b"].to_vec());
    |              ^^^^^^^^^^^^^^^ help: replace it with: `["b"].as_slice()`
 
 error: unnecessary use of `to_vec`
-  --> tests/ui/unnecessary_to_owned.rs:657:14
+  --> tests/ui/unnecessary_to_owned.rs:637:14
    |
 LL |     s.remove(&(&["b"]).to_vec());
    |              ^^^^^^^^^^^^^^^^^^ help: replace it with: `(&["b"]).as_slice()`
 
-error: aborting due to 88 previous errors
+error: aborting due to 82 previous errors
 
diff --git a/tests/ui/unnecessary_wraps.stderr b/tests/ui/unnecessary_wraps.stderr
index 53fd8bd4414..ba562f5a50b 100644
--- a/tests/ui/unnecessary_wraps.stderr
+++ b/tests/ui/unnecessary_wraps.stderr
@@ -13,8 +13,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<i32> {
+LL + fn func1(a: bool, b: bool) -> i32 {
+   |
 help: ...and then change returning expressions
    |
 LL ~         return 42;
@@ -40,8 +41,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<i32> {
+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<i32> {
+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`
@@ -80,11 +84,13 @@ LL | | }
    |
 help: remove `Result` from the return type...
    |
-LL | fn func7() -> i32 {
-   |               ~~~
+LL - fn func7() -> Result<i32, ()> {
+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`
@@ -99,11 +105,13 @@ LL | |     }
    |
 help: remove `Option` from the return type...
    |
-LL |     fn func12() -> i32 {
-   |                    ~~~
+LL -     fn func12() -> Option<i32> {
+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
@@ -119,8 +127,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/tests/ui/unneeded_struct_pattern.fixed b/tests/ui/unneeded_struct_pattern.fixed
index 1fcaa29c51f..665ab98913b 100644
--- a/tests/ui/unneeded_struct_pattern.fixed
+++ b/tests/ui/unneeded_struct_pattern.fixed
@@ -2,8 +2,7 @@
 #![allow(
     clippy::manual_unwrap_or_default,
     clippy::manual_unwrap_or,
-    clippy::redundant_pattern_matching,
-    clippy::no_effect
+    clippy::redundant_pattern_matching
 )]
 #![warn(clippy::unneeded_struct_pattern)]
 
@@ -65,19 +64,30 @@ fn main() {
     match Custom::Init {
         Custom::HasFields { field: value } => value,
         Custom::HasBracketsNoFields {} => 0,
+        Custom::NoBrackets => 0,              //~ unneeded_struct_pattern
+        Custom::NoBracketsNonExhaustive => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match Custom::Init {
         Custom::HasFields { field: value } => value,
         Custom::HasBracketsNoFields { .. } => 0,
+        Custom::NoBrackets => 0,              //~ unneeded_struct_pattern
+        Custom::NoBracketsNonExhaustive => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
-    0;
-    //~^^^ match_single_binding
+    match Custom::Init {
+        Custom::NoBrackets if true => 0, //~ unneeded_struct_pattern
+        _ => 0,
+    };
 
-    0;
+    match Custom::Init {
+        Custom::NoBrackets | Custom::NoBracketsNonExhaustive => 0,
+        //~^ unneeded_struct_pattern
+        //~| unneeded_struct_pattern
+        _ => 0,
+    };
 
     if let Custom::HasFields { field: value } = Custom::Init {
         noop();
@@ -121,6 +131,7 @@ fn main() {
     let Custom::HasBracketsNoFields { .. } = Custom::Init else {
         panic!()
     };
+    let Custom::NoBrackets = Custom::Init else { panic!() }; //~ unneeded_struct_pattern
 
     let Custom::NoBrackets = Custom::Init else {
         //~^ unneeded_struct_pattern
@@ -138,6 +149,12 @@ fn main() {
     enum Refutable {
         Variant,
     }
+
+    fn pat_in_fn_param_1(Refutable::Variant: Refutable) {} //~ unneeded_struct_pattern
+    fn pat_in_fn_param_2(Refutable::Variant: Refutable) {} //~ unneeded_struct_pattern
+
+    for Refutable::Variant in [] {} //~ unneeded_struct_pattern
+    for Refutable::Variant in [] {} //~ unneeded_struct_pattern
 }
 
 fn external_crate() {
@@ -149,9 +166,17 @@ fn external_crate() {
         _ => 0,
     };
 
-    0;
+    match ExhaustiveUnit {
+        // Exhaustive variant
+        ExhaustiveUnit => 0, //~ unneeded_struct_pattern
+        _ => 0,
+    };
 
-    0;
+    match ExhaustiveUnit {
+        // Exhaustive variant
+        ExhaustiveUnit => 0, //~ unneeded_struct_pattern
+        _ => 0,
+    };
 
     match ExhaustiveUnit {
         ExhaustiveUnit => 0,
diff --git a/tests/ui/unneeded_struct_pattern.rs b/tests/ui/unneeded_struct_pattern.rs
index e51311afd5f..7cadb6c7fbb 100644
--- a/tests/ui/unneeded_struct_pattern.rs
+++ b/tests/ui/unneeded_struct_pattern.rs
@@ -2,8 +2,7 @@
 #![allow(
     clippy::manual_unwrap_or_default,
     clippy::manual_unwrap_or,
-    clippy::redundant_pattern_matching,
-    clippy::no_effect
+    clippy::redundant_pattern_matching
 )]
 #![warn(clippy::unneeded_struct_pattern)]
 
@@ -65,22 +64,28 @@ fn main() {
     match Custom::Init {
         Custom::HasFields { field: value } => value,
         Custom::HasBracketsNoFields {} => 0,
+        Custom::NoBrackets {} => 0,              //~ unneeded_struct_pattern
+        Custom::NoBracketsNonExhaustive {} => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match Custom::Init {
         Custom::HasFields { field: value } => value,
         Custom::HasBracketsNoFields { .. } => 0,
+        Custom::NoBrackets { .. } => 0,              //~ unneeded_struct_pattern
+        Custom::NoBracketsNonExhaustive { .. } => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match Custom::Init {
+        Custom::NoBrackets {} if true => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
-    //~^^^ match_single_binding
 
     match Custom::Init {
-        //~^ match_single_binding
+        Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} => 0,
+        //~^ unneeded_struct_pattern
+        //~| unneeded_struct_pattern
         _ => 0,
     };
 
@@ -126,6 +131,7 @@ fn main() {
     let Custom::HasBracketsNoFields { .. } = Custom::Init else {
         panic!()
     };
+    let Custom::NoBrackets {} = Custom::Init else { panic!() }; //~ unneeded_struct_pattern
 
     let Custom::NoBrackets { .. } = Custom::Init else {
         //~^ unneeded_struct_pattern
@@ -143,6 +149,12 @@ fn main() {
     enum Refutable {
         Variant,
     }
+
+    fn pat_in_fn_param_1(Refutable::Variant {}: Refutable) {} //~ unneeded_struct_pattern
+    fn pat_in_fn_param_2(Refutable::Variant { .. }: Refutable) {} //~ unneeded_struct_pattern
+
+    for Refutable::Variant {} in [] {} //~ unneeded_struct_pattern
+    for Refutable::Variant { .. } in [] {} //~ unneeded_struct_pattern
 }
 
 fn external_crate() {
@@ -155,14 +167,14 @@ fn external_crate() {
     };
 
     match ExhaustiveUnit {
-        //~^ match_single_binding
         // Exhaustive variant
+        ExhaustiveUnit { .. } => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
     match ExhaustiveUnit {
-        //~^ match_single_binding
         // Exhaustive variant
+        ExhaustiveUnit {} => 0, //~ unneeded_struct_pattern
         _ => 0,
     };
 
diff --git a/tests/ui/unneeded_struct_pattern.stderr b/tests/ui/unneeded_struct_pattern.stderr
index 5630795823c..7c0c3c9e446 100644
--- a/tests/ui/unneeded_struct_pattern.stderr
+++ b/tests/ui/unneeded_struct_pattern.stderr
@@ -1,5 +1,5 @@
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:18:13
+  --> tests/ui/unneeded_struct_pattern.rs:17:13
    |
 LL |         None {} => 0,
    |             ^^^ help: remove the struct pattern
@@ -8,152 +8,196 @@ LL |         None {} => 0,
    = help: to override `-D warnings` add `#[allow(clippy::unneeded_struct_pattern)]`
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:24:13
+  --> tests/ui/unneeded_struct_pattern.rs:23:13
    |
 LL |         None { .. } => 0,
    |             ^^^^^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:35:18
+  --> tests/ui/unneeded_struct_pattern.rs:34:18
    |
 LL |         Some(None {}) => 0,
    |                  ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:37:13
+  --> tests/ui/unneeded_struct_pattern.rs:36:13
    |
 LL |         None {} => 0,
    |             ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:41:16
+  --> tests/ui/unneeded_struct_pattern.rs:40:16
    |
 LL |     if let None {} = Some(0) {}
    |                ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:43:16
+  --> tests/ui/unneeded_struct_pattern.rs:42:16
    |
 LL |     if let None { .. } = Some(0) {}
    |                ^^^^^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:45:21
+  --> tests/ui/unneeded_struct_pattern.rs:44:21
    |
 LL |     if let Some(None {}) = Some(Some(0)) {}
    |                     ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:47:13
+  --> tests/ui/unneeded_struct_pattern.rs:46:13
    |
 LL |     let None {} = Some(0) else { panic!() };
    |             ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:49:13
+  --> tests/ui/unneeded_struct_pattern.rs:48:13
    |
 LL |     let None { .. } = Some(0) else { panic!() };
    |             ^^^^^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:51:18
+  --> tests/ui/unneeded_struct_pattern.rs:50:18
    |
 LL |     let Some(None {}) = Some(Some(0)) else { panic!() };
    |                  ^^^ help: remove the struct pattern
 
-error: this match could be replaced by its body itself
-  --> tests/ui/unneeded_struct_pattern.rs:77:5
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:67:27
    |
-LL | /     match Custom::Init {
-LL | |         _ => 0,
-LL | |     };
-   | |_____^ help: consider using the match body instead: `0`
+LL |         Custom::NoBrackets {} => 0,
+   |                           ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:68:40
+   |
+LL |         Custom::NoBracketsNonExhaustive {} => 0,
+   |                                        ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:75:27
    |
-   = note: `-D clippy::match-single-binding` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::match_single_binding)]`
+LL |         Custom::NoBrackets { .. } => 0,
+   |                           ^^^^^^^ help: remove the struct pattern
 
-error: this match could be replaced by its body itself
-  --> tests/ui/unneeded_struct_pattern.rs:82:5
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:76:40
+   |
+LL |         Custom::NoBracketsNonExhaustive { .. } => 0,
+   |                                        ^^^^^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:81:27
+   |
+LL |         Custom::NoBrackets {} if true => 0,
+   |                           ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:86:27
+   |
+LL |         Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} => 0,
+   |                           ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:86:64
    |
-LL | /     match Custom::Init {
-LL | |
-LL | |         _ => 0,
-LL | |     };
-   | |_____^ help: consider using the match body instead: `0`
+LL |         Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} => 0,
+   |                                                                ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:96:30
+  --> tests/ui/unneeded_struct_pattern.rs:101:30
    |
 LL |     if let Custom::NoBrackets {} = Custom::Init {
    |                              ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:100:30
+  --> tests/ui/unneeded_struct_pattern.rs:105:30
    |
 LL |     if let Custom::NoBrackets { .. } = Custom::Init {
    |                              ^^^^^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:104:30
+  --> tests/ui/unneeded_struct_pattern.rs:109:30
    |
 LL |     if let Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} = Custom::Init {
    |                              ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:104:67
+  --> tests/ui/unneeded_struct_pattern.rs:109:67
    |
 LL |     if let Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} = Custom::Init {
    |                                                                   ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:109:43
+  --> tests/ui/unneeded_struct_pattern.rs:114:43
    |
 LL |     if let Custom::NoBracketsNonExhaustive {} = Custom::Init {
    |                                           ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:113:43
+  --> tests/ui/unneeded_struct_pattern.rs:118:43
    |
 LL |     if let Custom::NoBracketsNonExhaustive { .. } = Custom::Init {
    |                                           ^^^^^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:130:27
+  --> tests/ui/unneeded_struct_pattern.rs:134:27
+   |
+LL |     let Custom::NoBrackets {} = Custom::Init else { panic!() };
+   |                           ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:136:27
    |
 LL |     let Custom::NoBrackets { .. } = Custom::Init else {
    |                           ^^^^^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:134:40
+  --> tests/ui/unneeded_struct_pattern.rs:140:40
    |
 LL |     let Custom::NoBracketsNonExhaustive {} = Custom::Init else {
    |                                        ^^^ help: remove the struct pattern
 
 error: struct pattern is not needed for a unit variant
-  --> tests/ui/unneeded_struct_pattern.rs:138:40
+  --> tests/ui/unneeded_struct_pattern.rs:144:40
    |
 LL |     let Custom::NoBracketsNonExhaustive { .. } = Custom::Init else {
    |                                        ^^^^^^^ help: remove the struct pattern
 
-error: this match could be replaced by its body itself
-  --> tests/ui/unneeded_struct_pattern.rs:157:5
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:153:44
+   |
+LL |     fn pat_in_fn_param_1(Refutable::Variant {}: Refutable) {}
+   |                                            ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:154:44
+   |
+LL |     fn pat_in_fn_param_2(Refutable::Variant { .. }: Refutable) {}
+   |                                            ^^^^^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:156:27
    |
-LL | /     match ExhaustiveUnit {
-LL | |
-LL | |         // Exhaustive variant
-LL | |         _ => 0,
-LL | |     };
-   | |_____^ help: consider using the match body instead: `0`
+LL |     for Refutable::Variant {} in [] {}
+   |                           ^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:157:27
+   |
+LL |     for Refutable::Variant { .. } in [] {}
+   |                           ^^^^^^^ help: remove the struct pattern
 
-error: this match could be replaced by its body itself
-  --> tests/ui/unneeded_struct_pattern.rs:163:5
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:171:23
+   |
+LL |         ExhaustiveUnit { .. } => 0,
+   |                       ^^^^^^^ help: remove the struct pattern
+
+error: struct pattern is not needed for a unit variant
+  --> tests/ui/unneeded_struct_pattern.rs:177:23
    |
-LL | /     match ExhaustiveUnit {
-LL | |
-LL | |         // Exhaustive variant
-LL | |         _ => 0,
-LL | |     };
-   | |_____^ help: consider using the match body instead: `0`
+LL |         ExhaustiveUnit {} => 0,
+   |                       ^^^ help: remove the struct pattern
 
-error: aborting due to 23 previous errors
+error: aborting due to 33 previous errors
 
diff --git a/tests/ui/unnested_or_patterns.stderr b/tests/ui/unnested_or_patterns.stderr
index 3dfd34df4ef..ec5eb983c5a 100644
--- a/tests/ui/unnested_or_patterns.stderr
+++ b/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:18: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:21: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:23: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:25: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:27: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:29: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:31: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:33: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:35: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:37: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:39: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:42: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:44: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:46: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:52: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:64: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/tests/ui/unnested_or_patterns2.stderr b/tests/ui/unnested_or_patterns2.stderr
index 040bb46b084..3fc8fa174c9 100644
--- a/tests/ui/unnested_or_patterns2.stderr
+++ b/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:14: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:16: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:18: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:20: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:22: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:24: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:26: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/tests/ui/unused_enumerate_index.stderr b/tests/ui/unused_enumerate_index.stderr
index 9ea65631a5f..14d1d20a66e 100644
--- a/tests/ui/unused_enumerate_index.stderr
+++ b/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:60: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:65:39
diff --git a/tests/ui/unused_format_specs.stderr b/tests/ui/unused_format_specs.stderr
index 704e4987ec4..b07058fd568 100644
--- a/tests/ui/unused_format_specs.stderr
+++ b/tests/ui/unused_format_specs.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"));
@@ -66,8 +68,9 @@ LL |     usr_println!(true, "{:5}.", format_args!(""));
    |
 help: for the width to apply consider using `format!()`
    |
-LL |     usr_println!(true, "{:5}.", format!(""));
-   |                                 ~~~~~~
+LL -     usr_println!(true, "{:5}.", format_args!(""));
+LL +     usr_println!(true, "{:5}.", format!(""));
+   |
 help: if the current behavior is intentional, remove the format specifiers
    |
 LL -     usr_println!(true, "{:5}.", format_args!(""));
@@ -82,8 +85,9 @@ LL |     usr_println!(true, "{:.3}", format_args!("abcde"));
    |
 help: for the precision to apply consider using `format!()`
    |
-LL |     usr_println!(true, "{:.3}", format!("abcde"));
-   |                                 ~~~~~~
+LL -     usr_println!(true, "{:.3}", format_args!("abcde"));
+LL +     usr_println!(true, "{:.3}", format!("abcde"));
+   |
 help: if the current behavior is intentional, remove the format specifiers
    |
 LL -     usr_println!(true, "{:.3}", format_args!("abcde"));
diff --git a/tests/ui/unused_result_ok.stderr b/tests/ui/unused_result_ok.stderr
index e6fbd866651..0e134ba3ccb 100644
--- a/tests/ui/unused_result_ok.stderr
+++ b/tests/ui/unused_result_ok.stderr
@@ -8,8 +8,9 @@ LL |     x.parse::<u32>().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::<u32>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     x.parse::<u32>().ok();
+LL +     let _ = x.parse::<u32>();
+   |
 
 error: ignoring a result with `.ok()` is misleading
   --> tests/ui/unused_result_ok.rs:19:5
@@ -19,8 +20,9 @@ LL |     x   .   parse::<i32>()   .   ok   ();
    |
 help: consider using `let _ =` and removing the call to `.ok()` instead
    |
-LL |     let _ = x   .   parse::<i32>();
-   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL -     x   .   parse::<i32>()   .   ok   ();
+LL +     let _ = x   .   parse::<i32>();
+   |
 
 error: ignoring a result with `.ok()` is misleading
   --> tests/ui/unused_result_ok.rs:37: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:31: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/ui/useless_asref.fixed b/tests/ui/useless_asref.fixed
index e399bd76fc1..8c1f948fb58 100644
--- a/tests/ui/useless_asref.fixed
+++ b/tests/ui/useless_asref.fixed
@@ -8,6 +8,7 @@
 )]
 
 use std::fmt::Debug;
+use std::ops::Deref;
 use std::rc::{Rc, Weak as RcWeak};
 use std::sync::{Arc, Weak as ArcWeak};
 
@@ -218,6 +219,35 @@ fn issue_14088() {
     let _: Option<&str> = s.as_ref().map(|x| x.as_ref());
 }
 
+pub struct Wrap<T> {
+    inner: T,
+}
+
+impl<T> Deref for Wrap<T> {
+    type Target = T;
+
+    fn deref(&self) -> &Self::Target {
+        &self.inner
+    }
+}
+
+struct NonCloneableError;
+
+pub struct Issue12357 {
+    current: Option<Wrap<Arc<u32>>>,
+}
+
+impl Issue12357 {
+    fn f(&self) -> Option<Arc<u32>> {
+        self.current.as_ref().map(|p| Arc::clone(p))
+    }
+
+    fn g(&self) {
+        let result: Result<String, NonCloneableError> = Ok("Hello".to_string());
+        let cloned = result.as_ref().map(|s| s.clone());
+    }
+}
+
 fn main() {
     not_ok();
     ok();
diff --git a/tests/ui/useless_asref.rs b/tests/ui/useless_asref.rs
index 4c76a2ecf7b..d9db2d4f559 100644
--- a/tests/ui/useless_asref.rs
+++ b/tests/ui/useless_asref.rs
@@ -8,6 +8,7 @@
 )]
 
 use std::fmt::Debug;
+use std::ops::Deref;
 use std::rc::{Rc, Weak as RcWeak};
 use std::sync::{Arc, Weak as ArcWeak};
 
@@ -218,6 +219,35 @@ fn issue_14088() {
     let _: Option<&str> = s.as_ref().map(|x| x.as_ref());
 }
 
+pub struct Wrap<T> {
+    inner: T,
+}
+
+impl<T> Deref for Wrap<T> {
+    type Target = T;
+
+    fn deref(&self) -> &Self::Target {
+        &self.inner
+    }
+}
+
+struct NonCloneableError;
+
+pub struct Issue12357 {
+    current: Option<Wrap<Arc<u32>>>,
+}
+
+impl Issue12357 {
+    fn f(&self) -> Option<Arc<u32>> {
+        self.current.as_ref().map(|p| Arc::clone(p))
+    }
+
+    fn g(&self) {
+        let result: Result<String, NonCloneableError> = Ok("Hello".to_string());
+        let cloned = result.as_ref().map(|s| s.clone());
+    }
+}
+
 fn main() {
     not_ok();
     ok();
diff --git a/tests/ui/useless_asref.stderr b/tests/ui/useless_asref.stderr
index d0ca10936fd..8255f5d9d2a 100644
--- a/tests/ui/useless_asref.stderr
+++ b/tests/ui/useless_asref.stderr
@@ -1,5 +1,5 @@
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:50:18
+  --> tests/ui/useless_asref.rs:51:18
    |
 LL |         foo_rstr(rstr.as_ref());
    |                  ^^^^^^^^^^^^^ help: try: `rstr`
@@ -11,103 +11,103 @@ LL | #![deny(clippy::useless_asref)]
    |         ^^^^^^^^^^^^^^^^^^^^^
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:53:20
+  --> tests/ui/useless_asref.rs:54:20
    |
 LL |         foo_rslice(rslice.as_ref());
    |                    ^^^^^^^^^^^^^^^ help: try: `rslice`
 
 error: this call to `as_mut` does nothing
-  --> tests/ui/useless_asref.rs:58:21
+  --> tests/ui/useless_asref.rs:59:21
    |
 LL |         foo_mrslice(mrslice.as_mut());
    |                     ^^^^^^^^^^^^^^^^ help: try: `mrslice`
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:61:20
+  --> tests/ui/useless_asref.rs:62:20
    |
 LL |         foo_rslice(mrslice.as_ref());
    |                    ^^^^^^^^^^^^^^^^ help: try: `mrslice`
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:69:20
+  --> tests/ui/useless_asref.rs:70:20
    |
 LL |         foo_rslice(rrrrrslice.as_ref());
    |                    ^^^^^^^^^^^^^^^^^^^ help: try: `rrrrrslice`
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:72:18
+  --> tests/ui/useless_asref.rs:73:18
    |
 LL |         foo_rstr(rrrrrstr.as_ref());
    |                  ^^^^^^^^^^^^^^^^^ help: try: `rrrrrstr`
 
 error: this call to `as_mut` does nothing
-  --> tests/ui/useless_asref.rs:78:21
+  --> tests/ui/useless_asref.rs:79:21
    |
 LL |         foo_mrslice(mrrrrrslice.as_mut());
    |                     ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:81:20
+  --> tests/ui/useless_asref.rs:82:20
    |
 LL |         foo_rslice(mrrrrrslice.as_ref());
    |                    ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:86:16
+  --> tests/ui/useless_asref.rs:87:16
    |
 LL |     foo_rrrrmr((&&&&MoreRef).as_ref());
    |                ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&&&&MoreRef)`
 
 error: this call to `as_mut` does nothing
-  --> tests/ui/useless_asref.rs:137:13
+  --> tests/ui/useless_asref.rs:138:13
    |
 LL |     foo_mrt(mrt.as_mut());
    |             ^^^^^^^^^^^^ help: try: `mrt`
 
 error: this call to `as_ref` does nothing
-  --> tests/ui/useless_asref.rs:140:12
+  --> tests/ui/useless_asref.rs:141:12
    |
 LL |     foo_rt(mrt.as_ref());
    |            ^^^^^^^^^^^^ help: try: `mrt`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:152:13
+  --> tests/ui/useless_asref.rs:153:13
    |
 LL |     let z = x.as_ref().map(String::clone);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:155:13
+  --> tests/ui/useless_asref.rs:156:13
    |
 LL |     let z = x.as_ref().map(|z| z.clone());
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:158:13
+  --> tests/ui/useless_asref.rs:159:13
    |
 LL |     let z = x.as_ref().map(|z| String::clone(z));
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.clone()`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:182:9
+  --> tests/ui/useless_asref.rs:183:9
    |
 LL |         x.field.as_ref().map(|v| v.clone());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.field.clone()`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:185:9
+  --> tests/ui/useless_asref.rs:186:9
    |
 LL |         x.field.as_ref().map(Clone::clone);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.field.clone()`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:188:9
+  --> tests/ui/useless_asref.rs:189:9
    |
 LL |         x.field.as_ref().map(|v| Clone::clone(v));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.field.clone()`
 
 error: this call to `as_ref.map(...)` does nothing
-  --> tests/ui/useless_asref.rs:193:9
+  --> tests/ui/useless_asref.rs:194:9
    |
 LL |         Some(1).as_ref().map(|&x| x.clone());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(1).clone()`