about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-26 17:32:51 +0000
committerbors <bors@rust-lang.org>2023-06-26 17:32:51 +0000
commit15ed281699802aae2364b77a4e9900a9acad3d0d (patch)
treeb254dc3fbe51fef375f2dd050424b9acd9a2801f
parent2a9cc31ac70c4a28781f5e715ab2316fcdbba14f (diff)
parent0a87ce866244dd3d23270f438819d5418f736262 (diff)
downloadrust-15ed281699802aae2364b77a4e9900a9acad3d0d.tar.gz
rust-15ed281699802aae2364b77a4e9900a9acad3d0d.zip
Auto merge of #10426 - oli-obk:ui_test, r=Manishearth
Port clippy away from compiletest to ui_test

Reasons to do this:

* runs completely on stable Rust
* is easier to extend with new features
* has its own dogfood test suite, so changes can be tested in [the `ui_test` repo](https://github.com/oli-obk/ui_test)
* supports dependencies from crates.io without having to manually fiddle with command line flags
* supports `ui-cargo`, `ui`, `ui-toml` out of the box, no need to find and run the tests ourselves

One thing that is a big difference to `compiletest` is that if a test emits *any* error, you need to mark all of them with `//~ ERROR:` annotations. Since many clippy tests did not have annotations, I changed many lints to be `warn` in their test so that only the `stderr` output is tested.

TODO:

* [ ] check that this still works as a subtree in the rustc repo

changelog: none
<!-- changelog_checked -->

Note: at present the latest changes needed for clippy are only available as a git dependency, but I expect to publish a new crates.io version soon
-rw-r--r--.cargo/config.toml2
-rw-r--r--Cargo.toml19
-rw-r--r--book/src/development/adding_lints.md17
-rw-r--r--book/src/development/basics.md2
-rw-r--r--clippy_dev/src/bless.rs60
-rw-r--r--clippy_dev/src/lib.rs1
-rw-r--r--clippy_dev/src/main.rs6
-rw-r--r--clippy_dev/src/new_lint.rs2
-rw-r--r--clippy_test_deps/Cargo.toml25
-rw-r--r--clippy_test_deps/src/lib.rs14
-rw-r--r--clippy_utils/src/lib.rs6
-rw-r--r--tests/compile-test.rs439
-rw-r--r--tests/missing-test-files.rs6
-rw-r--r--tests/ui-cargo/cargo_common_metadata/fail/Cargo.stderr (renamed from tests/ui-cargo/cargo_common_metadata/fail/src/main.stderr)7
-rw-r--r--tests/ui-cargo/cargo_common_metadata/fail_publish/Cargo.stderr (renamed from tests/ui-cargo/cargo_common_metadata/fail_publish/src/main.stderr)7
-rw-r--r--tests/ui-cargo/cargo_common_metadata/fail_publish_true/Cargo.stderr (renamed from tests/ui-cargo/cargo_common_metadata/fail_publish_true/src/main.stderr)7
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.stderr21
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.stderr22
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.stderr19
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.stderr20
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.stderr19
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_cargo/src/main.stderr20
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.stderr19
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_clippy/src/main.stderr20
-rw-r--r--tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.stderr (renamed from tests/ui-cargo/cargo_rust_version/fail_file_attr/src/main.stderr)15
-rw-r--r--tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.stderr (renamed from tests/ui-cargo/cargo_rust_version/warn_both_diff/src/main.stderr)2
-rw-r--r--tests/ui-cargo/duplicate_mod/fail/Cargo.stderr52
-rw-r--r--tests/ui-cargo/duplicate_mod/fail/src/main.stderr53
-rw-r--r--tests/ui-cargo/feature_name/fail/Cargo.stderr43
-rw-r--r--tests/ui-cargo/feature_name/fail/src/main.stderr44
-rw-r--r--tests/ui-cargo/module_style/fail_mod/Cargo.stderr18
-rw-r--r--tests/ui-cargo/module_style/fail_mod/src/main.stderr19
-rw-r--r--tests/ui-cargo/module_style/fail_mod_remap/Cargo.stderr10
-rw-r--r--tests/ui-cargo/module_style/fail_mod_remap/src/main.stderr11
-rw-r--r--tests/ui-cargo/module_style/fail_no_mod/Cargo.stderr10
-rw-r--r--tests/ui-cargo/module_style/fail_no_mod/src/main.stderr11
-rw-r--r--tests/ui-cargo/multiple_config_files/warn/Cargo.stderr2
-rw-r--r--tests/ui-cargo/multiple_config_files/warn/src/main.stderr4
-rw-r--r--tests/ui-cargo/multiple_crate_versions/fail/Cargo.stderr5
-rw-r--r--tests/ui-cargo/multiple_crate_versions/fail/src/main.stderr6
-rwxr-xr-xtests/ui-cargo/update-all-references.sh2
-rw-r--r--tests/ui-cargo/wildcard_dependencies/fail/Cargo.stderr5
-rw-r--r--tests/ui-cargo/wildcard_dependencies/fail/src/main.stderr6
-rw-r--r--tests/ui-internal/custom_ice_message.stderr2
-rw-r--r--tests/ui-toml/bad_toml/conf_bad_toml.rs2
-rw-r--r--tests/ui-toml/bad_toml/conf_bad_toml.stderr2
-rw-r--r--tests/ui-toml/bad_toml_type/conf_bad_type.rs2
-rw-r--r--tests/ui-toml/bad_toml_type/conf_bad_type.stderr2
-rw-r--r--tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr4
-rw-r--r--tests/ui-toml/duplicated_keys/duplicated_keys.rs2
-rw-r--r--tests/ui-toml/duplicated_keys/duplicated_keys.stderr2
-rw-r--r--tests/ui-toml/duplicated_keys_deprecated/duplicated_keys.stderr4
-rw-r--r--tests/ui-toml/duplicated_keys_deprecated_2/duplicated_keys.stderr4
-rw-r--r--tests/ui-toml/excessive_nesting/auxiliary/proc_macros.rs4
-rw-r--r--tests/ui-toml/excessive_nesting/excessive_nesting.rs2
-rw-r--r--tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.rs2
-rw-r--r--tests/ui-toml/lint_decimal_readability/test.rs2
-rw-r--r--tests/ui-toml/lint_decimal_readability/test.stderr10
-rw-r--r--tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs1
-rw-r--r--tests/ui-toml/min_rust_version/min_rust_version.rs4
-rw-r--r--tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs5
-rw-r--r--tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed2
-rw-r--r--tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs2
-rw-r--r--tests/ui-toml/suppress_lint_in_const/test.rs3
-rw-r--r--tests/ui-toml/suppress_lint_in_const/test.stderr16
-rw-r--r--tests/ui-toml/toml_trivially_copy/test.rs2
-rw-r--r--tests/ui-toml/toml_trivially_copy/test.stderr6
-rw-r--r--tests/ui-toml/toml_unknown_key/conf_unknown_key.rs2
-rw-r--r--tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr4
-rw-r--r--tests/ui-toml/undocumented_unsafe_blocks/auxiliary/proc_macro_unsafe.rs5
-rw-r--r--tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs2
-rw-r--r--tests/ui-toml/unwrap_used/unwrap_used.rs2
-rw-r--r--tests/ui-toml/unwrap_used/unwrap_used.stderr6
-rwxr-xr-xtests/ui-toml/update-all-references.sh2
-rw-r--r--tests/ui/allow_attributes.fixed2
-rw-r--r--tests/ui/allow_attributes.rs2
-rw-r--r--tests/ui/allow_attributes_without_reason.rs2
-rw-r--r--tests/ui/almost_complete_range.fixed2
-rw-r--r--tests/ui/almost_complete_range.rs2
-rw-r--r--tests/ui/arithmetic_side_effects.rs2
-rw-r--r--tests/ui/as_conversions.rs2
-rw-r--r--tests/ui/asm_syntax.rs4
-rw-r--r--tests/ui/auxiliary/macro_use_helper.rs2
-rw-r--r--tests/ui/auxiliary/proc_macro_attr.rs4
-rw-r--r--tests/ui/auxiliary/proc_macro_derive.rs4
-rw-r--r--tests/ui/auxiliary/proc_macro_suspicious_else_formatting.rs5
-rw-r--r--tests/ui/auxiliary/proc_macro_unsafe.rs5
-rw-r--r--tests/ui/auxiliary/proc_macros.rs4
-rw-r--r--tests/ui/borrow_deref_ref.fixed2
-rw-r--r--tests/ui/borrow_deref_ref.rs2
-rw-r--r--tests/ui/borrow_interior_mutable_const/enums.rs26
-rw-r--r--tests/ui/borrow_interior_mutable_const/enums.stderr24
-rw-r--r--tests/ui/borrow_interior_mutable_const/others.rs30
-rw-r--r--tests/ui/borrow_interior_mutable_const/others.stderr34
-rw-r--r--tests/ui/borrow_interior_mutable_const/traits.rs32
-rw-r--r--tests/ui/borrow_interior_mutable_const/traits.stderr36
-rw-r--r--tests/ui/builtin_type_shadow.rs2
-rw-r--r--tests/ui/cmp_owned/with_suggestion.fixed2
-rw-r--r--tests/ui/cognitive_complexity.stderr10
-rw-r--r--tests/ui/crashes/auxiliary/proc_macro_crash.rs8
-rw-r--r--tests/ui/crashes/ice-10148.rs2
-rw-r--r--tests/ui/crashes/ice-3741.rs2
-rw-r--r--tests/ui/crashes/ice-5497.rs2
-rw-r--r--tests/ui/crashes/ice-6250.stderr11
-rw-r--r--tests/ui/crashes/ice-6251.stderr10
-rw-r--r--tests/ui/crashes/ice-6255.rs2
-rw-r--r--tests/ui/crashes/ice-6256.rs4
-rw-r--r--tests/ui/crashes/ice-6256.stderr2
-rw-r--r--tests/ui/crashes/ice-7410.rs4
-rw-r--r--tests/ui/crashes/ice-96721.rs2
-rw-r--r--tests/ui/crashes/ice-96721.stderr2
-rw-r--r--tests/ui/crate_level_checks/entrypoint_recursion.rs2
-rw-r--r--tests/ui/crate_level_checks/entrypoint_recursion.stderr11
-rw-r--r--tests/ui/crate_level_checks/no_std_main_recursion.rs2
-rw-r--r--tests/ui/dbg_macro.rs1
-rw-r--r--tests/ui/dbg_macro.stderr36
-rw-r--r--tests/ui/declare_interior_mutable_const/enums.rs27
-rw-r--r--tests/ui/declare_interior_mutable_const/enums.stderr43
-rw-r--r--tests/ui/declare_interior_mutable_const/others.rs16
-rw-r--r--tests/ui/declare_interior_mutable_const/others.stderr8
-rw-r--r--tests/ui/declare_interior_mutable_const/traits.rs22
-rw-r--r--tests/ui/declare_interior_mutable_const/traits.stderr22
-rw-r--r--tests/ui/def_id_nocore.rs2
-rw-r--r--tests/ui/default_numeric_fallback_f64.fixed2
-rw-r--r--tests/ui/default_numeric_fallback_f64.rs2
-rw-r--r--tests/ui/default_numeric_fallback_i32.fixed2
-rw-r--r--tests/ui/default_numeric_fallback_i32.rs2
-rw-r--r--tests/ui/default_trait_access.fixed2
-rw-r--r--tests/ui/default_trait_access.rs2
-rw-r--r--tests/ui/deref_addrof.fixed2
-rw-r--r--tests/ui/deref_addrof.rs2
-rw-r--r--tests/ui/deref_addrof_macro.rs2
-rw-r--r--tests/ui/doc_unsafe.rs2
-rw-r--r--tests/ui/else_if_without_else.rs4
-rw-r--r--tests/ui/else_if_without_else.stderr4
-rw-r--r--tests/ui/empty_line_after_doc_comments.rs2
-rw-r--r--tests/ui/empty_line_after_outer_attribute.rs2
-rw-r--r--tests/ui/empty_loop.rs2
-rw-r--r--tests/ui/empty_loop_no_std.rs2
-rw-r--r--tests/ui/enum_clike_unportable_variant.rs2
-rw-r--r--tests/ui/eprint_with_newline.rs2
-rw-r--r--tests/ui/eprint_with_newline.stderr12
-rw-r--r--tests/ui/eq_op.rs2
-rw-r--r--tests/ui/eq_op.stderr56
-rw-r--r--tests/ui/equatable_if_let.fixed2
-rw-r--r--tests/ui/equatable_if_let.rs2
-rw-r--r--tests/ui/extra_unused_lifetimes.rs2
-rw-r--r--tests/ui/extra_unused_type_parameters.fixed2
-rw-r--r--tests/ui/extra_unused_type_parameters.rs2
-rw-r--r--tests/ui/field_reassign_with_default.rs4
-rw-r--r--tests/ui/get_unwrap.fixed6
-rw-r--r--tests/ui/get_unwrap.rs6
-rw-r--r--tests/ui/get_unwrap.stderr6
-rw-r--r--tests/ui/if_same_then_else.rs10
-rw-r--r--tests/ui/if_same_then_else.stderr24
-rw-r--r--tests/ui/if_same_then_else2.rs11
-rw-r--r--tests/ui/if_same_then_else2.stderr25
-rw-r--r--tests/ui/ifs_same_cond.rs7
-rw-r--r--tests/ui/implicit_hasher.rs2
-rw-r--r--tests/ui/inconsistent_struct_constructor.fixed2
-rw-r--r--tests/ui/inconsistent_struct_constructor.rs2
-rw-r--r--tests/ui/into_iter_on_ref.fixed54
-rw-r--r--tests/ui/into_iter_on_ref.rs54
-rw-r--r--tests/ui/into_iter_on_ref.stderr54
-rw-r--r--tests/ui/issue-3145.rs2
-rw-r--r--tests/ui/issue-3145.stderr2
-rw-r--r--tests/ui/items_after_test_module/block_module.stderr17
-rw-r--r--tests/ui/large_enum_variant.rs2
-rw-r--r--tests/ui/let_underscore_untyped.rs2
-rw-r--r--tests/ui/let_with_type_underscore.rs2
-rw-r--r--tests/ui/macro_use_imports.fixed2
-rw-r--r--tests/ui/macro_use_imports.rs2
-rw-r--r--tests/ui/macro_use_imports.stderr16
-rw-r--r--tests/ui/macro_use_imports_expect.rs2
-rw-r--r--tests/ui/manual_rem_euclid.fixed2
-rw-r--r--tests/ui/manual_rem_euclid.rs2
-rw-r--r--tests/ui/manual_slice_size_calculation.fixed2
-rw-r--r--tests/ui/manual_slice_size_calculation.rs2
-rw-r--r--tests/ui/match_same_arms.rs20
-rw-r--r--tests/ui/match_same_arms.stderr24
-rw-r--r--tests/ui/match_same_arms2.rs23
-rw-r--r--tests/ui/match_same_arms2.stderr33
-rw-r--r--tests/ui/mem_replace_macro.rs2
-rw-r--r--tests/ui/min_ident_chars.rs2
-rw-r--r--tests/ui/missing_assert_message.rs11
-rw-r--r--tests/ui/missing_assert_message.stderr32
-rw-r--r--tests/ui/missing_const_for_fn/cant_be_const.rs3
-rw-r--r--tests/ui/missing_doc.rs2
-rw-r--r--tests/ui/missing_doc_impl.rs2
-rw-r--r--tests/ui/missing_inline_proc_macro.rs1
-rw-r--r--tests/ui/mistyped_literal_suffix.fixed2
-rw-r--r--tests/ui/mistyped_literal_suffix.rs2
-rw-r--r--tests/ui/multiple_unsafe_ops_per_block.rs2
-rw-r--r--tests/ui/must_use_unit.fixed2
-rw-r--r--tests/ui/must_use_unit.rs2
-rw-r--r--tests/ui/mut_mut.rs2
-rw-r--r--tests/ui/needless_arbitrary_self_type_unfixable.rs2
-rw-r--r--tests/ui/needless_if.fixed2
-rw-r--r--tests/ui/needless_if.rs2
-rw-r--r--tests/ui/needless_late_init.fixed2
-rw-r--r--tests/ui/needless_late_init.rs2
-rw-r--r--tests/ui/needless_lifetimes.fixed2
-rw-r--r--tests/ui/needless_lifetimes.rs2
-rw-r--r--tests/ui/needless_pass_by_value_proc_macro.rs1
-rw-r--r--tests/ui/non_expressive_names.rs12
-rw-r--r--tests/ui/non_expressive_names.stderr6
-rw-r--r--tests/ui/non_octal_unix_permissions.fixed2
-rw-r--r--tests/ui/non_octal_unix_permissions.rs2
-rw-r--r--tests/ui/octal_escapes.stderr6
-rw-r--r--tests/ui/option_env_unwrap.rs2
-rw-r--r--tests/ui/print_with_newline.fixed58
-rw-r--r--tests/ui/print_with_newline.rs2
-rw-r--r--tests/ui/print_with_newline.stderr12
-rw-r--r--tests/ui/proc_macro.rs1
-rw-r--r--tests/ui/proc_macro.stderr2
-rw-r--r--tests/ui/ptr_as_ptr.fixed2
-rw-r--r--tests/ui/ptr_as_ptr.rs2
-rw-r--r--tests/ui/ptr_cast_constness.fixed2
-rw-r--r--tests/ui/ptr_cast_constness.rs2
-rw-r--r--tests/ui/redundant_pub_crate.fixed8
-rw-r--r--tests/ui/redundant_pub_crate.rs8
-rw-r--r--tests/ui/redundant_static_lifetimes.fixed22
-rw-r--r--tests/ui/redundant_static_lifetimes.rs22
-rw-r--r--tests/ui/redundant_static_lifetimes.stderr24
-rw-r--r--tests/ui/redundant_static_lifetimes_multiple.rs6
-rw-r--r--tests/ui/redundant_static_lifetimes_multiple.stderr12
-rw-r--r--tests/ui/regex.stderr4
-rw-r--r--tests/ui/same_functions_in_if_condition.rs12
-rw-r--r--tests/ui/same_functions_in_if_condition.stderr4
-rw-r--r--tests/ui/shadow.rs2
-rw-r--r--tests/ui/significant_drop_in_scrutinee.fixed627
-rw-r--r--tests/ui/single_call_fn.rs3
-rw-r--r--tests/ui/single_call_fn.stderr16
-rw-r--r--tests/ui/single_char_pattern.stderr4
-rw-r--r--tests/ui/single_match_else.fixed2
-rw-r--r--tests/ui/single_match_else.rs2
-rw-r--r--tests/ui/single_range_in_vec_init.rs6
-rw-r--r--tests/ui/string_add.rs2
-rw-r--r--tests/ui/suspicious_else_formatting.rs2
-rw-r--r--tests/ui/tests_outside_test_module.rs1
-rw-r--r--tests/ui/tests_outside_test_module.stderr2
-rw-r--r--tests/ui/toplevel_ref_arg.fixed2
-rw-r--r--tests/ui/toplevel_ref_arg.rs2
-rw-r--r--tests/ui/toplevel_ref_arg_non_rustfix.rs2
-rw-r--r--tests/ui/transmute_ptr_to_ptr.rs2
-rw-r--r--tests/ui/try_err.fixed2
-rw-r--r--tests/ui/try_err.rs2
-rw-r--r--tests/ui/undocumented_unsafe_blocks.rs2
-rw-r--r--tests/ui/unicode.fixed1
-rw-r--r--tests/ui/unicode.rs1
-rw-r--r--tests/ui/unicode.stderr20
-rw-r--r--tests/ui/uninlined_format_args.fixed2
-rw-r--r--tests/ui/uninlined_format_args.rs2
-rw-r--r--tests/ui/unit_arg.rs2
-rw-r--r--tests/ui/unnecessary_lazy_eval.fixed2
-rw-r--r--tests/ui/unnecessary_lazy_eval.rs2
-rw-r--r--tests/ui/unnecessary_unsafety_doc.rs2
-rw-r--r--tests/ui/unseparated_prefix_literals.fixed2
-rw-r--r--tests/ui/unseparated_prefix_literals.rs2
-rwxr-xr-xtests/ui/update-all-references.sh2
-rw-r--r--tests/ui/use_self.fixed2
-rw-r--r--tests/ui/use_self.rs2
-rw-r--r--tests/ui/used_underscore_binding.rs2
-rw-r--r--tests/ui/useless_attribute.fixed2
-rw-r--r--tests/ui/useless_attribute.rs2
-rw-r--r--tests/ui/wildcard_imports.fixed2
-rw-r--r--tests/ui/wildcard_imports.rs2
-rw-r--r--tests/ui/wildcard_imports.stderr4
-rw-r--r--tests/ui/write_literal_2.stderr22
-rw-r--r--tests/ui/write_with_newline.fixed63
-rw-r--r--tests/ui/write_with_newline.stderr12
-rw-r--r--util/etc/vscode-tasks.json4
272 files changed, 1945 insertions, 1451 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 4d80d3ce63d..48a63e48568 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,5 +1,7 @@
 [alias]
 uitest = "test --test compile-test"
+uibless = "test --test compile-test -- -- --bless"
+bless = "test -- -- --bless"
 dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
 lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml  -- "
 collect-metadata = "test --test dogfood --features internal -- run_metadata_collection_lint --ignored"
diff --git a/Cargo.toml b/Cargo.toml
index ca8bf9fac91..76c804f935e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,27 +27,14 @@ tempfile = { version = "3.2", optional = true }
 termize = "0.1"
 
 [dev-dependencies]
-compiletest_rs = { version = "0.10", features = ["tmp"] }
+ui_test = "0.11.5"
 tester = "0.9"
 regex = "1.5"
 toml = "0.7.3"
 walkdir = "2.3"
 # This is used by the `collect-metadata` alias.
 filetime = "0.2"
-
-# UI test dependencies
-clap = { version = "4.1.4", features = ["derive"] }
-clippy_utils = { path = "clippy_utils" }
-derive-new = "0.5"
-if_chain = "1.0"
 itertools = "0.10.1"
-quote = "1.0"
-serde = { version = "1.0.125", features = ["derive"] }
-syn = { version = "2.0", features = ["full"] }
-futures = "0.3"
-parking_lot = "0.12"
-tokio = { version = "1", features = ["io-util"] }
-rustc-semver = "1.1"
 
 [build-dependencies]
 rustc_tools_util = "0.3.0"
@@ -60,3 +47,7 @@ internal = ["clippy_lints/internal", "tempfile"]
 [package.metadata.rust-analyzer]
 # This package uses #[feature(rustc_private)]
 rustc_private = true
+
+[[test]]
+name = "compile-test"
+harness = false
diff --git a/book/src/development/adding_lints.md b/book/src/development/adding_lints.md
index c26aa883eba..cfcb060c46e 100644
--- a/book/src/development/adding_lints.md
+++ b/book/src/development/adding_lints.md
@@ -122,20 +122,17 @@ fn main() {
 }
 ```
 
-Now we can run the test with `TESTNAME=foo_functions cargo uitest`, currently
+Now we can run the test with `TESTNAME=foo_functions cargo uibless`, currently
 this test is meaningless though.
 
 While we are working on implementing our lint, we can keep running the UI test.
-That allows us to check if the output is turning into what we want.
+That allows us to check if the output is turning into what we want by checking the
+`.stderr` file that gets updated on every test run.
 
-Once we are satisfied with the output, we need to run `cargo dev bless` to
-update the `.stderr` file for our lint. Please note that, we should run
-`TESTNAME=foo_functions cargo uitest` every time before running `cargo dev
-bless`. Running `TESTNAME=foo_functions cargo uitest` should pass then. When we
+Running `TESTNAME=foo_functions cargo uitest` should pass on its own. When we
 commit our lint, we need to commit the generated `.stderr` files, too. In
-general, you should only commit files changed by `cargo dev bless` for the
-specific lint you are creating/editing. Note that if the generated files are
-empty, they should be removed.
+general, you should only commit files changed by `cargo bless` for the
+specific lint you are creating/editing.
 
 > _Note:_ you can run multiple test files by specifying a comma separated list:
 > `TESTNAME=foo_functions,test2,test3`.
@@ -169,7 +166,7 @@ additionally run [rustfix] for that test. Rustfix will apply the suggestions
 from the lint to the code of the test file and compare that to the contents of a
 `.fixed` file.
 
-Use `cargo dev bless` to automatically generate the `.fixed` file after running
+Use `cargo bless` to automatically generate the `.fixed` file while running
 the tests.
 
 [rustfix]: https://github.com/rust-lang/rustfix
diff --git a/book/src/development/basics.md b/book/src/development/basics.md
index 7615dc12f9e..f4c109ff119 100644
--- a/book/src/development/basics.md
+++ b/book/src/development/basics.md
@@ -66,7 +66,7 @@ If the output of a [UI test] differs from the expected output, you can update
 the reference file with:
 
 ```bash
-cargo dev bless
+cargo bless
 ```
 
 For example, this is necessary if you fix a typo in an error message of a lint,
diff --git a/clippy_dev/src/bless.rs b/clippy_dev/src/bless.rs
deleted file mode 100644
index 92b2771f3fe..00000000000
--- a/clippy_dev/src/bless.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-//! `bless` updates the reference files in the repo with changed output files
-//! from the last test run.
-
-use crate::cargo_clippy_path;
-use std::ffi::OsStr;
-use std::fs;
-use std::path::{Path, PathBuf};
-use std::sync::LazyLock;
-use walkdir::{DirEntry, WalkDir};
-
-static CLIPPY_BUILD_TIME: LazyLock<Option<std::time::SystemTime>> =
-    LazyLock::new(|| cargo_clippy_path().metadata().ok()?.modified().ok());
-
-/// # Panics
-///
-/// Panics if the path to a test file is broken
-pub fn bless(ignore_timestamp: bool) {
-    let extensions = ["stdout", "stderr", "fixed"].map(OsStr::new);
-
-    WalkDir::new(build_dir())
-        .into_iter()
-        .map(Result::unwrap)
-        .filter(|entry| entry.path().extension().map_or(false, |ext| extensions.contains(&ext)))
-        .for_each(|entry| update_reference_file(&entry, ignore_timestamp));
-}
-
-fn update_reference_file(test_output_entry: &DirEntry, ignore_timestamp: bool) {
-    let test_output_path = test_output_entry.path();
-
-    let reference_file_name = test_output_entry.file_name().to_str().unwrap().replace(".stage-id", "");
-    let reference_file_path = Path::new("tests")
-        .join(test_output_path.strip_prefix(build_dir()).unwrap())
-        .with_file_name(reference_file_name);
-
-    // If the test output was not updated since the last clippy build, it may be outdated
-    if !ignore_timestamp && !updated_since_clippy_build(test_output_entry).unwrap_or(true) {
-        return;
-    }
-
-    let test_output_file = fs::read(test_output_path).expect("Unable to read test output file");
-    let reference_file = fs::read(&reference_file_path).unwrap_or_default();
-
-    if test_output_file != reference_file {
-        // If a test run caused an output file to change, update the reference file
-        println!("updating {}", reference_file_path.display());
-        fs::copy(test_output_path, &reference_file_path).expect("Could not update reference file");
-    }
-}
-
-fn updated_since_clippy_build(entry: &DirEntry) -> Option<bool> {
-    let clippy_build_time = (*CLIPPY_BUILD_TIME)?;
-    let modified = entry.metadata().ok()?.modified().ok()?;
-    Some(modified >= clippy_build_time)
-}
-
-fn build_dir() -> PathBuf {
-    let mut path = std::env::current_exe().unwrap();
-    path.set_file_name("test");
-    path
-}
diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs
index 8aaa029f776..4624451cff4 100644
--- a/clippy_dev/src/lib.rs
+++ b/clippy_dev/src/lib.rs
@@ -14,7 +14,6 @@ use std::io;
 use std::path::PathBuf;
 use std::process::{self, ExitStatus};
 
-pub mod bless;
 pub mod dogfood;
 pub mod fmt;
 pub mod lint;
diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs
index 97d6a8353a0..43eaccdf5a3 100644
--- a/clippy_dev/src/main.rs
+++ b/clippy_dev/src/main.rs
@@ -3,7 +3,7 @@
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
 use clap::{Arg, ArgAction, ArgMatches, Command};
-use clippy_dev::{bless, dogfood, fmt, lint, new_lint, serve, setup, update_lints};
+use clippy_dev::{dogfood, fmt, lint, new_lint, serve, setup, update_lints};
 use indoc::indoc;
 use std::convert::Infallible;
 
@@ -11,8 +11,8 @@ fn main() {
     let matches = get_clap_config();
 
     match matches.subcommand() {
-        Some(("bless", matches)) => {
-            bless::bless(matches.get_flag("ignore-timestamp"));
+        Some(("bless", _)) => {
+            eprintln!("use `cargo bless` to automatically replace `.stderr` and `.fixed` files as tests are being run");
         },
         Some(("dogfood", matches)) => {
             dogfood::dogfood(
diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs
index f0ccdb0fe10..f11aa547bd7 100644
--- a/clippy_dev/src/new_lint.rs
+++ b/clippy_dev/src/new_lint.rs
@@ -96,7 +96,7 @@ fn create_test(lint: &LintData<'_>) -> io::Result<()> {
 
         path.push("src");
         fs::create_dir(&path)?;
-        let header = format!("// compile-flags: --crate-name={lint_name}");
+        let header = format!("//@compile-flags: --crate-name={lint_name}");
         write_file(path.join("main.rs"), get_test_file_contents(lint_name, Some(&header)))?;
 
         Ok(())
diff --git a/clippy_test_deps/Cargo.toml b/clippy_test_deps/Cargo.toml
new file mode 100644
index 00000000000..6d053253fc3
--- /dev/null
+++ b/clippy_test_deps/Cargo.toml
@@ -0,0 +1,25 @@
+[package]
+name = "clippy_test_deps"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+clap = { version = "4.1.4", features = ["derive"] }
+clippy_utils = { path = "../clippy_utils" }
+derive-new = "0.5"
+if_chain = "1.0"
+itertools = "0.10.1"
+quote = "1.0"
+serde = { version = "1.0.125", features = ["derive"] }
+syn = { version = "2.0", features = ["full"] }
+futures = "0.3"
+parking_lot = "0.12"
+tokio = { version = "1", features = ["io-util"] }
+rustc-semver = "1.1"
+regex = "1.5"
+clippy_lints = { path = "../clippy_lints" }
+
+[features]
+internal = ["clippy_lints/internal"]
diff --git a/clippy_test_deps/src/lib.rs b/clippy_test_deps/src/lib.rs
new file mode 100644
index 00000000000..7d12d9af819
--- /dev/null
+++ b/clippy_test_deps/src/lib.rs
@@ -0,0 +1,14 @@
+pub fn add(left: usize, right: usize) -> usize {
+    left + right
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn it_works() {
+        let result = add(2, 2);
+        assert_eq!(result, 4);
+    }
+}
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 5b5e9fba6af..078dcef1927 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -2397,7 +2397,7 @@ fn with_test_item_names(tcx: TyCtxt<'_>, module: LocalDefId, f: impl Fn(&[Symbol
 
 /// Checks if the function containing the given `HirId` is a `#[test]` function
 ///
-/// Note: Add `// compile-flags: --test` to UI tests with a `#[test]` function
+/// Note: Add `//@compile-flags: --test` to UI tests with a `#[test]` function
 pub fn is_in_test_function(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
     with_test_item_names(tcx, tcx.parent_module(id), |names| {
         tcx.hir()
@@ -2419,7 +2419,7 @@ pub fn is_in_test_function(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
 
 /// Checks if the item containing the given `HirId` has `#[cfg(test)]` attribute applied
 ///
-/// Note: Add `// compile-flags: --test` to UI tests with a `#[cfg(test)]` function
+/// Note: Add `//@compile-flags: --test` to UI tests with a `#[cfg(test)]` function
 pub fn is_in_cfg_test(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
     fn is_cfg_test(attr: &Attribute) -> bool {
         if attr.has_name(sym::cfg)
@@ -2441,7 +2441,7 @@ pub fn is_in_cfg_test(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
 /// Checks whether item either has `test` attribute applied, or
 /// is a module with `test` in its name.
 ///
-/// Note: Add `// compile-flags: --test` to UI tests with a `#[test]` function
+/// Note: Add `//@compile-flags: --test` to UI tests with a `#[test]` function
 pub fn is_test_module_or_function(tcx: TyCtxt<'_>, item: &Item<'_>) -> bool {
     is_in_test_function(tcx, item.hir_id())
         || matches!(item.kind, ItemKind::Mod(..))
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 35d75cc51c2..c5e8622bc85 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -4,16 +4,14 @@
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
-use compiletest_rs as compiletest;
-use compiletest_rs::common::Mode as TestMode;
+use compiletest::{status_emitter, CommandBuilder};
+use ui_test as compiletest;
+use ui_test::Mode as TestMode;
 
-use std::collections::HashMap;
 use std::env::{self, remove_var, set_var, var_os};
 use std::ffi::{OsStr, OsString};
 use std::fs;
-use std::io;
 use std::path::{Path, PathBuf};
-use std::sync::LazyLock;
 use test_utils::IS_RUSTC_TEST_SUITE;
 
 mod test_utils;
@@ -21,143 +19,41 @@ mod test_utils;
 // whether to run internal tests or not
 const RUN_INTERNAL_TESTS: bool = cfg!(feature = "internal");
 
-/// All crates used in UI tests are listed here
-static TEST_DEPENDENCIES: &[&str] = &[
-    "clippy_lints",
-    "clippy_utils",
-    "derive_new",
-    "futures",
-    "if_chain",
-    "itertools",
-    "quote",
-    "regex",
-    "serde",
-    "serde_derive",
-    "syn",
-    "tokio",
-    "parking_lot",
-    "rustc_semver",
-];
-
-// Test dependencies may need an `extern crate` here to ensure that they show up
-// in the depinfo file (otherwise cargo thinks they are unused)
-#[allow(unused_extern_crates)]
-extern crate clippy_lints;
-#[allow(unused_extern_crates)]
-extern crate clippy_utils;
-#[allow(unused_extern_crates)]
-extern crate derive_new;
-#[allow(unused_extern_crates)]
-extern crate futures;
-#[allow(unused_extern_crates)]
-extern crate if_chain;
-#[allow(unused_extern_crates)]
-extern crate itertools;
-#[allow(unused_extern_crates)]
-extern crate parking_lot;
-#[allow(unused_extern_crates)]
-extern crate quote;
-#[allow(unused_extern_crates)]
-extern crate rustc_semver;
-#[allow(unused_extern_crates)]
-extern crate syn;
-#[allow(unused_extern_crates)]
-extern crate tokio;
-
-/// Produces a string with an `--extern` flag for all UI test crate
-/// dependencies.
-///
-/// The dependency files are located by parsing the depinfo file for this test
-/// module. This assumes the `-Z binary-dep-depinfo` flag is enabled. All test
-/// dependencies must be added to Cargo.toml at the project root. Test
-/// dependencies that are not *directly* used by this test module require an
-/// `extern crate` declaration.
-static EXTERN_FLAGS: LazyLock<String> = LazyLock::new(|| {
-    let current_exe_depinfo = {
-        let mut path = env::current_exe().unwrap();
-        path.set_extension("d");
-        fs::read_to_string(path).unwrap()
-    };
-    let mut crates: HashMap<&str, &str> = HashMap::with_capacity(TEST_DEPENDENCIES.len());
-    for line in current_exe_depinfo.lines() {
-        // each dependency is expected to have a Makefile rule like `/path/to/crate-hash.rlib:`
-        let parse_name_path = || {
-            if line.starts_with(char::is_whitespace) {
-                return None;
-            }
-            let path_str = line.strip_suffix(':')?;
-            let path = Path::new(path_str);
-            if !matches!(path.extension()?.to_str()?, "rlib" | "so" | "dylib" | "dll") {
-                return None;
-            }
-            let (name, _hash) = path.file_stem()?.to_str()?.rsplit_once('-')?;
-            // the "lib" prefix is not present for dll files
-            let name = name.strip_prefix("lib").unwrap_or(name);
-            Some((name, path_str))
-        };
-        if let Some((name, path)) = parse_name_path() {
-            if TEST_DEPENDENCIES.contains(&name) {
-                // A dependency may be listed twice if it is available in sysroot,
-                // and the sysroot dependencies are listed first. As of the writing,
-                // this only seems to apply to if_chain.
-                crates.insert(name, path);
-            }
-        }
-    }
-    let not_found: Vec<&str> = TEST_DEPENDENCIES
-        .iter()
-        .copied()
-        .filter(|n| !crates.contains_key(n))
-        .collect();
-    assert!(
-        not_found.is_empty(),
-        "dependencies not found in depinfo: {not_found:?}\n\
-        help: Make sure the `-Z binary-dep-depinfo` rust flag is enabled\n\
-        help: Try adding to dev-dependencies in Cargo.toml\n\
-        help: Be sure to also add `extern crate ...;` to tests/compile-test.rs",
-    );
-    crates
-        .into_iter()
-        .map(|(name, path)| format!(" --extern {name}={path}"))
-        .collect()
-});
-
 fn base_config(test_dir: &str) -> compiletest::Config {
     let mut config = compiletest::Config {
-        edition: Some("2021".into()),
-        mode: TestMode::Ui,
-        strict_headers: true,
-        ..Default::default()
+        mode: TestMode::Yolo,
+        stderr_filters: vec![],
+        stdout_filters: vec![],
+        output_conflict_handling: if std::env::args().any(|arg| arg == "--bless") {
+            compiletest::OutputConflictHandling::Bless
+        } else {
+            compiletest::OutputConflictHandling::Error("cargo test -- -- --bless".into())
+        },
+        dependencies_crate_manifest_path: Some("clippy_test_deps/Cargo.toml".into()),
+        target: None,
+        out_dir: "target/ui_test".into(),
+        ..compiletest::Config::rustc(Path::new("tests").join(test_dir))
     };
 
-    if let Ok(filters) = env::var("TESTNAME") {
-        config.filters = filters.split(',').map(ToString::to_string).collect();
-    }
-
-    if let Some(path) = option_env!("RUSTC_LIB_PATH") {
-        let path = PathBuf::from(path);
-        config.run_lib_path = path.clone();
-        config.compile_lib_path = path;
+    if let Some(_path) = option_env!("RUSTC_LIB_PATH") {
+        //let path = PathBuf::from(path);
+        //config.run_lib_path = path.clone();
+        //config.compile_lib_path = path;
     }
     let current_exe_path = env::current_exe().unwrap();
     let deps_path = current_exe_path.parent().unwrap();
     let profile_path = deps_path.parent().unwrap();
 
-    // Using `-L dependency={}` enforces that external dependencies are added with `--extern`.
-    // This is valuable because a) it allows us to monitor what external dependencies are used
-    // and b) it ensures that conflicting rlibs are resolved properly.
-    let host_libs = option_env!("HOST_LIBS")
-        .map(|p| format!(" -L dependency={}", Path::new(p).join("deps").display()))
-        .unwrap_or_default();
-    config.target_rustcflags = Some(format!(
-        "--emit=metadata -Dwarnings -Zui-testing -L dependency={}{host_libs}{}",
-        deps_path.display(),
-        &*EXTERN_FLAGS,
-    ));
-
-    config.src_base = Path::new("tests").join(test_dir);
-    config.build_base = profile_path.join("test").join(test_dir);
-    config.rustc_path = profile_path.join(if cfg!(windows) {
+    config.program.args.push("--emit=metadata".into());
+    config.program.args.push("-Aunused".into());
+    config.program.args.push("-Zui-testing".into());
+    config.program.args.push("-Dwarnings".into());
+
+    // Normalize away slashes in windows paths.
+    config.stderr_filter(r#"\\"#, "/");
+
+    //config.build_base = profile_path.join("test").join(test_dir);
+    config.program.program = profile_path.join(if cfg!(windows) {
         "clippy-driver.exe"
     } else {
         "clippy-driver"
@@ -165,9 +61,23 @@ fn base_config(test_dir: &str) -> compiletest::Config {
     config
 }
 
+fn test_filter() -> Box<dyn Sync + Fn(&Path) -> bool> {
+    if let Ok(filters) = env::var("TESTNAME") {
+        let filters: Vec<_> = filters.split(',').map(ToString::to_string).collect();
+        Box::new(move |path| {
+            filters.is_empty()
+                || filters
+                    .iter()
+                    .any(|f| path.file_stem().map_or(false, |stem| stem == f.as_str()))
+        })
+    } else {
+        Box::new(|_| true)
+    }
+}
+
 fn run_ui() {
-    let mut config = base_config("ui");
-    config.rustfix_coverage = true;
+    let config = base_config("ui");
+    //config.rustfix_coverage = true;
     // use tests/clippy.toml
     let _g = VarGuard::set("CARGO_MANIFEST_DIR", fs::canonicalize("tests").unwrap());
     let _threads = VarGuard::set(
@@ -179,7 +89,19 @@ fn run_ui() {
                 .to_string()
         }),
     );
-    compiletest::run_tests(&config);
+    eprintln!("   Compiler: {}", config.program.display());
+
+    let name = config.root_dir.display().to_string();
+
+    let test_filter = test_filter();
+
+    compiletest::run_tests_generic(
+        config,
+        move |path| compiletest::default_file_filter(path) && test_filter(path),
+        compiletest::default_per_file_config,
+        (status_emitter::Text, status_emitter::Gha::<true> { name }),
+    )
+    .unwrap();
     check_rustfix_coverage();
 }
 
@@ -188,177 +110,115 @@ fn run_internal_tests() {
     if !RUN_INTERNAL_TESTS {
         return;
     }
-    let config = base_config("ui-internal");
-    compiletest::run_tests(&config);
+    let mut config = base_config("ui-internal");
+    config.dependency_builder.args.push("--features".into());
+    config.dependency_builder.args.push("internal".into());
+    compiletest::run_tests(config).unwrap();
 }
 
 fn run_ui_toml() {
-    fn run_tests(config: &compiletest::Config, mut tests: Vec<tester::TestDescAndFn>) -> Result<bool, io::Error> {
-        let mut result = true;
-        let opts = compiletest::test_opts(config);
-        for dir in fs::read_dir(&config.src_base)? {
-            let dir = dir?;
-            if !dir.file_type()?.is_dir() {
-                continue;
-            }
-            let dir_path = dir.path();
-            let _g = VarGuard::set("CARGO_MANIFEST_DIR", &dir_path);
-            for file in fs::read_dir(&dir_path)? {
-                let file = file?;
-                let file_path = file.path();
-                if file.file_type()?.is_dir() {
-                    continue;
-                }
-                if file_path.extension() != Some(OsStr::new("rs")) {
-                    continue;
-                }
-                let paths = compiletest::common::TestPaths {
-                    file: file_path,
-                    base: config.src_base.clone(),
-                    relative_dir: dir_path.file_name().unwrap().into(),
-                };
-                let test_name = compiletest::make_test_name(config, &paths);
-                let index = tests
-                    .iter()
-                    .position(|test| test.desc.name == test_name)
-                    .expect("The test should be in there");
-                result &= tester::run_tests_console(&opts, vec![tests.swap_remove(index)])?;
-            }
-        }
-        Ok(result)
-    }
-
     let mut config = base_config("ui-toml");
-    config.src_base = config.src_base.canonicalize().unwrap();
 
-    let tests = compiletest::make_tests(&config);
+    config.stderr_filter(
+        &regex::escape(
+            &std::path::Path::new(file!())
+                .parent()
+                .unwrap()
+                .canonicalize()
+                .unwrap()
+                .parent()
+                .unwrap()
+                .display()
+                .to_string()
+                .replace('\\', "/"),
+        ),
+        "$$DIR",
+    );
+
+    let name = config.root_dir.display().to_string();
 
-    let res = run_tests(&config, tests);
-    match res {
-        Ok(true) => {},
-        Ok(false) => panic!("Some tests failed"),
-        Err(e) => {
-            panic!("I/O failure during tests: {e:?}");
+    let test_filter = test_filter();
+
+    ui_test::run_tests_generic(
+        config,
+        |path| test_filter(path) && path.extension() == Some("rs".as_ref()),
+        |config, path| {
+            let mut config = config.clone();
+            config
+                .program
+                .envs
+                .push(("CLIPPY_CONF_DIR".into(), Some(path.parent().unwrap().into())));
+            Some(config)
         },
-    }
+        (status_emitter::Text, status_emitter::Gha::<true> { name }),
+    )
+    .unwrap();
 }
 
 fn run_ui_cargo() {
-    fn run_tests(
-        config: &compiletest::Config,
-        filters: &[String],
-        mut tests: Vec<tester::TestDescAndFn>,
-    ) -> Result<bool, io::Error> {
-        let mut result = true;
-        let opts = compiletest::test_opts(config);
-
-        for dir in fs::read_dir(&config.src_base)? {
-            let dir = dir?;
-            if !dir.file_type()?.is_dir() {
-                continue;
-            }
-
-            // Use the filter if provided
-            let dir_path = dir.path();
-            for filter in filters {
-                if !dir_path.ends_with(filter) {
-                    continue;
-                }
-            }
-
-            for case in fs::read_dir(&dir_path)? {
-                let case = case?;
-                if !case.file_type()?.is_dir() {
-                    continue;
-                }
-
-                let src_path = case.path().join("src");
-
-                // When switching between branches, if the previous branch had a test
-                // that the current branch does not have, the directory is not removed
-                // because an ignored Cargo.lock file exists.
-                if !src_path.exists() {
-                    continue;
-                }
-
-                env::set_current_dir(&src_path)?;
-
-                let cargo_toml_path = case.path().join("Cargo.toml");
-                let cargo_content = fs::read(cargo_toml_path)?;
-                let cargo_parsed: toml::Value = toml::from_str(
-                    std::str::from_utf8(&cargo_content).expect("`Cargo.toml` is not a valid utf-8 file!"),
-                )
-                .expect("Can't parse `Cargo.toml`");
-
-                let _g = VarGuard::set("CARGO_MANIFEST_DIR", case.path());
-                let _h = VarGuard::set(
-                    "CARGO_PKG_RUST_VERSION",
-                    cargo_parsed
-                        .get("package")
-                        .and_then(|p| p.get("rust-version"))
-                        .and_then(toml::Value::as_str)
-                        .unwrap_or(""),
-                );
-
-                for file in fs::read_dir(&src_path)? {
-                    let file = file?;
-                    if file.file_type()?.is_dir() {
-                        continue;
-                    }
-
-                    // Search for the main file to avoid running a test for each file in the project
-                    let file_path = file.path();
-                    match file_path.file_name().and_then(OsStr::to_str) {
-                        Some("main.rs") => {},
-                        _ => continue,
-                    }
-                    let _g = VarGuard::set("CLIPPY_CONF_DIR", case.path());
-                    let paths = compiletest::common::TestPaths {
-                        file: file_path,
-                        base: config.src_base.clone(),
-                        relative_dir: src_path.strip_prefix(&config.src_base).unwrap().into(),
-                    };
-                    let test_name = compiletest::make_test_name(config, &paths);
-                    let index = tests
-                        .iter()
-                        .position(|test| test.desc.name == test_name)
-                        .expect("The test should be in there");
-                    result &= tester::run_tests_console(&opts, vec![tests.swap_remove(index)])?;
-                }
-            }
-        }
-        Ok(result)
-    }
-
     if IS_RUSTC_TEST_SUITE {
         return;
     }
 
     let mut config = base_config("ui-cargo");
-    config.src_base = config.src_base.canonicalize().unwrap();
+    config.program.input_file_flag = CommandBuilder::cargo().input_file_flag;
+    config.program.out_dir_flag = CommandBuilder::cargo().out_dir_flag;
+    config.program.args = vec!["clippy".into(), "--color".into(), "never".into(), "--quiet".into()];
+    config
+        .program
+        .envs
+        .push(("RUSTFLAGS".into(), Some("-Dwarnings".into())));
+    // We need to do this while we still have a rustc in the `program` field.
+    config.fill_host_and_target().unwrap();
+    config.dependencies_crate_manifest_path = None;
+    config.program.program.set_file_name(if cfg!(windows) {
+        "cargo-clippy.exe"
+    } else {
+        "cargo-clippy"
+    });
+    config.edition = None;
 
-    let tests = compiletest::make_tests(&config);
+    config.stderr_filter(
+        &regex::escape(
+            &std::path::Path::new(file!())
+                .parent()
+                .unwrap()
+                .canonicalize()
+                .unwrap()
+                .parent()
+                .unwrap()
+                .display()
+                .to_string()
+                .replace('\\', "/"),
+        ),
+        "$$DIR",
+    );
+
+    let name = config.root_dir.display().to_string();
 
-    let current_dir = env::current_dir().unwrap();
-    let res = run_tests(&config, &config.filters, tests);
-    env::set_current_dir(current_dir).unwrap();
+    let test_filter = test_filter();
 
-    match res {
-        Ok(true) => {},
-        Ok(false) => panic!("Some tests failed"),
-        Err(e) => {
-            panic!("I/O failure during tests: {e:?}");
+    ui_test::run_tests_generic(
+        config,
+        |path| test_filter(path) && path.ends_with("Cargo.toml"),
+        |config, path| {
+            let mut config = config.clone();
+            config.out_dir = PathBuf::from("target/ui_test_cargo/").join(path.parent().unwrap());
+            Some(config)
         },
-    }
+        (status_emitter::Text, status_emitter::Gha::<true> { name }),
+    )
+    .unwrap();
 }
 
-#[test]
-fn compile_test() {
+fn main() {
     set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
     run_ui();
     run_ui_toml();
     run_ui_cargo();
     run_internal_tests();
+    rustfix_coverage_known_exceptions_accuracy();
+    ui_cargo_toml_metadata();
 }
 
 const RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS: &[&str] = &[
@@ -384,7 +244,6 @@ const RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS: &[&str] = &[
     "needless_for_each_unfixable.rs",
     "nonminimal_bool.rs",
     "print_literal.rs",
-    "print_with_newline.rs",
     "redundant_static_lifetimes_multiple.rs",
     "ref_binding_to_reference.rs",
     "repl_uninit.rs",
@@ -399,7 +258,6 @@ const RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS: &[&str] = &[
     "unnecessary_lazy_eval_unfixable.rs",
     "write_literal.rs",
     "write_literal_2.rs",
-    "write_with_newline.rs",
 ];
 
 fn check_rustfix_coverage() {
@@ -432,25 +290,16 @@ fn check_rustfix_coverage() {
     }
 }
 
-#[test]
 fn rustfix_coverage_known_exceptions_accuracy() {
     for filename in RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS {
         let rs_path = Path::new("tests/ui").join(filename);
-        assert!(
-            rs_path.exists(),
-            "`{}` does not exist",
-            rs_path.strip_prefix(env!("CARGO_MANIFEST_DIR")).unwrap().display()
-        );
+        assert!(rs_path.exists(), "`{}` does not exist", rs_path.display());
         let fixed_path = rs_path.with_extension("fixed");
-        assert!(
-            !fixed_path.exists(),
-            "`{}` exists",
-            fixed_path.strip_prefix(env!("CARGO_MANIFEST_DIR")).unwrap().display()
-        );
+        println!("{}", fixed_path.display());
+        assert!(!fixed_path.exists(), "`{}` exists", fixed_path.display());
     }
 }
 
-#[test]
 fn ui_cargo_toml_metadata() {
     let ui_cargo_path = Path::new("tests/ui-cargo");
     let cargo_common_metadata_path = ui_cargo_path.join("cargo_common_metadata");
diff --git a/tests/missing-test-files.rs b/tests/missing-test-files.rs
index caedd5d76cd..0d35a22cd9a 100644
--- a/tests/missing-test-files.rs
+++ b/tests/missing-test-files.rs
@@ -41,8 +41,8 @@ fn explore_directory(dir: &Path) -> Vec<String> {
             x.path().extension().and_then(OsStr::to_str),
             y.path().extension().and_then(OsStr::to_str),
         ) {
-            (Some("rs"), _) => Ordering::Less,
-            (_, Some("rs")) => Ordering::Greater,
+            (Some("rs" | "toml"), _) => Ordering::Less,
+            (_, Some("rs" | "toml")) => Ordering::Greater,
             _ => Ordering::Equal,
         }
     });
@@ -54,7 +54,7 @@ fn explore_directory(dir: &Path) -> Vec<String> {
             let file_prefix = path.file_prefix().unwrap().to_str().unwrap().to_string();
             if let Some(ext) = path.extension() {
                 match ext.to_str().unwrap() {
-                    "rs" => current_file = file_prefix.clone(),
+                    "rs" | "toml" => current_file = file_prefix.clone(),
                     "stderr" | "stdout" => {
                         if file_prefix != current_file {
                             missing_files.push(path.to_str().unwrap().to_string());
diff --git a/tests/ui-cargo/cargo_common_metadata/fail/src/main.stderr b/tests/ui-cargo/cargo_common_metadata/fail/Cargo.stderr
index 86953142bef..e161507b533 100644
--- a/tests/ui-cargo/cargo_common_metadata/fail/src/main.stderr
+++ b/tests/ui-cargo/cargo_common_metadata/fail/Cargo.stderr
@@ -1,6 +1,6 @@
 error: package `cargo_common_metadata_fail` is missing `package.description` metadata
-   |
-   = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
+  |
+  = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
 
 error: package `cargo_common_metadata_fail` is missing `either package.license or package.license_file` metadata
 
@@ -12,5 +12,4 @@ error: package `cargo_common_metadata_fail` is missing `package.keywords` metada
 
 error: package `cargo_common_metadata_fail` is missing `package.categories` metadata
 
-error: aborting due to 6 previous errors
-
+error: could not compile `cargo_common_metadata_fail` (bin "cargo_common_metadata_fail") due to 6 previous errors
diff --git a/tests/ui-cargo/cargo_common_metadata/fail_publish/src/main.stderr b/tests/ui-cargo/cargo_common_metadata/fail_publish/Cargo.stderr
index ac1b5e8e903..dbf494cc342 100644
--- a/tests/ui-cargo/cargo_common_metadata/fail_publish/src/main.stderr
+++ b/tests/ui-cargo/cargo_common_metadata/fail_publish/Cargo.stderr
@@ -1,6 +1,6 @@
 error: package `cargo_common_metadata_fail_publish` is missing `package.description` metadata
-   |
-   = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
+  |
+  = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
 
 error: package `cargo_common_metadata_fail_publish` is missing `either package.license or package.license_file` metadata
 
@@ -12,5 +12,4 @@ error: package `cargo_common_metadata_fail_publish` is missing `package.keywords
 
 error: package `cargo_common_metadata_fail_publish` is missing `package.categories` metadata
 
-error: aborting due to 6 previous errors
-
+error: could not compile `cargo_common_metadata_fail_publish` (bin "cargo_common_metadata_fail_publish") due to 6 previous errors
diff --git a/tests/ui-cargo/cargo_common_metadata/fail_publish_true/src/main.stderr b/tests/ui-cargo/cargo_common_metadata/fail_publish_true/Cargo.stderr
index be32c0dc418..ae5967406f6 100644
--- a/tests/ui-cargo/cargo_common_metadata/fail_publish_true/src/main.stderr
+++ b/tests/ui-cargo/cargo_common_metadata/fail_publish_true/Cargo.stderr
@@ -1,6 +1,6 @@
 error: package `cargo_common_metadata_fail_publish_true` is missing `package.description` metadata
-   |
-   = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
+  |
+  = note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
 
 error: package `cargo_common_metadata_fail_publish_true` is missing `either package.license or package.license_file` metadata
 
@@ -12,5 +12,4 @@ error: package `cargo_common_metadata_fail_publish_true` is missing `package.key
 
 error: package `cargo_common_metadata_fail_publish_true` is missing `package.categories` metadata
 
-error: aborting due to 6 previous errors
-
+error: could not compile `cargo_common_metadata_fail_publish_true` (bin "cargo_common_metadata_fail_publish_true") due to 6 previous errors
diff --git a/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.stderr b/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.stderr
new file mode 100644
index 00000000000..dfbf19d33a5
--- /dev/null
+++ b/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.stderr
@@ -0,0 +1,21 @@
+warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.59.0` from `clippy.toml`
+
+error: unnecessary structure name repetition
+ --> src/main.rs:6:21
+  |
+6 |     pub fn bar() -> Foo {
+  |                     ^^^ help: use the applicable keyword: `Self`
+  |
+note: the lint level is defined here
+ --> src/main.rs:1:9
+  |
+1 | #![deny(clippy::use_self)]
+  |         ^^^^^^^^^^^^^^^^
+
+error: unnecessary structure name repetition
+ --> src/main.rs:7:9
+  |
+7 |         Foo
+  |         ^^^ help: use the applicable keyword: `Self`
+
+error: could not compile `fail-both-diff` (bin "fail-both-diff") due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.stderr b/tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.stderr
deleted file mode 100644
index 163f8bb35e7..00000000000
--- a/tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.59.0` from `clippy.toml`
-
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:6:21
-   |
-LL |     pub fn bar() -> Foo {
-   |                     ^^^ help: use the applicable keyword: `Self`
-   |
-note: the lint level is defined here
-  --> $DIR/main.rs:1:9
-   |
-LL | #![deny(clippy::use_self)]
-   |         ^^^^^^^^^^^^^^^^
-
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:7:9
-   |
-LL |         Foo
-   |         ^^^ help: use the applicable keyword: `Self`
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
diff --git a/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.stderr b/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.stderr
new file mode 100644
index 00000000000..407a9055de8
--- /dev/null
+++ b/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.stderr
@@ -0,0 +1,19 @@
+error: unnecessary structure name repetition
+ --> src/main.rs:6:21
+  |
+6 |     pub fn bar() -> Foo {
+  |                     ^^^ help: use the applicable keyword: `Self`
+  |
+note: the lint level is defined here
+ --> src/main.rs:1:9
+  |
+1 | #![deny(clippy::use_self)]
+  |         ^^^^^^^^^^^^^^^^
+
+error: unnecessary structure name repetition
+ --> src/main.rs:7:9
+  |
+7 |         Foo
+  |         ^^^ help: use the applicable keyword: `Self`
+
+error: could not compile `fail-both-same` (bin "fail-both-same") due to 2 previous errors
diff --git a/tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.stderr b/tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.stderr
deleted file mode 100644
index 259d39b1252..00000000000
--- a/tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:6:21
-   |
-LL |     pub fn bar() -> Foo {
-   |                     ^^^ help: use the applicable keyword: `Self`
-   |
-note: the lint level is defined here
-  --> $DIR/main.rs:1:9
-   |
-LL | #![deny(clippy::use_self)]
-   |         ^^^^^^^^^^^^^^^^
-
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:7:9
-   |
-LL |         Foo
-   |         ^^^ help: use the applicable keyword: `Self`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.stderr b/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.stderr
new file mode 100644
index 00000000000..566f5a68689
--- /dev/null
+++ b/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.stderr
@@ -0,0 +1,19 @@
+error: unnecessary structure name repetition
+ --> src/main.rs:6:21
+  |
+6 |     pub fn bar() -> Foo {
+  |                     ^^^ help: use the applicable keyword: `Self`
+  |
+note: the lint level is defined here
+ --> src/main.rs:1:9
+  |
+1 | #![deny(clippy::use_self)]
+  |         ^^^^^^^^^^^^^^^^
+
+error: unnecessary structure name repetition
+ --> src/main.rs:7:9
+  |
+7 |         Foo
+  |         ^^^ help: use the applicable keyword: `Self`
+
+error: could not compile `fail-cargo` (bin "fail-cargo") due to 2 previous errors
diff --git a/tests/ui-cargo/cargo_rust_version/fail_cargo/src/main.stderr b/tests/ui-cargo/cargo_rust_version/fail_cargo/src/main.stderr
deleted file mode 100644
index 259d39b1252..00000000000
--- a/tests/ui-cargo/cargo_rust_version/fail_cargo/src/main.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:6:21
-   |
-LL |     pub fn bar() -> Foo {
-   |                     ^^^ help: use the applicable keyword: `Self`
-   |
-note: the lint level is defined here
-  --> $DIR/main.rs:1:9
-   |
-LL | #![deny(clippy::use_self)]
-   |         ^^^^^^^^^^^^^^^^
-
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:7:9
-   |
-LL |         Foo
-   |         ^^^ help: use the applicable keyword: `Self`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.stderr b/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.stderr
new file mode 100644
index 00000000000..83d4be3bae4
--- /dev/null
+++ b/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.stderr
@@ -0,0 +1,19 @@
+error: unnecessary structure name repetition
+ --> src/main.rs:6:21
+  |
+6 |     pub fn bar() -> Foo {
+  |                     ^^^ help: use the applicable keyword: `Self`
+  |
+note: the lint level is defined here
+ --> src/main.rs:1:9
+  |
+1 | #![deny(clippy::use_self)]
+  |         ^^^^^^^^^^^^^^^^
+
+error: unnecessary structure name repetition
+ --> src/main.rs:7:9
+  |
+7 |         Foo
+  |         ^^^ help: use the applicable keyword: `Self`
+
+error: could not compile `fail-clippy` (bin "fail-clippy") due to 2 previous errors
diff --git a/tests/ui-cargo/cargo_rust_version/fail_clippy/src/main.stderr b/tests/ui-cargo/cargo_rust_version/fail_clippy/src/main.stderr
deleted file mode 100644
index 259d39b1252..00000000000
--- a/tests/ui-cargo/cargo_rust_version/fail_clippy/src/main.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:6:21
-   |
-LL |     pub fn bar() -> Foo {
-   |                     ^^^ help: use the applicable keyword: `Self`
-   |
-note: the lint level is defined here
-  --> $DIR/main.rs:1:9
-   |
-LL | #![deny(clippy::use_self)]
-   |         ^^^^^^^^^^^^^^^^
-
-error: unnecessary structure name repetition
-  --> $DIR/main.rs:7:9
-   |
-LL |         Foo
-   |         ^^^ help: use the applicable keyword: `Self`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui-cargo/cargo_rust_version/fail_file_attr/src/main.stderr b/tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.stderr
index 97e6c3d5a55..14a6b5047b1 100644
--- a/tests/ui-cargo/cargo_rust_version/fail_file_attr/src/main.stderr
+++ b/tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.stderr
@@ -1,20 +1,19 @@
 error: unnecessary structure name repetition
-  --> $DIR/main.rs:11:21
+  --> src/main.rs:11:21
    |
-LL |     pub fn bar() -> Foo {
+11 |     pub fn bar() -> Foo {
    |                     ^^^ help: use the applicable keyword: `Self`
    |
 note: the lint level is defined here
-  --> $DIR/main.rs:6:9
+  --> src/main.rs:6:9
    |
-LL | #![deny(clippy::use_self)]
+6  | #![deny(clippy::use_self)]
    |         ^^^^^^^^^^^^^^^^
 
 error: unnecessary structure name repetition
-  --> $DIR/main.rs:12:9
+  --> src/main.rs:12:9
    |
-LL |         Foo
+12 |         Foo
    |         ^^^ help: use the applicable keyword: `Self`
 
-error: aborting due to 2 previous errors
-
+error: could not compile `fail-file-attr` (bin "fail-file-attr") due to 2 previous errors
diff --git a/tests/ui-cargo/cargo_rust_version/warn_both_diff/src/main.stderr b/tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.stderr
index eeae5b7b275..e89388b501b 100644
--- a/tests/ui-cargo/cargo_rust_version/warn_both_diff/src/main.stderr
+++ b/tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.stderr
@@ -1,4 +1,2 @@
 warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.13.0` from `clippy.toml`
 
-warning: 1 warning emitted
-
diff --git a/tests/ui-cargo/duplicate_mod/fail/Cargo.stderr b/tests/ui-cargo/duplicate_mod/fail/Cargo.stderr
new file mode 100644
index 00000000000..fde3a1e6599
--- /dev/null
+++ b/tests/ui-cargo/duplicate_mod/fail/Cargo.stderr
@@ -0,0 +1,52 @@
+error: file is loaded as a module multiple times: `src/b.rs`
+ --> src/main.rs:5:1
+  |
+5 |   mod b;
+  |   ^^^^^^ first loaded here
+6 | / #[path = "b.rs"]
+7 | | mod b2;
+  | |_______^ loaded again here
+  |
+  = help: replace all but one `mod` item with `use` items
+  = note: `-D clippy::duplicate-mod` implied by `-D warnings`
+
+error: file is loaded as a module multiple times: `src/c.rs`
+  --> src/main.rs:9:1
+   |
+9  |   mod c;
+   |   ^^^^^^ first loaded here
+10 | / #[path = "c.rs"]
+11 | | mod c2;
+   | |_______^ loaded again here
+12 | / #[path = "c.rs"]
+13 | | mod c3;
+   | |_______^ loaded again here
+   |
+   = help: replace all but one `mod` item with `use` items
+
+error: file is loaded as a module multiple times: `src/d.rs`
+  --> src/main.rs:18:1
+   |
+18 |   mod d;
+   |   ^^^^^^ first loaded here
+19 | / #[path = "d.rs"]
+20 | | mod d2;
+   | |_______^ loaded again here
+   |
+   = help: replace all but one `mod` item with `use` items
+
+error: file is loaded as a module multiple times: `src/from_other_module.rs`
+  --> src/main.rs:15:1
+   |
+15 |   mod from_other_module;
+   |   ^^^^^^^^^^^^^^^^^^^^^^ first loaded here
+   |
+  ::: src/other_module/mod.rs:1:1
+   |
+1  | / #[path = "../from_other_module.rs"]
+2  | | mod m;
+   | |______^ loaded again here
+   |
+   = help: replace all but one `mod` item with `use` items
+
+error: could not compile `duplicate_mod` (bin "duplicate_mod") due to 4 previous errors
diff --git a/tests/ui-cargo/duplicate_mod/fail/src/main.stderr b/tests/ui-cargo/duplicate_mod/fail/src/main.stderr
deleted file mode 100644
index 3b80d89a686..00000000000
--- a/tests/ui-cargo/duplicate_mod/fail/src/main.stderr
+++ /dev/null
@@ -1,53 +0,0 @@
-error: file is loaded as a module multiple times: `$DIR/b.rs`
-  --> $DIR/main.rs:5:1
-   |
-LL |   mod b;
-   |   ^^^^^^ first loaded here
-LL | / #[path = "b.rs"]
-LL | | mod b2;
-   | |_______^ loaded again here
-   |
-   = help: replace all but one `mod` item with `use` items
-   = note: `-D clippy::duplicate-mod` implied by `-D warnings`
-
-error: file is loaded as a module multiple times: `$DIR/c.rs`
-  --> $DIR/main.rs:9:1
-   |
-LL |   mod c;
-   |   ^^^^^^ first loaded here
-LL | / #[path = "c.rs"]
-LL | | mod c2;
-   | |_______^ loaded again here
-LL | / #[path = "c.rs"]
-LL | | mod c3;
-   | |_______^ loaded again here
-   |
-   = help: replace all but one `mod` item with `use` items
-
-error: file is loaded as a module multiple times: `$DIR/d.rs`
-  --> $DIR/main.rs:18:1
-   |
-LL |   mod d;
-   |   ^^^^^^ first loaded here
-LL | / #[path = "d.rs"]
-LL | | mod d2;
-   | |_______^ loaded again here
-   |
-   = help: replace all but one `mod` item with `use` items
-
-error: file is loaded as a module multiple times: `$DIR/from_other_module.rs`
-  --> $DIR/main.rs:15:1
-   |
-LL |   mod from_other_module;
-   |   ^^^^^^^^^^^^^^^^^^^^^^ first loaded here
-   |
-  ::: $DIR/other_module/mod.rs:1:1
-   |
-LL | / #[path = "../from_other_module.rs"]
-LL | | mod m;
-   | |______^ loaded again here
-   |
-   = help: replace all but one `mod` item with `use` items
-
-error: aborting due to 4 previous errors
-
diff --git a/tests/ui-cargo/feature_name/fail/Cargo.stderr b/tests/ui-cargo/feature_name/fail/Cargo.stderr
new file mode 100644
index 00000000000..da2db45d3b8
--- /dev/null
+++ b/tests/ui-cargo/feature_name/fail/Cargo.stderr
@@ -0,0 +1,43 @@
+error: the "no-" prefix in the feature name "no-qaq" is negative
+  |
+  = help: consider renaming the feature to "qaq", but make sure the feature adds functionality
+  = note: `-D clippy::negative-feature-names` implied by `-D warnings`
+
+error: the "no_" prefix in the feature name "no_qaq" is negative
+  |
+  = help: consider renaming the feature to "qaq", but make sure the feature adds functionality
+
+error: the "not-" prefix in the feature name "not-orz" is negative
+  |
+  = help: consider renaming the feature to "orz", but make sure the feature adds functionality
+
+error: the "not_" prefix in the feature name "not_orz" is negative
+  |
+  = help: consider renaming the feature to "orz", but make sure the feature adds functionality
+
+error: the "-support" suffix in the feature name "qvq-support" is redundant
+  |
+  = help: consider renaming the feature to "qvq"
+  = note: `-D clippy::redundant-feature-names` implied by `-D warnings`
+
+error: the "_support" suffix in the feature name "qvq_support" is redundant
+  |
+  = help: consider renaming the feature to "qvq"
+
+error: the "use-" prefix in the feature name "use-qwq" is redundant
+  |
+  = help: consider renaming the feature to "qwq"
+
+error: the "use_" prefix in the feature name "use_qwq" is redundant
+  |
+  = help: consider renaming the feature to "qwq"
+
+error: the "with-" prefix in the feature name "with-owo" is redundant
+  |
+  = help: consider renaming the feature to "owo"
+
+error: the "with_" prefix in the feature name "with_owo" is redundant
+  |
+  = help: consider renaming the feature to "owo"
+
+error: could not compile `feature_name` (bin "feature_name") due to 10 previous errors
diff --git a/tests/ui-cargo/feature_name/fail/src/main.stderr b/tests/ui-cargo/feature_name/fail/src/main.stderr
deleted file mode 100644
index c6a11fa93eb..00000000000
--- a/tests/ui-cargo/feature_name/fail/src/main.stderr
+++ /dev/null
@@ -1,44 +0,0 @@
-error: the "no-" prefix in the feature name "no-qaq" is negative
-   |
-   = help: consider renaming the feature to "qaq", but make sure the feature adds functionality
-   = note: `-D clippy::negative-feature-names` implied by `-D warnings`
-
-error: the "no_" prefix in the feature name "no_qaq" is negative
-   |
-   = help: consider renaming the feature to "qaq", but make sure the feature adds functionality
-
-error: the "not-" prefix in the feature name "not-orz" is negative
-   |
-   = help: consider renaming the feature to "orz", but make sure the feature adds functionality
-
-error: the "not_" prefix in the feature name "not_orz" is negative
-   |
-   = help: consider renaming the feature to "orz", but make sure the feature adds functionality
-
-error: the "-support" suffix in the feature name "qvq-support" is redundant
-   |
-   = help: consider renaming the feature to "qvq"
-   = note: `-D clippy::redundant-feature-names` implied by `-D warnings`
-
-error: the "_support" suffix in the feature name "qvq_support" is redundant
-   |
-   = help: consider renaming the feature to "qvq"
-
-error: the "use-" prefix in the feature name "use-qwq" is redundant
-   |
-   = help: consider renaming the feature to "qwq"
-
-error: the "use_" prefix in the feature name "use_qwq" is redundant
-   |
-   = help: consider renaming the feature to "qwq"
-
-error: the "with-" prefix in the feature name "with-owo" is redundant
-   |
-   = help: consider renaming the feature to "owo"
-
-error: the "with_" prefix in the feature name "with_owo" is redundant
-   |
-   = help: consider renaming the feature to "owo"
-
-error: aborting due to 10 previous errors
-
diff --git a/tests/ui-cargo/module_style/fail_mod/Cargo.stderr b/tests/ui-cargo/module_style/fail_mod/Cargo.stderr
new file mode 100644
index 00000000000..c2907f319e6
--- /dev/null
+++ b/tests/ui-cargo/module_style/fail_mod/Cargo.stderr
@@ -0,0 +1,18 @@
+error: `mod.rs` files are required, found `src/bad/inner.rs`
+ --> src/bad/inner.rs:1:1
+  |
+1 | pub mod stuff;
+  | ^
+  |
+  = help: move `src/bad/inner.rs` to `src/bad/inner/mod.rs`
+  = note: `-D clippy::self-named-module-files` implied by `-D warnings`
+
+error: `mod.rs` files are required, found `src/bad/inner/stuff.rs`
+ --> src/bad/inner/stuff.rs:1:1
+  |
+1 | pub mod most;
+  | ^
+  |
+  = help: move `src/bad/inner/stuff.rs` to `src/bad/inner/stuff/mod.rs`
+
+error: could not compile `fail-mod` (bin "fail-mod") due to 2 previous errors
diff --git a/tests/ui-cargo/module_style/fail_mod/src/main.stderr b/tests/ui-cargo/module_style/fail_mod/src/main.stderr
deleted file mode 100644
index 697c8b57c4a..00000000000
--- a/tests/ui-cargo/module_style/fail_mod/src/main.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error: `mod.rs` files are required, found `bad/inner.rs`
-  --> $DIR/bad/inner.rs:1:1
-   |
-LL | pub mod stuff;
-   | ^
-   |
-   = help: move `bad/inner.rs` to `bad/inner/mod.rs`
-   = note: `-D clippy::self-named-module-files` implied by `-D warnings`
-
-error: `mod.rs` files are required, found `bad/inner/stuff.rs`
-  --> $DIR/bad/inner/stuff.rs:1:1
-   |
-LL | pub mod most;
-   | ^
-   |
-   = help: move `bad/inner/stuff.rs` to `bad/inner/stuff/mod.rs`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui-cargo/module_style/fail_mod_remap/Cargo.stderr b/tests/ui-cargo/module_style/fail_mod_remap/Cargo.stderr
new file mode 100644
index 00000000000..fcf1a3c5e66
--- /dev/null
+++ b/tests/ui-cargo/module_style/fail_mod_remap/Cargo.stderr
@@ -0,0 +1,10 @@
+error: `mod.rs` files are required, found `src/bad.rs`
+ --> src/bad.rs:1:1
+  |
+1 | pub mod inner;
+  | ^
+  |
+  = help: move `src/bad.rs` to `src/bad/mod.rs`
+  = note: `-D clippy::self-named-module-files` implied by `-D warnings`
+
+error: could not compile `fail-mod-remap` (bin "fail-mod-remap") due to previous error
diff --git a/tests/ui-cargo/module_style/fail_mod_remap/src/main.stderr b/tests/ui-cargo/module_style/fail_mod_remap/src/main.stderr
deleted file mode 100644
index ea6ea98064a..00000000000
--- a/tests/ui-cargo/module_style/fail_mod_remap/src/main.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `mod.rs` files are required, found `bad.rs`
-  --> /remapped/module_style/fail_mod_remap/src/bad.rs:1:1
-   |
-LL | pub mod inner;
-   | ^
-   |
-   = help: move `bad.rs` to `bad/mod.rs`
-   = note: `-D clippy::self-named-module-files` implied by `-D warnings`
-
-error: aborting due to previous error
-
diff --git a/tests/ui-cargo/module_style/fail_no_mod/Cargo.stderr b/tests/ui-cargo/module_style/fail_no_mod/Cargo.stderr
new file mode 100644
index 00000000000..f61642ca2ef
--- /dev/null
+++ b/tests/ui-cargo/module_style/fail_no_mod/Cargo.stderr
@@ -0,0 +1,10 @@
+error: `mod.rs` files are not allowed, found `src/bad/mod.rs`
+ --> src/bad/mod.rs:1:1
+  |
+1 | pub struct Thing;
+  | ^
+  |
+  = help: move `src/bad/mod.rs` to `src/bad.rs`
+  = note: `-D clippy::mod-module-files` implied by `-D warnings`
+
+error: could not compile `fail-no-mod` (bin "fail-no-mod") due to previous error
diff --git a/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr b/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr
deleted file mode 100644
index f40ceea234b..00000000000
--- a/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `mod.rs` files are not allowed, found `bad/mod.rs`
-  --> $DIR/bad/mod.rs:1:1
-   |
-LL | pub struct Thing;
-   | ^
-   |
-   = help: move `bad/mod.rs` to `bad.rs`
-   = note: `-D clippy::mod-module-files` implied by `-D warnings`
-
-error: aborting due to previous error
-
diff --git a/tests/ui-cargo/multiple_config_files/warn/Cargo.stderr b/tests/ui-cargo/multiple_config_files/warn/Cargo.stderr
new file mode 100644
index 00000000000..d82b9e73f78
--- /dev/null
+++ b/tests/ui-cargo/multiple_config_files/warn/Cargo.stderr
@@ -0,0 +1,2 @@
+warning: using config file `$DIR/$DIR/.clippy.toml`, `$DIR/$DIR/clippy.toml` will be ignored
+
diff --git a/tests/ui-cargo/multiple_config_files/warn/src/main.stderr b/tests/ui-cargo/multiple_config_files/warn/src/main.stderr
deleted file mode 100644
index aa1b3c638a0..00000000000
--- a/tests/ui-cargo/multiple_config_files/warn/src/main.stderr
+++ /dev/null
@@ -1,4 +0,0 @@
-warning: using config file `$SRC_DIR/.clippy.toml`, `$SRC_DIR/clippy.toml` will be ignored
-
-warning: 1 warning emitted
-
diff --git a/tests/ui-cargo/multiple_crate_versions/fail/Cargo.stderr b/tests/ui-cargo/multiple_crate_versions/fail/Cargo.stderr
new file mode 100644
index 00000000000..5bcce920455
--- /dev/null
+++ b/tests/ui-cargo/multiple_crate_versions/fail/Cargo.stderr
@@ -0,0 +1,5 @@
+error: multiple versions for dependency `winapi`: 0.2.8, 0.3.9
+  |
+  = note: `-D clippy::multiple-crate-versions` implied by `-D warnings`
+
+error: could not compile `multiple_crate_versions` (bin "multiple_crate_versions") due to previous error
diff --git a/tests/ui-cargo/multiple_crate_versions/fail/src/main.stderr b/tests/ui-cargo/multiple_crate_versions/fail/src/main.stderr
deleted file mode 100644
index f3113e09365..00000000000
--- a/tests/ui-cargo/multiple_crate_versions/fail/src/main.stderr
+++ /dev/null
@@ -1,6 +0,0 @@
-error: multiple versions for dependency `winapi`: 0.2.8, 0.3.9
-   |
-   = note: `-D clippy::multiple-crate-versions` implied by `-D warnings`
-
-error: aborting due to previous error
-
diff --git a/tests/ui-cargo/update-all-references.sh b/tests/ui-cargo/update-all-references.sh
index 4391499a1e1..d4204307026 100755
--- a/tests/ui-cargo/update-all-references.sh
+++ b/tests/ui-cargo/update-all-references.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-echo "Please use 'cargo dev bless' instead."
+echo "Please use 'cargo bless' instead."
diff --git a/tests/ui-cargo/wildcard_dependencies/fail/Cargo.stderr b/tests/ui-cargo/wildcard_dependencies/fail/Cargo.stderr
new file mode 100644
index 00000000000..b1578c9f324
--- /dev/null
+++ b/tests/ui-cargo/wildcard_dependencies/fail/Cargo.stderr
@@ -0,0 +1,5 @@
+error: wildcard dependency for `regex`
+  |
+  = note: `-D clippy::wildcard-dependencies` implied by `-D warnings`
+
+error: could not compile `wildcard_dependencies` (bin "wildcard_dependencies") due to previous error
diff --git a/tests/ui-cargo/wildcard_dependencies/fail/src/main.stderr b/tests/ui-cargo/wildcard_dependencies/fail/src/main.stderr
deleted file mode 100644
index 9e65d2f9942..00000000000
--- a/tests/ui-cargo/wildcard_dependencies/fail/src/main.stderr
+++ /dev/null
@@ -1,6 +0,0 @@
-error: wildcard dependency for `regex`
-   |
-   = note: `-D clippy::wildcard-dependencies` implied by `-D warnings`
-
-error: aborting due to previous error
-
diff --git a/tests/ui-internal/custom_ice_message.stderr b/tests/ui-internal/custom_ice_message.stderr
index b9ea5a64de7..19904318575 100644
--- a/tests/ui-internal/custom_ice_message.stderr
+++ b/tests/ui-internal/custom_ice_message.stderr
@@ -7,7 +7,7 @@ note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy
 
 note: rustc <version> running on <target>
 
-note: compiler flags: -C prefer-dynamic -Z ui-testing
+note: compiler flags: -Z ui-testing
 
 query stack during panic:
 thread panicked while processing panic. aborting.
diff --git a/tests/ui-toml/bad_toml/conf_bad_toml.rs b/tests/ui-toml/bad_toml/conf_bad_toml.rs
index f328e4d9d04..c69fcd30033 100644
--- a/tests/ui-toml/bad_toml/conf_bad_toml.rs
+++ b/tests/ui-toml/bad_toml/conf_bad_toml.rs
@@ -1 +1,3 @@
+//@error-in-other-file: error reading Clippy's configuration file: expected `.`, `=`
+
 fn main() {}
diff --git a/tests/ui-toml/bad_toml/conf_bad_toml.stderr b/tests/ui-toml/bad_toml/conf_bad_toml.stderr
index 5b7e8c0db74..f7d53763a43 100644
--- a/tests/ui-toml/bad_toml/conf_bad_toml.stderr
+++ b/tests/ui-toml/bad_toml/conf_bad_toml.stderr
@@ -1,5 +1,5 @@
 error: error reading Clippy's configuration file: expected `.`, `=`
-  --> $DIR/clippy.toml:1:4
+  --> $DIR/$DIR/clippy.toml:1:4
    |
 LL | fn this_is_obviously(not: a, toml: file) {
    |    ^
diff --git a/tests/ui-toml/bad_toml_type/conf_bad_type.rs b/tests/ui-toml/bad_toml_type/conf_bad_type.rs
index f328e4d9d04..688c92d8717 100644
--- a/tests/ui-toml/bad_toml_type/conf_bad_type.rs
+++ b/tests/ui-toml/bad_toml_type/conf_bad_type.rs
@@ -1 +1,3 @@
+//@error-in-other-file: invalid type: integer `42`, expected a sequence
+
 fn main() {}
diff --git a/tests/ui-toml/bad_toml_type/conf_bad_type.stderr b/tests/ui-toml/bad_toml_type/conf_bad_type.stderr
index 386e1135df9..fb0a1408152 100644
--- a/tests/ui-toml/bad_toml_type/conf_bad_type.stderr
+++ b/tests/ui-toml/bad_toml_type/conf_bad_type.stderr
@@ -1,5 +1,5 @@
 error: error reading Clippy's configuration file: invalid type: integer `42`, expected a sequence
-  --> $DIR/clippy.toml:1:20
+  --> $DIR/$DIR/clippy.toml:1:20
    |
 LL | disallowed-names = 42
    |                    ^^
diff --git a/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr b/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr
index 123ad94dd09..89d84eb2455 100644
--- a/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr
+++ b/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr
@@ -1,11 +1,11 @@
 warning: error reading Clippy's configuration file: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead
-  --> $DIR/clippy.toml:2:1
+  --> $DIR/$DIR/clippy.toml:2:1
    |
 LL | cyclomatic-complexity-threshold = 2
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: error reading Clippy's configuration file: deprecated field `blacklisted-names`. Please use `disallowed-names` instead
-  --> $DIR/clippy.toml:3:1
+  --> $DIR/$DIR/clippy.toml:3:1
    |
 LL | blacklisted-names = [ "..", "wibble" ]
    | ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-toml/duplicated_keys/duplicated_keys.rs b/tests/ui-toml/duplicated_keys/duplicated_keys.rs
index f328e4d9d04..187775545ed 100644
--- a/tests/ui-toml/duplicated_keys/duplicated_keys.rs
+++ b/tests/ui-toml/duplicated_keys/duplicated_keys.rs
@@ -1 +1,3 @@
+//@error-in-other-file: duplicate key `cognitive-complexity-threshold`
+
 fn main() {}
diff --git a/tests/ui-toml/duplicated_keys/duplicated_keys.stderr b/tests/ui-toml/duplicated_keys/duplicated_keys.stderr
index 54997735274..7c56dfdb948 100644
--- a/tests/ui-toml/duplicated_keys/duplicated_keys.stderr
+++ b/tests/ui-toml/duplicated_keys/duplicated_keys.stderr
@@ -1,5 +1,5 @@
 error: error reading Clippy's configuration file: duplicate key `cognitive-complexity-threshold` in document root
-  --> $DIR/clippy.toml:2:1
+  --> $DIR/$DIR/clippy.toml:2:1
    |
 LL | cognitive-complexity-threshold = 4
    | ^
diff --git a/tests/ui-toml/duplicated_keys_deprecated/duplicated_keys.stderr b/tests/ui-toml/duplicated_keys_deprecated/duplicated_keys.stderr
index 2ae7848f183..0af8c0add6c 100644
--- a/tests/ui-toml/duplicated_keys_deprecated/duplicated_keys.stderr
+++ b/tests/ui-toml/duplicated_keys_deprecated/duplicated_keys.stderr
@@ -1,11 +1,11 @@
 error: error reading Clippy's configuration file: duplicate field `cognitive_complexity_threshold` (provided as `cyclomatic_complexity_threshold`)
-  --> $DIR/clippy.toml:3:1
+  --> $DIR/$DIR/clippy.toml:3:1
    |
 LL | cyclomatic-complexity-threshold = 3
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: error reading Clippy's configuration file: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead
-  --> $DIR/clippy.toml:3:1
+  --> $DIR/$DIR/clippy.toml:3:1
    |
 LL | cyclomatic-complexity-threshold = 3
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-toml/duplicated_keys_deprecated_2/duplicated_keys.stderr b/tests/ui-toml/duplicated_keys_deprecated_2/duplicated_keys.stderr
index 53ad4271246..a4b1e9c335c 100644
--- a/tests/ui-toml/duplicated_keys_deprecated_2/duplicated_keys.stderr
+++ b/tests/ui-toml/duplicated_keys_deprecated_2/duplicated_keys.stderr
@@ -1,11 +1,11 @@
 error: error reading Clippy's configuration file: duplicate field `cognitive-complexity-threshold`
-  --> $DIR/clippy.toml:4:1
+  --> $DIR/$DIR/clippy.toml:4:1
    |
 LL | cognitive-complexity-threshold = 4
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: error reading Clippy's configuration file: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead
-  --> $DIR/clippy.toml:2:1
+  --> $DIR/$DIR/clippy.toml:2:1
    |
 LL | cyclomatic-complexity-threshold = 3
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui-toml/excessive_nesting/auxiliary/proc_macros.rs b/tests/ui-toml/excessive_nesting/auxiliary/proc_macros.rs
index df17974de03..ebadd4e440a 100644
--- a/tests/ui-toml/excessive_nesting/auxiliary/proc_macros.rs
+++ b/tests/ui-toml/excessive_nesting/auxiliary/proc_macros.rs
@@ -1,9 +1,5 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
 // NOTE: Copied from `ui/auxiliary/proc_macros.rs`, couldn't get `../` to work for some reason
 
-#![crate_type = "proc-macro"]
 #![feature(let_chains)]
 #![feature(proc_macro_span)]
 #![allow(clippy::excessive_nesting, dead_code)]
diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.rs b/tests/ui-toml/excessive_nesting/excessive_nesting.rs
index 25f0d0d6230..c28220b973e 100644
--- a/tests/ui-toml/excessive_nesting/excessive_nesting.rs
+++ b/tests/ui-toml/excessive_nesting/excessive_nesting.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![rustfmt::skip]
 #![feature(custom_inner_attributes)]
 #![allow(unused)]
diff --git a/tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.rs b/tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.rs
index 2ebf28645e5..03fa719975b 100644
--- a/tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.rs
+++ b/tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.rs
@@ -1,3 +1,5 @@
+//@error-in-other-file: `invalid.version` is not a valid Rust version
+
 #![allow(clippy::redundant_clone)]
 
 fn main() {}
diff --git a/tests/ui-toml/lint_decimal_readability/test.rs b/tests/ui-toml/lint_decimal_readability/test.rs
index 2498672d77f..bd5110138c8 100644
--- a/tests/ui-toml/lint_decimal_readability/test.rs
+++ b/tests/ui-toml/lint_decimal_readability/test.rs
@@ -1,5 +1,5 @@
 #![allow(clippy::excessive_precision)]
-#[deny(clippy::unreadable_literal)]
+#![warn(clippy::unreadable_literal)]
 
 fn allow_inconsistent_digit_grouping() {
     #![allow(clippy::inconsistent_digit_grouping)]
diff --git a/tests/ui-toml/lint_decimal_readability/test.stderr b/tests/ui-toml/lint_decimal_readability/test.stderr
index be505bda479..ac9d89d0cbe 100644
--- a/tests/ui-toml/lint_decimal_readability/test.stderr
+++ b/tests/ui-toml/lint_decimal_readability/test.stderr
@@ -6,5 +6,13 @@ LL |     let _fail1 = 100_200_300.123456789;
    |
    = note: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings`
 
-error: aborting due to previous error
+error: long literal lacking separators
+  --> $DIR/test.rs:22:18
+   |
+LL |     let _fail2 = 100200300.300200100;
+   |                  ^^^^^^^^^^^^^^^^^^^ help: consider: `100_200_300.300_200_100`
+   |
+   = note: `-D clippy::unreadable-literal` implied by `-D warnings`
+
+error: aborting due to 2 previous errors
 
diff --git a/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs b/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs
index 21849a14fa9..da76bb20fd9 100644
--- a/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs
+++ b/tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs
@@ -3,6 +3,7 @@
 fn below_limit() {
     let slice: Option<&[u32]> = Some(&[1, 2, 3]);
     if let Some(slice) = slice {
+        //~^ ERROR: binding can be a slice pattern
         // This would usually not be linted but is included now due to the
         // index limit in the config file
         println!("{}", slice[7]);
diff --git a/tests/ui-toml/min_rust_version/min_rust_version.rs b/tests/ui-toml/min_rust_version/min_rust_version.rs
index 1e3ec123a3c..e1dc3f4389c 100644
--- a/tests/ui-toml/min_rust_version/min_rust_version.rs
+++ b/tests/ui-toml/min_rust_version/min_rust_version.rs
@@ -41,7 +41,7 @@ fn match_like_matches() {
 fn match_same_arms() {
     match (1, 2, 3) {
         (1, .., 3) => 42,
-        (.., 3) => 42, //~ ERROR match arms have same body
+        (.., 3) => 42,
         _ => 0,
     };
 }
@@ -49,7 +49,7 @@ fn match_same_arms() {
 fn match_same_arms2() {
     let _ = match Some(42) {
         Some(_) => 24,
-        None => 24, //~ ERROR match arms have same body
+        None => 24,
     };
 }
 
diff --git a/tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs b/tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs
index f5761c6afeb..e7ac05dd3c6 100644
--- a/tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs
+++ b/tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs
@@ -1,8 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
-
 extern crate proc_macro;
 
 use proc_macro::TokenStream;
diff --git a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed
index e4747bedddb..054db5d9330 100644
--- a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed
+++ b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 //@run-rustfix
 
 #![warn(clippy::nonstandard_macro_braces)]
diff --git a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs
index 54edded99f4..95d1a2297e5 100644
--- a/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs
+++ b/tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 //@run-rustfix
 
 #![warn(clippy::nonstandard_macro_braces)]
diff --git a/tests/ui-toml/suppress_lint_in_const/test.rs b/tests/ui-toml/suppress_lint_in_const/test.rs
index 068b47bd09d..17c1b03d88c 100644
--- a/tests/ui-toml/suppress_lint_in_const/test.rs
+++ b/tests/ui-toml/suppress_lint_in_const/test.rs
@@ -13,6 +13,7 @@
 const ARR: [i32; 2] = [1, 2];
 const REF: &i32 = &ARR[idx()]; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
 const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
+//~^ ERROR: failed
 
 const fn idx() -> usize {
     1
@@ -34,6 +35,8 @@ fn main() {
     x[const { idx4() }]; // Ok, let rustc's `unconditional_panic` lint handle `usize` indexing on arrays.
     const { &ARR[idx()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
     const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
+    //
+    //~^^ ERROR: failed
 
     let y = &x;
     y[0]; // Ok, referencing shouldn't affect this lint. See the issue 6021
diff --git a/tests/ui-toml/suppress_lint_in_const/test.stderr b/tests/ui-toml/suppress_lint_in_const/test.stderr
index db88b1cbecb..14e13194427 100644
--- a/tests/ui-toml/suppress_lint_in_const/test.stderr
+++ b/tests/ui-toml/suppress_lint_in_const/test.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of `main::{constant#3}` failed
-  --> $DIR/test.rs:36:14
+  --> $DIR/test.rs:37:14
    |
 LL |     const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
    |              ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
 
 note: erroneous constant used
-  --> $DIR/test.rs:36:5
+  --> $DIR/test.rs:37:5
    |
 LL |     const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: indexing may panic
-  --> $DIR/test.rs:27:5
+  --> $DIR/test.rs:28:5
    |
 LL |     x[index];
    |     ^^^^^^^^
@@ -20,7 +20,7 @@ LL |     x[index];
    = note: `-D clippy::indexing-slicing` implied by `-D warnings`
 
 error: indexing may panic
-  --> $DIR/test.rs:43:5
+  --> $DIR/test.rs:46:5
    |
 LL |     v[0];
    |     ^^^^
@@ -28,7 +28,7 @@ LL |     v[0];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> $DIR/test.rs:44:5
+  --> $DIR/test.rs:47:5
    |
 LL |     v[10];
    |     ^^^^^
@@ -36,7 +36,7 @@ LL |     v[10];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> $DIR/test.rs:45:5
+  --> $DIR/test.rs:48:5
    |
 LL |     v[1 << 3];
    |     ^^^^^^^^^
@@ -44,7 +44,7 @@ LL |     v[1 << 3];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> $DIR/test.rs:51:5
+  --> $DIR/test.rs:54:5
    |
 LL |     v[N];
    |     ^^^^
@@ -52,7 +52,7 @@ LL |     v[N];
    = help: consider using `.get(n)` or `.get_mut(n)` instead
 
 error: indexing may panic
-  --> $DIR/test.rs:52:5
+  --> $DIR/test.rs:55:5
    |
 LL |     v[M];
    |     ^^^^
diff --git a/tests/ui-toml/toml_trivially_copy/test.rs b/tests/ui-toml/toml_trivially_copy/test.rs
index 179b1266169..f267a67f40e 100644
--- a/tests/ui-toml/toml_trivially_copy/test.rs
+++ b/tests/ui-toml/toml_trivially_copy/test.rs
@@ -1,7 +1,7 @@
 //@normalize-stderr-test: "\(\d+ byte\)" -> "(N byte)"
 //@normalize-stderr-test: "\(limit: \d+ byte\)" -> "(limit: N byte)"
 
-#![deny(clippy::trivially_copy_pass_by_ref)]
+#![warn(clippy::trivially_copy_pass_by_ref)]
 
 #[derive(Copy, Clone)]
 struct Foo(u8);
diff --git a/tests/ui-toml/toml_trivially_copy/test.stderr b/tests/ui-toml/toml_trivially_copy/test.stderr
index b3ef5928e8e..d2b55eff16d 100644
--- a/tests/ui-toml/toml_trivially_copy/test.stderr
+++ b/tests/ui-toml/toml_trivially_copy/test.stderr
@@ -4,11 +4,7 @@ error: this argument (N byte) is passed by reference, but would be more efficien
 LL | fn bad(x: &u16, y: &Foo) {}
    |           ^^^^ help: consider passing by value instead: `u16`
    |
-note: the lint level is defined here
-  --> $DIR/test.rs:4:9
-   |
-LL | #![deny(clippy::trivially_copy_pass_by_ref)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: `-D clippy::trivially-copy-pass-by-ref` implied by `-D warnings`
 
 error: this argument (N byte) is passed by reference, but would be more efficient if passed by value (limit: N byte)
   --> $DIR/test.rs:14:20
diff --git a/tests/ui-toml/toml_unknown_key/conf_unknown_key.rs b/tests/ui-toml/toml_unknown_key/conf_unknown_key.rs
index 569fd2c3553..38009627757 100644
--- a/tests/ui-toml/toml_unknown_key/conf_unknown_key.rs
+++ b/tests/ui-toml/toml_unknown_key/conf_unknown_key.rs
@@ -1,3 +1,3 @@
-//@error-pattern: unknown field `foobar`, expected one of
+//@error-in-other-file: unknown field `foobar`, expected one of
 
 fn main() {}
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 475b15a2414..69678057917 100644
--- a/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
+++ b/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr
@@ -61,7 +61,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
            vec-box-size-threshold
            verbose-bit-mask-threshold
            warn-on-all-wildcard-imports
-  --> $DIR/clippy.toml:2:1
+  --> $DIR/$DIR/clippy.toml:2:1
    |
 LL | foobar = 42
    | ^^^^^^
@@ -129,7 +129,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
            vec-box-size-threshold
            verbose-bit-mask-threshold
            warn-on-all-wildcard-imports
-  --> $DIR/clippy.toml:4:1
+  --> $DIR/$DIR/clippy.toml:4:1
    |
 LL | barfoo = 53
    | ^^^^^^
diff --git a/tests/ui-toml/undocumented_unsafe_blocks/auxiliary/proc_macro_unsafe.rs b/tests/ui-toml/undocumented_unsafe_blocks/auxiliary/proc_macro_unsafe.rs
index c2326678d0d..1c591fc76f3 100644
--- a/tests/ui-toml/undocumented_unsafe_blocks/auxiliary/proc_macro_unsafe.rs
+++ b/tests/ui-toml/undocumented_unsafe_blocks/auxiliary/proc_macro_unsafe.rs
@@ -1,8 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
-
 extern crate proc_macro;
 
 use proc_macro::{Delimiter, Group, Ident, TokenStream, TokenTree};
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 c0976f0d600..33d63670958 100644
--- a/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs
+++ b/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_unsafe.rs
+//@aux-build:proc_macro_unsafe.rs:proc-macro
 
 #![warn(clippy::undocumented_unsafe_blocks, clippy::unnecessary_safety_comment)]
 #![allow(deref_nullptr, clippy::let_unit_value, clippy::missing_safety_doc)]
diff --git a/tests/ui-toml/unwrap_used/unwrap_used.rs b/tests/ui-toml/unwrap_used/unwrap_used.rs
index 9f4d0ef1bf9..dde1c6d7c37 100644
--- a/tests/ui-toml/unwrap_used/unwrap_used.rs
+++ b/tests/ui-toml/unwrap_used/unwrap_used.rs
@@ -7,7 +7,7 @@
     clippy::useless_vec
 )]
 #![warn(clippy::unwrap_used)]
-#![deny(clippy::get_unwrap)]
+#![warn(clippy::get_unwrap)]
 
 use std::collections::BTreeMap;
 use std::collections::HashMap;
diff --git a/tests/ui-toml/unwrap_used/unwrap_used.stderr b/tests/ui-toml/unwrap_used/unwrap_used.stderr
index 706f9a89cbb..eb66a5cf50b 100644
--- a/tests/ui-toml/unwrap_used/unwrap_used.stderr
+++ b/tests/ui-toml/unwrap_used/unwrap_used.stderr
@@ -4,11 +4,7 @@ error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more co
 LL |         let _ = boxed_slice.get(1).unwrap();
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
    |
-note: the lint level is defined here
-  --> $DIR/unwrap_used.rs:10:9
-   |
-LL | #![deny(clippy::get_unwrap)]
-   |         ^^^^^^^^^^^^^^^^^^
+   = note: `-D clippy::get-unwrap` implied by `-D warnings`
 
 error: used `unwrap()` on an `Option` value
   --> $DIR/unwrap_used.rs:40:17
diff --git a/tests/ui-toml/update-all-references.sh b/tests/ui-toml/update-all-references.sh
index 4391499a1e1..d4204307026 100755
--- a/tests/ui-toml/update-all-references.sh
+++ b/tests/ui-toml/update-all-references.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-echo "Please use 'cargo dev bless' instead."
+echo "Please use 'cargo bless' instead."
diff --git a/tests/ui/allow_attributes.fixed b/tests/ui/allow_attributes.fixed
index fa04f53ca91..cc95a06817d 100644
--- a/tests/ui/allow_attributes.fixed
+++ b/tests/ui/allow_attributes.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(unused)]
 #![warn(clippy::allow_attributes)]
 #![feature(lint_reasons)]
diff --git a/tests/ui/allow_attributes.rs b/tests/ui/allow_attributes.rs
index 10d2ed1a8a9..2eb6ad304ea 100644
--- a/tests/ui/allow_attributes.rs
+++ b/tests/ui/allow_attributes.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(unused)]
 #![warn(clippy::allow_attributes)]
 #![feature(lint_reasons)]
diff --git a/tests/ui/allow_attributes_without_reason.rs b/tests/ui/allow_attributes_without_reason.rs
index 663c2eb2c37..d223d564221 100644
--- a/tests/ui/allow_attributes_without_reason.rs
+++ b/tests/ui/allow_attributes_without_reason.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![feature(lint_reasons)]
 #![deny(clippy::allow_attributes_without_reason)]
 #![allow(unfulfilled_lint_expectations)]
diff --git a/tests/ui/almost_complete_range.fixed b/tests/ui/almost_complete_range.fixed
index 5cd0dcce6f7..50a13f16b44 100644
--- a/tests/ui/almost_complete_range.fixed
+++ b/tests/ui/almost_complete_range.fixed
@@ -1,6 +1,6 @@
 //@run-rustfix
 //@edition:2018
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![feature(exclusive_range_pattern)]
 #![feature(stmt_expr_attributes)]
diff --git a/tests/ui/almost_complete_range.rs b/tests/ui/almost_complete_range.rs
index db0bfc8afc3..fd8223a2309 100644
--- a/tests/ui/almost_complete_range.rs
+++ b/tests/ui/almost_complete_range.rs
@@ -1,6 +1,6 @@
 //@run-rustfix
 //@edition:2018
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![feature(exclusive_range_pattern)]
 #![feature(stmt_expr_attributes)]
diff --git a/tests/ui/arithmetic_side_effects.rs b/tests/ui/arithmetic_side_effects.rs
index 7dd14e3824d..4f38e50c81d 100644
--- a/tests/ui/arithmetic_side_effects.rs
+++ b/tests/ui/arithmetic_side_effects.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![allow(
     clippy::assign_op_pattern,
diff --git a/tests/ui/as_conversions.rs b/tests/ui/as_conversions.rs
index 48ca2f6d143..427842a51d9 100644
--- a/tests/ui/as_conversions.rs
+++ b/tests/ui/as_conversions.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::as_conversions)]
 #![allow(clippy::borrow_as_ptr, unused)]
diff --git a/tests/ui/asm_syntax.rs b/tests/ui/asm_syntax.rs
index c93995f939a..af02e202b17 100644
--- a/tests/ui/asm_syntax.rs
+++ b/tests/ui/asm_syntax.rs
@@ -1,5 +1,5 @@
-//@only-x86_64
-//@ignore-aarch64
+//@only-target-x86_64
+//@ignore-target-aarch64
 
 #[warn(clippy::inline_asm_x86_intel_syntax)]
 mod warn_intel {
diff --git a/tests/ui/auxiliary/macro_use_helper.rs b/tests/ui/auxiliary/macro_use_helper.rs
index 7ed8a28dbd9..cab216b51ac 100644
--- a/tests/ui/auxiliary/macro_use_helper.rs
+++ b/tests/ui/auxiliary/macro_use_helper.rs
@@ -1,3 +1,5 @@
+//@aux-build:macro_rules.rs
+
 extern crate macro_rules;
 
 // STMT
diff --git a/tests/ui/auxiliary/proc_macro_attr.rs b/tests/ui/auxiliary/proc_macro_attr.rs
index d164dd0e545..fdfe5fc4181 100644
--- a/tests/ui/auxiliary/proc_macro_attr.rs
+++ b/tests/ui/auxiliary/proc_macro_attr.rs
@@ -1,7 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
 #![feature(repr128, proc_macro_hygiene, proc_macro_quote, box_patterns)]
 #![allow(incomplete_features)]
 #![allow(clippy::useless_conversion, clippy::uninlined_format_args)]
diff --git a/tests/ui/auxiliary/proc_macro_derive.rs b/tests/ui/auxiliary/proc_macro_derive.rs
index 5ea86a9ff37..37f0ec2b37d 100644
--- a/tests/ui/auxiliary/proc_macro_derive.rs
+++ b/tests/ui/auxiliary/proc_macro_derive.rs
@@ -1,7 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
 #![feature(repr128, proc_macro_quote)]
 #![allow(incomplete_features)]
 #![allow(clippy::field_reassign_with_default)]
diff --git a/tests/ui/auxiliary/proc_macro_suspicious_else_formatting.rs b/tests/ui/auxiliary/proc_macro_suspicious_else_formatting.rs
index f13b76e44b0..79e8eff3aa1 100644
--- a/tests/ui/auxiliary/proc_macro_suspicious_else_formatting.rs
+++ b/tests/ui/auxiliary/proc_macro_suspicious_else_formatting.rs
@@ -1,8 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
-
 extern crate proc_macro;
 use proc_macro::{token_stream, Delimiter, Group, Ident, Span, TokenStream, TokenTree};
 
diff --git a/tests/ui/auxiliary/proc_macro_unsafe.rs b/tests/ui/auxiliary/proc_macro_unsafe.rs
index c2326678d0d..1c591fc76f3 100644
--- a/tests/ui/auxiliary/proc_macro_unsafe.rs
+++ b/tests/ui/auxiliary/proc_macro_unsafe.rs
@@ -1,8 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
-
 extern crate proc_macro;
 
 use proc_macro::{Delimiter, Group, Ident, TokenStream, TokenTree};
diff --git a/tests/ui/auxiliary/proc_macros.rs b/tests/ui/auxiliary/proc_macros.rs
index 5d849bfcf81..4d008c8cb59 100644
--- a/tests/ui/auxiliary/proc_macros.rs
+++ b/tests/ui/auxiliary/proc_macros.rs
@@ -1,7 +1,3 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-
-#![crate_type = "proc-macro"]
 #![feature(let_chains)]
 #![feature(proc_macro_span)]
 #![allow(clippy::needless_if, dead_code)]
diff --git a/tests/ui/borrow_deref_ref.fixed b/tests/ui/borrow_deref_ref.fixed
index 75526461792..b951ba04c37 100644
--- a/tests/ui/borrow_deref_ref.fixed
+++ b/tests/ui/borrow_deref_ref.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![allow(dead_code, unused_variables)]
 
diff --git a/tests/ui/borrow_deref_ref.rs b/tests/ui/borrow_deref_ref.rs
index e319d365f7e..52980e55fbe 100644
--- a/tests/ui/borrow_deref_ref.rs
+++ b/tests/ui/borrow_deref_ref.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![allow(dead_code, unused_variables)]
 
diff --git a/tests/ui/borrow_interior_mutable_const/enums.rs b/tests/ui/borrow_interior_mutable_const/enums.rs
index 29b08ab3643..da940a4cfb5 100644
--- a/tests/ui/borrow_interior_mutable_const/enums.rs
+++ b/tests/ui/borrow_interior_mutable_const/enums.rs
@@ -1,6 +1,6 @@
 //@aux-build:helper.rs
 
-#![warn(clippy::borrow_interior_mutable_const)]
+#![deny(clippy::borrow_interior_mutable_const)]
 #![allow(clippy::declare_interior_mutable_const)]
 
 // this file (mostly) replicates its `declare` counterpart. Please see it for more discussions.
@@ -19,7 +19,7 @@ const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true));
 const FROZEN_VARIANT: OptionalCell = OptionalCell::Frozen;
 
 fn borrow_optional_cell() {
-    let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability
+    let _ = &UNFROZEN_VARIANT; //~ ERROR: interior mutability
     let _ = &FROZEN_VARIANT;
 }
 
@@ -34,11 +34,11 @@ trait AssocConsts {
         // This is the "suboptimal behavior" mentioned in `is_value_unfrozen`
         // caused by a similar reason to unfrozen types without any default values
         // get linted even if it has frozen variants'.
-        let _ = &Self::TO_BE_FROZEN_VARIANT; //~ ERROR interior mutable
+        let _ = &Self::TO_BE_FROZEN_VARIANT; //~ ERROR: interior mutability
 
         // The lint ignores default values because an impl of this trait can set
         // an unfrozen variant to `DEFAULTED_ON_FROZEN_VARIANT` and use the default impl for `function`.
-        let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT; //~ ERROR interior mutable
+        let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT; //~ ERROR: interior mutability
     }
 }
 
@@ -47,9 +47,9 @@ impl AssocConsts for u64 {
     const TO_BE_FROZEN_VARIANT: OptionalCell = OptionalCell::Frozen;
 
     fn function() {
-        let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT; //~ ERROR interior mutable
+        let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT; //~ ERROR: interior mutability
         let _ = &<Self as AssocConsts>::TO_BE_FROZEN_VARIANT;
-        let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT; //~ ERROR interior mutable
+        let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT; //~ ERROR: interior mutability
         let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT;
     }
 }
@@ -67,11 +67,11 @@ trait AssocTypes {
 impl AssocTypes for u64 {
     type ToBeUnfrozen = AtomicUsize;
 
-    const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4)); //~ ERROR interior mutable
+    const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4));
     const TO_BE_FROZEN_VARIANT: Option<Self::ToBeUnfrozen> = None;
 
     fn function() {
-        let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT; //~ ERROR interior mutable
+        let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT; //~ ERROR: interior mutability
         let _ = &<Self as AssocTypes>::TO_BE_FROZEN_VARIANT;
     }
 }
@@ -83,19 +83,19 @@ enum BothOfCellAndGeneric<T> {
 }
 
 impl<T> BothOfCellAndGeneric<T> {
-    const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mutable
-    const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mutable
+    const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null()));
+    const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null());
     const FROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Frozen(5);
 
     fn function() {
-        let _ = &Self::UNFROZEN_VARIANT; //~ ERROR interior mutability
-        let _ = &Self::GENERIC_VARIANT; //~ ERROR interior mutability
+        let _ = &Self::UNFROZEN_VARIANT; //~ ERROR: interior mutability
+        let _ = &Self::GENERIC_VARIANT; //~ ERROR: interior mutability
         let _ = &Self::FROZEN_VARIANT;
     }
 }
 
 fn main() {
     // constants defined in foreign crates
-    let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT; //~ ERROR interior mutability
+    let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT; //~ ERROR: interior mutability
     let _ = &helper::WRAPPED_PRIVATE_FROZEN_VARIANT;
 }
diff --git a/tests/ui/borrow_interior_mutable_const/enums.stderr b/tests/ui/borrow_interior_mutable_const/enums.stderr
index b0cab977a03..b753ec92608 100644
--- a/tests/ui/borrow_interior_mutable_const/enums.stderr
+++ b/tests/ui/borrow_interior_mutable_const/enums.stderr
@@ -1,16 +1,20 @@
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:22:14
    |
-LL |     let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability
+LL |     let _ = &UNFROZEN_VARIANT;
    |              ^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
-   = note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
+note: the lint level is defined here
+  --> $DIR/enums.rs:3:9
+   |
+LL | #![deny(clippy::borrow_interior_mutable_const)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:37:18
    |
-LL |         let _ = &Self::TO_BE_FROZEN_VARIANT; //~ ERROR interior mutable
+LL |         let _ = &Self::TO_BE_FROZEN_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -18,7 +22,7 @@ LL |         let _ = &Self::TO_BE_FROZEN_VARIANT; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:41:18
    |
-LL |         let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT; //~ ERROR interior mutable
+LL |         let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -26,7 +30,7 @@ LL |         let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT; //~ ERROR interior muta
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:50:18
    |
-LL |         let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT; //~ ERROR interior mutable
+LL |         let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -34,7 +38,7 @@ LL |         let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT; //~ ERROR i
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:52:18
    |
-LL |         let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT; //~ ERROR interior mutable
+LL |         let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -42,7 +46,7 @@ LL |         let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT; //~ ERROR interior mu
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:74:18
    |
-LL |         let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT; //~ ERROR interior mutable
+LL |         let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -50,7 +54,7 @@ LL |         let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT; //~ ERROR in
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:91:18
    |
-LL |         let _ = &Self::UNFROZEN_VARIANT; //~ ERROR interior mutability
+LL |         let _ = &Self::UNFROZEN_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -58,7 +62,7 @@ LL |         let _ = &Self::UNFROZEN_VARIANT; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:92:18
    |
-LL |         let _ = &Self::GENERIC_VARIANT; //~ ERROR interior mutability
+LL |         let _ = &Self::GENERIC_VARIANT;
    |                  ^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -66,7 +70,7 @@ LL |         let _ = &Self::GENERIC_VARIANT; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/enums.rs:99:14
    |
-LL |     let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT; //~ ERROR interior mutability
+LL |     let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT;
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
diff --git a/tests/ui/borrow_interior_mutable_const/others.rs b/tests/ui/borrow_interior_mutable_const/others.rs
index 7c57864245a..0ea93dd8462 100644
--- a/tests/ui/borrow_interior_mutable_const/others.rs
+++ b/tests/ui/borrow_interior_mutable_const/others.rs
@@ -1,4 +1,4 @@
-#![warn(clippy::borrow_interior_mutable_const)]
+#![deny(clippy::borrow_interior_mutable_const)]
 #![allow(clippy::declare_interior_mutable_const, clippy::needless_borrow)]
 #![allow(const_item_mutation)]
 
@@ -51,14 +51,14 @@ impl<T> std::ops::Deref for StaticRef<T> {
 const CELL_REF: StaticRef<(UnsafeCell<u32>,)> = unsafe { StaticRef::new(std::ptr::null()) };
 
 fn main() {
-    ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
-    assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
+    ATOMIC.store(1, Ordering::SeqCst); //~ ERROR: interior mutability
+    assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR: interior mutability
 
     let _once = ONCE_INIT;
-    let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
-    let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
-    let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
-    let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
+    let _once_ref = &ONCE_INIT; //~ ERROR: interior mutability
+    let _once_ref_2 = &&ONCE_INIT; //~ ERROR: interior mutability
+    let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR: interior mutability
+    let _once_mut = &mut ONCE_INIT; //~ ERROR: interior mutability
     let _atomic_into_inner = ATOMIC.into_inner();
     // these should be all fine.
     let _twice = (ONCE_INIT, ONCE_INIT);
@@ -69,23 +69,23 @@ fn main() {
     let _ref_array_once = &[ONCE_INIT, ONCE_INIT][0];
 
     // referencing projection is still bad.
-    let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
-    let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
-    let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
-    let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
-    let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
+    let _ = &ATOMIC_TUPLE; //~ ERROR: interior mutability
+    let _ = &ATOMIC_TUPLE.0; //~ ERROR: interior mutability
+    let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR: interior mutability
+    let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR: interior mutability
+    let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR: interior mutability
     let _ = &*ATOMIC_TUPLE.1;
     let _ = &ATOMIC_TUPLE.2;
     let _ = (&&&&ATOMIC_TUPLE).0;
     let _ = (&&&&ATOMIC_TUPLE).2;
     let _ = ATOMIC_TUPLE.0;
-    let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
+    let _ = ATOMIC_TUPLE.0[0]; //~ ERROR: interior mutability
     let _ = ATOMIC_TUPLE.1.into_iter();
     let _ = ATOMIC_TUPLE.2;
     let _ = &{ ATOMIC_TUPLE };
 
-    CELL.set(2); //~ ERROR interior mutability
-    assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
+    CELL.set(2); //~ ERROR: interior mutability
+    assert_eq!(CELL.get(), 6); //~ ERROR: interior mutability
 
     assert_eq!(INTEGER, 8);
     assert!(STRING.is_empty());
diff --git a/tests/ui/borrow_interior_mutable_const/others.stderr b/tests/ui/borrow_interior_mutable_const/others.stderr
index c87ad206c2a..200e04b8f6b 100644
--- a/tests/ui/borrow_interior_mutable_const/others.stderr
+++ b/tests/ui/borrow_interior_mutable_const/others.stderr
@@ -1,16 +1,20 @@
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:54:5
    |
-LL |     ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
+LL |     ATOMIC.store(1, Ordering::SeqCst);
    |     ^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
-   = note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
+note: the lint level is defined here
+  --> $DIR/others.rs:1:9
+   |
+LL | #![deny(clippy::borrow_interior_mutable_const)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:55:16
    |
-LL |     assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
+LL |     assert_eq!(ATOMIC.load(Ordering::SeqCst), 5);
    |                ^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -18,7 +22,7 @@ LL |     assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutabi
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:58:22
    |
-LL |     let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
+LL |     let _once_ref = &ONCE_INIT;
    |                      ^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -26,7 +30,7 @@ LL |     let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:59:25
    |
-LL |     let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
+LL |     let _once_ref_2 = &&ONCE_INIT;
    |                         ^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -34,7 +38,7 @@ LL |     let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:60:27
    |
-LL |     let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
+LL |     let _once_ref_4 = &&&&ONCE_INIT;
    |                           ^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -42,7 +46,7 @@ LL |     let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:61:26
    |
-LL |     let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
+LL |     let _once_mut = &mut ONCE_INIT;
    |                          ^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -50,7 +54,7 @@ LL |     let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:72:14
    |
-LL |     let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
+LL |     let _ = &ATOMIC_TUPLE;
    |              ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -58,7 +62,7 @@ LL |     let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:73:14
    |
-LL |     let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
+LL |     let _ = &ATOMIC_TUPLE.0;
    |              ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -66,7 +70,7 @@ LL |     let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:74:19
    |
-LL |     let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
+LL |     let _ = &(&&&&ATOMIC_TUPLE).0;
    |                   ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -74,7 +78,7 @@ LL |     let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:75:14
    |
-LL |     let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
+LL |     let _ = &ATOMIC_TUPLE.0[0];
    |              ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -82,7 +86,7 @@ LL |     let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:76:13
    |
-LL |     let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
+LL |     let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst);
    |             ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -90,7 +94,7 @@ LL |     let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mu
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:82:13
    |
-LL |     let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
+LL |     let _ = ATOMIC_TUPLE.0[0];
    |             ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -98,7 +102,7 @@ LL |     let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:87:5
    |
-LL |     CELL.set(2); //~ ERROR interior mutability
+LL |     CELL.set(2);
    |     ^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -106,7 +110,7 @@ LL |     CELL.set(2); //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/others.rs:88:16
    |
-LL |     assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
+LL |     assert_eq!(CELL.get(), 6);
    |                ^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
diff --git a/tests/ui/borrow_interior_mutable_const/traits.rs b/tests/ui/borrow_interior_mutable_const/traits.rs
index 06b5d62e8f9..4da3833cbf5 100644
--- a/tests/ui/borrow_interior_mutable_const/traits.rs
+++ b/tests/ui/borrow_interior_mutable_const/traits.rs
@@ -1,4 +1,4 @@
-#![warn(clippy::borrow_interior_mutable_const)]
+#![deny(clippy::borrow_interior_mutable_const)]
 #![allow(clippy::declare_interior_mutable_const)]
 
 // this file replicates its `declare` counterpart. Please see it for more discussions.
@@ -12,7 +12,7 @@ trait ConcreteTypes {
     const STRING: String;
 
     fn function() {
-        let _ = &Self::ATOMIC; //~ ERROR interior mutable
+        let _ = &Self::ATOMIC; //~ ERROR: interior mutability
         let _ = &Self::STRING;
     }
 }
@@ -23,7 +23,7 @@ impl ConcreteTypes for u64 {
 
     fn function() {
         // Lint this again since implementers can choose not to borrow it.
-        let _ = &Self::ATOMIC; //~ ERROR interior mutable
+        let _ = &Self::ATOMIC; //~ ERROR: interior mutability
         let _ = &Self::STRING;
     }
 }
@@ -48,7 +48,7 @@ impl<T: ConstDefault> GenericTypes<T, AtomicUsize> for Vec<T> {
 
     fn function() {
         let _ = &Self::TO_REMAIN_GENERIC;
-        let _ = &Self::TO_BE_CONCRETE; //~ ERROR interior mutable
+        let _ = &Self::TO_BE_CONCRETE; //~ ERROR: interior mutability
     }
 }
 
@@ -83,8 +83,8 @@ impl<T: ConstDefault> AssocTypes for Vec<T> {
 
     fn function() {
         let _ = &Self::TO_BE_FROZEN;
-        let _ = &Self::TO_BE_UNFROZEN; //~ ERROR interior mutable
-        let _ = &Self::WRAPPED_TO_BE_UNFROZEN; //~ ERROR interior mutable
+        let _ = &Self::TO_BE_UNFROZEN; //~ ERROR: interior mutability
+        let _ = &Self::WRAPPED_TO_BE_UNFROZEN; //~ ERROR: interior mutability
         let _ = &Self::WRAPPED_TO_BE_GENERIC_PARAM;
     }
 }
@@ -106,7 +106,7 @@ where
 
     fn function() {
         let _ = &Self::NOT_BOUNDED;
-        let _ = &Self::BOUNDED; //~ ERROR interior mutable
+        let _ = &Self::BOUNDED; //~ ERROR: interior mutability
     }
 }
 
@@ -119,7 +119,7 @@ where
 
     fn function() {
         let _ = &Self::NOT_BOUNDED;
-        let _ = &Self::BOUNDED; //~ ERROR interior mutable
+        let _ = &Self::BOUNDED; //~ ERROR: interior mutability
     }
 }
 
@@ -148,8 +148,8 @@ impl SelfType for AtomicUsize {
     const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21));
 
     fn function() {
-        let _ = &Self::SELF; //~ ERROR interior mutable
-        let _ = &Self::WRAPPED_SELF; //~ ERROR interior mutable
+        let _ = &Self::SELF; //~ ERROR: interior mutability
+        let _ = &Self::WRAPPED_SELF; //~ ERROR: interior mutability
     }
 }
 
@@ -159,7 +159,7 @@ trait BothOfCellAndGeneric<T> {
 
     fn function() {
         let _ = &Self::DIRECT;
-        let _ = &Self::INDIRECT; //~ ERROR interior mutable
+        let _ = &Self::INDIRECT; //~ ERROR: interior mutability
     }
 }
 
@@ -169,7 +169,7 @@ impl<T: ConstDefault> BothOfCellAndGeneric<T> for Vec<T> {
 
     fn function() {
         let _ = &Self::DIRECT;
-        let _ = &Self::INDIRECT; //~ ERROR interior mutable
+        let _ = &Self::INDIRECT; //~ ERROR: interior mutability
     }
 }
 
@@ -188,15 +188,15 @@ where
     const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19);
 
     fn function() {
-        let _ = &Self::ATOMIC; //~ ERROR interior mutable
+        let _ = &Self::ATOMIC; //~ ERROR: interior mutability
         let _ = &Self::COW;
         let _ = &Self::GENERIC_TYPE;
         let _ = &Self::ASSOC_TYPE;
-        let _ = &Self::BOUNDED_ASSOC_TYPE; //~ ERROR interior mutable
+        let _ = &Self::BOUNDED_ASSOC_TYPE; //~ ERROR: interior mutability
     }
 }
 
 fn main() {
-    u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
-    assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
+    u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR: interior mutability
+    assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR: interior mutability
 }
diff --git a/tests/ui/borrow_interior_mutable_const/traits.stderr b/tests/ui/borrow_interior_mutable_const/traits.stderr
index f34ae8814c3..add223acd68 100644
--- a/tests/ui/borrow_interior_mutable_const/traits.stderr
+++ b/tests/ui/borrow_interior_mutable_const/traits.stderr
@@ -1,16 +1,20 @@
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:15:18
    |
-LL |         let _ = &Self::ATOMIC; //~ ERROR interior mutable
+LL |         let _ = &Self::ATOMIC;
    |                  ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
-   = note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
+note: the lint level is defined here
+  --> $DIR/traits.rs:1:9
+   |
+LL | #![deny(clippy::borrow_interior_mutable_const)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:26:18
    |
-LL |         let _ = &Self::ATOMIC; //~ ERROR interior mutable
+LL |         let _ = &Self::ATOMIC;
    |                  ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -18,7 +22,7 @@ LL |         let _ = &Self::ATOMIC; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:51:18
    |
-LL |         let _ = &Self::TO_BE_CONCRETE; //~ ERROR interior mutable
+LL |         let _ = &Self::TO_BE_CONCRETE;
    |                  ^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -26,7 +30,7 @@ LL |         let _ = &Self::TO_BE_CONCRETE; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:86:18
    |
-LL |         let _ = &Self::TO_BE_UNFROZEN; //~ ERROR interior mutable
+LL |         let _ = &Self::TO_BE_UNFROZEN;
    |                  ^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -34,7 +38,7 @@ LL |         let _ = &Self::TO_BE_UNFROZEN; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:87:18
    |
-LL |         let _ = &Self::WRAPPED_TO_BE_UNFROZEN; //~ ERROR interior mutable
+LL |         let _ = &Self::WRAPPED_TO_BE_UNFROZEN;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -42,7 +46,7 @@ LL |         let _ = &Self::WRAPPED_TO_BE_UNFROZEN; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:109:18
    |
-LL |         let _ = &Self::BOUNDED; //~ ERROR interior mutable
+LL |         let _ = &Self::BOUNDED;
    |                  ^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -50,7 +54,7 @@ LL |         let _ = &Self::BOUNDED; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:122:18
    |
-LL |         let _ = &Self::BOUNDED; //~ ERROR interior mutable
+LL |         let _ = &Self::BOUNDED;
    |                  ^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -58,7 +62,7 @@ LL |         let _ = &Self::BOUNDED; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:151:18
    |
-LL |         let _ = &Self::SELF; //~ ERROR interior mutable
+LL |         let _ = &Self::SELF;
    |                  ^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -66,7 +70,7 @@ LL |         let _ = &Self::SELF; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:152:18
    |
-LL |         let _ = &Self::WRAPPED_SELF; //~ ERROR interior mutable
+LL |         let _ = &Self::WRAPPED_SELF;
    |                  ^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -74,7 +78,7 @@ LL |         let _ = &Self::WRAPPED_SELF; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:162:18
    |
-LL |         let _ = &Self::INDIRECT; //~ ERROR interior mutable
+LL |         let _ = &Self::INDIRECT;
    |                  ^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -82,7 +86,7 @@ LL |         let _ = &Self::INDIRECT; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:172:18
    |
-LL |         let _ = &Self::INDIRECT; //~ ERROR interior mutable
+LL |         let _ = &Self::INDIRECT;
    |                  ^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -90,7 +94,7 @@ LL |         let _ = &Self::INDIRECT; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:191:18
    |
-LL |         let _ = &Self::ATOMIC; //~ ERROR interior mutable
+LL |         let _ = &Self::ATOMIC;
    |                  ^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -98,7 +102,7 @@ LL |         let _ = &Self::ATOMIC; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:195:18
    |
-LL |         let _ = &Self::BOUNDED_ASSOC_TYPE; //~ ERROR interior mutable
+LL |         let _ = &Self::BOUNDED_ASSOC_TYPE;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -106,7 +110,7 @@ LL |         let _ = &Self::BOUNDED_ASSOC_TYPE; //~ ERROR interior mutable
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:200:5
    |
-LL |     u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
+LL |     u64::ATOMIC.store(5, Ordering::SeqCst);
    |     ^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
@@ -114,7 +118,7 @@ LL |     u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
 error: a `const` item with interior mutability should not be borrowed
   --> $DIR/traits.rs:201:16
    |
-LL |     assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
+LL |     assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9);
    |                ^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
diff --git a/tests/ui/builtin_type_shadow.rs b/tests/ui/builtin_type_shadow.rs
index 69b8b6a0e68..c5addd53434 100644
--- a/tests/ui/builtin_type_shadow.rs
+++ b/tests/ui/builtin_type_shadow.rs
@@ -3,7 +3,7 @@
 
 fn foo<u32>(a: u32) -> u32 {
     42
-    // ^ rustc's type error
+    //~^ ERROR: mismatched types
 }
 
 fn main() {}
diff --git a/tests/ui/cmp_owned/with_suggestion.fixed b/tests/ui/cmp_owned/with_suggestion.fixed
index 76f90ab2a9d..bf1a58588a8 100644
--- a/tests/ui/cmp_owned/with_suggestion.fixed
+++ b/tests/ui/cmp_owned/with_suggestion.fixed
@@ -31,7 +31,7 @@ struct Foo;
 impl PartialEq for Foo {
     // Allow this here, because it emits the lint
     // without a suggestion. This is tested in
-    // `tests/ui/cmp_owned/without_suggestion.rs`
+    // `$DIR/without_suggestion.rs`
     #[allow(clippy::cmp_owned)]
     fn eq(&self, other: &Self) -> bool {
         self.to_owned() == *other
diff --git a/tests/ui/cognitive_complexity.stderr b/tests/ui/cognitive_complexity.stderr
index 5824631fa83..d867246301a 100644
--- a/tests/ui/cognitive_complexity.stderr
+++ b/tests/ui/cognitive_complexity.stderr
@@ -40,6 +40,14 @@ LL | fn bar() {
    = help: you could split it up into multiple smaller functions
 
 error: the function has a cognitive complexity of (2/1)
+  --> $DIR/cognitive_complexity.rs:178:4
+   |
+LL | fn dont_warn_on_tests() {
+   |    ^^^^^^^^^^^^^^^^^^
+   |
+   = help: you could split it up into multiple smaller functions
+
+error: the function has a cognitive complexity of (2/1)
   --> $DIR/cognitive_complexity.rs:186:4
    |
 LL | fn barr() {
@@ -151,5 +159,5 @@ LL |         pub async fn async_method() {
    |
    = help: you could split it up into multiple smaller functions
 
-error: aborting due to 19 previous errors
+error: aborting due to 20 previous errors
 
diff --git a/tests/ui/crashes/auxiliary/proc_macro_crash.rs b/tests/ui/crashes/auxiliary/proc_macro_crash.rs
index 66419656a32..5dffddc119a 100644
--- a/tests/ui/crashes/auxiliary/proc_macro_crash.rs
+++ b/tests/ui/crashes/auxiliary/proc_macro_crash.rs
@@ -1,13 +1,5 @@
-//@compile-flags: --emit=link
-//@no-prefer-dynamic
-// ^ compiletest by default builds all aux files as dylibs, but we don't want that for proc-macro
-// crates. If we don't set this, compiletest will override the `crate_type` attribute below and
-// compile this as dylib. Removing this then causes the test to fail because a `dylib` crate can't
-// contain a proc-macro.
-
 #![feature(repr128)]
 #![allow(incomplete_features)]
-#![crate_type = "proc-macro"]
 
 extern crate proc_macro;
 
diff --git a/tests/ui/crashes/ice-10148.rs b/tests/ui/crashes/ice-10148.rs
index c7f0224820e..0df22f41374 100644
--- a/tests/ui/crashes/ice-10148.rs
+++ b/tests/ui/crashes/ice-10148.rs
@@ -1,4 +1,4 @@
-//@aux-build:../../auxiliary/proc_macros.rs
+//@aux-build:../auxiliary/proc_macros.rs:proc-macro
 
 extern crate proc_macros;
 
diff --git a/tests/ui/crashes/ice-3741.rs b/tests/ui/crashes/ice-3741.rs
index 3106a2e7216..268c5ba0ad0 100644
--- a/tests/ui/crashes/ice-3741.rs
+++ b/tests/ui/crashes/ice-3741.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_crash.rs
+//@aux-build:proc_macro_crash.rs:proc-macro
 
 #![warn(clippy::suspicious_else_formatting)]
 
diff --git a/tests/ui/crashes/ice-5497.rs b/tests/ui/crashes/ice-5497.rs
index 0769bce5fc8..f77f691c192 100644
--- a/tests/ui/crashes/ice-5497.rs
+++ b/tests/ui/crashes/ice-5497.rs
@@ -7,5 +7,5 @@ pub trait Foo {
 
 impl<T: Foo> Foo for Vec<T> {
     const OOB: i32 = [1][1] + T::OOB;
-    //~^ ERROR operation will panic
+    //~^ ERROR: operation will panic
 }
diff --git a/tests/ui/crashes/ice-6250.stderr b/tests/ui/crashes/ice-6250.stderr
index 4506d1550bd..b72037b7d4a 100644
--- a/tests/ui/crashes/ice-6250.stderr
+++ b/tests/ui/crashes/ice-6250.stderr
@@ -1,9 +1,3 @@
-error[E0601]: `main` function not found in crate `ice_6250`
-  --> $DIR/ice-6250.rs:16:2
-   |
-LL | }
-   |  ^ consider adding a `main` function to `$DIR/ice-6250.rs`
-
 error[E0308]: mismatched types
   --> $DIR/ice-6250.rs:12:14
    |
@@ -29,7 +23,6 @@ help: consider adding `let`
 LL |         let Some(reference) = cache.data.get(key) {
    |         +++
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0308, E0601.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/crashes/ice-6251.stderr b/tests/ui/crashes/ice-6251.stderr
index 8da2965c635..68a5766c90c 100644
--- a/tests/ui/crashes/ice-6251.stderr
+++ b/tests/ui/crashes/ice-6251.stderr
@@ -1,9 +1,3 @@
-error[E0601]: `main` function not found in crate `ice_6251`
-  --> $DIR/ice-6251.rs:6:2
-   |
-LL | }
-   |  ^ consider adding a `main` function to `$DIR/ice-6251.rs`
-
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> $DIR/ice-6251.rs:4:45
    |
@@ -35,7 +29,7 @@ LL | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
    = note: expected type `usize`
            found closure `[closure@$DIR/ice-6251.rs:4:44: 4:53]`
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0277, E0308, E0601.
+Some errors have detailed explanations: E0277, E0308.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/crashes/ice-6255.rs b/tests/ui/crashes/ice-6255.rs
index ccde6aa2b0f..b6555ac5c40 100644
--- a/tests/ui/crashes/ice-6255.rs
+++ b/tests/ui/crashes/ice-6255.rs
@@ -4,7 +4,6 @@
 macro_rules! define_other_core {
     ( ) => {
         extern crate std as core;
-        //~^ ERROR macro-expanded `extern crate` items cannot shadow names passed with `--extern`
     };
 }
 
@@ -13,3 +12,4 @@ fn main() {
 }
 
 define_other_core!();
+//~^ ERROR: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
diff --git a/tests/ui/crashes/ice-6256.rs b/tests/ui/crashes/ice-6256.rs
index f9ee3e058c1..1d336b3cdc0 100644
--- a/tests/ui/crashes/ice-6256.rs
+++ b/tests/ui/crashes/ice-6256.rs
@@ -10,6 +10,6 @@ impl dyn TT {
 
 #[rustfmt::skip]
 fn main() {
-    let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
-                                   //[nll]~^ ERROR: borrowed data escapes outside of closure
+    let f = |x: &dyn TT| x.func();
+    //~^ ERROR: borrowed data escapes outside of closure
 }
diff --git a/tests/ui/crashes/ice-6256.stderr b/tests/ui/crashes/ice-6256.stderr
index 9cfcccf1e3c..671933157c8 100644
--- a/tests/ui/crashes/ice-6256.stderr
+++ b/tests/ui/crashes/ice-6256.stderr
@@ -1,7 +1,7 @@
 error[E0521]: borrowed data escapes outside of closure
   --> $DIR/ice-6256.rs:13:26
    |
-LL |     let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
+LL |     let f = |x: &dyn TT| x.func();
    |              -  -        ^^^^^^^^
    |              |  |        |
    |              |  |        `x` escapes the closure body here
diff --git a/tests/ui/crashes/ice-7410.rs b/tests/ui/crashes/ice-7410.rs
index a5373cdcae1..a2683b3ce34 100644
--- a/tests/ui/crashes/ice-7410.rs
+++ b/tests/ui/crashes/ice-7410.rs
@@ -1,6 +1,6 @@
 //@compile-flags: -Clink-arg=-nostartfiles
-//@ignore-macos
-//@ignore-windows
+//@ignore-target-apple
+//@ignore-target-windows
 
 #![feature(lang_items, start, libc)]
 #![no_std]
diff --git a/tests/ui/crashes/ice-96721.rs b/tests/ui/crashes/ice-96721.rs
index 4b3fb764010..ca68ba3d03a 100644
--- a/tests/ui/crashes/ice-96721.rs
+++ b/tests/ui/crashes/ice-96721.rs
@@ -4,7 +4,7 @@ macro_rules! foo {
     };
 }
 
-#[path = foo!()] //~ ERROR malformed `path` attribute
+#[path = foo!()] //~ ERROR: malformed `path` attribute
 mod abc {}
 
 fn main() {}
diff --git a/tests/ui/crashes/ice-96721.stderr b/tests/ui/crashes/ice-96721.stderr
index 78c567b8e77..712bd14c685 100644
--- a/tests/ui/crashes/ice-96721.stderr
+++ b/tests/ui/crashes/ice-96721.stderr
@@ -1,7 +1,7 @@
 error: malformed `path` attribute input
   --> $DIR/ice-96721.rs:7:1
    |
-LL | #[path = foo!()] //~ ERROR malformed `path` attribute
+LL | #[path = foo!()]
    | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[path = "file"]`
 
 error: aborting due to previous error
diff --git a/tests/ui/crate_level_checks/entrypoint_recursion.rs b/tests/ui/crate_level_checks/entrypoint_recursion.rs
index d6cd594d7c9..aa76688d801 100644
--- a/tests/ui/crate_level_checks/entrypoint_recursion.rs
+++ b/tests/ui/crate_level_checks/entrypoint_recursion.rs
@@ -1,4 +1,4 @@
-//@ignore-macos
+//@ignore-target-apple
 
 #![feature(rustc_attrs)]
 
diff --git a/tests/ui/crate_level_checks/entrypoint_recursion.stderr b/tests/ui/crate_level_checks/entrypoint_recursion.stderr
deleted file mode 100644
index 3d79a115cb3..00000000000
--- a/tests/ui/crate_level_checks/entrypoint_recursion.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: recursing into entrypoint `a`
-  --> $DIR/entrypoint_recursion.rs:10:5
-   |
-LL |     a();
-   |     ^
-   |
-   = help: consider using another function for this recursion
-   = note: `-D clippy::main-recursion` implied by `-D warnings`
-
-error: aborting due to previous error
-
diff --git a/tests/ui/crate_level_checks/no_std_main_recursion.rs b/tests/ui/crate_level_checks/no_std_main_recursion.rs
index a382135bb69..32eba969592 100644
--- a/tests/ui/crate_level_checks/no_std_main_recursion.rs
+++ b/tests/ui/crate_level_checks/no_std_main_recursion.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Clink-arg=-nostartfiles
-//@ignore-macos
+//@ignore-target-apple
 
 #![feature(lang_items, start, libc)]
 #![no_std]
diff --git a/tests/ui/dbg_macro.rs b/tests/ui/dbg_macro.rs
index 10788d40481..6c63c098916 100644
--- a/tests/ui/dbg_macro.rs
+++ b/tests/ui/dbg_macro.rs
@@ -1,4 +1,3 @@
-//@compile-flags: --test
 #![warn(clippy::dbg_macro)]
 
 fn foo(n: u32) -> u32 {
diff --git a/tests/ui/dbg_macro.stderr b/tests/ui/dbg_macro.stderr
index 530e7663317..3d292625959 100644
--- a/tests/ui/dbg_macro.stderr
+++ b/tests/ui/dbg_macro.stderr
@@ -1,5 +1,5 @@
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:5:22
+  --> $DIR/dbg_macro.rs:4:22
    |
 LL |     if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
    |                      ^^^^^^^^^^^^^^^^^^^^^^
@@ -11,7 +11,7 @@ LL |     if let Some(n) = n.checked_sub(4) { n } else { n }
    |                      ~~~~~~~~~~~~~~~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:10:8
+  --> $DIR/dbg_macro.rs:9:8
    |
 LL |     if dbg!(n <= 1) {
    |        ^^^^^^^^^^^^
@@ -22,7 +22,7 @@ LL |     if n <= 1 {
    |        ~~~~~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:11:9
+  --> $DIR/dbg_macro.rs:10:9
    |
 LL |         dbg!(1)
    |         ^^^^^^^
@@ -33,7 +33,7 @@ LL |         1
    |
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:13:9
+  --> $DIR/dbg_macro.rs:12:9
    |
 LL |         dbg!(n * factorial(n - 1))
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -44,7 +44,7 @@ LL |         n * factorial(n - 1)
    |
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:18:5
+  --> $DIR/dbg_macro.rs:17:5
    |
 LL |     dbg!(42);
    |     ^^^^^^^^
@@ -55,7 +55,7 @@ LL |     42;
    |     ~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:19:5
+  --> $DIR/dbg_macro.rs:18:5
    |
 LL |     dbg!(dbg!(dbg!(42)));
    |     ^^^^^^^^^^^^^^^^^^^^
@@ -66,7 +66,7 @@ LL |     dbg!(dbg!(42));
    |     ~~~~~~~~~~~~~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:20:14
+  --> $DIR/dbg_macro.rs:19:14
    |
 LL |     foo(3) + dbg!(factorial(4));
    |              ^^^^^^^^^^^^^^^^^^
@@ -77,7 +77,7 @@ LL |     foo(3) + factorial(4);
    |              ~~~~~~~~~~~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:21:5
+  --> $DIR/dbg_macro.rs:20:5
    |
 LL |     dbg!(1, 2, dbg!(3, 4));
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -88,7 +88,7 @@ LL |     (1, 2, dbg!(3, 4));
    |     ~~~~~~~~~~~~~~~~~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:22:5
+  --> $DIR/dbg_macro.rs:21:5
    |
 LL |     dbg!(1, 2, 3, 4, 5);
    |     ^^^^^^^^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL |     (1, 2, 3, 4, 5);
    |     ~~~~~~~~~~~~~~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:42:5
+  --> $DIR/dbg_macro.rs:41:5
    |
 LL |     dbg!();
    |     ^^^^^^^
@@ -111,7 +111,7 @@ LL +
    |
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:44:13
+  --> $DIR/dbg_macro.rs:43:13
    |
 LL |     let _ = dbg!();
    |             ^^^^^^
@@ -122,7 +122,7 @@ LL |     let _ = ();
    |             ~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:45:9
+  --> $DIR/dbg_macro.rs:44:9
    |
 LL |     bar(dbg!());
    |         ^^^^^^
@@ -133,7 +133,7 @@ LL |     bar(());
    |         ~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:46:10
+  --> $DIR/dbg_macro.rs:45:10
    |
 LL |     foo!(dbg!());
    |          ^^^^^^
@@ -144,7 +144,7 @@ LL |     foo!(());
    |          ~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:47:16
+  --> $DIR/dbg_macro.rs:46:16
    |
 LL |     foo2!(foo!(dbg!()));
    |                ^^^^^^
@@ -155,7 +155,7 @@ LL |     foo2!(foo!(()));
    |                ~~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:68:9
+  --> $DIR/dbg_macro.rs:67:9
    |
 LL |         dbg!(2);
    |         ^^^^^^^
@@ -166,7 +166,7 @@ LL |         2;
    |         ~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:74:5
+  --> $DIR/dbg_macro.rs:73:5
    |
 LL |     dbg!(1);
    |     ^^^^^^^
@@ -177,7 +177,7 @@ LL |     1;
    |     ~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:79:5
+  --> $DIR/dbg_macro.rs:78:5
    |
 LL |     dbg!(1);
    |     ^^^^^^^
@@ -188,7 +188,7 @@ LL |     1;
    |     ~
 
 error: the `dbg!` macro is intended as a debugging tool
-  --> $DIR/dbg_macro.rs:85:9
+  --> $DIR/dbg_macro.rs:84:9
    |
 LL |         dbg!(1);
    |         ^^^^^^^
diff --git a/tests/ui/declare_interior_mutable_const/enums.rs b/tests/ui/declare_interior_mutable_const/enums.rs
index f44518694b8..a88bf7b21b8 100644
--- a/tests/ui/declare_interior_mutable_const/enums.rs
+++ b/tests/ui/declare_interior_mutable_const/enums.rs
@@ -9,7 +9,7 @@ enum OptionalCell {
 }
 
 // a constant with enums should be linted only when the used variant is unfrozen (#3962).
-const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true)); //~ ERROR interior mutable
+const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true)); //~ ERROR: interior mutable
 const FROZEN_VARIANT: OptionalCell = OptionalCell::Frozen;
 
 const fn unfrozen_variant() -> OptionalCell {
@@ -20,7 +20,7 @@ const fn frozen_variant() -> OptionalCell {
     OptionalCell::Frozen
 }
 
-const UNFROZEN_VARIANT_FROM_FN: OptionalCell = unfrozen_variant(); //~ ERROR interior mutable
+const UNFROZEN_VARIANT_FROM_FN: OptionalCell = unfrozen_variant(); //~ ERROR: interior mutable
 const FROZEN_VARIANT_FROM_FN: OptionalCell = frozen_variant();
 
 enum NestedInnermost {
@@ -43,10 +43,11 @@ struct NestedOutermost {
 
 // a constant with enums should be linted according to its value, no matter how structs involve.
 const NESTED_UNFROZEN_VARIANT: NestedOutermost = NestedOutermost {
+    //~^ ERROR: interior mutable
     outer: NestedOuter::NestedInner(NestedInner {
         inner: NestedInnermost::Unfrozen(AtomicUsize::new(2)),
     }),
-}; //~ ERROR interior mutable
+};
 const NESTED_FROZEN_VARIANT: NestedOutermost = NestedOutermost {
     outer: NestedOuter::NestedInner(NestedInner {
         inner: NestedInnermost::Frozen,
@@ -56,11 +57,11 @@ const NESTED_FROZEN_VARIANT: NestedOutermost = NestedOutermost {
 trait AssocConsts {
     // When there's no default value, lint it only according to its type.
     // Further details are on the corresponding code (`NonCopyConst::check_trait_item`).
-    const TO_BE_UNFROZEN_VARIANT: OptionalCell; //~ ERROR interior mutable
-    const TO_BE_FROZEN_VARIANT: OptionalCell; //~ ERROR interior mutable
+    const TO_BE_UNFROZEN_VARIANT: OptionalCell; //~ ERROR: interior mutable
+    const TO_BE_FROZEN_VARIANT: OptionalCell; //~ ERROR: interior mutable
 
     // Lint default values accordingly.
-    const DEFAULTED_ON_UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(false)); //~ ERROR interior mutable
+    const DEFAULTED_ON_UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(false)); //~ ERROR: interior mutable
     const DEFAULTED_ON_FROZEN_VARIANT: OptionalCell = OptionalCell::Frozen;
 }
 
@@ -86,7 +87,7 @@ trait AssocTypes {
 impl AssocTypes for u64 {
     type ToBeUnfrozen = AtomicUsize;
 
-    const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4)); //~ ERROR interior mutable
+    const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4)); //~ ERROR: interior mutable
     const TO_BE_FROZEN_VARIANT: Option<Self::ToBeUnfrozen> = None;
 }
 
@@ -98,25 +99,25 @@ enum BothOfCellAndGeneric<T> {
 }
 
 impl<T> BothOfCellAndGeneric<T> {
-    const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mutable
+    const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR: interior mutable
 
     // This is a false positive. The argument about this is on `is_value_unfrozen_raw`
-    const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mutable
+    const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR: interior mutable
 
     const FROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Frozen(5);
 
     // This is what is likely to be a false negative when one tries to fix
     // the `GENERIC_VARIANT` false positive.
-    const NO_ENUM: Cell<*const T> = Cell::new(std::ptr::null()); //~ ERROR interior mutable
+    const NO_ENUM: Cell<*const T> = Cell::new(std::ptr::null()); //~ ERROR: interior mutable
 }
 
 // associated types here is basically the same as the one above.
 trait BothOfCellAndGenericWithAssocType {
     type AssocType;
 
-    const UNFROZEN_VARIANT: BothOfCellAndGeneric<Self::AssocType> =
-        BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mutable
-    const GENERIC_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mutable
+    const UNFROZEN_VARIANT: BothOfCellAndGeneric<Self::AssocType> = //~ ERROR: interior mutable
+        BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null()));
+    const GENERIC_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR: interior mutable
     const FROZEN_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Frozen(5);
 }
 
diff --git a/tests/ui/declare_interior_mutable_const/enums.stderr b/tests/ui/declare_interior_mutable_const/enums.stderr
index 84198d54615..6070df749ca 100644
--- a/tests/ui/declare_interior_mutable_const/enums.stderr
+++ b/tests/ui/declare_interior_mutable_const/enums.stderr
@@ -1,7 +1,7 @@
 error: a `const` item should never be interior mutable
   --> $DIR/enums.rs:12:1
    |
-LL | const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true)); //~ ERROR interior mutable
+LL | const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true));
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | make this a static item (maybe with lazy_static)
@@ -11,7 +11,7 @@ LL | const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(tru
 error: a `const` item should never be interior mutable
   --> $DIR/enums.rs:23:1
    |
-LL | const UNFROZEN_VARIANT_FROM_FN: OptionalCell = unfrozen_variant(); //~ ERROR interior mutable
+LL | const UNFROZEN_VARIANT_FROM_FN: OptionalCell = unfrozen_variant();
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | make this a static item (maybe with lazy_static)
@@ -24,65 +24,66 @@ LL |   const NESTED_UNFROZEN_VARIANT: NestedOutermost = NestedOutermost {
    |   |
    |  _make this a static item (maybe with lazy_static)
    | |
+LL | |
 LL | |     outer: NestedOuter::NestedInner(NestedInner {
 LL | |         inner: NestedInnermost::Unfrozen(AtomicUsize::new(2)),
 LL | |     }),
-LL | | }; //~ ERROR interior mutable
+LL | | };
    | |__^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:59:5
+  --> $DIR/enums.rs:60:5
    |
-LL |     const TO_BE_UNFROZEN_VARIANT: OptionalCell; //~ ERROR interior mutable
+LL |     const TO_BE_UNFROZEN_VARIANT: OptionalCell;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:60:5
+  --> $DIR/enums.rs:61:5
    |
-LL |     const TO_BE_FROZEN_VARIANT: OptionalCell; //~ ERROR interior mutable
+LL |     const TO_BE_FROZEN_VARIANT: OptionalCell;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:63:5
+  --> $DIR/enums.rs:64:5
    |
-LL |     const DEFAULTED_ON_UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(false)); //~ ERROR interior mutable
+LL |     const DEFAULTED_ON_UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(false));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:89:5
+  --> $DIR/enums.rs:90:5
    |
-LL |     const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4)); //~ ERROR interior mutable
+LL |     const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:101:5
+  --> $DIR/enums.rs:102:5
    |
-LL |     const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mut...
+LL |     const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null()));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:104:5
+  --> $DIR/enums.rs:105:5
    |
-LL |     const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mutable
+LL |     const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:110:5
+  --> $DIR/enums.rs:111:5
    |
-LL |     const NO_ENUM: Cell<*const T> = Cell::new(std::ptr::null()); //~ ERROR interior mutable
+LL |     const NO_ENUM: Cell<*const T> = Cell::new(std::ptr::null());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:117:5
+  --> $DIR/enums.rs:118:5
    |
 LL | /     const UNFROZEN_VARIANT: BothOfCellAndGeneric<Self::AssocType> =
-LL | |         BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mutable
+LL | |         BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null()));
    | |____________________________________________________________________^
 
 error: a `const` item should never be interior mutable
-  --> $DIR/enums.rs:119:5
+  --> $DIR/enums.rs:120:5
    |
-LL |     const GENERIC_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mu...
+LL |     const GENERIC_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Generic(std::ptr::null());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 12 previous errors
diff --git a/tests/ui/declare_interior_mutable_const/others.rs b/tests/ui/declare_interior_mutable_const/others.rs
index 896596b5679..1cec2980652 100644
--- a/tests/ui/declare_interior_mutable_const/others.rs
+++ b/tests/ui/declare_interior_mutable_const/others.rs
@@ -6,17 +6,17 @@ use std::fmt::Display;
 use std::sync::atomic::AtomicUsize;
 use std::sync::Once;
 
-const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
-const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
+const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR: interior mutable
+const CELL: Cell<usize> = Cell::new(6); //~ ERROR: interior mutable
 const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
-//~^ ERROR interior mutable
+//~^ ERROR: interior mutable
 
 macro_rules! declare_const {
     ($name:ident: $ty:ty = $e:expr) => {
         const $name: $ty = $e;
     };
 }
-declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
+declare_const!(_ONCE: Once = Once::new()); //~ ERROR: interior mutable
 
 // const ATOMIC_REF: &AtomicUsize = &AtomicUsize::new(7); // This will simply trigger E0492.
 
@@ -24,12 +24,12 @@ const INTEGER: u8 = 8;
 const STRING: String = String::new();
 const STR: &str = "012345";
 const COW: Cow<str> = Cow::Borrowed("abcdef");
-//^ note: a const item of Cow is used in the `postgres` package.
+// note: a const item of Cow is used in the `postgres` package.
 
 const NO_ANN: &dyn Display = &70;
 
 static STATIC_TUPLE: (AtomicUsize, String) = (ATOMIC, STRING);
-//^ there should be no lints on this line
+// there should be no lints on the line above line
 
 mod issue_8493 {
     use std::cell::Cell;
@@ -40,7 +40,7 @@ mod issue_8493 {
 
     macro_rules! issue_8493 {
         () => {
-            const _BAZ: Cell<usize> = Cell::new(0); //~ ERROR interior mutable
+            const _BAZ: Cell<usize> = Cell::new(0);
             static _FOOBAR: () = {
                 thread_local! {
                     static _VAR: Cell<i32> = const { Cell::new(0) };
@@ -49,7 +49,7 @@ mod issue_8493 {
         };
     }
 
-    issue_8493!();
+    issue_8493!(); //~ ERROR: interior mutable
 }
 
 fn main() {}
diff --git a/tests/ui/declare_interior_mutable_const/others.stderr b/tests/ui/declare_interior_mutable_const/others.stderr
index 1fd6d7322a7..0259f6a4a28 100644
--- a/tests/ui/declare_interior_mutable_const/others.stderr
+++ b/tests/ui/declare_interior_mutable_const/others.stderr
@@ -1,7 +1,7 @@
 error: a `const` item should never be interior mutable
   --> $DIR/others.rs:9:1
    |
-LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
+LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5);
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | make this a static item (maybe with lazy_static)
@@ -11,7 +11,7 @@ LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
 error: a `const` item should never be interior mutable
   --> $DIR/others.rs:10:1
    |
-LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
+LL | const CELL: Cell<usize> = Cell::new(6);
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | make this a static item (maybe with lazy_static)
@@ -30,7 +30,7 @@ error: a `const` item should never be interior mutable
 LL |         const $name: $ty = $e;
    |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
-LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
+LL | declare_const!(_ONCE: Once = Once::new());
    | ----------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -38,7 +38,7 @@ LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
 error: a `const` item should never be interior mutable
   --> $DIR/others.rs:43:13
    |
-LL |             const _BAZ: Cell<usize> = Cell::new(0); //~ ERROR interior mutable
+LL |             const _BAZ: Cell<usize> = Cell::new(0);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL |     issue_8493!();
diff --git a/tests/ui/declare_interior_mutable_const/traits.rs b/tests/ui/declare_interior_mutable_const/traits.rs
index 256a336db82..a6ccdd27079 100644
--- a/tests/ui/declare_interior_mutable_const/traits.rs
+++ b/tests/ui/declare_interior_mutable_const/traits.rs
@@ -12,10 +12,10 @@ macro_rules! declare_const {
 
 // a constant whose type is a concrete type should be linted at the definition site.
 trait ConcreteTypes {
-    const ATOMIC: AtomicUsize; //~ ERROR interior mutable
+    const ATOMIC: AtomicUsize; //~ ERROR: interior mutable
     const INTEGER: u64;
     const STRING: String;
-    declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR interior mutable
+    declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR: interior mutable
 }
 
 impl ConcreteTypes for u64 {
@@ -40,7 +40,7 @@ trait GenericTypes<T, U> {
 
 impl<T: ConstDefault> GenericTypes<T, AtomicUsize> for u64 {
     const TO_REMAIN_GENERIC: T = T::DEFAULT;
-    const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11); //~ ERROR interior mutable
+    const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11); //~ ERROR: interior mutable
 }
 
 // a helper type used below
@@ -65,8 +65,8 @@ impl<T: ConstDefault> AssocTypes for Vec<T> {
     type ToBeGenericParam = T;
 
     const TO_BE_FROZEN: Self::ToBeFrozen = 12;
-    const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13); //~ ERROR interior mutable
-    const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14)); //~ ERROR interior mutable
+    const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13); //~ ERROR: interior mutable
+    const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14)); //~ ERROR: interior mutable
     const WRAPPED_TO_BE_GENERIC_PARAM: Wrapper<Self::ToBeGenericParam> = Wrapper(T::DEFAULT);
 }
 
@@ -85,7 +85,7 @@ where
     T: AssocTypesHelper<ToBeBounded = AtomicUsize>,
 {
     const NOT_BOUNDED: T::NotToBeBounded;
-    const BOUNDED: T::ToBeBounded; //~ ERROR interior mutable
+    const BOUNDED: T::ToBeBounded; //~ ERROR: interior mutable
 }
 
 impl<T> AssocTypesFromGenericParam<T> for u64
@@ -113,8 +113,8 @@ impl SelfType for u64 {
 impl SelfType for AtomicUsize {
     // this (interior mutable `Self` const) exists in `parking_lot`.
     // `const_trait_impl` will replace it in the future, hopefully.
-    const SELF: Self = AtomicUsize::new(17); //~ ERROR interior mutable
-    const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21)); //~ ERROR interior mutable
+    const SELF: Self = AtomicUsize::new(17); //~ ERROR: interior mutable
+    const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21)); //~ ERROR: interior mutable
 }
 
 // Even though a constant contains a generic type, if it also have an interior mutable type,
@@ -122,7 +122,7 @@ impl SelfType for AtomicUsize {
 trait BothOfCellAndGeneric<T> {
     // this is a false negative in the current implementation.
     const DIRECT: Cell<T>;
-    const INDIRECT: Cell<*const T>; //~ ERROR interior mutable
+    const INDIRECT: Cell<*const T>; //~ ERROR: interior mutable
 }
 
 impl<T: ConstDefault> BothOfCellAndGeneric<T> for u64 {
@@ -138,13 +138,13 @@ impl<T> Local<T>
 where
     T: ConstDefault + AssocTypesHelper<ToBeBounded = AtomicUsize>,
 {
-    const ATOMIC: AtomicUsize = AtomicUsize::new(18); //~ ERROR interior mutable
+    const ATOMIC: AtomicUsize = AtomicUsize::new(18); //~ ERROR: interior mutable
     const COW: Cow<'static, str> = Cow::Borrowed("tuvwxy");
 
     const GENERIC_TYPE: T = T::DEFAULT;
 
     const ASSOC_TYPE: T::NotToBeBounded = T::NOT_TO_BE_BOUNDED;
-    const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19); //~ ERROR interior mutable
+    const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19); //~ ERROR: interior mutable
 }
 
 fn main() {}
diff --git a/tests/ui/declare_interior_mutable_const/traits.stderr b/tests/ui/declare_interior_mutable_const/traits.stderr
index 7debe059ff4..ef62919dfea 100644
--- a/tests/ui/declare_interior_mutable_const/traits.stderr
+++ b/tests/ui/declare_interior_mutable_const/traits.stderr
@@ -1,7 +1,7 @@
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:15:5
    |
-LL |     const ATOMIC: AtomicUsize; //~ ERROR interior mutable
+LL |     const ATOMIC: AtomicUsize;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
@@ -12,7 +12,7 @@ error: a `const` item should never be interior mutable
 LL |         const $name: $ty = $e;
    |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
-LL |     declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR interior mutable
+LL |     declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC);
    |     ---------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -20,55 +20,55 @@ LL |     declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR i
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:43:5
    |
-LL |     const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11); //~ ERROR interior mutable
+LL |     const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:68:5
    |
-LL |     const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13); //~ ERROR interior mutable
+LL |     const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:69:5
    |
-LL |     const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14)); //~ ERROR interior mutable
+LL |     const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:88:5
    |
-LL |     const BOUNDED: T::ToBeBounded; //~ ERROR interior mutable
+LL |     const BOUNDED: T::ToBeBounded;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:116:5
    |
-LL |     const SELF: Self = AtomicUsize::new(17); //~ ERROR interior mutable
+LL |     const SELF: Self = AtomicUsize::new(17);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:117:5
    |
-LL |     const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21)); //~ ERROR interior mutable
+LL |     const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:125:5
    |
-LL |     const INDIRECT: Cell<*const T>; //~ ERROR interior mutable
+LL |     const INDIRECT: Cell<*const T>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:141:5
    |
-LL |     const ATOMIC: AtomicUsize = AtomicUsize::new(18); //~ ERROR interior mutable
+LL |     const ATOMIC: AtomicUsize = AtomicUsize::new(18);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a `const` item should never be interior mutable
   --> $DIR/traits.rs:147:5
    |
-LL |     const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19); //~ ERROR interior mutable
+LL |     const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 11 previous errors
diff --git a/tests/ui/def_id_nocore.rs b/tests/ui/def_id_nocore.rs
index f7819068ac5..da0816830b8 100644
--- a/tests/ui/def_id_nocore.rs
+++ b/tests/ui/def_id_nocore.rs
@@ -1,4 +1,4 @@
-//@ignore-macos
+//@ignore-target-apple
 
 #![feature(no_core, lang_items, start)]
 #![no_core]
diff --git a/tests/ui/default_numeric_fallback_f64.fixed b/tests/ui/default_numeric_fallback_f64.fixed
index 9520efe6329..02eb7806013 100644
--- a/tests/ui/default_numeric_fallback_f64.fixed
+++ b/tests/ui/default_numeric_fallback_f64.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::default_numeric_fallback)]
 #![allow(
diff --git a/tests/ui/default_numeric_fallback_f64.rs b/tests/ui/default_numeric_fallback_f64.rs
index cacbdb4a95b..79a9669833f 100644
--- a/tests/ui/default_numeric_fallback_f64.rs
+++ b/tests/ui/default_numeric_fallback_f64.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::default_numeric_fallback)]
 #![allow(
diff --git a/tests/ui/default_numeric_fallback_i32.fixed b/tests/ui/default_numeric_fallback_i32.fixed
index fbabb8bcf8e..23272d07eec 100644
--- a/tests/ui/default_numeric_fallback_i32.fixed
+++ b/tests/ui/default_numeric_fallback_i32.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![feature(lint_reasons)]
 #![warn(clippy::default_numeric_fallback)]
diff --git a/tests/ui/default_numeric_fallback_i32.rs b/tests/ui/default_numeric_fallback_i32.rs
index 7bfc390e4bf..fb149141609 100644
--- a/tests/ui/default_numeric_fallback_i32.rs
+++ b/tests/ui/default_numeric_fallback_i32.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![feature(lint_reasons)]
 #![warn(clippy::default_numeric_fallback)]
diff --git a/tests/ui/default_trait_access.fixed b/tests/ui/default_trait_access.fixed
index bf5dca97641..14eb6d572cf 100644
--- a/tests/ui/default_trait_access.fixed
+++ b/tests/ui/default_trait_access.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![deny(clippy::default_trait_access)]
 #![allow(dead_code, unused_imports)]
 #![allow(clippy::uninlined_format_args)]
diff --git a/tests/ui/default_trait_access.rs b/tests/ui/default_trait_access.rs
index 5e8e9ce85b1..aa2ced0a7f0 100644
--- a/tests/ui/default_trait_access.rs
+++ b/tests/ui/default_trait_access.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![deny(clippy::default_trait_access)]
 #![allow(dead_code, unused_imports)]
 #![allow(clippy::uninlined_format_args)]
diff --git a/tests/ui/deref_addrof.fixed b/tests/ui/deref_addrof.fixed
index 0bf739fe2d1..0ecca1b8ffa 100644
--- a/tests/ui/deref_addrof.fixed
+++ b/tests/ui/deref_addrof.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(clippy::return_self_not_must_use, clippy::useless_vec)]
 #![warn(clippy::deref_addrof)]
diff --git a/tests/ui/deref_addrof.rs b/tests/ui/deref_addrof.rs
index 2d796a24fec..9f91310e61f 100644
--- a/tests/ui/deref_addrof.rs
+++ b/tests/ui/deref_addrof.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(clippy::return_self_not_must_use, clippy::useless_vec)]
 #![warn(clippy::deref_addrof)]
diff --git a/tests/ui/deref_addrof_macro.rs b/tests/ui/deref_addrof_macro.rs
index c7e60f36506..ce4b94a73bd 100644
--- a/tests/ui/deref_addrof_macro.rs
+++ b/tests/ui/deref_addrof_macro.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::deref_addrof)]
 
diff --git a/tests/ui/doc_unsafe.rs b/tests/ui/doc_unsafe.rs
index 0c8eac5ccff..d21b046f167 100644
--- a/tests/ui/doc_unsafe.rs
+++ b/tests/ui/doc_unsafe.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(clippy::let_unit_value)]
 
diff --git a/tests/ui/else_if_without_else.rs b/tests/ui/else_if_without_else.rs
index 879b3ac398e..eb5e2266540 100644
--- a/tests/ui/else_if_without_else.rs
+++ b/tests/ui/else_if_without_else.rs
@@ -43,7 +43,7 @@ fn main() {
     if bla1() {
         println!("if");
     } else if bla2() {
-        //~ ERROR else if without else
+        //~^ ERROR: `if` expression with an `else if`, but without a final `else`
         println!("else if");
     }
 
@@ -52,7 +52,7 @@ fn main() {
     } else if bla2() {
         println!("else if 1");
     } else if bla3() {
-        //~ ERROR else if without else
+        //~^ ERROR: `if` expression with an `else if`, but without a final `else`
         println!("else if 2");
     }
 }
diff --git a/tests/ui/else_if_without_else.stderr b/tests/ui/else_if_without_else.stderr
index 90ccfb4fad6..11baf75441a 100644
--- a/tests/ui/else_if_without_else.stderr
+++ b/tests/ui/else_if_without_else.stderr
@@ -3,7 +3,7 @@ error: `if` expression with an `else if`, but without a final `else`
    |
 LL |       } else if bla2() {
    |  ____________^
-LL | |         //~ ERROR else if without else
+LL | |
 LL | |         println!("else if");
 LL | |     }
    | |_____^
@@ -16,7 +16,7 @@ error: `if` expression with an `else if`, but without a final `else`
    |
 LL |       } else if bla3() {
    |  ____________^
-LL | |         //~ ERROR else if without else
+LL | |
 LL | |         println!("else if 2");
 LL | |     }
    | |_____^
diff --git a/tests/ui/empty_line_after_doc_comments.rs b/tests/ui/empty_line_after_doc_comments.rs
index e843770f578..83db2a07d33 100644
--- a/tests/ui/empty_line_after_doc_comments.rs
+++ b/tests/ui/empty_line_after_doc_comments.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_attr.rs
+//@aux-build:proc_macro_attr.rs:proc-macro
 #![warn(clippy::empty_line_after_doc_comments)]
 #![allow(clippy::assertions_on_constants)]
 #![feature(custom_inner_attributes)]
diff --git a/tests/ui/empty_line_after_outer_attribute.rs b/tests/ui/empty_line_after_outer_attribute.rs
index 269e66ea0a8..b2d7ddae427 100644
--- a/tests/ui/empty_line_after_outer_attribute.rs
+++ b/tests/ui/empty_line_after_outer_attribute.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_attr.rs
+//@aux-build:proc_macro_attr.rs:proc-macro
 #![warn(clippy::empty_line_after_outer_attr)]
 #![allow(clippy::assertions_on_constants)]
 #![feature(custom_inner_attributes)]
diff --git a/tests/ui/empty_loop.rs b/tests/ui/empty_loop.rs
index 54e8fb4907c..f1a55415c8d 100644
--- a/tests/ui/empty_loop.rs
+++ b/tests/ui/empty_loop.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::empty_loop)]
 
diff --git a/tests/ui/empty_loop_no_std.rs b/tests/ui/empty_loop_no_std.rs
index d564b2d24f5..f9ab443dfd9 100644
--- a/tests/ui/empty_loop_no_std.rs
+++ b/tests/ui/empty_loop_no_std.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Clink-arg=-nostartfiles
-//@ignore-macos
+//@ignore-target-apple
 
 #![warn(clippy::empty_loop)]
 #![feature(lang_items, start, libc)]
diff --git a/tests/ui/enum_clike_unportable_variant.rs b/tests/ui/enum_clike_unportable_variant.rs
index f17556ea907..abe42a2305f 100644
--- a/tests/ui/enum_clike_unportable_variant.rs
+++ b/tests/ui/enum_clike_unportable_variant.rs
@@ -1,4 +1,4 @@
-//@ignore-x86
+//@ignore-target-x86
 
 #![warn(clippy::enum_clike_unportable_variant)]
 #![allow(unused, non_upper_case_globals)]
diff --git a/tests/ui/eprint_with_newline.rs b/tests/ui/eprint_with_newline.rs
index de5e121be87..8389806c838 100644
--- a/tests/ui/eprint_with_newline.rs
+++ b/tests/ui/eprint_with_newline.rs
@@ -44,7 +44,7 @@ fn main() {
     // Don't warn on CRLF (#4208)
     eprint!("\r\n");
     eprint!("foo\r\n");
-    eprint!("\\r\n"); //~ ERROR
+    eprint!("\\r\n");
     eprint!("foo\rbar\n");
 
     // Ignore expanded format strings
diff --git a/tests/ui/eprint_with_newline.stderr b/tests/ui/eprint_with_newline.stderr
index 0eefb9f0ca9..0a6bdf15df8 100644
--- a/tests/ui/eprint_with_newline.stderr
+++ b/tests/ui/eprint_with_newline.stderr
@@ -62,13 +62,13 @@ LL +     eprintln!();
 error: using `eprint!()` with a format string that ends in a single newline
   --> $DIR/eprint_with_newline.rs:28:5
    |
-LL |     eprint!("//n"); // should fail
+LL |     eprint!("///n"); // should fail
    |     ^^^^^^^^^^^^^^^
    |
 help: use `eprintln!` instead
    |
-LL -     eprint!("//n"); // should fail
-LL +     eprintln!("/"); // should fail
+LL -     eprint!("///n"); // should fail
+LL +     eprintln!("//"); // should fail
    |
 
 error: using `eprint!()` with a format string that ends in a single newline
@@ -104,13 +104,13 @@ LL ~
 error: using `eprint!()` with a format string that ends in a single newline
   --> $DIR/eprint_with_newline.rs:47:5
    |
-LL |     eprint!("/r/n"); //~ ERROR
+LL |     eprint!("//r/n");
    |     ^^^^^^^^^^^^^^^^
    |
 help: use `eprintln!` instead
    |
-LL -     eprint!("/r/n"); //~ ERROR
-LL +     eprintln!("/r"); //~ ERROR
+LL -     eprint!("//r/n");
+LL +     eprintln!("//r");
    |
 
 error: aborting due to 9 previous errors
diff --git a/tests/ui/eq_op.rs b/tests/ui/eq_op.rs
index cdd33ebe582..38372378168 100644
--- a/tests/ui/eq_op.rs
+++ b/tests/ui/eq_op.rs
@@ -1,5 +1,3 @@
-//@compile-flags: --test
-
 #![warn(clippy::eq_op)]
 #![allow(clippy::double_parens, clippy::identity_op, clippy::nonminimal_bool)]
 #![allow(clippy::suspicious_xor_used_as_pow)]
diff --git a/tests/ui/eq_op.stderr b/tests/ui/eq_op.stderr
index d365ab27edc..2c013b6b6fe 100644
--- a/tests/ui/eq_op.stderr
+++ b/tests/ui/eq_op.stderr
@@ -1,5 +1,5 @@
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:9:13
+  --> $DIR/eq_op.rs:7:13
    |
 LL |     let _ = 1 == 1;
    |             ^^^^^^
@@ -7,163 +7,163 @@ LL |     let _ = 1 == 1;
    = note: `-D clippy::eq-op` implied by `-D warnings`
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:10:13
+  --> $DIR/eq_op.rs:8:13
    |
 LL |     let _ = "no" == "no";
    |             ^^^^^^^^^^^^
 
 error: equal expressions as operands to `!=`
-  --> $DIR/eq_op.rs:12:13
+  --> $DIR/eq_op.rs:10:13
    |
 LL |     let _ = false != false;
    |             ^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `<`
-  --> $DIR/eq_op.rs:13:13
+  --> $DIR/eq_op.rs:11:13
    |
 LL |     let _ = 1.5 < 1.5;
    |             ^^^^^^^^^
 
 error: equal expressions as operands to `>=`
-  --> $DIR/eq_op.rs:14:13
+  --> $DIR/eq_op.rs:12:13
    |
 LL |     let _ = 1u64 >= 1u64;
    |             ^^^^^^^^^^^^
 
 error: equal expressions as operands to `&`
-  --> $DIR/eq_op.rs:17:13
+  --> $DIR/eq_op.rs:15:13
    |
 LL |     let _ = (1u32 as u64) & (1u32 as u64);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `^`
-  --> $DIR/eq_op.rs:20:17
+  --> $DIR/eq_op.rs:18:17
    |
 LL |         let _ = 1 ^ ((((((1))))));
    |                 ^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `<`
-  --> $DIR/eq_op.rs:24:13
+  --> $DIR/eq_op.rs:22:13
    |
 LL |     let _ = (-(2) < -(2));
    |             ^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:25:13
+  --> $DIR/eq_op.rs:23:13
    |
 LL |     let _ = ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&`
-  --> $DIR/eq_op.rs:25:14
+  --> $DIR/eq_op.rs:23:14
    |
 LL |     let _ = ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
    |              ^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&`
-  --> $DIR/eq_op.rs:25:35
+  --> $DIR/eq_op.rs:23:35
    |
 LL |     let _ = ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
    |                                   ^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:26:13
+  --> $DIR/eq_op.rs:24:13
    |
 LL |     let _ = (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `!=`
-  --> $DIR/eq_op.rs:29:13
+  --> $DIR/eq_op.rs:27:13
    |
 LL |     let _ = ([1] != [1]);
    |             ^^^^^^^^^^^^
 
 error: equal expressions as operands to `!=`
-  --> $DIR/eq_op.rs:30:13
+  --> $DIR/eq_op.rs:28:13
    |
 LL |     let _ = ((1, 2) != (1, 2));
    |             ^^^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:34:13
+  --> $DIR/eq_op.rs:32:13
    |
 LL |     let _ = 1 + 1 == 2;
    |             ^^^^^^^^^^
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:35:13
+  --> $DIR/eq_op.rs:33:13
    |
 LL |     let _ = 1 - 1 == 0;
    |             ^^^^^^^^^^
 
 error: equal expressions as operands to `-`
-  --> $DIR/eq_op.rs:35:13
+  --> $DIR/eq_op.rs:33:13
    |
 LL |     let _ = 1 - 1 == 0;
    |             ^^^^^
 
 error: equal expressions as operands to `-`
-  --> $DIR/eq_op.rs:37:13
+  --> $DIR/eq_op.rs:35:13
    |
 LL |     let _ = 1 - 1;
    |             ^^^^^
 
 error: equal expressions as operands to `/`
-  --> $DIR/eq_op.rs:38:13
+  --> $DIR/eq_op.rs:36:13
    |
 LL |     let _ = 1 / 1;
    |             ^^^^^
 
 error: equal expressions as operands to `&&`
-  --> $DIR/eq_op.rs:39:13
+  --> $DIR/eq_op.rs:37:13
    |
 LL |     let _ = true && true;
    |             ^^^^^^^^^^^^
 
 error: equal expressions as operands to `||`
-  --> $DIR/eq_op.rs:41:13
+  --> $DIR/eq_op.rs:39:13
    |
 LL |     let _ = true || true;
    |             ^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
-  --> $DIR/eq_op.rs:46:13
+  --> $DIR/eq_op.rs:44:13
    |
 LL |     let _ = a == b && b == a;
    |             ^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
-  --> $DIR/eq_op.rs:47:13
+  --> $DIR/eq_op.rs:45:13
    |
 LL |     let _ = a != b && b != a;
    |             ^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
-  --> $DIR/eq_op.rs:48:13
+  --> $DIR/eq_op.rs:46:13
    |
 LL |     let _ = a < b && b > a;
    |             ^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `&&`
-  --> $DIR/eq_op.rs:49:13
+  --> $DIR/eq_op.rs:47:13
    |
 LL |     let _ = a <= b && b >= a;
    |             ^^^^^^^^^^^^^^^^
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:52:13
+  --> $DIR/eq_op.rs:50:13
    |
 LL |     let _ = a == a;
    |             ^^^^^^
 
 error: equal expressions as operands to `/`
-  --> $DIR/eq_op.rs:62:20
+  --> $DIR/eq_op.rs:60:20
    |
 LL |     const D: u32 = A / A;
    |                    ^^^^^
 
 error: equal expressions as operands to `==`
-  --> $DIR/eq_op.rs:93:5
+  --> $DIR/eq_op.rs:91:5
    |
 LL |     (n1.inner.0).0 == (n1.inner.0).0 && (n1.inner.1).0 == (n2.inner.1).0 && (n1.inner.2).0 == (n2.inner.2).0
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/equatable_if_let.fixed b/tests/ui/equatable_if_let.fixed
index 1869301d224..6cc070fb552 100644
--- a/tests/ui/equatable_if_let.fixed
+++ b/tests/ui/equatable_if_let.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(
     unused_variables,
diff --git a/tests/ui/equatable_if_let.rs b/tests/ui/equatable_if_let.rs
index a78aec74a7b..f00a129bef1 100644
--- a/tests/ui/equatable_if_let.rs
+++ b/tests/ui/equatable_if_let.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(
     unused_variables,
diff --git a/tests/ui/extra_unused_lifetimes.rs b/tests/ui/extra_unused_lifetimes.rs
index cdfaf8d3afe..50abe89da89 100644
--- a/tests/ui/extra_unused_lifetimes.rs
+++ b/tests/ui/extra_unused_lifetimes.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![allow(
     unused,
diff --git a/tests/ui/extra_unused_type_parameters.fixed b/tests/ui/extra_unused_type_parameters.fixed
index 03ac9abf498..8420df6634d 100644
--- a/tests/ui/extra_unused_type_parameters.fixed
+++ b/tests/ui/extra_unused_type_parameters.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(unused, clippy::needless_lifetimes)]
 #![warn(clippy::extra_unused_type_parameters)]
diff --git a/tests/ui/extra_unused_type_parameters.rs b/tests/ui/extra_unused_type_parameters.rs
index 731c89c18dc..f63535d7ae6 100644
--- a/tests/ui/extra_unused_type_parameters.rs
+++ b/tests/ui/extra_unused_type_parameters.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(unused, clippy::needless_lifetimes)]
 #![warn(clippy::extra_unused_type_parameters)]
diff --git a/tests/ui/field_reassign_with_default.rs b/tests/ui/field_reassign_with_default.rs
index 2045b1eebcd..d6df114b8d2 100644
--- a/tests/ui/field_reassign_with_default.rs
+++ b/tests/ui/field_reassign_with_default.rs
@@ -1,5 +1,5 @@
-//@aux-build:proc_macro_derive.rs
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::field_reassign_with_default)]
 
diff --git a/tests/ui/get_unwrap.fixed b/tests/ui/get_unwrap.fixed
index f0d28dd9349..56ee37f02d2 100644
--- a/tests/ui/get_unwrap.fixed
+++ b/tests/ui/get_unwrap.fixed
@@ -76,14 +76,14 @@ mod issue9909 {
     fn reduced() {
         let f = &[1, 2, 3];
 
+        // include a borrow in the suggestion, even if the argument is not just a numeric literal
         let _x: &i32 = &f[1 + 2];
-        // ^ include a borrow in the suggestion, even if the argument is not just a numeric literal
 
+        // don't include a borrow here
         let _x = f[1 + 2].to_string();
-        // ^ don't include a borrow here
 
+        // don't include a borrow here
         let _x = f[1 + 2].abs();
-        // ^ don't include a borrow here
     }
 
     // original code:
diff --git a/tests/ui/get_unwrap.rs b/tests/ui/get_unwrap.rs
index 21c1ecb0af2..af3a619adc5 100644
--- a/tests/ui/get_unwrap.rs
+++ b/tests/ui/get_unwrap.rs
@@ -76,14 +76,14 @@ mod issue9909 {
     fn reduced() {
         let f = &[1, 2, 3];
 
+        // include a borrow in the suggestion, even if the argument is not just a numeric literal
         let _x: &i32 = f.get(1 + 2).unwrap();
-        // ^ include a borrow in the suggestion, even if the argument is not just a numeric literal
 
+        // don't include a borrow here
         let _x = f.get(1 + 2).unwrap().to_string();
-        // ^ don't include a borrow here
 
+        // don't include a borrow here
         let _x = f.get(1 + 2).unwrap().abs();
-        // ^ don't include a borrow here
     }
 
     // original code:
diff --git a/tests/ui/get_unwrap.stderr b/tests/ui/get_unwrap.stderr
index 154083ea654..fd961420dc4 100644
--- a/tests/ui/get_unwrap.stderr
+++ b/tests/ui/get_unwrap.stderr
@@ -188,19 +188,19 @@ LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
    = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
 
 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-  --> $DIR/get_unwrap.rs:79:24
+  --> $DIR/get_unwrap.rs:80:24
    |
 LL |         let _x: &i32 = f.get(1 + 2).unwrap();
    |                        ^^^^^^^^^^^^^^^^^^^^^ help: try this: `&f[1 + 2]`
 
 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-  --> $DIR/get_unwrap.rs:82:18
+  --> $DIR/get_unwrap.rs:83:18
    |
 LL |         let _x = f.get(1 + 2).unwrap().to_string();
    |                  ^^^^^^^^^^^^^^^^^^^^^ help: try this: `f[1 + 2]`
 
 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
-  --> $DIR/get_unwrap.rs:85:18
+  --> $DIR/get_unwrap.rs:86:18
    |
 LL |         let _x = f.get(1 + 2).unwrap().abs();
    |                  ^^^^^^^^^^^^^^^^^^^^^ help: try this: `f[1 + 2]`
diff --git a/tests/ui/if_same_then_else.rs b/tests/ui/if_same_then_else.rs
index 07d2002eb27..dad4543f84c 100644
--- a/tests/ui/if_same_then_else.rs
+++ b/tests/ui/if_same_then_else.rs
@@ -21,6 +21,7 @@ fn foo() -> bool {
 
 fn if_same_then_else() {
     if true {
+        //~^ ERROR: this `if` has identical blocks
         Foo { bar: 42 };
         0..10;
         ..;
@@ -29,7 +30,6 @@ fn if_same_then_else() {
         0..=10;
         foo();
     } else {
-        //~ ERROR same body as `if` block
         Foo { bar: 42 };
         0..10;
         ..;
@@ -65,16 +65,16 @@ fn if_same_then_else() {
     }
 
     let _ = if true {
+        //~^ ERROR: this `if` has identical blocks
         0.0
     } else {
-        //~ ERROR same body as `if` block
         0.0
     };
 
     let _ = if true {
+        //~^ ERROR: this `if` has identical blocks
         -0.0
     } else {
-        //~ ERROR same body as `if` block
         -0.0
     };
 
@@ -88,13 +88,14 @@ fn if_same_then_else() {
     }
 
     let _ = if true {
+        //~^ ERROR: this `if` has identical blocks
         42
     } else {
-        //~ ERROR same body as `if` block
         42
     };
 
     if true {
+        //~^ ERROR: this `if` has identical blocks
         let bar = if true { 42 } else { 43 };
 
         while foo() {
@@ -102,7 +103,6 @@ fn if_same_then_else() {
         }
         bar + 1;
     } else {
-        //~ ERROR same body as `if` block
         let bar = if true { 42 } else { 43 };
 
         while foo() {
diff --git a/tests/ui/if_same_then_else.stderr b/tests/ui/if_same_then_else.stderr
index fb23b81d36d..a34fc565590 100644
--- a/tests/ui/if_same_then_else.stderr
+++ b/tests/ui/if_same_then_else.stderr
@@ -3,22 +3,22 @@ error: this `if` has identical blocks
    |
 LL |       if true {
    |  _____________^
+LL | |
 LL | |         Foo { bar: 42 };
 LL | |         0..10;
-LL | |         ..;
 ...  |
 LL | |         foo();
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else.rs:31:12
+  --> $DIR/if_same_then_else.rs:32:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         Foo { bar: 42 };
 LL | |         0..10;
+LL | |         ..;
 ...  |
 LL | |         foo();
 LL | |     }
@@ -30,16 +30,16 @@ error: this `if` has identical blocks
    |
 LL |       let _ = if true {
    |  _____________________^
+LL | |
 LL | |         0.0
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else.rs:69:12
+  --> $DIR/if_same_then_else.rs:70:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         0.0
 LL | |     };
    | |_____^
@@ -49,16 +49,16 @@ error: this `if` has identical blocks
    |
 LL |       let _ = if true {
    |  _____________________^
+LL | |
 LL | |         -0.0
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else.rs:76:12
+  --> $DIR/if_same_then_else.rs:77:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         -0.0
 LL | |     };
    | |_____^
@@ -68,16 +68,16 @@ error: this `if` has identical blocks
    |
 LL |       let _ = if true {
    |  _____________________^
+LL | |
 LL | |         42
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else.rs:92:12
+  --> $DIR/if_same_then_else.rs:93:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         42
 LL | |     };
    | |_____^
@@ -87,22 +87,22 @@ error: this `if` has identical blocks
    |
 LL |       if true {
    |  _____________^
+LL | |
 LL | |         let bar = if true { 42 } else { 43 };
 LL | |
-LL | |         while foo() {
 ...  |
 LL | |         bar + 1;
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else.rs:104:12
+  --> $DIR/if_same_then_else.rs:105:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         let bar = if true { 42 } else { 43 };
 LL | |
+LL | |         while foo() {
 ...  |
 LL | |         bar + 1;
 LL | |     }
diff --git a/tests/ui/if_same_then_else2.rs b/tests/ui/if_same_then_else2.rs
index 3b9b029d354..0b171f21d0c 100644
--- a/tests/ui/if_same_then_else2.rs
+++ b/tests/ui/if_same_then_else2.rs
@@ -13,6 +13,7 @@
 
 fn if_same_then_else2() -> Result<&'static str, ()> {
     if true {
+        //~^ ERROR: this `if` has identical blocks
         for _ in &[42] {
             let foo: &Option<_> = &Some::<u8>(42);
             if foo.is_some() {
@@ -22,7 +23,6 @@ fn if_same_then_else2() -> Result<&'static str, ()> {
             }
         }
     } else {
-        //~ ERROR same body as `if` block
         for _ in &[42] {
             let bar: &Option<_> = &Some::<u8>(42);
             if bar.is_some() {
@@ -34,16 +34,16 @@ fn if_same_then_else2() -> Result<&'static str, ()> {
     }
 
     if true {
+        //~^ ERROR: this `if` has identical blocks
         if let Some(a) = Some(42) {}
     } else {
-        //~ ERROR same body as `if` block
         if let Some(a) = Some(42) {}
     }
 
     if true {
+        //~^ ERROR: this `if` has identical blocks
         if let (1, .., 3) = (1, 2, 3) {}
     } else {
-        //~ ERROR same body as `if` block
         if let (1, .., 3) = (1, 2, 3) {}
     }
 
@@ -91,16 +91,16 @@ fn if_same_then_else2() -> Result<&'static str, ()> {
 
     // Same NaNs
     let _ = if true {
+        //~^ ERROR: this `if` has identical blocks
         f32::NAN
     } else {
-        //~ ERROR same body as `if` block
         f32::NAN
     };
 
     if true {
+        //~^ ERROR: this `if` has identical blocks
         Ok("foo")?;
     } else {
-        //~ ERROR same body as `if` block
         Ok("foo")?;
     }
 
@@ -122,6 +122,7 @@ fn if_same_then_else2() -> Result<&'static str, ()> {
         let foo = "bar";
         return Ok(&foo[0..]);
     } else if true {
+        //~^ ERROR: this `if` has identical blocks
         let foo = "";
         return Ok(&foo[0..]);
     } else {
diff --git a/tests/ui/if_same_then_else2.stderr b/tests/ui/if_same_then_else2.stderr
index a4d8a74167e..56e5f3e45b2 100644
--- a/tests/ui/if_same_then_else2.stderr
+++ b/tests/ui/if_same_then_else2.stderr
@@ -3,22 +3,22 @@ error: this `if` has identical blocks
    |
 LL |       if true {
    |  _____________^
+LL | |
 LL | |         for _ in &[42] {
 LL | |             let foo: &Option<_> = &Some::<u8>(42);
-LL | |             if foo.is_some() {
 ...  |
 LL | |         }
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else2.rs:24:12
+  --> $DIR/if_same_then_else2.rs:25:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         for _ in &[42] {
 LL | |             let bar: &Option<_> = &Some::<u8>(42);
+LL | |             if bar.is_some() {
 ...  |
 LL | |         }
 LL | |     }
@@ -30,16 +30,16 @@ error: this `if` has identical blocks
    |
 LL |       if true {
    |  _____________^
+LL | |
 LL | |         if let Some(a) = Some(42) {}
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else2.rs:38:12
+  --> $DIR/if_same_then_else2.rs:39:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         if let Some(a) = Some(42) {}
 LL | |     }
    | |_____^
@@ -49,16 +49,16 @@ error: this `if` has identical blocks
    |
 LL |       if true {
    |  _____________^
+LL | |
 LL | |         if let (1, .., 3) = (1, 2, 3) {}
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else2.rs:45:12
+  --> $DIR/if_same_then_else2.rs:46:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         if let (1, .., 3) = (1, 2, 3) {}
 LL | |     }
    | |_____^
@@ -68,16 +68,16 @@ error: this `if` has identical blocks
    |
 LL |       let _ = if true {
    |  _____________________^
+LL | |
 LL | |         f32::NAN
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else2.rs:95:12
+  --> $DIR/if_same_then_else2.rs:96:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         f32::NAN
 LL | |     };
    | |_____^
@@ -87,16 +87,16 @@ error: this `if` has identical blocks
    |
 LL |       if true {
    |  _____________^
+LL | |
 LL | |         Ok("foo")?;
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else2.rs:102:12
+  --> $DIR/if_same_then_else2.rs:103:12
    |
 LL |       } else {
    |  ____________^
-LL | |         //~ ERROR same body as `if` block
 LL | |         Ok("foo")?;
 LL | |     }
    | |_____^
@@ -106,13 +106,14 @@ error: this `if` has identical blocks
    |
 LL |       } else if true {
    |  ____________________^
+LL | |
 LL | |         let foo = "";
 LL | |         return Ok(&foo[0..]);
 LL | |     } else {
    | |_____^
    |
 note: same as this
-  --> $DIR/if_same_then_else2.rs:127:12
+  --> $DIR/if_same_then_else2.rs:128:12
    |
 LL |       } else {
    |  ____________^
diff --git a/tests/ui/ifs_same_cond.rs b/tests/ui/ifs_same_cond.rs
index c321b08909f..5c338e3c5c8 100644
--- a/tests/ui/ifs_same_cond.rs
+++ b/tests/ui/ifs_same_cond.rs
@@ -12,18 +12,18 @@ fn ifs_same_cond() {
 
     if b {
     } else if b {
-        //~ ERROR ifs same condition
+        //~^ ERROR: this `if` has the same condition as a previous `if`
     }
 
     if a == 1 {
     } else if a == 1 {
-        //~ ERROR ifs same condition
+        //~^ ERROR: this `if` has the same condition as a previous `if`
     }
 
     if 2 * a == 1 {
     } else if 2 * a == 2 {
     } else if 2 * a == 1 {
-        //~ ERROR ifs same condition
+        //~^ ERROR: this `if` has the same condition as a previous `if`
     } else if a == 1 {
     }
 
@@ -52,6 +52,7 @@ fn issue10272() {
     let a = String::from("ha");
     if a.contains("ah") {
     } else if a.contains("ah") {
+        //~^ ERROR: this `if` has the same condition as a previous `if`
         // Trigger this lint
     } else if a.contains("ha") {
     } else if a == "wow" {
diff --git a/tests/ui/implicit_hasher.rs b/tests/ui/implicit_hasher.rs
index ca7c1221372..7ed7bf94a4b 100644
--- a/tests/ui/implicit_hasher.rs
+++ b/tests/ui/implicit_hasher.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![deny(clippy::implicit_hasher)]
 #![allow(unused)]
diff --git a/tests/ui/inconsistent_struct_constructor.fixed b/tests/ui/inconsistent_struct_constructor.fixed
index 620d45e6828..d84346e8789 100644
--- a/tests/ui/inconsistent_struct_constructor.fixed
+++ b/tests/ui/inconsistent_struct_constructor.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::inconsistent_struct_constructor)]
 #![allow(clippy::redundant_field_names)]
diff --git a/tests/ui/inconsistent_struct_constructor.rs b/tests/ui/inconsistent_struct_constructor.rs
index 10ffadcb2ba..87fba7448e3 100644
--- a/tests/ui/inconsistent_struct_constructor.rs
+++ b/tests/ui/inconsistent_struct_constructor.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::inconsistent_struct_constructor)]
 #![allow(clippy::redundant_field_names)]
diff --git a/tests/ui/into_iter_on_ref.fixed b/tests/ui/into_iter_on_ref.fixed
index 9f550acb157..af197e33fd8 100644
--- a/tests/ui/into_iter_on_ref.fixed
+++ b/tests/ui/into_iter_on_ref.fixed
@@ -11,35 +11,35 @@ fn main() {
     for _ in &vec![X, X] {}
 
     let _ = vec![1, 2, 3].into_iter();
-    let _ = (&vec![1, 2, 3]).iter(); //~ WARN equivalent to .iter()
-    let _ = vec![1, 2, 3].into_boxed_slice().iter(); //~ WARN equivalent to .iter()
-    let _ = std::rc::Rc::from(&[X][..]).iter(); //~ WARN equivalent to .iter()
-    let _ = std::sync::Arc::from(&[X][..]).iter(); //~ WARN equivalent to .iter()
+    let _ = (&vec![1, 2, 3]).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = vec![1, 2, 3].into_boxed_slice().iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::rc::Rc::from(&[X][..]).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::sync::Arc::from(&[X][..]).iter(); //~ ERROR: equivalent to `.iter()
 
-    let _ = (&&&&&&&[1, 2, 3]).iter(); //~ ERROR equivalent to .iter()
-    let _ = (&&&&mut &&&[1, 2, 3]).iter(); //~ ERROR equivalent to .iter()
-    let _ = (&mut &mut &mut [1, 2, 3]).iter_mut(); //~ ERROR equivalent to .iter_mut()
+    let _ = (&&&&&&&[1, 2, 3]).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&&&&mut &&&[1, 2, 3]).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut &mut &mut [1, 2, 3]).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
 
-    let _ = (&Some(4)).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut Some(5)).iter_mut(); //~ WARN equivalent to .iter_mut()
-    let _ = (&Ok::<_, i32>(6)).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut Err::<i32, _>(7)).iter_mut(); //~ WARN equivalent to .iter_mut()
-    let _ = (&Vec::<i32>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut Vec::<i32>::new()).iter_mut(); //~ WARN equivalent to .iter_mut()
-    let _ = (&BTreeMap::<i32, u64>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut BTreeMap::<i32, u64>::new()).iter_mut(); //~ WARN equivalent to .iter_mut()
-    let _ = (&VecDeque::<i32>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut VecDeque::<i32>::new()).iter_mut(); //~ WARN equivalent to .iter_mut()
-    let _ = (&LinkedList::<i32>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut LinkedList::<i32>::new()).iter_mut(); //~ WARN equivalent to .iter_mut()
-    let _ = (&HashMap::<i32, u64>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut HashMap::<i32, u64>::new()).iter_mut(); //~ WARN equivalent to .iter_mut()
+    let _ = (&Some(4)).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut Some(5)).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&Ok::<_, i32>(6)).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut Err::<i32, _>(7)).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&Vec::<i32>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut Vec::<i32>::new()).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&BTreeMap::<i32, u64>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut BTreeMap::<i32, u64>::new()).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&VecDeque::<i32>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut VecDeque::<i32>::new()).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&LinkedList::<i32>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut LinkedList::<i32>::new()).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&HashMap::<i32, u64>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut HashMap::<i32, u64>::new()).iter_mut(); //~ ERROR: equivalent to `.iter_mut()
 
-    let _ = (&BTreeSet::<i32>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&BinaryHeap::<i32>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = (&HashSet::<i32>::new()).iter(); //~ WARN equivalent to .iter()
-    let _ = std::path::Path::new("12/34").iter(); //~ WARN equivalent to .iter()
-    let _ = std::path::PathBuf::from("12/34").iter(); //~ ERROR equivalent to .iter()
+    let _ = (&BTreeSet::<i32>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&BinaryHeap::<i32>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&HashSet::<i32>::new()).iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::path::Path::new("12/34").iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::path::PathBuf::from("12/34").iter(); //~ ERROR: equivalent to `.iter()
 
-    let _ = (&[1, 2, 3]).iter().next(); //~ WARN equivalent to .iter()
+    let _ = (&[1, 2, 3]).iter().next(); //~ ERROR: equivalent to `.iter()
 }
diff --git a/tests/ui/into_iter_on_ref.rs b/tests/ui/into_iter_on_ref.rs
index 3381ae04dce..3ac13d7dd3e 100644
--- a/tests/ui/into_iter_on_ref.rs
+++ b/tests/ui/into_iter_on_ref.rs
@@ -11,35 +11,35 @@ fn main() {
     for _ in &vec![X, X] {}
 
     let _ = vec![1, 2, 3].into_iter();
-    let _ = (&vec![1, 2, 3]).into_iter(); //~ WARN equivalent to .iter()
-    let _ = vec![1, 2, 3].into_boxed_slice().into_iter(); //~ WARN equivalent to .iter()
-    let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
-    let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
+    let _ = (&vec![1, 2, 3]).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = vec![1, 2, 3].into_boxed_slice().into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ ERROR: equivalent to `.iter()
 
-    let _ = (&&&&&&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
-    let _ = (&&&&mut &&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
-    let _ = (&mut &mut &mut [1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter_mut()
+    let _ = (&&&&&&&[1, 2, 3]).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&&&&mut &&&[1, 2, 3]).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut &mut &mut [1, 2, 3]).into_iter(); //~ ERROR: equivalent to `.iter_mut()
 
-    let _ = (&Some(4)).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut Some(5)).into_iter(); //~ WARN equivalent to .iter_mut()
-    let _ = (&Ok::<_, i32>(6)).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut Err::<i32, _>(7)).into_iter(); //~ WARN equivalent to .iter_mut()
-    let _ = (&Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
-    let _ = (&BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
-    let _ = (&VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
-    let _ = (&LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
-    let _ = (&HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&mut HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
+    let _ = (&Some(4)).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut Some(5)).into_iter(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&Ok::<_, i32>(6)).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut Err::<i32, _>(7)).into_iter(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&Vec::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut Vec::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&BTreeMap::<i32, u64>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&VecDeque::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut VecDeque::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&LinkedList::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut LinkedList::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter_mut()
+    let _ = (&HashMap::<i32, u64>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&mut HashMap::<i32, u64>::new()).into_iter(); //~ ERROR: equivalent to `.iter_mut()
 
-    let _ = (&BTreeSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&BinaryHeap::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = (&HashSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
-    let _ = std::path::Path::new("12/34").into_iter(); //~ WARN equivalent to .iter()
-    let _ = std::path::PathBuf::from("12/34").into_iter(); //~ ERROR equivalent to .iter()
+    let _ = (&BTreeSet::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&BinaryHeap::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = (&HashSet::<i32>::new()).into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::path::Path::new("12/34").into_iter(); //~ ERROR: equivalent to `.iter()
+    let _ = std::path::PathBuf::from("12/34").into_iter(); //~ ERROR: equivalent to `.iter()
 
-    let _ = (&[1, 2, 3]).into_iter().next(); //~ WARN equivalent to .iter()
+    let _ = (&[1, 2, 3]).into_iter().next(); //~ ERROR: equivalent to `.iter()
 }
diff --git a/tests/ui/into_iter_on_ref.stderr b/tests/ui/into_iter_on_ref.stderr
index 28003b365bb..06014a93f8c 100644
--- a/tests/ui/into_iter_on_ref.stderr
+++ b/tests/ui/into_iter_on_ref.stderr
@@ -1,7 +1,7 @@
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
   --> $DIR/into_iter_on_ref.rs:14:30
    |
-LL |     let _ = (&vec![1, 2, 3]).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&vec![1, 2, 3]).into_iter();
    |                              ^^^^^^^^^ help: call directly: `iter`
    |
    = note: `-D clippy::into-iter-on-ref` implied by `-D warnings`
@@ -9,157 +9,157 @@ LL |     let _ = (&vec![1, 2, 3]).into_iter(); //~ WARN equivalent to .iter()
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
   --> $DIR/into_iter_on_ref.rs:15:46
    |
-LL |     let _ = vec![1, 2, 3].into_boxed_slice().into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = vec![1, 2, 3].into_boxed_slice().into_iter();
    |                                              ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
   --> $DIR/into_iter_on_ref.rs:16:41
    |
-LL |     let _ = std::rc::Rc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = std::rc::Rc::from(&[X][..]).into_iter();
    |                                         ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
   --> $DIR/into_iter_on_ref.rs:17:44
    |
-LL |     let _ = std::sync::Arc::from(&[X][..]).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = std::sync::Arc::from(&[X][..]).into_iter();
    |                                            ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array`
   --> $DIR/into_iter_on_ref.rs:19:32
    |
-LL |     let _ = (&&&&&&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
+LL |     let _ = (&&&&&&&[1, 2, 3]).into_iter();
    |                                ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array`
   --> $DIR/into_iter_on_ref.rs:20:36
    |
-LL |     let _ = (&&&&mut &&&[1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter()
+LL |     let _ = (&&&&mut &&&[1, 2, 3]).into_iter();
    |                                    ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `array`
   --> $DIR/into_iter_on_ref.rs:21:40
    |
-LL |     let _ = (&mut &mut &mut [1, 2, 3]).into_iter(); //~ ERROR equivalent to .iter_mut()
+LL |     let _ = (&mut &mut &mut [1, 2, 3]).into_iter();
    |                                        ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Option`
   --> $DIR/into_iter_on_ref.rs:23:24
    |
-LL |     let _ = (&Some(4)).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&Some(4)).into_iter();
    |                        ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Option`
   --> $DIR/into_iter_on_ref.rs:24:28
    |
-LL |     let _ = (&mut Some(5)).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut Some(5)).into_iter();
    |                            ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Result`
   --> $DIR/into_iter_on_ref.rs:25:32
    |
-LL |     let _ = (&Ok::<_, i32>(6)).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&Ok::<_, i32>(6)).into_iter();
    |                                ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Result`
   --> $DIR/into_iter_on_ref.rs:26:37
    |
-LL |     let _ = (&mut Err::<i32, _>(7)).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut Err::<i32, _>(7)).into_iter();
    |                                     ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
   --> $DIR/into_iter_on_ref.rs:27:34
    |
-LL |     let _ = (&Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&Vec::<i32>::new()).into_iter();
    |                                  ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec`
   --> $DIR/into_iter_on_ref.rs:28:38
    |
-LL |     let _ = (&mut Vec::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut Vec::<i32>::new()).into_iter();
    |                                      ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeMap`
   --> $DIR/into_iter_on_ref.rs:29:44
    |
-LL |     let _ = (&BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&BTreeMap::<i32, u64>::new()).into_iter();
    |                                            ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `BTreeMap`
   --> $DIR/into_iter_on_ref.rs:30:48
    |
-LL |     let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut BTreeMap::<i32, u64>::new()).into_iter();
    |                                                ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `VecDeque`
   --> $DIR/into_iter_on_ref.rs:31:39
    |
-LL |     let _ = (&VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&VecDeque::<i32>::new()).into_iter();
    |                                       ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `VecDeque`
   --> $DIR/into_iter_on_ref.rs:32:43
    |
-LL |     let _ = (&mut VecDeque::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut VecDeque::<i32>::new()).into_iter();
    |                                           ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `LinkedList`
   --> $DIR/into_iter_on_ref.rs:33:41
    |
-LL |     let _ = (&LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&LinkedList::<i32>::new()).into_iter();
    |                                         ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `LinkedList`
   --> $DIR/into_iter_on_ref.rs:34:45
    |
-LL |     let _ = (&mut LinkedList::<i32>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut LinkedList::<i32>::new()).into_iter();
    |                                             ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashMap`
   --> $DIR/into_iter_on_ref.rs:35:43
    |
-LL |     let _ = (&HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&HashMap::<i32, u64>::new()).into_iter();
    |                                           ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `HashMap`
   --> $DIR/into_iter_on_ref.rs:36:47
    |
-LL |     let _ = (&mut HashMap::<i32, u64>::new()).into_iter(); //~ WARN equivalent to .iter_mut()
+LL |     let _ = (&mut HashMap::<i32, u64>::new()).into_iter();
    |                                               ^^^^^^^^^ help: call directly: `iter_mut`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeSet`
   --> $DIR/into_iter_on_ref.rs:38:39
    |
-LL |     let _ = (&BTreeSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&BTreeSet::<i32>::new()).into_iter();
    |                                       ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BinaryHeap`
   --> $DIR/into_iter_on_ref.rs:39:41
    |
-LL |     let _ = (&BinaryHeap::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&BinaryHeap::<i32>::new()).into_iter();
    |                                         ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet`
   --> $DIR/into_iter_on_ref.rs:40:38
    |
-LL |     let _ = (&HashSet::<i32>::new()).into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = (&HashSet::<i32>::new()).into_iter();
    |                                      ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Path`
   --> $DIR/into_iter_on_ref.rs:41:43
    |
-LL |     let _ = std::path::Path::new("12/34").into_iter(); //~ WARN equivalent to .iter()
+LL |     let _ = std::path::Path::new("12/34").into_iter();
    |                                           ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `PathBuf`
   --> $DIR/into_iter_on_ref.rs:42:47
    |
-LL |     let _ = std::path::PathBuf::from("12/34").into_iter(); //~ ERROR equivalent to .iter()
+LL |     let _ = std::path::PathBuf::from("12/34").into_iter();
    |                                               ^^^^^^^^^ help: call directly: `iter`
 
 error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `array`
   --> $DIR/into_iter_on_ref.rs:44:26
    |
-LL |     let _ = (&[1, 2, 3]).into_iter().next(); //~ WARN equivalent to .iter()
+LL |     let _ = (&[1, 2, 3]).into_iter().next();
    |                          ^^^^^^^^^ help: call directly: `iter`
 
 error: aborting due to 27 previous errors
diff --git a/tests/ui/issue-3145.rs b/tests/ui/issue-3145.rs
index 586d13647d1..0b07de1144c 100644
--- a/tests/ui/issue-3145.rs
+++ b/tests/ui/issue-3145.rs
@@ -1,3 +1,3 @@
 fn main() {
-    println!("{}" a); //~ERROR expected `,`, found `a`
+    println!("{}" a); //~ERROR: expected `,`, found `a`
 }
diff --git a/tests/ui/issue-3145.stderr b/tests/ui/issue-3145.stderr
index a35032aa150..d7c2c88a204 100644
--- a/tests/ui/issue-3145.stderr
+++ b/tests/ui/issue-3145.stderr
@@ -1,7 +1,7 @@
 error: expected `,`, found `a`
   --> $DIR/issue-3145.rs:2:19
    |
-LL |     println!("{}" a); //~ERROR expected `,`, found `a`
+LL |     println!("{}" a);
    |                   ^ expected `,`
 
 error: aborting due to previous error
diff --git a/tests/ui/items_after_test_module/block_module.stderr b/tests/ui/items_after_test_module/block_module.stderr
index 597f1b9510c..1b625747161 100644
--- a/tests/ui/items_after_test_module/block_module.stderr
+++ b/tests/ui/items_after_test_module/block_module.stderr
@@ -1,17 +1,2 @@
-error: items were found after the testing module
-  --> $DIR/block_module.rs:13:1
-   |
-LL | / mod tests {
-LL | |     #[test]
-LL | |     fn hi() {}
-LL | | }
-...  |
-LL | |     () => {};
-LL | | }
-   | |_^
-   |
-   = help: move the items to before the testing module was defined
-   = note: `-D clippy::items-after-test-module` implied by `-D warnings`
-
-error: aborting due to previous error
+error: Option 'test' given more than once
 
diff --git a/tests/ui/large_enum_variant.rs b/tests/ui/large_enum_variant.rs
index ea8bc5b4aca..e677cc9a7b9 100644
--- a/tests/ui/large_enum_variant.rs
+++ b/tests/ui/large_enum_variant.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(dead_code)]
 #![allow(unused_variables)]
diff --git a/tests/ui/let_underscore_untyped.rs b/tests/ui/let_underscore_untyped.rs
index 2c313ff35d5..431d83778e3 100644
--- a/tests/ui/let_underscore_untyped.rs
+++ b/tests/ui/let_underscore_untyped.rs
@@ -1,4 +1,4 @@
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![allow(unused)]
 #![warn(clippy::let_underscore_untyped)]
diff --git a/tests/ui/let_with_type_underscore.rs b/tests/ui/let_with_type_underscore.rs
index ae1a480bcfc..8214176cfd5 100644
--- a/tests/ui/let_with_type_underscore.rs
+++ b/tests/ui/let_with_type_underscore.rs
@@ -1,4 +1,4 @@
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![allow(unused)]
 #![warn(clippy::let_with_type_underscore)]
 #![allow(clippy::let_unit_value, clippy::needless_late_init)]
diff --git a/tests/ui/macro_use_imports.fixed b/tests/ui/macro_use_imports.fixed
index b4dabe3cae5..53b6a0250f9 100644
--- a/tests/ui/macro_use_imports.fixed
+++ b/tests/ui/macro_use_imports.fixed
@@ -1,6 +1,6 @@
 //@aux-build:macro_rules.rs
 //@aux-build:macro_use_helper.rs
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 //@run-rustfix
 //@ignore-32bit
 
diff --git a/tests/ui/macro_use_imports.rs b/tests/ui/macro_use_imports.rs
index 925a2c61f8d..a40fa389895 100644
--- a/tests/ui/macro_use_imports.rs
+++ b/tests/ui/macro_use_imports.rs
@@ -1,6 +1,6 @@
 //@aux-build:macro_rules.rs
 //@aux-build:macro_use_helper.rs
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 //@run-rustfix
 //@ignore-32bit
 
diff --git a/tests/ui/macro_use_imports.stderr b/tests/ui/macro_use_imports.stderr
index 6fd338cef86..67a833e85e0 100644
--- a/tests/ui/macro_use_imports.stderr
+++ b/tests/ui/macro_use_imports.stderr
@@ -1,28 +1,28 @@
 error: `macro_use` attributes are no longer needed in the Rust 2018 edition
-  --> $DIR/macro_use_imports.rs:25:5
+  --> $DIR/macro_use_imports.rs:19:5
    |
 LL |     #[macro_use]
-   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::inner::nested::string_add;`
+   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};`
    |
    = note: `-D clippy::macro-use-imports` implied by `-D warnings`
 
 error: `macro_use` attributes are no longer needed in the Rust 2018 edition
-  --> $DIR/macro_use_imports.rs:21:5
+  --> $DIR/macro_use_imports.rs:23:5
    |
 LL |     #[macro_use]
-   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mini_mac::ClippyMiniMacroTest;`
+   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{inner::mut_mut, inner::try_err};`
 
 error: `macro_use` attributes are no longer needed in the Rust 2018 edition
-  --> $DIR/macro_use_imports.rs:23:5
+  --> $DIR/macro_use_imports.rs:25:5
    |
 LL |     #[macro_use]
-   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{inner::mut_mut, inner::try_err};`
+   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::inner::nested::string_add;`
 
 error: `macro_use` attributes are no longer needed in the Rust 2018 edition
-  --> $DIR/macro_use_imports.rs:19:5
+  --> $DIR/macro_use_imports.rs:21:5
    |
 LL |     #[macro_use]
-   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};`
+   |     ^^^^^^^^^^^^ help: remove the attribute and import the macro directly, try: `use mini_mac::ClippyMiniMacroTest;`
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/macro_use_imports_expect.rs b/tests/ui/macro_use_imports_expect.rs
index b9677851b92..3971aadbef8 100644
--- a/tests/ui/macro_use_imports_expect.rs
+++ b/tests/ui/macro_use_imports_expect.rs
@@ -1,6 +1,6 @@
 //@aux-build:macro_rules.rs
 //@aux-build:macro_use_helper.rs
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 //@ignore-32bit
 
 #![feature(lint_reasons)]
diff --git a/tests/ui/manual_rem_euclid.fixed b/tests/ui/manual_rem_euclid.fixed
index f2e44e56f02..594a76897bb 100644
--- a/tests/ui/manual_rem_euclid.fixed
+++ b/tests/ui/manual_rem_euclid.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::manual_rem_euclid)]
 #![allow(clippy::let_with_type_underscore)]
diff --git a/tests/ui/manual_rem_euclid.rs b/tests/ui/manual_rem_euclid.rs
index b2329c33a47..d5f98e71517 100644
--- a/tests/ui/manual_rem_euclid.rs
+++ b/tests/ui/manual_rem_euclid.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::manual_rem_euclid)]
 #![allow(clippy::let_with_type_underscore)]
diff --git a/tests/ui/manual_slice_size_calculation.fixed b/tests/ui/manual_slice_size_calculation.fixed
index ac85bd8d3ac..5b9629f4bc1 100644
--- a/tests/ui/manual_slice_size_calculation.fixed
+++ b/tests/ui/manual_slice_size_calculation.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(unused)]
 #![warn(clippy::manual_slice_size_calculation)]
 
diff --git a/tests/ui/manual_slice_size_calculation.rs b/tests/ui/manual_slice_size_calculation.rs
index 1f824b12bc2..297887a9cfc 100644
--- a/tests/ui/manual_slice_size_calculation.rs
+++ b/tests/ui/manual_slice_size_calculation.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(unused)]
 #![warn(clippy::manual_slice_size_calculation)]
 
diff --git a/tests/ui/match_same_arms.rs b/tests/ui/match_same_arms.rs
index 3914b45464c..fad6a7db988 100644
--- a/tests/ui/match_same_arms.rs
+++ b/tests/ui/match_same_arms.rs
@@ -8,29 +8,30 @@ pub enum Abc {
 
 fn match_same_arms() {
     let _ = match Abc::A {
-        Abc::A => 0,
+        Abc::A => 0, //~ ERROR: this match arm has an identical body to the `_` wildcard arm
         Abc::B => 1,
-        _ => 0, //~ ERROR match arms have same body
+        _ => 0,
     };
 
     match (1, 2, 3) {
-        (1, .., 3) => 42,
-        (.., 3) => 42, //~ ERROR match arms have same body
+        (1, .., 3) => 42, //~ ERROR: this match arm has an identical body to another arm
+        (.., 3) => 42,
         _ => 0,
     };
 
     let _ = match 42 {
         42 => 1,
-        51 => 1, //~ ERROR match arms have same body
-        41 => 2,
-        52 => 2, //~ ERROR match arms have same body
+        51 => 1, //~ ERROR: this match arm has an identical body to another arm
+        41 => 2, //~ ERROR: this match arm has an identical body to another arm
+        52 => 2,
         _ => 0,
     };
 
     let _ = match 42 {
         1 => 2,
-        2 => 2, //~ ERROR 2nd matched arms have same body
-        3 => 2, //~ ERROR 3rd matched arms have same body
+        2 => 2, //~ ERROR: this match arm has an identical body to another arm
+        //~^ ERROR: this match arm has an identical body to another arm
+        3 => 2, //~ ERROR: this match arm has an identical body to another arm
         4 => 3,
         _ => 0,
     };
@@ -48,6 +49,7 @@ mod issue4244 {
             match self {
                 CommandInfo::BuiltIn { name, .. } => name.to_string(),
                 CommandInfo::External { name, .. } => name.to_string(),
+                //~^ ERROR: this match arm has an identical body to another arm
             }
         }
     }
diff --git a/tests/ui/match_same_arms.stderr b/tests/ui/match_same_arms.stderr
index db85b5964e8..88b9a20a372 100644
--- a/tests/ui/match_same_arms.stderr
+++ b/tests/ui/match_same_arms.stderr
@@ -8,7 +8,7 @@ LL |         Abc::A => 0,
 note: `_` wildcard arm here
   --> $DIR/match_same_arms.rs:13:9
    |
-LL |         _ => 0, //~ ERROR match arms have same body
+LL |         _ => 0,
    |         ^^^^^^
    = note: `-D clippy::match-same-arms` implied by `-D warnings`
 
@@ -24,13 +24,13 @@ LL |         (1, .., 3) => 42,
 note: other arm here
   --> $DIR/match_same_arms.rs:18:9
    |
-LL |         (.., 3) => 42, //~ ERROR match arms have same body
+LL |         (.., 3) => 42,
    |         ^^^^^^^^^^^^^
 
 error: this match arm has an identical body to another arm
   --> $DIR/match_same_arms.rs:24:9
    |
-LL |         51 => 1, //~ ERROR match arms have same body
+LL |         51 => 1,
    |         --^^^^^
    |         |
    |         help: try merging the arm patterns: `51 | 42`
@@ -54,13 +54,13 @@ LL |         41 => 2,
 note: other arm here
   --> $DIR/match_same_arms.rs:26:9
    |
-LL |         52 => 2, //~ ERROR match arms have same body
+LL |         52 => 2,
    |         ^^^^^^^
 
 error: this match arm has an identical body to another arm
   --> $DIR/match_same_arms.rs:32:9
    |
-LL |         2 => 2, //~ ERROR 2nd matched arms have same body
+LL |         2 => 2,
    |         -^^^^^
    |         |
    |         help: try merging the arm patterns: `2 | 1`
@@ -73,9 +73,9 @@ LL |         1 => 2,
    |         ^^^^^^
 
 error: this match arm has an identical body to another arm
-  --> $DIR/match_same_arms.rs:33:9
+  --> $DIR/match_same_arms.rs:34:9
    |
-LL |         3 => 2, //~ ERROR 3rd matched arms have same body
+LL |         3 => 2,
    |         -^^^^^
    |         |
    |         help: try merging the arm patterns: `3 | 1`
@@ -90,20 +90,20 @@ LL |         1 => 2,
 error: this match arm has an identical body to another arm
   --> $DIR/match_same_arms.rs:32:9
    |
-LL |         2 => 2, //~ ERROR 2nd matched arms have same body
+LL |         2 => 2,
    |         -^^^^^
    |         |
    |         help: try merging the arm patterns: `2 | 3`
    |
    = help: or try changing either arm body
 note: other arm here
-  --> $DIR/match_same_arms.rs:33:9
+  --> $DIR/match_same_arms.rs:34:9
    |
-LL |         3 => 2, //~ ERROR 3rd matched arms have same body
+LL |         3 => 2,
    |         ^^^^^^
 
 error: this match arm has an identical body to another arm
-  --> $DIR/match_same_arms.rs:50:17
+  --> $DIR/match_same_arms.rs:51:17
    |
 LL |                 CommandInfo::External { name, .. } => name.to_string(),
    |                 ----------------------------------^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +112,7 @@ LL |                 CommandInfo::External { name, .. } => name.to_string(),
    |
    = help: or try changing either arm body
 note: other arm here
-  --> $DIR/match_same_arms.rs:49:17
+  --> $DIR/match_same_arms.rs:50:17
    |
 LL |                 CommandInfo::BuiltIn { name, .. } => name.to_string(),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/match_same_arms2.rs b/tests/ui/match_same_arms2.rs
index 60b2975be04..b1b9a6ae3e8 100644
--- a/tests/ui/match_same_arms2.rs
+++ b/tests/ui/match_same_arms2.rs
@@ -13,6 +13,7 @@ fn foo() -> bool {
 fn match_same_arms() {
     let _ = match 42 {
         42 => {
+            //~^ ERROR: this match arm has an identical body to the `_` wildcard arm
             foo();
             let mut a = 42 + [23].len() as i32;
             if true {
@@ -22,7 +23,6 @@ fn match_same_arms() {
             a
         },
         _ => {
-            //~ ERROR match arms have same body
             foo();
             let mut a = 42 + [23].len() as i32;
             if true {
@@ -35,13 +35,13 @@ fn match_same_arms() {
 
     let _ = match 42 {
         42 => foo(),
-        51 => foo(), //~ ERROR match arms have same body
+        51 => foo(), //~ ERROR: this match arm has an identical body to another arm
         _ => true,
     };
 
     let _ = match Some(42) {
         Some(_) => 24,
-        None => 24, //~ ERROR match arms have same body
+        None => 24, //~ ERROR: this match arm has an identical body to another arm
     };
 
     let _ = match Some(42) {
@@ -63,13 +63,13 @@ fn match_same_arms() {
 
     match (Some(42), Some(42)) {
         (Some(a), None) => bar(a),
-        (None, Some(a)) => bar(a), //~ ERROR match arms have same body
+        (None, Some(a)) => bar(a), //~ ERROR: this match arm has an identical body to another arm
         _ => (),
     }
 
     match (Some(42), Some(42)) {
-        (Some(a), ..) => bar(a),
-        (.., Some(a)) => bar(a), //~ ERROR match arms have same body
+        (Some(a), ..) => bar(a), //~ ERROR: this match arm has an identical body to another arm
+        (.., Some(a)) => bar(a),
         _ => (),
     }
 
@@ -102,7 +102,7 @@ fn match_same_arms() {
     }
 
     match (x, Some(1i32)) {
-        (Ok(x), Some(_)) => println!("ok {}", x),
+        (Ok(x), Some(_)) => println!("ok {}", x), //~ ERROR: this match arm has an identical body to another arm
         (Ok(_), Some(x)) => println!("ok {}", x),
         _ => println!("err"),
     }
@@ -118,7 +118,7 @@ fn match_same_arms() {
     match x {
         Ok(_tmp) => println!("ok"),
         Ok(3) => println!("ok"),
-        Ok(_) => println!("ok"),
+        Ok(_) => println!("ok"), //~ ERROR: this match arm has an identical body to another arm
         Err(_) => {
             unreachable!();
         },
@@ -146,6 +146,7 @@ fn match_same_arms() {
             empty!(0);
         },
         1 => {
+            //~^ ERROR: this match arm has an identical body to another arm
             empty!(0);
         },
         x => {
@@ -195,7 +196,7 @@ fn main() {
 
     // Suggest moving `Foo::Z(_)` up.
     let _ = match Foo::X(0) {
-        Foo::X(0) => 1,
+        Foo::X(0) => 1, //~ ERROR: this match arm has an identical body to another arm
         Foo::X(_) | Foo::Y(_) => 2,
         Foo::Z(_) => 1,
         _ => 0,
@@ -205,7 +206,7 @@ fn main() {
     let _ = match Foo::X(0) {
         Foo::X(0) => 1,
         Foo::Y(_) | Foo::Z(0) => 2,
-        Foo::Z(_) => 1,
+        Foo::Z(_) => 1, //~ ERROR: this match arm has an identical body to another arm
         _ => 0,
     };
 
@@ -228,7 +229,7 @@ fn main() {
         Some(Bar { x: 0, y: 5, .. }) => 1,
         Some(Bar { y: 10, z: 0, .. }) => 2,
         None => 50,
-        Some(Bar { y: 0, x: 5, .. }) => 1,
+        Some(Bar { y: 0, x: 5, .. }) => 1, //~ ERROR: this match arm has an identical body to another arm
         _ => 200,
     };
 
diff --git a/tests/ui/match_same_arms2.stderr b/tests/ui/match_same_arms2.stderr
index 8fb461bd286..7f0c70745ac 100644
--- a/tests/ui/match_same_arms2.stderr
+++ b/tests/ui/match_same_arms2.stderr
@@ -2,9 +2,9 @@ error: this match arm has an identical body to the `_` wildcard arm
   --> $DIR/match_same_arms2.rs:15:9
    |
 LL | /         42 => {
+LL | |
 LL | |             foo();
 LL | |             let mut a = 42 + [23].len() as i32;
-LL | |             if true {
 ...  |
 LL | |             a
 LL | |         },
@@ -12,12 +12,12 @@ LL | |         },
    |
    = help: or try changing either arm body
 note: `_` wildcard arm here
-  --> $DIR/match_same_arms2.rs:24:9
+  --> $DIR/match_same_arms2.rs:25:9
    |
 LL | /         _ => {
-LL | |             //~ ERROR match arms have same body
 LL | |             foo();
 LL | |             let mut a = 42 + [23].len() as i32;
+LL | |             if true {
 ...  |
 LL | |             a
 LL | |         },
@@ -27,7 +27,7 @@ LL | |         },
 error: this match arm has an identical body to another arm
   --> $DIR/match_same_arms2.rs:38:9
    |
-LL |         51 => foo(), //~ ERROR match arms have same body
+LL |         51 => foo(),
    |         --^^^^^^^^^
    |         |
    |         help: try merging the arm patterns: `51 | 42`
@@ -42,7 +42,7 @@ LL |         42 => foo(),
 error: this match arm has an identical body to another arm
   --> $DIR/match_same_arms2.rs:44:9
    |
-LL |         None => 24, //~ ERROR match arms have same body
+LL |         None => 24,
    |         ----^^^^^^
    |         |
    |         help: try merging the arm patterns: `None | Some(_)`
@@ -57,7 +57,7 @@ LL |         Some(_) => 24,
 error: this match arm has an identical body to another arm
   --> $DIR/match_same_arms2.rs:66:9
    |
-LL |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
+LL |         (None, Some(a)) => bar(a),
    |         ---------------^^^^^^^^^^
    |         |
    |         help: try merging the arm patterns: `(None, Some(a)) | (Some(a), None)`
@@ -81,7 +81,7 @@ LL |         (Some(a), ..) => bar(a),
 note: other arm here
   --> $DIR/match_same_arms2.rs:72:9
    |
-LL |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
+LL |         (.., Some(a)) => bar(a),
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: this match arm has an identical body to another arm
@@ -121,6 +121,7 @@ LL |           1 => {
    |           ^ help: try merging the arm patterns: `1 | 0`
    |  _________|
    | |
+LL | |
 LL | |             empty!(0);
 LL | |         },
    | |_________^
@@ -135,7 +136,7 @@ LL | |         },
    | |_________^
 
 error: match expression looks like `matches!` macro
-  --> $DIR/match_same_arms2.rs:166:16
+  --> $DIR/match_same_arms2.rs:167:16
    |
 LL |       let _ans = match x {
    |  ________________^
@@ -148,7 +149,7 @@ LL | |     };
    = note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
 
 error: this match arm has an identical body to another arm
-  --> $DIR/match_same_arms2.rs:198:9
+  --> $DIR/match_same_arms2.rs:199:9
    |
 LL |         Foo::X(0) => 1,
    |         ---------^^^^^
@@ -157,13 +158,13 @@ LL |         Foo::X(0) => 1,
    |
    = help: or try changing either arm body
 note: other arm here
-  --> $DIR/match_same_arms2.rs:200:9
+  --> $DIR/match_same_arms2.rs:201:9
    |
 LL |         Foo::Z(_) => 1,
    |         ^^^^^^^^^^^^^^
 
 error: this match arm has an identical body to another arm
-  --> $DIR/match_same_arms2.rs:208:9
+  --> $DIR/match_same_arms2.rs:209:9
    |
 LL |         Foo::Z(_) => 1,
    |         ---------^^^^^
@@ -172,13 +173,13 @@ LL |         Foo::Z(_) => 1,
    |
    = help: or try changing either arm body
 note: other arm here
-  --> $DIR/match_same_arms2.rs:206:9
+  --> $DIR/match_same_arms2.rs:207:9
    |
 LL |         Foo::X(0) => 1,
    |         ^^^^^^^^^^^^^^
 
 error: this match arm has an identical body to another arm
-  --> $DIR/match_same_arms2.rs:231:9
+  --> $DIR/match_same_arms2.rs:232:9
    |
 LL |         Some(Bar { y: 0, x: 5, .. }) => 1,
    |         ----------------------------^^^^^
@@ -187,13 +188,13 @@ LL |         Some(Bar { y: 0, x: 5, .. }) => 1,
    |
    = help: or try changing either arm body
 note: other arm here
-  --> $DIR/match_same_arms2.rs:228:9
+  --> $DIR/match_same_arms2.rs:229:9
    |
 LL |         Some(Bar { x: 0, y: 5, .. }) => 1,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: this match arm has an identical body to another arm
-  --> $DIR/match_same_arms2.rs:245:9
+  --> $DIR/match_same_arms2.rs:246:9
    |
 LL |         1 => cfg!(not_enable),
    |         -^^^^^^^^^^^^^^^^^^^^
@@ -202,7 +203,7 @@ LL |         1 => cfg!(not_enable),
    |
    = help: or try changing either arm body
 note: other arm here
-  --> $DIR/match_same_arms2.rs:244:9
+  --> $DIR/match_same_arms2.rs:245:9
    |
 LL |         0 => cfg!(not_enable),
    |         ^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/mem_replace_macro.rs b/tests/ui/mem_replace_macro.rs
index 132873858b7..e53342f2ed3 100644
--- a/tests/ui/mem_replace_macro.rs
+++ b/tests/ui/mem_replace_macro.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![warn(clippy::mem_replace_with_default)]
 
 extern crate proc_macros;
diff --git a/tests/ui/min_ident_chars.rs b/tests/ui/min_ident_chars.rs
index c5e03468ef9..b5b9e66aa7a 100644
--- a/tests/ui/min_ident_chars.rs
+++ b/tests/ui/min_ident_chars.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(irrefutable_let_patterns, nonstandard_style, unused)]
 #![warn(clippy::min_ident_chars)]
 
diff --git a/tests/ui/missing_assert_message.rs b/tests/ui/missing_assert_message.rs
index 89404ca8827..af1358f61b5 100644
--- a/tests/ui/missing_assert_message.rs
+++ b/tests/ui/missing_assert_message.rs
@@ -7,8 +7,6 @@ macro_rules! bar {
     };
 }
 
-fn main() {}
-
 // Should trigger warning
 fn asserts_without_message() {
     assert!(foo());
@@ -66,9 +64,14 @@ fn asserts_without_message_but_inside_a_test_function() {
     debug_assert_ne!(foo(), foo());
 }
 
+fn foo() -> bool {
+    true
+}
+
 // Should not trigger warning
 #[cfg(test)]
 mod tests {
+    use super::foo;
     fn asserts_without_message_but_inside_a_test_module() {
         assert!(foo());
         assert_eq!(foo(), foo());
@@ -78,7 +81,3 @@ mod tests {
         debug_assert_ne!(foo(), foo());
     }
 }
-
-fn foo() -> bool {
-    true
-}
diff --git a/tests/ui/missing_assert_message.stderr b/tests/ui/missing_assert_message.stderr
index ecd03801277..33a5c1f8e05 100644
--- a/tests/ui/missing_assert_message.stderr
+++ b/tests/ui/missing_assert_message.stderr
@@ -1,5 +1,5 @@
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:14:5
+  --> $DIR/missing_assert_message.rs:12:5
    |
 LL |     assert!(foo());
    |     ^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     assert!(foo());
    = note: `-D clippy::missing-assert-message` implied by `-D warnings`
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:15:5
+  --> $DIR/missing_assert_message.rs:13:5
    |
 LL |     assert_eq!(foo(), foo());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -16,7 +16,7 @@ LL |     assert_eq!(foo(), foo());
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:16:5
+  --> $DIR/missing_assert_message.rs:14:5
    |
 LL |     assert_ne!(foo(), foo());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -24,7 +24,7 @@ LL |     assert_ne!(foo(), foo());
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:17:5
+  --> $DIR/missing_assert_message.rs:15:5
    |
 LL |     debug_assert!(foo());
    |     ^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL |     debug_assert!(foo());
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:18:5
+  --> $DIR/missing_assert_message.rs:16:5
    |
 LL |     debug_assert_eq!(foo(), foo());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,7 +40,7 @@ LL |     debug_assert_eq!(foo(), foo());
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:19:5
+  --> $DIR/missing_assert_message.rs:17:5
    |
 LL |     debug_assert_ne!(foo(), foo());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -48,7 +48,7 @@ LL |     debug_assert_ne!(foo(), foo());
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:24:5
+  --> $DIR/missing_assert_message.rs:22:5
    |
 LL |     assert!(bar!(true));
    |     ^^^^^^^^^^^^^^^^^^^
@@ -56,7 +56,7 @@ LL |     assert!(bar!(true));
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:25:5
+  --> $DIR/missing_assert_message.rs:23:5
    |
 LL |     assert!(bar!(true, false));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -64,7 +64,7 @@ LL |     assert!(bar!(true, false));
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:26:5
+  --> $DIR/missing_assert_message.rs:24:5
    |
 LL |     assert_eq!(bar!(true), foo());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -72,7 +72,7 @@ LL |     assert_eq!(bar!(true), foo());
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:27:5
+  --> $DIR/missing_assert_message.rs:25:5
    |
 LL |     assert_ne!(bar!(true, true), bar!(true));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -80,7 +80,7 @@ LL |     assert_ne!(bar!(true, true), bar!(true));
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:32:5
+  --> $DIR/missing_assert_message.rs:30:5
    |
 LL |     assert!(foo(),);
    |     ^^^^^^^^^^^^^^^
@@ -88,7 +88,7 @@ LL |     assert!(foo(),);
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:33:5
+  --> $DIR/missing_assert_message.rs:31:5
    |
 LL |     assert_eq!(foo(), foo(),);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -96,7 +96,7 @@ LL |     assert_eq!(foo(), foo(),);
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:34:5
+  --> $DIR/missing_assert_message.rs:32:5
    |
 LL |     assert_ne!(foo(), foo(),);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -104,7 +104,7 @@ LL |     assert_ne!(foo(), foo(),);
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:35:5
+  --> $DIR/missing_assert_message.rs:33:5
    |
 LL |     debug_assert!(foo(),);
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +112,7 @@ LL |     debug_assert!(foo(),);
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:36:5
+  --> $DIR/missing_assert_message.rs:34:5
    |
 LL |     debug_assert_eq!(foo(), foo(),);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -120,7 +120,7 @@ LL |     debug_assert_eq!(foo(), foo(),);
    = help: consider describing why the failing assert is problematic
 
 error: assert without any message
-  --> $DIR/missing_assert_message.rs:37:5
+  --> $DIR/missing_assert_message.rs:35:5
    |
 LL |     debug_assert_ne!(foo(), foo(),);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/missing_const_for_fn/cant_be_const.rs b/tests/ui/missing_const_for_fn/cant_be_const.rs
index abadf82fe4b..06e05352479 100644
--- a/tests/ui/missing_const_for_fn/cant_be_const.rs
+++ b/tests/ui/missing_const_for_fn/cant_be_const.rs
@@ -3,7 +3,7 @@
 //! The .stderr output of this test should be empty. Otherwise it's a bug somewhere.
 
 //@aux-build:helper.rs
-//@aux-build:../../auxiliary/proc_macros.rs
+//@aux-build:../auxiliary/proc_macros.rs:proc-macro
 
 #![warn(clippy::missing_const_for_fn)]
 #![feature(start)]
@@ -44,7 +44,6 @@ static Y: u32 = 0;
 // refer to a static variable
 fn get_y() -> u32 {
     Y
-    //~^ ERROR E0013
 }
 
 // Don't lint entrypoint functions
diff --git a/tests/ui/missing_doc.rs b/tests/ui/missing_doc.rs
index bf587e774f7..cff1706a842 100644
--- a/tests/ui/missing_doc.rs
+++ b/tests/ui/missing_doc.rs
@@ -1,5 +1,5 @@
 //@needs-asm-support
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![warn(clippy::missing_docs_in_private_items)]
 // When denying at the crate level, be sure to not get random warnings from the
diff --git a/tests/ui/missing_doc_impl.rs b/tests/ui/missing_doc_impl.rs
index 520ddbe16b8..2d45132f968 100644
--- a/tests/ui/missing_doc_impl.rs
+++ b/tests/ui/missing_doc_impl.rs
@@ -1,4 +1,4 @@
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![warn(clippy::missing_docs_in_private_items)]
 #![allow(dead_code)]
diff --git a/tests/ui/missing_inline_proc_macro.rs b/tests/ui/missing_inline_proc_macro.rs
index 3c68fb905f1..e47a198c6ae 100644
--- a/tests/ui/missing_inline_proc_macro.rs
+++ b/tests/ui/missing_inline_proc_macro.rs
@@ -1,5 +1,4 @@
 #![warn(clippy::missing_inline_in_public_items)]
-#![crate_type = "proc-macro"]
 
 extern crate proc_macro;
 
diff --git a/tests/ui/mistyped_literal_suffix.fixed b/tests/ui/mistyped_literal_suffix.fixed
index 62cfeafdc49..9c2ffcb02ea 100644
--- a/tests/ui/mistyped_literal_suffix.fixed
+++ b/tests/ui/mistyped_literal_suffix.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![allow(
     dead_code,
diff --git a/tests/ui/mistyped_literal_suffix.rs b/tests/ui/mistyped_literal_suffix.rs
index f83b7c3dbda..a0a1e96a775 100644
--- a/tests/ui/mistyped_literal_suffix.rs
+++ b/tests/ui/mistyped_literal_suffix.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 
 #![allow(
     dead_code,
diff --git a/tests/ui/multiple_unsafe_ops_per_block.rs b/tests/ui/multiple_unsafe_ops_per_block.rs
index 4ef6f0ca92f..23ad36bb473 100644
--- a/tests/ui/multiple_unsafe_ops_per_block.rs
+++ b/tests/ui/multiple_unsafe_ops_per_block.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(unused)]
 #![allow(deref_nullptr)]
 #![allow(clippy::unnecessary_operation)]
diff --git a/tests/ui/must_use_unit.fixed b/tests/ui/must_use_unit.fixed
index 4f7cf4e56d1..c460fd7c6b0 100644
--- a/tests/ui/must_use_unit.fixed
+++ b/tests/ui/must_use_unit.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::must_use_unit)]
 #![allow(clippy::unused_unit)]
diff --git a/tests/ui/must_use_unit.rs b/tests/ui/must_use_unit.rs
index 3a814ce1685..fe95624f799 100644
--- a/tests/ui/must_use_unit.rs
+++ b/tests/ui/must_use_unit.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::must_use_unit)]
 #![allow(clippy::unused_unit)]
diff --git a/tests/ui/mut_mut.rs b/tests/ui/mut_mut.rs
index d838098de11..b7213428367 100644
--- a/tests/ui/mut_mut.rs
+++ b/tests/ui/mut_mut.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![warn(clippy::mut_mut)]
 #![allow(unused)]
 #![allow(clippy::no_effect, clippy::uninlined_format_args, clippy::unnecessary_operation)]
diff --git a/tests/ui/needless_arbitrary_self_type_unfixable.rs b/tests/ui/needless_arbitrary_self_type_unfixable.rs
index 00871f9f450..876f16a3854 100644
--- a/tests/ui/needless_arbitrary_self_type_unfixable.rs
+++ b/tests/ui/needless_arbitrary_self_type_unfixable.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_attr.rs
+//@aux-build:proc_macro_attr.rs:proc-macro
 
 #![warn(clippy::needless_arbitrary_self_type)]
 
diff --git a/tests/ui/needless_if.fixed b/tests/ui/needless_if.fixed
index 8fd945f1a54..5e6e140c2db 100644
--- a/tests/ui/needless_if.fixed
+++ b/tests/ui/needless_if.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![feature(let_chains)]
 #![allow(
     clippy::blocks_in_if_conditions,
diff --git a/tests/ui/needless_if.rs b/tests/ui/needless_if.rs
index 04868299a54..eb28ce73be8 100644
--- a/tests/ui/needless_if.rs
+++ b/tests/ui/needless_if.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![feature(let_chains)]
 #![allow(
     clippy::blocks_in_if_conditions,
diff --git a/tests/ui/needless_late_init.fixed b/tests/ui/needless_late_init.fixed
index b3ed0932ab5..933dd8bed2a 100644
--- a/tests/ui/needless_late_init.fixed
+++ b/tests/ui/needless_late_init.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![feature(let_chains)]
 #![allow(unused)]
 #![allow(
diff --git a/tests/ui/needless_late_init.rs b/tests/ui/needless_late_init.rs
index dbbbf24085e..ba3a04e0825 100644
--- a/tests/ui/needless_late_init.rs
+++ b/tests/ui/needless_late_init.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![feature(let_chains)]
 #![allow(unused)]
 #![allow(
diff --git a/tests/ui/needless_lifetimes.fixed b/tests/ui/needless_lifetimes.fixed
index 7b99042f744..302a3f9edbe 100644
--- a/tests/ui/needless_lifetimes.fixed
+++ b/tests/ui/needless_lifetimes.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::needless_lifetimes)]
 #![allow(
diff --git a/tests/ui/needless_lifetimes.rs b/tests/ui/needless_lifetimes.rs
index 6fcf1efc2ee..b15477c92e8 100644
--- a/tests/ui/needless_lifetimes.rs
+++ b/tests/ui/needless_lifetimes.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::needless_lifetimes)]
 #![allow(
diff --git a/tests/ui/needless_pass_by_value_proc_macro.rs b/tests/ui/needless_pass_by_value_proc_macro.rs
index 78a0e92d179..c603163c145 100644
--- a/tests/ui/needless_pass_by_value_proc_macro.rs
+++ b/tests/ui/needless_pass_by_value_proc_macro.rs
@@ -1,4 +1,3 @@
-#![crate_type = "proc-macro"]
 #![warn(clippy::needless_pass_by_value)]
 
 extern crate proc_macro;
diff --git a/tests/ui/non_expressive_names.rs b/tests/ui/non_expressive_names.rs
index 583096ac054..987a4775ef0 100644
--- a/tests/ui/non_expressive_names.rs
+++ b/tests/ui/non_expressive_names.rs
@@ -25,9 +25,9 @@ impl MaybeInst {
 }
 
 fn underscores_and_numbers() {
-    let _1 = 1; //~ERROR Consider a more descriptive name
-    let ____1 = 1; //~ERROR Consider a more descriptive name
-    let __1___2 = 12; //~ERROR Consider a more descriptive name
+    let _1 = 1; //~ERROR: consider choosing a more descriptive name
+    let ____1 = 1; //~ERROR: consider choosing a more descriptive name
+    let __1___2 = 12; //~ERROR: consider choosing a more descriptive name
     let _1_ok = 1;
 }
 
@@ -48,9 +48,9 @@ struct Bar;
 
 impl Bar {
     fn bar() {
-        let _1 = 1;
-        let ____1 = 1;
-        let __1___2 = 12;
+        let _1 = 1; //~ERROR: consider choosing a more descriptive name
+        let ____1 = 1; //~ERROR: consider choosing a more descriptive name
+        let __1___2 = 12; //~ERROR: consider choosing a more descriptive name
         let _1_ok = 1;
     }
 }
diff --git a/tests/ui/non_expressive_names.stderr b/tests/ui/non_expressive_names.stderr
index 116d5da8729..b62748d4989 100644
--- a/tests/ui/non_expressive_names.stderr
+++ b/tests/ui/non_expressive_names.stderr
@@ -1,7 +1,7 @@
 error: consider choosing a more descriptive name
   --> $DIR/non_expressive_names.rs:28:9
    |
-LL |     let _1 = 1; //~ERROR Consider a more descriptive name
+LL |     let _1 = 1;
    |         ^^
    |
    = note: `-D clippy::just-underscores-and-digits` implied by `-D warnings`
@@ -9,13 +9,13 @@ LL |     let _1 = 1; //~ERROR Consider a more descriptive name
 error: consider choosing a more descriptive name
   --> $DIR/non_expressive_names.rs:29:9
    |
-LL |     let ____1 = 1; //~ERROR Consider a more descriptive name
+LL |     let ____1 = 1;
    |         ^^^^^
 
 error: consider choosing a more descriptive name
   --> $DIR/non_expressive_names.rs:30:9
    |
-LL |     let __1___2 = 12; //~ERROR Consider a more descriptive name
+LL |     let __1___2 = 12;
    |         ^^^^^^^
 
 error: consider choosing a more descriptive name
diff --git a/tests/ui/non_octal_unix_permissions.fixed b/tests/ui/non_octal_unix_permissions.fixed
index 89d12752834..5d0da8dce67 100644
--- a/tests/ui/non_octal_unix_permissions.fixed
+++ b/tests/ui/non_octal_unix_permissions.fixed
@@ -1,4 +1,4 @@
-//@ignore-windows
+//@ignore-target-windows
 //@run-rustfix
 #![warn(clippy::non_octal_unix_permissions)]
 use std::fs::{DirBuilder, File, OpenOptions, Permissions};
diff --git a/tests/ui/non_octal_unix_permissions.rs b/tests/ui/non_octal_unix_permissions.rs
index 1b3a322d726..04a3643050e 100644
--- a/tests/ui/non_octal_unix_permissions.rs
+++ b/tests/ui/non_octal_unix_permissions.rs
@@ -1,4 +1,4 @@
-//@ignore-windows
+//@ignore-target-windows
 //@run-rustfix
 #![warn(clippy::non_octal_unix_permissions)]
 use std::fs::{DirBuilder, File, OpenOptions, Permissions};
diff --git a/tests/ui/octal_escapes.stderr b/tests/ui/octal_escapes.stderr
index aa362e96321..63fdfe486e8 100644
--- a/tests/ui/octal_escapes.stderr
+++ b/tests/ui/octal_escapes.stderr
@@ -34,17 +34,17 @@ LL |     let _bad2 = b"/x0033[0m";
 error: octal-looking escape in string literal
   --> $DIR/octal_escapes.rs:6:17
    |
-LL |     let _bad3 = "//033[0m";
+LL |     let _bad3 = "///033[0m";
    |                 ^^^^^^^^^^^
    |
    = help: octal escapes are not supported, `/0` is always a null character
 help: if an octal escape was intended, use the hexadecimal representation instead
    |
-LL |     let _bad3 = "//x1b[0m";
+LL |     let _bad3 = "///x1b[0m";
    |                 ~~~~~~~~~~~
 help: if the null character is intended, disambiguate using
    |
-LL |     let _bad3 = "//x0033[0m";
+LL |     let _bad3 = "///x0033[0m";
    |                 ~~~~~~~~~~~~~
 
 error: octal-looking escape in string literal
diff --git a/tests/ui/option_env_unwrap.rs b/tests/ui/option_env_unwrap.rs
index ee1fe3f1fc0..65a1b467f81 100644
--- a/tests/ui/option_env_unwrap.rs
+++ b/tests/ui/option_env_unwrap.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![warn(clippy::option_env_unwrap)]
 #![allow(clippy::map_flatten)]
 
diff --git a/tests/ui/print_with_newline.fixed b/tests/ui/print_with_newline.fixed
new file mode 100644
index 00000000000..6098dea3991
--- /dev/null
+++ b/tests/ui/print_with_newline.fixed
@@ -0,0 +1,58 @@
+// FIXME: Ideally these suggestions would be fixed via rustfix. Blocked by rust-lang/rust#53934
+//@run-rustfix
+
+#![allow(clippy::print_literal)]
+#![warn(clippy::print_with_newline)]
+
+fn main() {
+    println!("Hello");
+    println!("Hello {}", "world");
+    println!("Hello {} {}", "world", "#2");
+    println!("{}", 1265);
+    println!();
+
+    // these are all fine
+    print!("");
+    print!("Hello");
+    println!("Hello");
+    println!("Hello\n");
+    println!("Hello {}\n", "world");
+    print!("Issue\n{}", 1265);
+    print!("{}", 1265);
+    print!("\n{}", 1275);
+    print!("\n\n");
+    print!("like eof\n\n");
+    print!("Hello {} {}\n\n", "world", "#2");
+    println!("\ndon't\nwarn\nfor\nmultiple\nnewlines\n"); // #3126
+    println!("\nbla\n\n"); // #3126
+
+    // Escaping
+    print!("\\n"); // #3514
+    println!("\\"); // should fail
+    print!("\\\\n");
+
+    // Raw strings
+    print!(r"\n"); // #3778
+
+    // Literal newlines should also fail
+    println!(
+        
+    );
+    println!(
+        
+    );
+
+    // Don't warn on CRLF (#4208)
+    print!("\r\n");
+    print!("foo\r\n");
+    println!("\\r"); // should fail
+    print!("foo\rbar\n");
+
+    // Ignore expanded format strings
+    macro_rules! newline {
+        () => {
+            "\n"
+        };
+    }
+    print!(newline!());
+}
diff --git a/tests/ui/print_with_newline.rs b/tests/ui/print_with_newline.rs
index ff79ca75ffa..d9c7acc2748 100644
--- a/tests/ui/print_with_newline.rs
+++ b/tests/ui/print_with_newline.rs
@@ -47,7 +47,7 @@ fn main() {
     // Don't warn on CRLF (#4208)
     print!("\r\n");
     print!("foo\r\n");
-    print!("\\r\n"); //~ ERROR
+    print!("\\r\n"); // should fail
     print!("foo\rbar\n");
 
     // Ignore expanded format strings
diff --git a/tests/ui/print_with_newline.stderr b/tests/ui/print_with_newline.stderr
index b9f5675faec..b97711e777d 100644
--- a/tests/ui/print_with_newline.stderr
+++ b/tests/ui/print_with_newline.stderr
@@ -62,13 +62,13 @@ LL +     println!();
 error: using `print!()` with a format string that ends in a single newline
   --> $DIR/print_with_newline.rs:31:5
    |
-LL |     print!("//n"); // should fail
+LL |     print!("///n"); // should fail
    |     ^^^^^^^^^^^^^^
    |
 help: use `println!` instead
    |
-LL -     print!("//n"); // should fail
-LL +     println!("/"); // should fail
+LL -     print!("///n"); // should fail
+LL +     println!("//"); // should fail
    |
 
 error: using `print!()` with a format string that ends in a single newline
@@ -104,13 +104,13 @@ LL ~
 error: using `print!()` with a format string that ends in a single newline
   --> $DIR/print_with_newline.rs:50:5
    |
-LL |     print!("/r/n"); //~ ERROR
+LL |     print!("//r/n"); // should fail
    |     ^^^^^^^^^^^^^^^
    |
 help: use `println!` instead
    |
-LL -     print!("/r/n"); //~ ERROR
-LL +     println!("/r"); //~ ERROR
+LL -     print!("//r/n"); // should fail
+LL +     println!("//r"); // should fail
    |
 
 error: aborting due to 9 previous errors
diff --git a/tests/ui/proc_macro.rs b/tests/ui/proc_macro.rs
index 59914b8b8f6..b77874034d0 100644
--- a/tests/ui/proc_macro.rs
+++ b/tests/ui/proc_macro.rs
@@ -1,5 +1,4 @@
 //! Check that we correctly lint procedural macros.
-#![crate_type = "proc-macro"]
 
 extern crate proc_macro;
 
diff --git a/tests/ui/proc_macro.stderr b/tests/ui/proc_macro.stderr
index c795f6ad0d2..d912b502755 100644
--- a/tests/ui/proc_macro.stderr
+++ b/tests/ui/proc_macro.stderr
@@ -1,5 +1,5 @@
 error: approximate value of `f{32, 64}::consts::PI` found
-  --> $DIR/proc_macro.rs:10:14
+  --> $DIR/proc_macro.rs:9:14
    |
 LL |     let _x = 3.14;
    |              ^^^^
diff --git a/tests/ui/ptr_as_ptr.fixed b/tests/ui/ptr_as_ptr.fixed
index 2c2567d67cd..26a64c861cf 100644
--- a/tests/ui/ptr_as_ptr.fixed
+++ b/tests/ui/ptr_as_ptr.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::ptr_as_ptr)]
 
diff --git a/tests/ui/ptr_as_ptr.rs b/tests/ui/ptr_as_ptr.rs
index 6000e5c08ac..ea40d494733 100644
--- a/tests/ui/ptr_as_ptr.rs
+++ b/tests/ui/ptr_as_ptr.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::ptr_as_ptr)]
 
diff --git a/tests/ui/ptr_cast_constness.fixed b/tests/ui/ptr_cast_constness.fixed
index ba3eca061df..1ef1809d153 100644
--- a/tests/ui/ptr_cast_constness.fixed
+++ b/tests/ui/ptr_cast_constness.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::ptr_cast_constness)]
 #![allow(clippy::transmute_ptr_to_ref, clippy::unnecessary_cast, unused)]
diff --git a/tests/ui/ptr_cast_constness.rs b/tests/ui/ptr_cast_constness.rs
index adeb43edf68..2c15cd429da 100644
--- a/tests/ui/ptr_cast_constness.rs
+++ b/tests/ui/ptr_cast_constness.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::ptr_cast_constness)]
 #![allow(clippy::transmute_ptr_to_ref, clippy::unnecessary_cast, unused)]
diff --git a/tests/ui/redundant_pub_crate.fixed b/tests/ui/redundant_pub_crate.fixed
index f65c0fdd35d..a1ed491bbc6 100644
--- a/tests/ui/redundant_pub_crate.fixed
+++ b/tests/ui/redundant_pub_crate.fixed
@@ -14,7 +14,7 @@ mod m1 {
     }
 
     pub mod m1_2 {
-        // ^ private due to m1
+        //:^ private due to m1
         fn f() {}
         pub fn g() {} // private due to m1_2 and m1
         pub fn h() {}
@@ -39,7 +39,7 @@ pub(crate) mod m2 {
     }
 
     pub mod m2_2 {
-        // ^ already crate visible due to m2
+        //:^ already crate visible due to m2
         fn f() {}
         pub fn g() {} // already crate visible due to m2_2 and m2
         pub fn h() {}
@@ -64,7 +64,7 @@ pub mod m3 {
     }
 
     pub(crate) mod m3_2 {
-        // ^ ok
+        //:^ ok
         fn f() {}
         pub fn g() {} // already crate visible due to m3_2
         pub fn h() {}
@@ -89,7 +89,7 @@ mod m4 {
     }
 
     pub mod m4_2 {
-        // ^ private: not re-exported by `pub use m4::*`
+        //:^ private: not re-exported by `pub use m4::*`
         fn f() {}
         pub fn g() {} // private due to m4_2
         pub fn h() {}
diff --git a/tests/ui/redundant_pub_crate.rs b/tests/ui/redundant_pub_crate.rs
index fb07fed98be..9accd297fc9 100644
--- a/tests/ui/redundant_pub_crate.rs
+++ b/tests/ui/redundant_pub_crate.rs
@@ -14,7 +14,7 @@ mod m1 {
     }
 
     pub(crate) mod m1_2 {
-        // ^ private due to m1
+        //:^ private due to m1
         fn f() {}
         pub(crate) fn g() {} // private due to m1_2 and m1
         pub fn h() {}
@@ -39,7 +39,7 @@ pub(crate) mod m2 {
     }
 
     pub(crate) mod m2_2 {
-        // ^ already crate visible due to m2
+        //:^ already crate visible due to m2
         fn f() {}
         pub(crate) fn g() {} // already crate visible due to m2_2 and m2
         pub fn h() {}
@@ -64,7 +64,7 @@ pub mod m3 {
     }
 
     pub(crate) mod m3_2 {
-        // ^ ok
+        //:^ ok
         fn f() {}
         pub(crate) fn g() {} // already crate visible due to m3_2
         pub fn h() {}
@@ -89,7 +89,7 @@ mod m4 {
     }
 
     pub(crate) mod m4_2 {
-        // ^ private: not re-exported by `pub use m4::*`
+        //:^ private: not re-exported by `pub use m4::*`
         fn f() {}
         pub(crate) fn g() {} // private due to m4_2
         pub fn h() {}
diff --git a/tests/ui/redundant_static_lifetimes.fixed b/tests/ui/redundant_static_lifetimes.fixed
index 2651735d103..a83699ec68d 100644
--- a/tests/ui/redundant_static_lifetimes.fixed
+++ b/tests/ui/redundant_static_lifetimes.fixed
@@ -5,39 +5,39 @@
 #[derive(Debug)]
 struct Foo;
 
-const VAR_ONE: &str = "Test constant #1"; // ERROR Consider removing 'static.
+const VAR_ONE: &str = "Test constant #1"; // ERROR: Consider removing 'static.
 
 const VAR_TWO: &str = "Test constant #2"; // This line should not raise a warning.
 
-const VAR_THREE: &[&str] = &["one", "two"]; // ERROR Consider removing 'static
+const VAR_THREE: &[&str] = &["one", "two"]; // ERROR: Consider removing 'static
 
-const VAR_FOUR: (&str, (&str, &str), &str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+const VAR_FOUR: (&str, (&str, &str), &str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
 
 const VAR_SIX: &u8 = &5;
 
 const VAR_HEIGHT: &Foo = &Foo {};
 
-const VAR_SLICE: &[u8] = b"Test constant #1"; // ERROR Consider removing 'static.
+const VAR_SLICE: &[u8] = b"Test constant #1"; // ERROR: Consider removing 'static.
 
-const VAR_TUPLE: &(u8, u8) = &(1, 2); // ERROR Consider removing 'static.
+const VAR_TUPLE: &(u8, u8) = &(1, 2); // ERROR: Consider removing 'static.
 
-const VAR_ARRAY: &[u8; 1] = b"T"; // ERROR Consider removing 'static.
+const VAR_ARRAY: &[u8; 1] = b"T"; // ERROR: Consider removing 'static.
 
-static STATIC_VAR_ONE: &str = "Test static #1"; // ERROR Consider removing 'static.
+static STATIC_VAR_ONE: &str = "Test static #1"; // ERROR: Consider removing 'static.
 
 static STATIC_VAR_TWO: &str = "Test static #2"; // This line should not raise a warning.
 
-static STATIC_VAR_THREE: &[&str] = &["one", "two"]; // ERROR Consider removing 'static
+static STATIC_VAR_THREE: &[&str] = &["one", "two"]; // ERROR: Consider removing 'static
 
 static STATIC_VAR_SIX: &u8 = &5;
 
 static STATIC_VAR_HEIGHT: &Foo = &Foo {};
 
-static STATIC_VAR_SLICE: &[u8] = b"Test static #3"; // ERROR Consider removing 'static.
+static STATIC_VAR_SLICE: &[u8] = b"Test static #3"; // ERROR: Consider removing 'static.
 
-static STATIC_VAR_TUPLE: &(u8, u8) = &(1, 2); // ERROR Consider removing 'static.
+static STATIC_VAR_TUPLE: &(u8, u8) = &(1, 2); // ERROR: Consider removing 'static.
 
-static STATIC_VAR_ARRAY: &[u8; 1] = b"T"; // ERROR Consider removing 'static.
+static STATIC_VAR_ARRAY: &[u8; 1] = b"T"; // ERROR: Consider removing 'static.
 
 static mut STATIC_MUT_SLICE: &mut [u32] = &mut [0];
 
diff --git a/tests/ui/redundant_static_lifetimes.rs b/tests/ui/redundant_static_lifetimes.rs
index 7286652899d..b165cbaa3aa 100644
--- a/tests/ui/redundant_static_lifetimes.rs
+++ b/tests/ui/redundant_static_lifetimes.rs
@@ -5,39 +5,39 @@
 #[derive(Debug)]
 struct Foo;
 
-const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
+const VAR_ONE: &'static str = "Test constant #1"; // ERROR: Consider removing 'static.
 
 const VAR_TWO: &str = "Test constant #2"; // This line should not raise a warning.
 
-const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
+const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR: Consider removing 'static
 
-const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
 
 const VAR_SIX: &'static u8 = &5;
 
 const VAR_HEIGHT: &'static Foo = &Foo {};
 
-const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR Consider removing 'static.
+const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR: Consider removing 'static.
 
-const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
+const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR: Consider removing 'static.
 
-const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
+const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR: Consider removing 'static.
 
-static STATIC_VAR_ONE: &'static str = "Test static #1"; // ERROR Consider removing 'static.
+static STATIC_VAR_ONE: &'static str = "Test static #1"; // ERROR: Consider removing 'static.
 
 static STATIC_VAR_TWO: &str = "Test static #2"; // This line should not raise a warning.
 
-static STATIC_VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
+static STATIC_VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR: Consider removing 'static
 
 static STATIC_VAR_SIX: &'static u8 = &5;
 
 static STATIC_VAR_HEIGHT: &'static Foo = &Foo {};
 
-static STATIC_VAR_SLICE: &'static [u8] = b"Test static #3"; // ERROR Consider removing 'static.
+static STATIC_VAR_SLICE: &'static [u8] = b"Test static #3"; // ERROR: Consider removing 'static.
 
-static STATIC_VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
+static STATIC_VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR: Consider removing 'static.
 
-static STATIC_VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
+static STATIC_VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR: Consider removing 'static.
 
 static mut STATIC_MUT_SLICE: &'static mut [u32] = &mut [0];
 
diff --git a/tests/ui/redundant_static_lifetimes.stderr b/tests/ui/redundant_static_lifetimes.stderr
index b2cbd2d9d01..a13e5eadf15 100644
--- a/tests/ui/redundant_static_lifetimes.stderr
+++ b/tests/ui/redundant_static_lifetimes.stderr
@@ -1,7 +1,7 @@
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:8:17
    |
-LL | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static.
+LL | const VAR_ONE: &'static str = "Test constant #1"; // ERROR: Consider removing 'static.
    |                -^^^^^^^---- help: consider removing `'static`: `&str`
    |
    = note: `-D clippy::redundant-static-lifetimes` implied by `-D warnings`
@@ -9,19 +9,19 @@ LL | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removin
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:12:21
    |
-LL | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
+LL | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR: Consider removing 'static
    |                    -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:14:32
    |
-LL | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+LL | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
    |                               -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:14:47
    |
-LL | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+LL | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
    |                                              -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: constants have by default a `'static` lifetime
@@ -39,31 +39,31 @@ LL | const VAR_HEIGHT: &'static Foo = &Foo {};
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:20:19
    |
-LL | const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR Consider removing 'static.
+LL | const VAR_SLICE: &'static [u8] = b"Test constant #1"; // ERROR: Consider removing 'static.
    |                  -^^^^^^^----- help: consider removing `'static`: `&[u8]`
 
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:22:19
    |
-LL | const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
+LL | const VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR: Consider removing 'static.
    |                  -^^^^^^^--------- help: consider removing `'static`: `&(u8, u8)`
 
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:24:19
    |
-LL | const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
+LL | const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR: Consider removing 'static.
    |                  -^^^^^^^-------- help: consider removing `'static`: `&[u8; 1]`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:26:25
    |
-LL | static STATIC_VAR_ONE: &'static str = "Test static #1"; // ERROR Consider removing 'static.
+LL | static STATIC_VAR_ONE: &'static str = "Test static #1"; // ERROR: Consider removing 'static.
    |                        -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:30:29
    |
-LL | static STATIC_VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static
+LL | static STATIC_VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR: Consider removing 'static
    |                            -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: statics have by default a `'static` lifetime
@@ -81,19 +81,19 @@ LL | static STATIC_VAR_HEIGHT: &'static Foo = &Foo {};
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:36:27
    |
-LL | static STATIC_VAR_SLICE: &'static [u8] = b"Test static #3"; // ERROR Consider removing 'static.
+LL | static STATIC_VAR_SLICE: &'static [u8] = b"Test static #3"; // ERROR: Consider removing 'static.
    |                          -^^^^^^^----- help: consider removing `'static`: `&[u8]`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:38:27
    |
-LL | static STATIC_VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR Consider removing 'static.
+LL | static STATIC_VAR_TUPLE: &'static (u8, u8) = &(1, 2); // ERROR: Consider removing 'static.
    |                          -^^^^^^^--------- help: consider removing `'static`: `&(u8, u8)`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes.rs:40:27
    |
-LL | static STATIC_VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
+LL | static STATIC_VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR: Consider removing 'static.
    |                          -^^^^^^^-------- help: consider removing `'static`: `&[u8; 1]`
 
 error: statics have by default a `'static` lifetime
diff --git a/tests/ui/redundant_static_lifetimes_multiple.rs b/tests/ui/redundant_static_lifetimes_multiple.rs
index f57dd58e230..b3f263a7d66 100644
--- a/tests/ui/redundant_static_lifetimes_multiple.rs
+++ b/tests/ui/redundant_static_lifetimes_multiple.rs
@@ -1,12 +1,12 @@
 // these are rustfixable, but run-rustfix tests cannot handle them
 
-const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
+const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR: Consider removing 'static
 
 const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
 
-static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
 
-static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
+static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR: Consider removing 'static
 
 static STATIC_VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])];
 
diff --git a/tests/ui/redundant_static_lifetimes_multiple.stderr b/tests/ui/redundant_static_lifetimes_multiple.stderr
index cc7e55a757a..4e7500903f8 100644
--- a/tests/ui/redundant_static_lifetimes_multiple.stderr
+++ b/tests/ui/redundant_static_lifetimes_multiple.stderr
@@ -1,7 +1,7 @@
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes_multiple.rs:3:18
    |
-LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
+LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR: Consider removing 'static
    |                 -^^^^^^^------------------ help: consider removing `'static`: `&[&[&'static str]]`
    |
    = note: `-D clippy::redundant-static-lifetimes` implied by `-D warnings`
@@ -9,7 +9,7 @@ LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]];
 error: constants have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes_multiple.rs:3:30
    |
-LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
+LL | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR: Consider removing 'static
    |                             -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: constants have by default a `'static` lifetime
@@ -27,25 +27,25 @@ LL | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes_multiple.rs:7:40
    |
-LL | static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+LL | static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
    |                                       -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes_multiple.rs:7:55
    |
-LL | static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static
+LL | static STATIC_VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR: Consider removing 'static
    |                                                      -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes_multiple.rs:9:26
    |
-LL | static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
+LL | static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR: Consider removing 'static
    |                         -^^^^^^^------------------ help: consider removing `'static`: `&[&[&'static str]]`
 
 error: statics have by default a `'static` lifetime
   --> $DIR/redundant_static_lifetimes_multiple.rs:9:38
    |
-LL | static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static
+LL | static STATIC_VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR: Consider removing 'static
    |                                     -^^^^^^^---- help: consider removing `'static`: `&str`
 
 error: statics have by default a `'static` lifetime
diff --git a/tests/ui/regex.stderr b/tests/ui/regex.stderr
index 1e8a21283cd..c74dc8108fe 100644
--- a/tests/ui/regex.stderr
+++ b/tests/ui/regex.stderr
@@ -88,7 +88,7 @@ error: regex parse error:
        error: unrecognized escape sequence
   --> $DIR/regex.rs:42:42
    |
-LL |     let escaped_string_span = Regex::new("/b/c");
+LL |     let escaped_string_span = Regex::new("//b//c");
    |                                          ^^^^^^^^
    |
    = help: consider using a raw string literal: `r".."`
@@ -156,7 +156,7 @@ LL |     let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
 error: trivial regex
   --> $DIR/regex.rs:65:40
    |
-LL |     let trivial_backslash = Regex::new("a/.b");
+LL |     let trivial_backslash = Regex::new("a//.b");
    |                                        ^^^^^^^
    |
    = help: consider using `str::contains`
diff --git a/tests/ui/same_functions_in_if_condition.rs b/tests/ui/same_functions_in_if_condition.rs
index aea1507cc5b..02e347ed9f6 100644
--- a/tests/ui/same_functions_in_if_condition.rs
+++ b/tests/ui/same_functions_in_if_condition.rs
@@ -35,33 +35,33 @@ fn ifs_same_cond_fn() {
 
     if function() {
     } else if function() {
-        //~ ERROR ifs same condition
+        //~^ ERROR: `if` has the same function call as a previous `if`
     }
 
     if fn_arg(a) {
     } else if fn_arg(a) {
-        //~ ERROR ifs same condition
+        //~^ ERROR: `if` has the same function call as a previous `if`
     }
 
     if obj.method() {
     } else if obj.method() {
-        //~ ERROR ifs same condition
+        //~^ ERROR: `if` has the same function call as a previous `if`
     }
 
     if obj.method_arg(a) {
     } else if obj.method_arg(a) {
-        //~ ERROR ifs same condition
+        //~^ ERROR: `if` has the same function call as a previous `if`
     }
 
     let mut v = vec![1];
     if v.pop().is_none() {
-        //~ ERROR ifs same condition
     } else if v.pop().is_none() {
+        //~^ ERROR: `if` has the same function call as a previous `if`
     }
 
     if v.len() == 42 {
-        //~ ERROR ifs same condition
     } else if v.len() == 42 {
+        //~^ ERROR: `if` has the same function call as a previous `if`
     }
 
     if v.len() == 1 {
diff --git a/tests/ui/same_functions_in_if_condition.stderr b/tests/ui/same_functions_in_if_condition.stderr
index aade3b1fa45..d7b2d762db7 100644
--- a/tests/ui/same_functions_in_if_condition.stderr
+++ b/tests/ui/same_functions_in_if_condition.stderr
@@ -52,7 +52,7 @@ LL |     if obj.method_arg(a) {
    |        ^^^^^^^^^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> $DIR/same_functions_in_if_condition.rs:59:15
+  --> $DIR/same_functions_in_if_condition.rs:58:15
    |
 LL |     } else if v.pop().is_none() {
    |               ^^^^^^^^^^^^^^^^^
@@ -64,7 +64,7 @@ LL |     if v.pop().is_none() {
    |        ^^^^^^^^^^^^^^^^^
 
 error: this `if` has the same function call as a previous `if`
-  --> $DIR/same_functions_in_if_condition.rs:64:15
+  --> $DIR/same_functions_in_if_condition.rs:63:15
    |
 LL |     } else if v.len() == 42 {
    |               ^^^^^^^^^^^^^
diff --git a/tests/ui/shadow.rs b/tests/ui/shadow.rs
index c2895718a1a..9be8c5e59d0 100644
--- a/tests/ui/shadow.rs
+++ b/tests/ui/shadow.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![warn(clippy::shadow_same, clippy::shadow_reuse, clippy::shadow_unrelated)]
 #![allow(clippy::let_unit_value, clippy::needless_if)]
diff --git a/tests/ui/significant_drop_in_scrutinee.fixed b/tests/ui/significant_drop_in_scrutinee.fixed
new file mode 100644
index 00000000000..acc78d6bb04
--- /dev/null
+++ b/tests/ui/significant_drop_in_scrutinee.fixed
@@ -0,0 +1,627 @@
+// FIXME: Ideally these suggestions would be fixed via rustfix. Blocked by rust-lang/rust#53934
+// //@run-rustfix
+#![warn(clippy::significant_drop_in_scrutinee)]
+#![allow(dead_code, unused_assignments)]
+#![allow(clippy::match_single_binding, clippy::single_match, clippy::uninlined_format_args)]
+
+use std::num::ParseIntError;
+use std::ops::Deref;
+use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::RwLock;
+use std::sync::{Mutex, MutexGuard};
+
+struct State {}
+
+impl State {
+    fn foo(&self) -> bool {
+        true
+    }
+
+    fn bar(&self) {}
+}
+
+fn should_not_trigger_lint_with_mutex_guard_outside_match() {
+    let mutex = Mutex::new(State {});
+
+    // Should not trigger lint because the temporary should drop at the `;` on line before the match
+    let is_foo = mutex.lock().unwrap().foo();
+    match is_foo {
+        true => {
+            mutex.lock().unwrap().bar();
+        },
+        false => {},
+    };
+}
+
+fn should_not_trigger_lint_with_mutex_guard_when_taking_ownership_in_match() {
+    let mutex = Mutex::new(State {});
+
+    // Should not trigger lint because the scrutinee is explicitly returning the MutexGuard,
+    // so its lifetime should not be surprising.
+    match mutex.lock() {
+        Ok(guard) => {
+            guard.foo();
+            mutex.lock().unwrap().bar();
+        },
+        _ => {},
+    };
+}
+
+fn should_trigger_lint_with_mutex_guard_in_match_scrutinee() {
+    let mutex = Mutex::new(State {});
+
+    // Should trigger lint because the lifetime of the temporary MutexGuard is surprising because it
+    // is preserved until the end of the match, but there is no clear indication that this is the
+    // case.
+    match mutex.lock().unwrap().foo() {
+        true => {
+            mutex.lock().unwrap().bar();
+        },
+        false => {},
+    };
+}
+
+fn should_not_trigger_lint_with_mutex_guard_in_match_scrutinee_when_lint_allowed() {
+    let mutex = Mutex::new(State {});
+
+    // Lint should not be triggered because it is "allowed" below.
+    #[allow(clippy::significant_drop_in_scrutinee)]
+    match mutex.lock().unwrap().foo() {
+        true => {
+            mutex.lock().unwrap().bar();
+        },
+        false => {},
+    };
+}
+
+fn should_not_trigger_lint_for_insignificant_drop() {
+    // Should not trigger lint because there are no temporaries whose drops have a significant
+    // side effect.
+    match 1u64.to_string().is_empty() {
+        true => {
+            println!("It was empty")
+        },
+        false => {
+            println!("It was not empty")
+        },
+    }
+}
+
+struct StateWithMutex {
+    m: Mutex<u64>,
+}
+
+struct MutexGuardWrapper<'a> {
+    mg: MutexGuard<'a, u64>,
+}
+
+impl<'a> MutexGuardWrapper<'a> {
+    fn get_the_value(&self) -> u64 {
+        *self.mg.deref()
+    }
+}
+
+struct MutexGuardWrapperWrapper<'a> {
+    mg: MutexGuardWrapper<'a>,
+}
+
+impl<'a> MutexGuardWrapperWrapper<'a> {
+    fn get_the_value(&self) -> u64 {
+        *self.mg.mg.deref()
+    }
+}
+
+impl StateWithMutex {
+    fn lock_m(&self) -> MutexGuardWrapper<'_> {
+        MutexGuardWrapper {
+            mg: self.m.lock().unwrap(),
+        }
+    }
+
+    fn lock_m_m(&self) -> MutexGuardWrapperWrapper<'_> {
+        MutexGuardWrapperWrapper {
+            mg: MutexGuardWrapper {
+                mg: self.m.lock().unwrap(),
+            },
+        }
+    }
+
+    fn foo(&self) -> bool {
+        true
+    }
+
+    fn bar(&self) {}
+}
+
+fn should_trigger_lint_with_wrapped_mutex() {
+    let s = StateWithMutex { m: Mutex::new(1) };
+
+    // Should trigger lint because a temporary contains a type with a significant drop and its
+    // lifetime is not obvious. Additionally, it is not obvious from looking at the scrutinee that
+    // the temporary contains such a type, making it potentially even more surprising.
+    match s.lock_m().get_the_value() {
+        1 => {
+            println!("Got 1. Is it still 1?");
+            println!("{}", s.lock_m().get_the_value());
+        },
+        2 => {
+            println!("Got 2. Is it still 2?");
+            println!("{}", s.lock_m().get_the_value());
+        },
+        _ => {},
+    }
+    println!("All done!");
+}
+
+fn should_trigger_lint_with_double_wrapped_mutex() {
+    let s = StateWithMutex { m: Mutex::new(1) };
+
+    // Should trigger lint because a temporary contains a type which further contains a type with a
+    // significant drop and its lifetime is not obvious. Additionally, it is not obvious from
+    // looking at the scrutinee that the temporary contains such a type, making it potentially even
+    // more surprising.
+    match s.lock_m_m().get_the_value() {
+        1 => {
+            println!("Got 1. Is it still 1?");
+            println!("{}", s.lock_m().get_the_value());
+        },
+        2 => {
+            println!("Got 2. Is it still 2?");
+            println!("{}", s.lock_m().get_the_value());
+        },
+        _ => {},
+    }
+    println!("All done!");
+}
+
+struct Counter {
+    i: AtomicU64,
+}
+
+#[clippy::has_significant_drop]
+struct CounterWrapper<'a> {
+    counter: &'a Counter,
+}
+
+impl<'a> CounterWrapper<'a> {
+    fn new(counter: &Counter) -> CounterWrapper {
+        counter.i.fetch_add(1, Ordering::Relaxed);
+        CounterWrapper { counter }
+    }
+}
+
+impl<'a> Drop for CounterWrapper<'a> {
+    fn drop(&mut self) {
+        self.counter.i.fetch_sub(1, Ordering::Relaxed);
+    }
+}
+
+impl Counter {
+    fn temp_increment(&self) -> Vec<CounterWrapper> {
+        vec![CounterWrapper::new(self), CounterWrapper::new(self)]
+    }
+}
+
+fn should_trigger_lint_for_vec() {
+    let counter = Counter { i: AtomicU64::new(0) };
+
+    // Should trigger lint because the temporary in the scrutinee returns a collection of types
+    // which have significant drops. The types with significant drops are also non-obvious when
+    // reading the expression in the scrutinee.
+    match counter.temp_increment().len() {
+        2 => {
+            let current_count = counter.i.load(Ordering::Relaxed);
+            println!("Current count {}", current_count);
+            assert_eq!(current_count, 0);
+        },
+        1 => {},
+        3 => {},
+        _ => {},
+    };
+}
+
+struct StateWithField {
+    s: String,
+}
+
+// Should trigger lint only on the type in the tuple which is created using a temporary
+// with a significant drop. Additionally, this test ensures that the format of the tuple
+// is preserved correctly in the suggestion.
+fn should_trigger_lint_for_tuple_in_scrutinee() {
+    let mutex1 = Mutex::new(StateWithField { s: "one".to_owned() });
+
+    {
+        match (mutex1.lock().unwrap().s.len(), true) {
+            (3, _) => {
+                println!("started");
+                mutex1.lock().unwrap().s.len();
+                println!("done");
+            },
+            (_, _) => {},
+        };
+
+        match (true, mutex1.lock().unwrap().s.len(), true) {
+            (_, 3, _) => {
+                println!("started");
+                mutex1.lock().unwrap().s.len();
+                println!("done");
+            },
+            (_, _, _) => {},
+        };
+
+        let mutex2 = Mutex::new(StateWithField { s: "two".to_owned() });
+        match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
+            (3, _, 3) => {
+                println!("started");
+                mutex1.lock().unwrap().s.len();
+                mutex2.lock().unwrap().s.len();
+                println!("done");
+            },
+            (_, _, _) => {},
+        };
+
+        let mutex3 = Mutex::new(StateWithField { s: "three".to_owned() });
+        match mutex3.lock().unwrap().s.as_str() {
+            "three" => {
+                println!("started");
+                mutex1.lock().unwrap().s.len();
+                mutex2.lock().unwrap().s.len();
+                println!("done");
+            },
+            _ => {},
+        };
+
+        match (true, mutex3.lock().unwrap().s.as_str()) {
+            (_, "three") => {
+                println!("started");
+                mutex1.lock().unwrap().s.len();
+                mutex2.lock().unwrap().s.len();
+                println!("done");
+            },
+            (_, _) => {},
+        };
+    }
+}
+
+// Should trigger lint when either side of a binary operation creates a temporary with a
+// significant drop.
+// To avoid potential unnecessary copies or creating references that would trigger the significant
+// drop problem, the lint recommends moving the entire binary operation.
+fn should_trigger_lint_for_accessing_field_in_mutex_in_one_side_of_binary_op() {
+    let mutex = Mutex::new(StateWithField { s: "state".to_owned() });
+
+    match mutex.lock().unwrap().s.len() > 1 {
+        true => {
+            mutex.lock().unwrap().s.len();
+        },
+        false => {},
+    };
+
+    match 1 < mutex.lock().unwrap().s.len() {
+        true => {
+            mutex.lock().unwrap().s.len();
+        },
+        false => {},
+    };
+}
+
+// Should trigger lint when both sides of a binary operation creates a temporary with a
+// significant drop.
+// To avoid potential unnecessary copies or creating references that would trigger the significant
+// drop problem, the lint recommends moving the entire binary operation.
+fn should_trigger_lint_for_accessing_fields_in_mutex_in_both_sides_of_binary_op() {
+    let mutex1 = Mutex::new(StateWithField { s: "state".to_owned() });
+    let mutex2 = Mutex::new(StateWithField {
+        s: "statewithfield".to_owned(),
+    });
+
+    match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
+        true => {
+            println!(
+                "{} < {}",
+                mutex1.lock().unwrap().s.len(),
+                mutex2.lock().unwrap().s.len()
+            );
+        },
+        false => {},
+    };
+
+    match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
+        true => {
+            println!(
+                "{} >= {}",
+                mutex1.lock().unwrap().s.len(),
+                mutex2.lock().unwrap().s.len()
+            );
+        },
+        false => {},
+    };
+}
+
+fn should_not_trigger_lint_for_closure_in_scrutinee() {
+    let mutex1 = Mutex::new(StateWithField { s: "one".to_owned() });
+
+    let get_mutex_guard = || mutex1.lock().unwrap().s.len();
+
+    // Should not trigger lint because the temporary with a significant drop will be dropped
+    // at the end of the closure, so the MutexGuard will be unlocked and not have a potentially
+    // surprising lifetime.
+    match get_mutex_guard() > 1 {
+        true => {
+            mutex1.lock().unwrap().s.len();
+        },
+        false => {},
+    };
+}
+
+fn should_trigger_lint_for_return_from_closure_in_scrutinee() {
+    let mutex1 = Mutex::new(StateWithField { s: "one".to_owned() });
+
+    let get_mutex_guard = || mutex1.lock().unwrap();
+
+    // Should trigger lint because the temporary with a significant drop is returned from the
+    // closure but not used directly in any match arms, so it has a potentially surprising lifetime.
+    match get_mutex_guard().s.len() > 1 {
+        true => {
+            mutex1.lock().unwrap().s.len();
+        },
+        false => {},
+    };
+}
+
+fn should_trigger_lint_for_return_from_match_in_scrutinee() {
+    let mutex1 = Mutex::new(StateWithField { s: "one".to_owned() });
+    let mutex2 = Mutex::new(StateWithField { s: "two".to_owned() });
+
+    let i = 100;
+
+    // Should trigger lint because the nested match within the scrutinee returns a temporary with a
+    // significant drop is but not used directly in any match arms, so it has a potentially
+    // surprising lifetime.
+    match match i {
+        100 => mutex1.lock().unwrap(),
+        _ => mutex2.lock().unwrap(),
+    }
+    .s
+    .len()
+        > 1
+    {
+        true => {
+            mutex1.lock().unwrap().s.len();
+        },
+        false => {
+            println!("nothing to do here");
+        },
+    };
+}
+
+fn should_trigger_lint_for_return_from_if_in_scrutinee() {
+    let mutex1 = Mutex::new(StateWithField { s: "one".to_owned() });
+    let mutex2 = Mutex::new(StateWithField { s: "two".to_owned() });
+
+    let i = 100;
+
+    // Should trigger lint because the nested if-expression within the scrutinee returns a temporary
+    // with a significant drop is but not used directly in any match arms, so it has a potentially
+    // surprising lifetime.
+    match if i > 1 {
+        mutex1.lock().unwrap()
+    } else {
+        mutex2.lock().unwrap()
+    }
+    .s
+    .len()
+        > 1
+    {
+        true => {
+            mutex1.lock().unwrap().s.len();
+        },
+        false => {},
+    };
+}
+
+fn should_not_trigger_lint_for_if_in_scrutinee() {
+    let mutex = Mutex::new(StateWithField { s: "state".to_owned() });
+
+    let i = 100;
+
+    // Should not trigger the lint because the temporary with a significant drop *is* dropped within
+    // the body of the if-expression nested within the match scrutinee, and therefore does not have
+    // a potentially surprising lifetime.
+    match if i > 1 {
+        mutex.lock().unwrap().s.len() > 1
+    } else {
+        false
+    } {
+        true => {
+            mutex.lock().unwrap().s.len();
+        },
+        false => {},
+    };
+}
+
+struct StateWithBoxedMutexGuard {
+    u: Mutex<u64>,
+}
+
+impl StateWithBoxedMutexGuard {
+    fn new() -> StateWithBoxedMutexGuard {
+        StateWithBoxedMutexGuard { u: Mutex::new(42) }
+    }
+    fn lock(&self) -> Box<MutexGuard<u64>> {
+        Box::new(self.u.lock().unwrap())
+    }
+}
+
+fn should_trigger_lint_for_boxed_mutex_guard() {
+    let s = StateWithBoxedMutexGuard::new();
+
+    // Should trigger lint because a temporary Box holding a type with a significant drop in a match
+    // scrutinee may have a potentially surprising lifetime.
+    match s.lock().deref().deref() {
+        0 | 1 => println!("Value was less than 2"),
+        _ => println!("Value is {}", s.lock().deref()),
+    };
+}
+
+struct StateStringWithBoxedMutexGuard {
+    s: Mutex<String>,
+}
+
+impl StateStringWithBoxedMutexGuard {
+    fn new() -> StateStringWithBoxedMutexGuard {
+        StateStringWithBoxedMutexGuard {
+            s: Mutex::new("A String".to_owned()),
+        }
+    }
+    fn lock(&self) -> Box<MutexGuard<String>> {
+        Box::new(self.s.lock().unwrap())
+    }
+}
+
+fn should_trigger_lint_for_boxed_mutex_guard_holding_string() {
+    let s = StateStringWithBoxedMutexGuard::new();
+
+    let matcher = String::from("A String");
+
+    // Should trigger lint because a temporary Box holding a type with a significant drop in a match
+    // scrutinee may have a potentially surprising lifetime.
+    match s.lock().deref().deref() {
+        matcher => println!("Value is {}", s.lock().deref()),
+        _ => println!("Value was not a match"),
+    };
+}
+
+struct StateWithIntField {
+    i: u64,
+}
+
+// Should trigger lint when either side of an assign expression contains a temporary with a
+// significant drop, because the temporary's lifetime will be extended to the end of the match.
+// To avoid potential unnecessary copies or creating references that would trigger the significant
+// drop problem, the lint recommends moving the entire binary operation.
+fn should_trigger_lint_in_assign_expr() {
+    let mutex = Mutex::new(StateWithIntField { i: 10 });
+
+    let mut i = 100;
+
+    match mutex.lock().unwrap().i = i {
+        _ => {
+            println!("{}", mutex.lock().unwrap().i);
+        },
+    };
+
+    match i = mutex.lock().unwrap().i {
+        _ => {
+            println!("{}", mutex.lock().unwrap().i);
+        },
+    };
+
+    match mutex.lock().unwrap().i += 1 {
+        _ => {
+            println!("{}", mutex.lock().unwrap().i);
+        },
+    };
+
+    match i += mutex.lock().unwrap().i {
+        _ => {
+            println!("{}", mutex.lock().unwrap().i);
+        },
+    };
+}
+
+#[derive(Debug)]
+enum RecursiveEnum {
+    Foo(Option<Box<RecursiveEnum>>),
+}
+
+#[derive(Debug)]
+enum GenericRecursiveEnum<T> {
+    Foo(T, Option<Box<GenericRecursiveEnum<T>>>),
+}
+
+fn should_not_cause_stack_overflow() {
+    // Test that when a type recursively contains itself, a stack overflow does not occur when
+    // checking sub-types for significant drops.
+    let f = RecursiveEnum::Foo(Some(Box::new(RecursiveEnum::Foo(None))));
+    match f {
+        RecursiveEnum::Foo(Some(f)) => {
+            println!("{:?}", f)
+        },
+        RecursiveEnum::Foo(f) => {
+            println!("{:?}", f)
+        },
+    }
+
+    let f = GenericRecursiveEnum::Foo(1u64, Some(Box::new(GenericRecursiveEnum::Foo(2u64, None))));
+    match f {
+        GenericRecursiveEnum::Foo(i, Some(f)) => {
+            println!("{} {:?}", i, f)
+        },
+        GenericRecursiveEnum::Foo(i, f) => {
+            println!("{} {:?}", i, f)
+        },
+    }
+}
+
+fn should_not_produce_lint_for_try_desugar() -> Result<u64, ParseIntError> {
+    // TryDesugar (i.e. using `?` for a Result type) will turn into a match but is out of scope
+    // for this lint
+    let rwlock = RwLock::new("1".to_string());
+    let result = rwlock.read().unwrap().parse::<u64>()?;
+    println!("{}", result);
+    rwlock.write().unwrap().push('2');
+    Ok(result)
+}
+
+struct ResultReturner {
+    s: String,
+}
+
+impl ResultReturner {
+    fn to_number(&self) -> Result<i64, ParseIntError> {
+        self.s.parse::<i64>()
+    }
+}
+
+fn should_trigger_lint_for_non_ref_move_and_clone_suggestion() {
+    let rwlock = RwLock::<ResultReturner>::new(ResultReturner { s: "1".to_string() });
+    match rwlock.read().unwrap().to_number() {
+        Ok(n) => println!("Converted to number: {}", n),
+        Err(e) => println!("Could not convert {} to number", e),
+    };
+}
+
+fn should_trigger_lint_for_read_write_lock_for_loop() {
+    // For-in loops desugar to match expressions and are prone to the type of deadlock this lint is
+    // designed to look for.
+    let rwlock = RwLock::<Vec<String>>::new(vec!["1".to_string()]);
+    for s in rwlock.read().unwrap().iter() {
+        println!("{}", s);
+    }
+}
+
+fn do_bar(mutex: &Mutex<State>) {
+    mutex.lock().unwrap().bar();
+}
+
+fn should_trigger_lint_without_significant_drop_in_arm() {
+    let mutex = Mutex::new(State {});
+
+    // Should trigger lint because the lifetime of the temporary MutexGuard is surprising because it
+    // is preserved until the end of the match, but there is no clear indication that this is the
+    // case.
+    match mutex.lock().unwrap().foo() {
+        true => do_bar(&mutex),
+        false => {},
+    };
+}
+
+fn should_not_trigger_on_significant_iterator_drop() {
+    let lines = std::io::stdin().lines();
+    for line in lines {
+        println!("foo: {}", line.unwrap());
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/single_call_fn.rs b/tests/ui/single_call_fn.rs
index bfb773187fb..76e175014b8 100644
--- a/tests/ui/single_call_fn.rs
+++ b/tests/ui/single_call_fn.rs
@@ -1,5 +1,4 @@
-//@aux-build:proc_macros.rs
-//@compile-flags: --test
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(clippy::redundant_closure_call, unused)]
 #![warn(clippy::single_call_fn)]
 #![no_main]
diff --git a/tests/ui/single_call_fn.stderr b/tests/ui/single_call_fn.stderr
index bb92e3cf71a..9ef8c487844 100644
--- a/tests/ui/single_call_fn.stderr
+++ b/tests/ui/single_call_fn.stderr
@@ -1,5 +1,5 @@
 error: this function is only used once
-  --> $DIR/single_call_fn.rs:34:1
+  --> $DIR/single_call_fn.rs:33:1
    |
 LL | / fn c() {
 LL | |     println!("really");
@@ -9,44 +9,44 @@ LL | | }
    | |_^
    |
 help: used here
-  --> $DIR/single_call_fn.rs:41:5
+  --> $DIR/single_call_fn.rs:40:5
    |
 LL |     c();
    |     ^
    = note: `-D clippy::single-call-fn` implied by `-D warnings`
 
 error: this function is only used once
-  --> $DIR/single_call_fn.rs:13:1
+  --> $DIR/single_call_fn.rs:12:1
    |
 LL | fn i() {}
    | ^^^^^^^^^
    |
 help: used here
-  --> $DIR/single_call_fn.rs:18:13
+  --> $DIR/single_call_fn.rs:17:13
    |
 LL |     let a = i;
    |             ^
 
 error: this function is only used once
-  --> $DIR/single_call_fn.rs:44:1
+  --> $DIR/single_call_fn.rs:43:1
    |
 LL | fn a() {}
    | ^^^^^^^^^
    |
 help: used here
-  --> $DIR/single_call_fn.rs:47:5
+  --> $DIR/single_call_fn.rs:46:5
    |
 LL |     a();
    |     ^
 
 error: this function is only used once
-  --> $DIR/single_call_fn.rs:14:1
+  --> $DIR/single_call_fn.rs:13:1
    |
 LL | fn j() {}
    | ^^^^^^^^^
    |
 help: used here
-  --> $DIR/single_call_fn.rs:25:9
+  --> $DIR/single_call_fn.rs:24:9
    |
 LL |         j();
    |         ^
diff --git a/tests/ui/single_char_pattern.stderr b/tests/ui/single_char_pattern.stderr
index 5564aac674d..5ae2450c226 100644
--- a/tests/ui/single_char_pattern.stderr
+++ b/tests/ui/single_char_pattern.stderr
@@ -226,13 +226,13 @@ error: single-character string constant used as pattern
   --> $DIR/single_char_pattern.rs:65:13
    |
 LL |     x.split(r#"/"#);
-   |             ^^^^^^ help: try using a `char` instead: `'/'`
+   |             ^^^^^^ help: try using a `char` instead: `'//'`
 
 error: single-character string constant used as pattern
   --> $DIR/single_char_pattern.rs:66:13
    |
 LL |     x.split(r"/");
-   |             ^^^^ help: try using a `char` instead: `'/'`
+   |             ^^^^ help: try using a `char` instead: `'//'`
 
 error: aborting due to 39 previous errors
 
diff --git a/tests/ui/single_match_else.fixed b/tests/ui/single_match_else.fixed
index f88498655a4..fcc8f14803d 100644
--- a/tests/ui/single_match_else.fixed
+++ b/tests/ui/single_match_else.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![warn(clippy::single_match_else)]
 #![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)]
 extern crate proc_macros;
diff --git a/tests/ui/single_match_else.rs b/tests/ui/single_match_else.rs
index b34b9553919..77afd58a08d 100644
--- a/tests/ui/single_match_else.rs
+++ b/tests/ui/single_match_else.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![warn(clippy::single_match_else)]
 #![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)]
 extern crate proc_macros;
diff --git a/tests/ui/single_range_in_vec_init.rs b/tests/ui/single_range_in_vec_init.rs
index abf784e0f0e..833e1c43bfc 100644
--- a/tests/ui/single_range_in_vec_init.rs
+++ b/tests/ui/single_range_in_vec_init.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![allow(clippy::no_effect, clippy::useless_vec, unused)]
 #![warn(clippy::single_range_in_vec_init)]
 #![feature(generic_arg_infer)]
@@ -39,8 +39,8 @@ fn main() {
     [0.0..200.0];
     vec![0.0..200.0];
     // `Copy` is not implemented for `Range`, so this doesn't matter
-    // [0..200; 2];
-    // [vec!0..200; 2];
+    // FIXME: [0..200; 2];
+    // FIXME: [vec!0..200; 2];
 
     // Unfortunately skips any macros
     a!();
diff --git a/tests/ui/string_add.rs b/tests/ui/string_add.rs
index de78dfe4d69..6980242ae72 100644
--- a/tests/ui/string_add.rs
+++ b/tests/ui/string_add.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 extern crate proc_macros;
 use proc_macros::external;
diff --git a/tests/ui/suspicious_else_formatting.rs b/tests/ui/suspicious_else_formatting.rs
index c0856427eae..0473ccdc3f6 100644
--- a/tests/ui/suspicious_else_formatting.rs
+++ b/tests/ui/suspicious_else_formatting.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_suspicious_else_formatting.rs
+//@aux-build:proc_macro_suspicious_else_formatting.rs:proc-macro
 
 #![warn(clippy::suspicious_else_formatting)]
 #![allow(
diff --git a/tests/ui/tests_outside_test_module.rs b/tests/ui/tests_outside_test_module.rs
index 21fdfdf9005..d53c692b78e 100644
--- a/tests/ui/tests_outside_test_module.rs
+++ b/tests/ui/tests_outside_test_module.rs
@@ -1,4 +1,3 @@
-//@compile-flags: --test
 #![allow(unused)]
 #![warn(clippy::tests_outside_test_module)]
 
diff --git a/tests/ui/tests_outside_test_module.stderr b/tests/ui/tests_outside_test_module.stderr
index 125a79d6edf..71c649c5d27 100644
--- a/tests/ui/tests_outside_test_module.stderr
+++ b/tests/ui/tests_outside_test_module.stderr
@@ -1,5 +1,5 @@
 error: this function marked with #[test] is outside a #[cfg(test)] module
-  --> $DIR/tests_outside_test_module.rs:11:1
+  --> $DIR/tests_outside_test_module.rs:10:1
    |
 LL | fn my_test() {}
    | ^^^^^^^^^^^^^^^
diff --git a/tests/ui/toplevel_ref_arg.fixed b/tests/ui/toplevel_ref_arg.fixed
index 4bacf9efdae..9ad45c7a817 100644
--- a/tests/ui/toplevel_ref_arg.fixed
+++ b/tests/ui/toplevel_ref_arg.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![warn(clippy::toplevel_ref_arg)]
 #![allow(clippy::uninlined_format_args, unused, clippy::useless_vec)]
 
diff --git a/tests/ui/toplevel_ref_arg.rs b/tests/ui/toplevel_ref_arg.rs
index 723870ccc80..45ccc024cbd 100644
--- a/tests/ui/toplevel_ref_arg.rs
+++ b/tests/ui/toplevel_ref_arg.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 #![warn(clippy::toplevel_ref_arg)]
 #![allow(clippy::uninlined_format_args, unused, clippy::useless_vec)]
 
diff --git a/tests/ui/toplevel_ref_arg_non_rustfix.rs b/tests/ui/toplevel_ref_arg_non_rustfix.rs
index 8aaf47b1bd0..464762af825 100644
--- a/tests/ui/toplevel_ref_arg_non_rustfix.rs
+++ b/tests/ui/toplevel_ref_arg_non_rustfix.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![warn(clippy::toplevel_ref_arg)]
 #![allow(unused)]
diff --git a/tests/ui/transmute_ptr_to_ptr.rs b/tests/ui/transmute_ptr_to_ptr.rs
index f06ffab5d9b..61a6c98ed5a 100644
--- a/tests/ui/transmute_ptr_to_ptr.rs
+++ b/tests/ui/transmute_ptr_to_ptr.rs
@@ -32,7 +32,7 @@ fn transmute_ptr_to_ptr() {
         // ref-ref transmutes; bad
         let _: &f32 = std::mem::transmute(&1u32);
         let _: &f64 = std::mem::transmute(&1f32);
-        // ^ this test is here because both f32 and f64 are the same TypeVariant, but they are not
+        //:^ this test is here because both f32 and f64 are the same TypeVariant, but they are not
         // the same type
         let _: &mut f32 = std::mem::transmute(&mut 1u32);
         let _: &GenericParam<f32> = std::mem::transmute(&GenericParam { t: 1u32 });
diff --git a/tests/ui/try_err.fixed b/tests/ui/try_err.fixed
index dc773ad4bad..1816740870a 100644
--- a/tests/ui/try_err.fixed
+++ b/tests/ui/try_err.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![deny(clippy::try_err)]
 #![allow(clippy::unnecessary_wraps, clippy::needless_question_mark)]
diff --git a/tests/ui/try_err.rs b/tests/ui/try_err.rs
index 7a7433a7ec2..0e47c4d023e 100644
--- a/tests/ui/try_err.rs
+++ b/tests/ui/try_err.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![deny(clippy::try_err)]
 #![allow(clippy::unnecessary_wraps, clippy::needless_question_mark)]
diff --git a/tests/ui/undocumented_unsafe_blocks.rs b/tests/ui/undocumented_unsafe_blocks.rs
index f4e7f1943ae..a9cc4295435 100644
--- a/tests/ui/undocumented_unsafe_blocks.rs
+++ b/tests/ui/undocumented_unsafe_blocks.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_unsafe.rs
+//@aux-build:proc_macro_unsafe.rs:proc-macro
 
 #![warn(clippy::undocumented_unsafe_blocks, clippy::unnecessary_safety_comment)]
 #![allow(clippy::let_unit_value, clippy::missing_safety_doc)]
diff --git a/tests/ui/unicode.fixed b/tests/ui/unicode.fixed
index 910968afa7f..032040c4805 100644
--- a/tests/ui/unicode.fixed
+++ b/tests/ui/unicode.fixed
@@ -1,5 +1,4 @@
 //@run-rustfix
-//@compile-flags: --test
 #![allow(dead_code)]
 
 #[warn(clippy::invisible_characters)]
diff --git a/tests/ui/unicode.rs b/tests/ui/unicode.rs
index bc4b84d3435..dd215bc6048 100644
--- a/tests/ui/unicode.rs
+++ b/tests/ui/unicode.rs
@@ -1,5 +1,4 @@
 //@run-rustfix
-//@compile-flags: --test
 #![allow(dead_code)]
 
 #[warn(clippy::invisible_characters)]
diff --git a/tests/ui/unicode.stderr b/tests/ui/unicode.stderr
index ea74a81451e..21cc22a778b 100644
--- a/tests/ui/unicode.stderr
+++ b/tests/ui/unicode.stderr
@@ -1,5 +1,5 @@
 error: invisible character detected
-  --> $DIR/unicode.rs:7:12
+  --> $DIR/unicode.rs:6:12
    |
 LL |     print!("Here >​< is a ZWS, and ​another");
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{200B}< is a ZWS, and /u{200B}another"`
@@ -7,19 +7,19 @@ LL |     print!("Here >​< is a ZWS, and ​another");
    = note: `-D clippy::invisible-characters` implied by `-D warnings`
 
 error: invisible character detected
-  --> $DIR/unicode.rs:9:12
+  --> $DIR/unicode.rs:8:12
    |
 LL |     print!("Here >­< is a SHY, and ­another");
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{AD}< is a SHY, and /u{AD}another"`
 
 error: invisible character detected
-  --> $DIR/unicode.rs:11:12
+  --> $DIR/unicode.rs:10:12
    |
 LL |     print!("Here >⁠< is a WJ, and ⁠another");
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{2060}< is a WJ, and /u{2060}another"`
 
 error: non-NFC Unicode sequence detected
-  --> $DIR/unicode.rs:17:12
+  --> $DIR/unicode.rs:16:12
    |
 LL |     print!("̀àh?");
    |            ^^^^^ help: consider replacing the string with: `"̀àh?"`
@@ -27,37 +27,37 @@ LL |     print!("̀àh?");
    = note: `-D clippy::unicode-not-nfc` implied by `-D warnings`
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:25:16
+  --> $DIR/unicode.rs:24:16
    |
 LL |         print!("Üben!");
    |                ^^^^^^^ help: consider replacing the string with: `"/u{dc}ben!"`
    |
 note: the lint level is defined here
-  --> $DIR/unicode.rs:22:13
+  --> $DIR/unicode.rs:21:13
    |
 LL |     #![deny(clippy::non_ascii_literal)]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:31:36
+  --> $DIR/unicode.rs:30:36
    |
 LL |         const _EMPTY_BLOCK: char = '▱';
    |                                    ^^^ help: consider replacing the string with: `'/u{25b1}'`
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:32:35
+  --> $DIR/unicode.rs:31:35
    |
 LL |         const _FULL_BLOCK: char = '▰';
    |                                   ^^^ help: consider replacing the string with: `'/u{25b0}'`
 
 error: literal non-ASCII character detected
-  --> $DIR/unicode.rs:52:21
+  --> $DIR/unicode.rs:51:21
    |
 LL |             let _ = "悲しいかな、ここに日本語を書くことはできない。";
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"/u{60b2}/u{3057}/u{3044}/u{304b}/u{306a}/u{3001}/u{3053}/u{3053}/u{306b}/u{65e5}/u{672c}/u{8a9e}/u{3092}/u{66f8}/u{304f}/u{3053}/u{3068}/u{306f}/u{3067}/u{304d}/u{306a}/u{3044}/u{3002}"`
    |
 note: the lint level is defined here
-  --> $DIR/unicode.rs:41:17
+  --> $DIR/unicode.rs:40:17
    |
 LL |         #![deny(clippy::non_ascii_literal)]
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/uninlined_format_args.fixed b/tests/ui/uninlined_format_args.fixed
index 972e0356b62..a042731a9bf 100644
--- a/tests/ui/uninlined_format_args.fixed
+++ b/tests/ui/uninlined_format_args.fixed
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 //@run-rustfix
 #![warn(clippy::uninlined_format_args)]
 #![allow(named_arguments_used_positionally, unused)]
diff --git a/tests/ui/uninlined_format_args.rs b/tests/ui/uninlined_format_args.rs
index 7614ffb38e6..d830b74d607 100644
--- a/tests/ui/uninlined_format_args.rs
+++ b/tests/ui/uninlined_format_args.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 //@run-rustfix
 #![warn(clippy::uninlined_format_args)]
 #![allow(named_arguments_used_positionally, unused)]
diff --git a/tests/ui/unit_arg.rs b/tests/ui/unit_arg.rs
index d082063c8e8..fded8db5daf 100644
--- a/tests/ui/unit_arg.rs
+++ b/tests/ui/unit_arg.rs
@@ -1,4 +1,4 @@
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![warn(clippy::unit_arg)]
 #![allow(unused_must_use, unused_variables)]
 #![allow(
diff --git a/tests/ui/unnecessary_lazy_eval.fixed b/tests/ui/unnecessary_lazy_eval.fixed
index 75a42809ad2..dca38034177 100644
--- a/tests/ui/unnecessary_lazy_eval.fixed
+++ b/tests/ui/unnecessary_lazy_eval.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![warn(clippy::unnecessary_lazy_evaluations)]
 #![allow(clippy::redundant_closure)]
 #![allow(clippy::bind_instead_of_map)]
diff --git a/tests/ui/unnecessary_lazy_eval.rs b/tests/ui/unnecessary_lazy_eval.rs
index 3777b9c25c2..7fda719edc1 100644
--- a/tests/ui/unnecessary_lazy_eval.rs
+++ b/tests/ui/unnecessary_lazy_eval.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build: proc_macros.rs
+//@aux-build: proc_macros.rs:proc-macro
 #![warn(clippy::unnecessary_lazy_evaluations)]
 #![allow(clippy::redundant_closure)]
 #![allow(clippy::bind_instead_of_map)]
diff --git a/tests/ui/unnecessary_unsafety_doc.rs b/tests/ui/unnecessary_unsafety_doc.rs
index 373b18470f6..2d55dc664a3 100644
--- a/tests/ui/unnecessary_unsafety_doc.rs
+++ b/tests/ui/unnecessary_unsafety_doc.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macros.rs
+//@aux-build:proc_macros.rs:proc-macro
 
 #![allow(clippy::let_unit_value)]
 #![warn(clippy::unnecessary_safety_doc)]
diff --git a/tests/ui/unseparated_prefix_literals.fixed b/tests/ui/unseparated_prefix_literals.fixed
index b6241612d9d..12512087267 100644
--- a/tests/ui/unseparated_prefix_literals.fixed
+++ b/tests/ui/unseparated_prefix_literals.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![warn(clippy::unseparated_literal_suffix)]
 #![allow(dead_code)]
diff --git a/tests/ui/unseparated_prefix_literals.rs b/tests/ui/unseparated_prefix_literals.rs
index ae583f4bde3..0a3ffc4784b 100644
--- a/tests/ui/unseparated_prefix_literals.rs
+++ b/tests/ui/unseparated_prefix_literals.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![warn(clippy::unseparated_literal_suffix)]
 #![allow(dead_code)]
diff --git a/tests/ui/update-all-references.sh b/tests/ui/update-all-references.sh
index 4391499a1e1..d4204307026 100755
--- a/tests/ui/update-all-references.sh
+++ b/tests/ui/update-all-references.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-echo "Please use 'cargo dev bless' instead."
+echo "Please use 'cargo bless' instead."
diff --git a/tests/ui/use_self.fixed b/tests/ui/use_self.fixed
index 89ea14759b7..4179f21c510 100644
--- a/tests/ui/use_self.fixed
+++ b/tests/ui/use_self.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![warn(clippy::use_self)]
 #![allow(dead_code, unreachable_code)]
diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs
index 49e5bcb7ed9..01a36def9e9 100644
--- a/tests/ui/use_self.rs
+++ b/tests/ui/use_self.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![warn(clippy::use_self)]
 #![allow(dead_code, unreachable_code)]
diff --git a/tests/ui/used_underscore_binding.rs b/tests/ui/used_underscore_binding.rs
index c672eff1c27..879e2e24ab3 100644
--- a/tests/ui/used_underscore_binding.rs
+++ b/tests/ui/used_underscore_binding.rs
@@ -1,4 +1,4 @@
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 #![feature(rustc_private)]
 #![warn(clippy::all)]
 #![warn(clippy::used_underscore_binding)]
diff --git a/tests/ui/useless_attribute.fixed b/tests/ui/useless_attribute.fixed
index de6660c95e6..8e77ec444b5 100644
--- a/tests/ui/useless_attribute.fixed
+++ b/tests/ui/useless_attribute.fixed
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![allow(unused)]
 #![warn(clippy::useless_attribute)]
diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs
index 8de4331e8a6..27498d9bc13 100644
--- a/tests/ui/useless_attribute.rs
+++ b/tests/ui/useless_attribute.rs
@@ -1,5 +1,5 @@
 //@run-rustfix
-//@aux-build:proc_macro_derive.rs
+//@aux-build:proc_macro_derive.rs:proc-macro
 
 #![allow(unused)]
 #![warn(clippy::useless_attribute)]
diff --git a/tests/ui/wildcard_imports.fixed b/tests/ui/wildcard_imports.fixed
index 733bbcfbcef..2961b062ec3 100644
--- a/tests/ui/wildcard_imports.fixed
+++ b/tests/ui/wildcard_imports.fixed
@@ -211,7 +211,7 @@ mod super_imports {
     }
 
     mod use_explicit_should_be_replaced {
-        use super_imports::foofoo;
+        use crate::super_imports::foofoo;
 
         fn with_explicit() {
             let _ = foofoo();
diff --git a/tests/ui/wildcard_imports.rs b/tests/ui/wildcard_imports.rs
index 4acdd374bde..28508a2538b 100644
--- a/tests/ui/wildcard_imports.rs
+++ b/tests/ui/wildcard_imports.rs
@@ -212,7 +212,7 @@ mod super_imports {
     }
 
     mod use_explicit_should_be_replaced {
-        use super_imports::*;
+        use crate::super_imports::*;
 
         fn with_explicit() {
             let _ = foofoo();
diff --git a/tests/ui/wildcard_imports.stderr b/tests/ui/wildcard_imports.stderr
index 235be2d5708..c96b3041a00 100644
--- a/tests/ui/wildcard_imports.stderr
+++ b/tests/ui/wildcard_imports.stderr
@@ -107,8 +107,8 @@ LL |             use super::*;
 error: usage of wildcard import
   --> $DIR/wildcard_imports.rs:215:13
    |
-LL |         use super_imports::*;
-   |             ^^^^^^^^^^^^^^^^ help: try: `super_imports::foofoo`
+LL |         use crate::super_imports::*;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::super_imports::foofoo`
 
 error: usage of wildcard import
   --> $DIR/wildcard_imports.rs:224:17
diff --git a/tests/ui/write_literal_2.stderr b/tests/ui/write_literal_2.stderr
index d5956db9ff0..bf22738480d 100644
--- a/tests/ui/write_literal_2.stderr
+++ b/tests/ui/write_literal_2.stderr
@@ -87,7 +87,7 @@ LL |         "1", "2", "3",
 help: try this
    |
 LL ~         "some 1/
-LL ~         {} / {}", "2", "3",
+LL ~         {} // {}", "2", "3",
    |
 
 error: literal with an empty format string
@@ -98,7 +98,7 @@ LL |         "1", "2", "3",
    |
 help: try this
    |
-LL ~         2 / {}",
+LL ~         2 // {}",
 LL ~         "1", "3",
    |
 
@@ -110,43 +110,43 @@ LL |         "1", "2", "3",
    |
 help: try this
    |
-LL ~         {} / 3",
+LL ~         {} // 3",
 LL ~         "1", "2",
    |
 
 error: literal with an empty format string
   --> $DIR/write_literal_2.rs:27:23
    |
-LL |     writeln!(v, "{}", "/");
+LL |     writeln!(v, "{}", "//");
    |                       ^^^^
    |
 help: try this
    |
-LL -     writeln!(v, "{}", "/");
-LL +     writeln!(v, "/");
+LL -     writeln!(v, "{}", "//");
+LL +     writeln!(v, "//");
    |
 
 error: literal with an empty format string
   --> $DIR/write_literal_2.rs:28:24
    |
-LL |     writeln!(v, r"{}", "/");
+LL |     writeln!(v, r"{}", "//");
    |                        ^^^^
    |
 help: try this
    |
-LL -     writeln!(v, r"{}", "/");
+LL -     writeln!(v, r"{}", "//");
 LL +     writeln!(v, r"/");
    |
 
 error: literal with an empty format string
   --> $DIR/write_literal_2.rs:29:26
    |
-LL |     writeln!(v, r#"{}"#, "/");
+LL |     writeln!(v, r#"{}"#, "//");
    |                          ^^^^
    |
 help: try this
    |
-LL -     writeln!(v, r#"{}"#, "/");
+LL -     writeln!(v, r#"{}"#, "//");
 LL +     writeln!(v, r#"/"#);
    |
 
@@ -159,7 +159,7 @@ LL |     writeln!(v, "{}", r"/");
 help: try this
    |
 LL -     writeln!(v, "{}", r"/");
-LL +     writeln!(v, "/");
+LL +     writeln!(v, "//");
    |
 
 error: literal with an empty format string
diff --git a/tests/ui/write_with_newline.fixed b/tests/ui/write_with_newline.fixed
new file mode 100644
index 00000000000..0a10e526a2f
--- /dev/null
+++ b/tests/ui/write_with_newline.fixed
@@ -0,0 +1,63 @@
+// FIXME: Ideally these suggestions would be fixed via rustfix. Blocked by rust-lang/rust#53934
+// //@run-rustfix
+
+#![allow(clippy::write_literal)]
+#![warn(clippy::write_with_newline)]
+
+use std::io::Write;
+
+fn main() {
+    let mut v = Vec::new();
+
+    // These should fail
+    writeln!(v, "Hello");
+    writeln!(v, "Hello {}", "world");
+    writeln!(v, "Hello {} {}", "world", "#2");
+    writeln!(v, "{}", 1265);
+    writeln!(v);
+
+    // These should be fine
+    write!(v, "");
+    write!(v, "Hello");
+    writeln!(v, "Hello");
+    writeln!(v, "Hello\n");
+    writeln!(v, "Hello {}\n", "world");
+    write!(v, "Issue\n{}", 1265);
+    write!(v, "{}", 1265);
+    write!(v, "\n{}", 1275);
+    write!(v, "\n\n");
+    write!(v, "like eof\n\n");
+    write!(v, "Hello {} {}\n\n", "world", "#2");
+    writeln!(v, "\ndon't\nwarn\nfor\nmultiple\nnewlines\n"); // #3126
+    writeln!(v, "\nbla\n\n"); // #3126
+
+    // Escaping
+    write!(v, "\\n"); // #3514
+    writeln!(v, "\\"); // should fail
+    write!(v, "\\\\n");
+
+    // Raw strings
+    write!(v, r"\n"); // #3778
+
+    // Literal newlines should also fail
+    writeln!(
+        v
+    );
+    writeln!(
+        v
+    );
+
+    // Don't warn on CRLF (#4208)
+    write!(v, "\r\n");
+    write!(v, "foo\r\n");
+    writeln!(v, "\\r"); // warns
+    write!(v, "foo\rbar\n");
+
+    // Ignore expanded format strings
+    macro_rules! newline {
+        () => {
+            "\n"
+        };
+    }
+    write!(v, newline!());
+}
diff --git a/tests/ui/write_with_newline.stderr b/tests/ui/write_with_newline.stderr
index 9035275b29d..03a18a4dc3f 100644
--- a/tests/ui/write_with_newline.stderr
+++ b/tests/ui/write_with_newline.stderr
@@ -62,13 +62,13 @@ LL +     writeln!(v);
 error: using `write!()` with a format string that ends in a single newline
   --> $DIR/write_with_newline.rs:36:5
    |
-LL |     write!(v, "//n"); // should fail
+LL |     write!(v, "///n"); // should fail
    |     ^^^^^^^^^^^^^^^^^
    |
 help: use `writeln!` instead
    |
-LL -     write!(v, "//n"); // should fail
-LL +     writeln!(v, "/"); // should fail
+LL -     write!(v, "///n"); // should fail
+LL +     writeln!(v, "//"); // should fail
    |
 
 error: using `write!()` with a format string that ends in a single newline
@@ -106,13 +106,13 @@ LL ~         v
 error: using `write!()` with a format string that ends in a single newline
   --> $DIR/write_with_newline.rs:57:5
    |
-LL |     write!(v, "/r/n");
+LL |     write!(v, "//r/n");
    |     ^^^^^^^^^^^^^^^^^^
    |
 help: use `writeln!` instead
    |
-LL -     write!(v, "/r/n");
-LL +     writeln!(v, "/r");
+LL -     write!(v, "//r/n");
+LL +     writeln!(v, "//r");
    |
 
 error: aborting due to 9 previous errors
diff --git a/util/etc/vscode-tasks.json b/util/etc/vscode-tasks.json
index ab98f9b4154..38e31b337a0 100644
--- a/util/etc/vscode-tasks.json
+++ b/util/etc/vscode-tasks.json
@@ -47,9 +47,9 @@
             "group": "test"
         },
         {
-            "label": "cargo dev bless",
+            "label": "bless ui tests",
             "type": "shell",
-            "command": "cargo dev bless",
+            "command": "cargo bless",
             "problemMatcher": [],
             "group": "none"
         }