about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-03-29 02:41:32 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-04-03 11:08:55 +0300
commit4d649906900cd833b0680f53b8c197b087711a4a (patch)
treea840262c32e0e954ebe3f6dfc4ae1c3eda51eaba
parentb6d74b5e15b0d479a98b8b18bb70050511108882 (diff)
downloadrust-4d649906900cd833b0680f53b8c197b087711a4a.tar.gz
rust-4d649906900cd833b0680f53b8c197b087711a4a.zip
compiletest: Require `//~` annotations even if `error-pattern` is specified
-rw-r--r--src/doc/rustc-dev-guide/src/tests/ui.md3
-rw-r--r--src/tools/compiletest/src/runtest/ui.rs16
-rw-r--r--tests/rustdoc-ui/doctest/no-run-flag-error.rs3
-rw-r--r--tests/rustdoc-ui/invalid-theme-name.rs3
-rw-r--r--tests/rustdoc-ui/issues/issue-91713.rs3
-rw-r--r--tests/rustdoc-ui/lints/no-crate-level-doc-lint.rs3
-rw-r--r--tests/rustdoc-ui/lints/no-crate-level-doc-lint.stderr2
-rw-r--r--tests/rustdoc-ui/track-diagnostics.rs2
-rw-r--r--tests/ui-fulldeps/missing-rustc-driver-error.rs2
-rw-r--r--tests/ui/abi/fixed_x18.rs2
-rw-r--r--tests/ui/abi/shadow-call-stack-without-fixed-x18.rs3
-rw-r--r--tests/ui/allocator/two-allocators2.rs3
-rw-r--r--tests/ui/allocator/two-allocators3.rs4
-rw-r--r--tests/ui/amdgpu-require-explicit-cpu.rs3
-rw-r--r--tests/ui/associated-types/issue-36499.rs2
-rw-r--r--tests/ui/attributes/attr-bad-crate-attr.rs3
-rw-r--r--tests/ui/attributes/attr-bad-crate-attr.stderr2
-rw-r--r--tests/ui/attributes/z-crate-attr/garbage.rs5
-rw-r--r--tests/ui/attributes/z-crate-attr/injection.rs4
-rw-r--r--tests/ui/attributes/z-crate-attr/inner-attr.rs3
-rw-r--r--tests/ui/attributes/z-crate-attr/multiple.rs4
-rw-r--r--tests/ui/attributes/z-crate-attr/unbalanced-paren.rs4
-rw-r--r--tests/ui/binop/binop-bitxor-str.rs3
-rw-r--r--tests/ui/binop/binop-bitxor-str.stderr2
-rw-r--r--tests/ui/binop/binop-mul-bool.rs4
-rw-r--r--tests/ui/binop/binop-mul-bool.stderr2
-rw-r--r--tests/ui/c-variadic/issue-86053-1.rs14
-rw-r--r--tests/ui/c-variadic/issue-86053-1.stderr8
-rw-r--r--tests/ui/capture1.rs4
-rw-r--r--tests/ui/capture1.stderr2
-rw-r--r--tests/ui/cast/cast-from-nil.rs3
-rw-r--r--tests/ui/cast/cast-from-nil.stderr2
-rw-r--r--tests/ui/cast/cast-to-nil.rs3
-rw-r--r--tests/ui/cast/cast-to-nil.stderr2
-rw-r--r--tests/ui/cfg/cfg_false_no_std-2.rs4
-rw-r--r--tests/ui/codegen/mismatched-data-layouts.rs3
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-3.rs4
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-5.rs4
-rw-r--r--tests/ui/conditional-compilation/cfg-attr-cfg-2.rs3
-rw-r--r--tests/ui/conditional-compilation/cfg-attr-cfg-2.stderr2
-rw-r--r--tests/ui/conditional-compilation/cfg-in-crate-1.rs4
-rw-r--r--tests/ui/conditional-compilation/cfg-in-crate-1.stderr2
-rw-r--r--tests/ui/const-ptr/out_of_bounds_read.rs5
-rw-r--r--tests/ui/const-ptr/out_of_bounds_read.stderr4
-rw-r--r--tests/ui/consts/const-size_of-cycle.rs3
-rw-r--r--tests/ui/consts/const-size_of-cycle.stderr6
-rw-r--r--tests/ui/consts/miri_unleashed/drop.rs4
-rw-r--r--tests/ui/consts/timeout.rs3
-rw-r--r--tests/ui/consts/timeout.stderr2
-rw-r--r--tests/ui/crate_type_flag.rs3
-rw-r--r--tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs2
-rw-r--r--tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs2
-rw-r--r--tests/ui/debuginfo/dwarf-versions.rs6
-rw-r--r--tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs3
-rw-r--r--tests/ui/debuginfo/windows_gnu_split_debuginfo_unpacked.rs3
-rw-r--r--tests/ui/deprecation/deprecation-lint-2.rs3
-rw-r--r--tests/ui/deprecation/deprecation-lint-2.stderr4
-rw-r--r--tests/ui/deprecation/deprecation-lint-3.rs2
-rw-r--r--tests/ui/deprecation/deprecation-lint-3.stderr4
-rw-r--r--tests/ui/duplicate/dupe-symbols-4.rs4
-rw-r--r--tests/ui/duplicate/dupe-symbols-4.stderr2
-rw-r--r--tests/ui/duplicate/dupe-symbols-7.rs5
-rw-r--r--tests/ui/duplicate/dupe-symbols-7.stderr2
-rw-r--r--tests/ui/duplicate/dupe-symbols-8.rs3
-rw-r--r--tests/ui/duplicate/dupe-symbols-8.stderr2
-rw-r--r--tests/ui/elided-test.rs4
-rw-r--r--tests/ui/elided-test.stderr2
-rw-r--r--tests/ui/error-codes/E0602.rs5
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.local-self.stderr2
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr2
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.rs3
-rw-r--r--tests/ui/errors/remap-path-prefix-sysroot.rs4
-rw-r--r--tests/ui/errors/remap-path-prefix.normal.stderr2
-rw-r--r--tests/ui/errors/remap-path-prefix.rs9
-rw-r--r--tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr2
-rw-r--r--tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr2
-rw-r--r--tests/ui/expr/if/if-typeck.rs3
-rw-r--r--tests/ui/expr/if/if-typeck.stderr2
-rw-r--r--tests/ui/ext-nonexistent.rs2
-rw-r--r--tests/ui/ext-nonexistent.stderr2
-rw-r--r--tests/ui/extern-flag/empty-extern-arg.rs5
-rw-r--r--tests/ui/extern-flag/invalid-crate-name-dashed.rs3
-rw-r--r--tests/ui/extern-flag/invalid-crate-name-non-ascii.rs3
-rw-r--r--tests/ui/extern-flag/invalid-crate-name.rs3
-rw-r--r--tests/ui/extern-flag/no-force-extern.rs6
-rw-r--r--tests/ui/fn/fn-bad-block-type.rs4
-rw-r--r--tests/ui/fn/fn-bad-block-type.stderr2
-rw-r--r--tests/ui/imports/import-loop-2.rs4
-rw-r--r--tests/ui/imports/import-loop-2.stderr2
-rw-r--r--tests/ui/imports/import-loop.rs4
-rw-r--r--tests/ui/imports/import-loop.stderr2
-rw-r--r--tests/ui/imports/import3.rs3
-rw-r--r--tests/ui/imports/import3.stderr2
-rw-r--r--tests/ui/imports/import4.rs5
-rw-r--r--tests/ui/imports/import4.stderr2
-rw-r--r--tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs17
-rw-r--r--tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr8
-rw-r--r--tests/ui/instrument-xray/flags-always-never-1.rs3
-rw-r--r--tests/ui/instrument-xray/flags-dupe-always.rs3
-rw-r--r--tests/ui/instrument-xray/flags-dupe-ignore-loops.rs3
-rw-r--r--tests/ui/instrument-xray/target-not-supported.rs3
-rw-r--r--tests/ui/internal/internal-unstable-noallow.rs10
-rw-r--r--tests/ui/internal/internal-unstable-noallow.stderr8
-rw-r--r--tests/ui/invalid-compile-flags/crate-type-flag.rs7
-rw-r--r--tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs3
-rw-r--r--tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs3
-rw-r--r--tests/ui/invalid-compile-flags/reg-struct-return/requires-x86.rs5
-rw-r--r--tests/ui/invalid-compile-flags/regparm/regparm-valid-values.rs3
-rw-r--r--tests/ui/invalid-compile-flags/regparm/requires-x86.rs5
-rw-r--r--tests/ui/invalid/issue-114435-layout-type-err.rs3
-rw-r--r--tests/ui/io-checks/non-ice-error-on-worker-io-fail.rs4
-rw-r--r--tests/ui/issues/issue-37131.rs1
-rw-r--r--tests/ui/lang-items/lang-item-missing.rs4
-rw-r--r--tests/ui/lang-items/lang-item-missing.stderr2
-rw-r--r--tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs4
-rw-r--r--tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr2
-rw-r--r--tests/ui/layout/size-of-val-raw-too-big.rs3
-rw-r--r--tests/ui/layout/unknown-when-no-type-parameter.rs3
-rw-r--r--tests/ui/layout/unknown-when-no-type-parameter.stderr2
-rw-r--r--tests/ui/limits/issue-17913.rs3
-rw-r--r--tests/ui/limits/issue-55878.rs2
-rw-r--r--tests/ui/limits/issue-55878.stderr2
-rw-r--r--tests/ui/link-native-libs/empty-kind-1.rs3
-rw-r--r--tests/ui/link-native-libs/empty-kind-2.rs3
-rw-r--r--tests/ui/link-native-libs/link-arg-error.rs3
-rw-r--r--tests/ui/link-native-libs/manual-link-bad-form.rs3
-rw-r--r--tests/ui/link-native-libs/manual-link-bad-kind.rs3
-rw-r--r--tests/ui/link-native-libs/manual-link-bad-search-path.rs3
-rw-r--r--tests/ui/link-native-libs/manual-link-framework.rs3
-rw-r--r--tests/ui/link-native-libs/manual-link-unsupported-kind.rs3
-rw-r--r--tests/ui/link-native-libs/modifiers-override-3.rs3
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-1.rs5
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-1.stderr2
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-2.rs5
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-2.stderr2
-rw-r--r--tests/ui/linkage-attr/incompatible-flavor.rs3
-rw-r--r--tests/ui/linkage-attr/issue-10755.rs3
-rw-r--r--tests/ui/linkage-attr/raw-dylib/elf/multiple-libraries.rs2
-rw-r--r--tests/ui/linkage-attr/raw-dylib/elf/single-symbol.rs2
-rw-r--r--tests/ui/linkage-attr/raw-dylib/elf/verbatim.rs2
-rw-r--r--tests/ui/linkage-attr/unstable-flavor.rs5
-rw-r--r--tests/ui/lint/bad-lint-cap.rs3
-rw-r--r--tests/ui/lint/cli-unknown-force-warn.rs5
-rw-r--r--tests/ui/lint/command-line-register-unknown-lint-tool.rs5
-rw-r--r--tests/ui/lint/force-warn/warnings-lint-group.rs5
-rw-r--r--tests/ui/lint/issue-104897.rs5
-rw-r--r--tests/ui/lint/issue-104897.stderr2
-rw-r--r--tests/ui/lint/lint-pre-expansion-extern-module.rs4
-rw-r--r--tests/ui/lint/lint-removed-cmdline-deny.rs7
-rw-r--r--tests/ui/lint/lint-removed-cmdline-deny.stderr4
-rw-r--r--tests/ui/lint/lint-removed-cmdline.rs7
-rw-r--r--tests/ui/lint/lint-removed-cmdline.stderr4
-rw-r--r--tests/ui/lint/lint-renamed-cmdline-deny.rs8
-rw-r--r--tests/ui/lint/lint-renamed-cmdline-deny.stderr4
-rw-r--r--tests/ui/lint/lint-renamed-cmdline.rs8
-rw-r--r--tests/ui/lint/lint-renamed-cmdline.stderr4
-rw-r--r--tests/ui/lint/lint-stability2.rs3
-rw-r--r--tests/ui/lint/lint-stability2.stderr4
-rw-r--r--tests/ui/lint/lint-stability3.rs2
-rw-r--r--tests/ui/lint/lint-stability3.stderr4
-rw-r--r--tests/ui/lint/lint-unknown-lint-cmdline-deny.rs8
-rw-r--r--tests/ui/lint/lint-unknown-lint-cmdline.rs9
-rw-r--r--tests/ui/lint/unused_parens_multibyte_recovery.rs7
-rw-r--r--tests/ui/lint/unused_parens_multibyte_recovery.stderr2
-rw-r--r--tests/ui/lto/issue-11154.rs4
-rw-r--r--tests/ui/lto/lto-duplicate-symbols.rs4
-rw-r--r--tests/ui/macros/not-utf8.rs2
-rw-r--r--tests/ui/macros/not-utf8.stderr2
-rw-r--r--tests/ui/macros/unreachable-arg.edition_2021.stderr2
-rw-r--r--tests/ui/macros/unreachable-arg.rs3
-rw-r--r--tests/ui/macros/unreachable-format-args.edition_2015.stderr2
-rw-r--r--tests/ui/macros/unreachable-format-args.rs2
-rw-r--r--tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs5
-rw-r--r--tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.stderr2
-rw-r--r--tests/ui/minus-string.rs4
-rw-r--r--tests/ui/minus-string.stderr2
-rw-r--r--tests/ui/mir/enable_passes_validation.rs11
-rw-r--r--tests/ui/mir/lint/assignment-overlap.rs2
-rw-r--r--tests/ui/mir/lint/call-overlap.rs2
-rw-r--r--tests/ui/mir/lint/no-storage.rs2
-rw-r--r--tests/ui/mir/lint/storage-live.rs2
-rw-r--r--tests/ui/mir/lint/storage-return.rs2
-rw-r--r--tests/ui/mir/validate/noncleanup-cleanup.rs6
-rw-r--r--tests/ui/mir/validate/noncleanup-resume.rs4
-rw-r--r--tests/ui/mir/validate/noncleanup-terminate.rs4
-rw-r--r--tests/ui/missing/missing-main.rs3
-rw-r--r--tests/ui/missing/missing-main.stderr2
-rw-r--r--tests/ui/missing/missing-return.rs2
-rw-r--r--tests/ui/nested-ty-params.rs2
-rw-r--r--tests/ui/no-capture-arc.rs4
-rw-r--r--tests/ui/no-capture-arc.stderr2
-rw-r--r--tests/ui/no_std/no-std-no-start-binary.rs2
-rw-r--r--tests/ui/no_std/no-std-unwind-binary.rs3
-rw-r--r--tests/ui/packed/packed-struct-generic-transmute.rs1
-rw-r--r--tests/ui/packed/packed-struct-transmute.rs1
-rw-r--r--tests/ui/panic-handler/panic-handler-missing.rs3
-rw-r--r--tests/ui/panic-handler/panic-handler-std.rs3
-rw-r--r--tests/ui/panic-handler/panic-handler-std.stderr2
-rw-r--r--tests/ui/panic-handler/weak-lang-item.rs7
-rw-r--r--tests/ui/panic-handler/weak-lang-item.stderr2
-rw-r--r--tests/ui/panic-runtime/abort-link-to-unwind-dylib.rs3
-rw-r--r--tests/ui/panic-runtime/bad-panic-flag1.rs3
-rw-r--r--tests/ui/panic-runtime/bad-panic-flag2.rs3
-rw-r--r--tests/ui/panic-runtime/need-abort-got-unwind.rs3
-rw-r--r--tests/ui/panic-runtime/need-unwind-got-abort.rs3
-rw-r--r--tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs3
-rw-r--r--tests/ui/panic-runtime/transitive-link-a-bunch.rs5
-rw-r--r--tests/ui/panic-runtime/two-panic-runtimes.rs3
-rw-r--r--tests/ui/panic-runtime/want-abort-got-unwind.rs5
-rw-r--r--tests/ui/panic-runtime/want-abort-got-unwind2.rs5
-rw-r--r--tests/ui/panic-runtime/want-unwind-got-abort.rs3
-rw-r--r--tests/ui/panic-runtime/want-unwind-got-abort2.rs4
-rw-r--r--tests/ui/panics/default-backtrace-ice.rs2
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-fn.rs4
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-fn.stderr2
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-mod.rs4
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-mod.stderr2
-rw-r--r--tests/ui/parser/circular_modules_main.rs4
-rw-r--r--tests/ui/parser/class-implements-bad-trait.rs3
-rw-r--r--tests/ui/parser/class-implements-bad-trait.stderr2
-rw-r--r--tests/ui/parser/import-from-path.rs3
-rw-r--r--tests/ui/parser/import-from-path.stderr2
-rw-r--r--tests/ui/parser/import-from-rename.rs4
-rw-r--r--tests/ui/parser/import-from-rename.stderr2
-rw-r--r--tests/ui/parser/import-glob-path.rs3
-rw-r--r--tests/ui/parser/import-glob-path.stderr2
-rw-r--r--tests/ui/parser/import-glob-rename.rs4
-rw-r--r--tests/ui/parser/import-glob-rename.stderr2
-rw-r--r--tests/ui/parser/issues/circular-module-with-doc-comment-issue-97589/circular-module-with-doc-comment-issue-97589.rs3
-rw-r--r--tests/ui/parser/issues/issue-21146.rs3
-rw-r--r--tests/ui/parser/issues/issue-66473.rsbin129 -> 287 bytes
-rw-r--r--tests/ui/parser/issues/issue-66473.stderr13
-rw-r--r--tests/ui/parser/issues/issue-68629.rsbin131 -> 258 bytes
-rw-r--r--tests/ui/parser/issues/issue-68629.stderr10
-rw-r--r--tests/ui/parser/issues/issue-68730.rsbin177 -> 305 bytes
-rw-r--r--tests/ui/parser/issues/issue-68730.stderr10
-rw-r--r--tests/ui/parser/shebang/shebang-split.rs3
-rw-r--r--tests/ui/parser/utf16-be-without-bom.rsbin162 -> 202 bytes
-rw-r--r--tests/ui/parser/utf16-be-without-bom.stderr28
-rw-r--r--tests/ui/parser/utf16-le-without-bom.rsbin163 -> 203 bytes
-rw-r--r--tests/ui/parser/utf16-le-without-bom.stderr28
-rw-r--r--tests/ui/print-request/print-lints-help.rs3
-rw-r--r--tests/ui/print-request/stability.rs9
-rw-r--r--tests/ui/privacy/private-inferred-type-3.rs15
-rw-r--r--tests/ui/privacy/private-inferred-type-3.stderr14
-rw-r--r--tests/ui/proc-macro/export-macro.rs4
-rw-r--r--tests/ui/proc-macro/export-macro.stderr2
-rw-r--r--tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs4
-rw-r--r--tests/ui/proc-macro/panic-abort.rs3
-rw-r--r--tests/ui/proc-macro/two-crate-types-1.rs4
-rw-r--r--tests/ui/proc-macro/two-crate-types-2.rs3
-rw-r--r--tests/ui/reachable/unreachable-code-ret.rs4
-rw-r--r--tests/ui/reachable/unreachable-code-ret.stderr4
-rw-r--r--tests/ui/resolve/bad-env-capture.rs4
-rw-r--r--tests/ui/resolve/bad-env-capture.stderr6
-rw-r--r--tests/ui/resolve/bad-env-capture2.rs4
-rw-r--r--tests/ui/resolve/bad-env-capture2.stderr6
-rw-r--r--tests/ui/resolve/bad-env-capture3.rs4
-rw-r--r--tests/ui/resolve/bad-env-capture3.stderr6
-rw-r--r--tests/ui/return/ret-non-nil.rs4
-rw-r--r--tests/ui/return/ret-non-nil.stderr2
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs3
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs3
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs2
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr2
-rw-r--r--tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs3
-rw-r--r--tests/ui/rmeta/rmeta_bin.rs3
-rw-r--r--tests/ui/rmeta/rmeta_lib.rs3
-rw-r--r--tests/ui/sanitizer/incompatible.rs3
-rw-r--r--tests/ui/sanitizer/unsupported-target.rs4
-rw-r--r--tests/ui/simd/monomorphize-too-long.rs3
-rw-r--r--tests/ui/simd/monomorphize-zero-length.rs3
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-empty.rs4
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-non-primitive.rs4
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-oversized.rs4
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-wide-ptr.rs4
-rw-r--r--tests/ui/simd/type-generic-monomorphisation.rs5
-rw-r--r--tests/ui/simd/type-wide-ptr.rs4
-rw-r--r--tests/ui/tail-typeck.rs4
-rw-r--r--tests/ui/tail-typeck.stderr2
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs4
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs4
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs5
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs5
-rw-r--r--tests/ui/target-feature/forbidden-target-feature-flag-disable.rs2
-rw-r--r--tests/ui/target-feature/forbidden-target-feature-flag.rs4
-rw-r--r--tests/ui/target-feature/target-cpu-lacks-required-target-feature.rs3
-rw-r--r--tests/ui/target-feature/tied-features-no-implication.pacg.stderr4
-rw-r--r--tests/ui/target-feature/tied-features-no-implication.rs8
-rw-r--r--tests/ui/test-attrs/test-panic-abort-disabled.rs3
-rw-r--r--tests/ui/track-diagnostics/track.rs3
-rw-r--r--tests/ui/track-diagnostics/track2.rs2
-rw-r--r--tests/ui/track-diagnostics/track3.rs2
-rw-r--r--tests/ui/track-diagnostics/track4.rs2
-rw-r--r--tests/ui/track-diagnostics/track5.rs2
-rw-r--r--tests/ui/track-diagnostics/track6.rs2
-rw-r--r--tests/ui/traits/solver-cycles/129541-recursive-struct.rs3
-rw-r--r--tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs2
-rw-r--r--tests/ui/treat-err-as-bug/span_delayed_bug.rs2
-rw-r--r--tests/ui/type/issue-91268.rs3
-rw-r--r--tests/ui/type/issue-91268.stderr2
-rw-r--r--tests/ui/type/type-arg-out-of-scope.rs3
-rw-r--r--tests/ui/type/type-arg-out-of-scope.stderr4
-rw-r--r--tests/ui/typeck/issue-91334.rs4
-rw-r--r--tests/ui/typeck/output-type-mismatch.rs4
-rw-r--r--tests/ui/typeck/output-type-mismatch.stderr2
-rw-r--r--tests/ui/typeck/while-type-error.rs4
-rw-r--r--tests/ui/typeck/while-type-error.stderr2
-rw-r--r--tests/ui/typeck/wrong-ret-type.rs3
-rw-r--r--tests/ui/typeck/wrong-ret-type.stderr2
-rw-r--r--tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs2
-rw-r--r--tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs2
-rw-r--r--tests/ui/use/use-meta-mismatch.rs4
-rw-r--r--tests/ui/use/use-meta-mismatch.stderr2
-rw-r--r--tests/ui/windows-subsystem/windows-subsystem-invalid.rs4
315 files changed, 656 insertions, 530 deletions
diff --git a/src/doc/rustc-dev-guide/src/tests/ui.md b/src/doc/rustc-dev-guide/src/tests/ui.md
index 1190c2646af..6f412a7a60e 100644
--- a/src/doc/rustc-dev-guide/src/tests/ui.md
+++ b/src/doc/rustc-dev-guide/src/tests/ui.md
@@ -335,6 +335,9 @@ But for strict testing, try to use the `ERROR` annotation as much as possible,
 including `//~?` annotations for diagnostics without span.
 For compile time diagnostics `error-pattern` should very rarely be necessary.
 
+Per-line annotations (`//~`) are still checked in tests using `error-pattern`,
+to opt out of these checks in exceptional cases use `//@ compile-flags: --error-format=human`.
+
 ### Error levels
 
 The error levels that you can have are:
diff --git a/src/tools/compiletest/src/runtest/ui.rs b/src/tools/compiletest/src/runtest/ui.rs
index 9b5b8b56b60..974e5170465 100644
--- a/src/tools/compiletest/src/runtest/ui.rs
+++ b/src/tools/compiletest/src/runtest/ui.rs
@@ -169,16 +169,9 @@ impl TestCx<'_> {
             self.props.error_patterns
         );
 
-        let check_patterns = should_run == WillExecute::No
-            && (!self.props.error_patterns.is_empty()
-                || !self.props.regex_error_patterns.is_empty());
         if !explicit && self.config.compare_mode.is_none() {
-            let check_annotations = !check_patterns || !expected_errors.is_empty();
-
-            if check_annotations {
-                // "//~ERROR comments"
-                self.check_expected_errors(expected_errors, &proc_res);
-            }
+            // "//~ERROR comments"
+            self.check_expected_errors(expected_errors, &proc_res);
         } else if explicit && !expected_errors.is_empty() {
             let msg = format!(
                 "line {}: cannot combine `--error-format` with {} annotations; use `error-pattern` instead",
@@ -188,7 +181,10 @@ impl TestCx<'_> {
             self.fatal(&msg);
         }
         let output_to_check = self.get_output(&proc_res);
-        if check_patterns {
+        if should_run == WillExecute::No
+            && (!self.props.error_patterns.is_empty()
+                || !self.props.regex_error_patterns.is_empty())
+        {
             // "// error-pattern" comments
             self.check_all_error_patterns(&output_to_check, &proc_res, pm);
         }
diff --git a/tests/rustdoc-ui/doctest/no-run-flag-error.rs b/tests/rustdoc-ui/doctest/no-run-flag-error.rs
index 896d7729b8d..3f9016b23db 100644
--- a/tests/rustdoc-ui/doctest/no-run-flag-error.rs
+++ b/tests/rustdoc-ui/doctest/no-run-flag-error.rs
@@ -1,6 +1,7 @@
 // test the behavior of the --no-run flag without the --test flag
 
 //@ compile-flags:-Z unstable-options --no-run --test-args=--test-threads=1
-//@ error-pattern: the `--test` flag must be passed
 
 pub fn f() {}
+
+//~? ERROR the `--test` flag must be passed to enable `--no-run`
diff --git a/tests/rustdoc-ui/invalid-theme-name.rs b/tests/rustdoc-ui/invalid-theme-name.rs
index d632a08ebc8..7f1d191c89d 100644
--- a/tests/rustdoc-ui/invalid-theme-name.rs
+++ b/tests/rustdoc-ui/invalid-theme-name.rs
@@ -1,3 +1,4 @@
 //@ compile-flags:--theme {{src-base}}/invalid-theme-name.rs
-//@ error-pattern: invalid argument
 //@ error-pattern: must have a .css extension
+
+//~? ERROR invalid argument: "$DIR/invalid-theme-name.rs"
diff --git a/tests/rustdoc-ui/issues/issue-91713.rs b/tests/rustdoc-ui/issues/issue-91713.rs
index 9875b5d4ad6..68240726007 100644
--- a/tests/rustdoc-ui/issues/issue-91713.rs
+++ b/tests/rustdoc-ui/issues/issue-91713.rs
@@ -1,3 +1,4 @@
 //@ check-pass
 //@ compile-flags: --passes list
-//@ error-pattern: the `passes` flag no longer functions
+
+//~? WARN the `passes` flag no longer functions
diff --git a/tests/rustdoc-ui/lints/no-crate-level-doc-lint.rs b/tests/rustdoc-ui/lints/no-crate-level-doc-lint.rs
index 6e631061e8a..5e7dc377f5d 100644
--- a/tests/rustdoc-ui/lints/no-crate-level-doc-lint.rs
+++ b/tests/rustdoc-ui/lints/no-crate-level-doc-lint.rs
@@ -1,6 +1,7 @@
-//@ error-pattern: no documentation found
 //@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
 #![deny(rustdoc::missing_crate_level_docs)]
 //^~ NOTE defined here
 
 pub fn foo() {}
+
+//~? ERROR no documentation found for this crate's top-level module
diff --git a/tests/rustdoc-ui/lints/no-crate-level-doc-lint.stderr b/tests/rustdoc-ui/lints/no-crate-level-doc-lint.stderr
index 3a748335ea8..721d3662c93 100644
--- a/tests/rustdoc-ui/lints/no-crate-level-doc-lint.stderr
+++ b/tests/rustdoc-ui/lints/no-crate-level-doc-lint.stderr
@@ -3,7 +3,7 @@ error: no documentation found for this crate's top-level module
    = help: The following guide may be of use:
            https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
 note: the lint level is defined here
-  --> $DIR/no-crate-level-doc-lint.rs:3:9
+  --> $DIR/no-crate-level-doc-lint.rs:2:9
    |
 LL | #![deny(rustdoc::missing_crate_level_docs)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/rustdoc-ui/track-diagnostics.rs b/tests/rustdoc-ui/track-diagnostics.rs
index 27781f47e0d..d18d26bf794 100644
--- a/tests/rustdoc-ui/track-diagnostics.rs
+++ b/tests/rustdoc-ui/track-diagnostics.rs
@@ -8,4 +8,4 @@
 struct A;
 struct B;
 
-pub const S: A = B;
+pub const S: A = B; //~ ERROR mismatched types
diff --git a/tests/ui-fulldeps/missing-rustc-driver-error.rs b/tests/ui-fulldeps/missing-rustc-driver-error.rs
index 03ab5ce7b25..d582efada90 100644
--- a/tests/ui-fulldeps/missing-rustc-driver-error.rs
+++ b/tests/ui-fulldeps/missing-rustc-driver-error.rs
@@ -1,6 +1,6 @@
 // Test that we get the following hint when trying to use a compiler crate without rustc_driver.
 //@ error-pattern: try adding `extern crate rustc_driver;` at the top level of this crate
-//@ compile-flags: --emit link
+//@ compile-flags: --emit link --error-format=human
 //@ normalize-stderr: ".*crate .* required.*\n\n" -> ""
 //@ normalize-stderr: "aborting due to [0-9]+" -> "aborting due to NUMBER"
 
diff --git a/tests/ui/abi/fixed_x18.rs b/tests/ui/abi/fixed_x18.rs
index f1ff3e1d534..d373468f68f 100644
--- a/tests/ui/abi/fixed_x18.rs
+++ b/tests/ui/abi/fixed_x18.rs
@@ -23,3 +23,5 @@
 
 #[lang = "sized"]
 trait Sized {}
+
+//~? ERROR the `-Zfixed-x18` flag is not supported on the `
diff --git a/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs b/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs
index d758c903087..74882fb5c55 100644
--- a/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs
+++ b/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: --target aarch64-unknown-none -Zsanitizer=shadow-call-stack
-//@ error-pattern: shadow-call-stack sanitizer is not supported for this target
 //@ dont-check-compiler-stderr
 //@ needs-llvm-components: aarch64
 
@@ -13,3 +12,5 @@ trait Sized {}
 
 #[no_mangle]
 pub fn foo() {}
+
+//~? ERROR shadow-call-stack sanitizer is not supported for this target
diff --git a/tests/ui/allocator/two-allocators2.rs b/tests/ui/allocator/two-allocators2.rs
index b3bb4598c77..6efb297054b 100644
--- a/tests/ui/allocator/two-allocators2.rs
+++ b/tests/ui/allocator/two-allocators2.rs
@@ -1,6 +1,5 @@
 //@ aux-build:system-allocator.rs
 //@ no-prefer-dynamic
-//@ error-pattern: the `#[global_allocator]` in
 
 extern crate system_allocator;
 
@@ -10,3 +9,5 @@ use std::alloc::System;
 static A: System = System;
 
 fn main() {}
+
+//~? ERROR the `#[global_allocator]` in this crate conflicts with global allocator in: system_allocator
diff --git a/tests/ui/allocator/two-allocators3.rs b/tests/ui/allocator/two-allocators3.rs
index 0cb3879666d..3aba96068de 100644
--- a/tests/ui/allocator/two-allocators3.rs
+++ b/tests/ui/allocator/two-allocators3.rs
@@ -1,10 +1,10 @@
 //@ aux-build:system-allocator.rs
 //@ aux-build:system-allocator2.rs
 //@ no-prefer-dynamic
-//@ error-pattern: the `#[global_allocator]` in
-
 
 extern crate system_allocator;
 extern crate system_allocator2;
 
 fn main() {}
+
+//~? ERROR the `#[global_allocator]` in system_allocator conflicts with global allocator in: system_allocator2
diff --git a/tests/ui/amdgpu-require-explicit-cpu.rs b/tests/ui/amdgpu-require-explicit-cpu.rs
index 46778a1094f..d40cb97977d 100644
--- a/tests/ui/amdgpu-require-explicit-cpu.rs
+++ b/tests/ui/amdgpu-require-explicit-cpu.rs
@@ -3,7 +3,6 @@
 //@ compile-flags: --crate-type=cdylib --target=amdgcn-amd-amdhsa
 //@ needs-llvm-components: amdgpu
 //@ needs-rust-lld
-//@[nocpu] error-pattern: target requires explicitly specifying a cpu
 //@[nocpu] build-fail
 //@[cpu] compile-flags: -Ctarget-cpu=gfx900
 //@[cpu] build-pass
@@ -15,3 +14,5 @@
 trait Sized {}
 
 pub fn foo() {}
+
+//[nocpu]~? ERROR target requires explicitly specifying a cpu with `-C target-cpu`
diff --git a/tests/ui/associated-types/issue-36499.rs b/tests/ui/associated-types/issue-36499.rs
index 25f4060fa6f..606918b40b7 100644
--- a/tests/ui/associated-types/issue-36499.rs
+++ b/tests/ui/associated-types/issue-36499.rs
@@ -1,5 +1,5 @@
 //@ error-pattern: aborting due to 1 previous error
 
 fn main() {
-    2 + +2;
+    2 + +2; //~ ERROR leading `+` is not supported
 }
diff --git a/tests/ui/attributes/attr-bad-crate-attr.rs b/tests/ui/attributes/attr-bad-crate-attr.rs
index 9de0abca9a7..d37d349026a 100644
--- a/tests/ui/attributes/attr-bad-crate-attr.rs
+++ b/tests/ui/attributes/attr-bad-crate-attr.rs
@@ -3,7 +3,6 @@
 //!
 //! See <https://doc.rust-lang.org/reference/attributes.html>.
 
-//@ error-pattern: expected item
-
 #![attr = "val"]
 #[attr = "val"] // Unterminated
+//~^ ERROR expected item after attributes
diff --git a/tests/ui/attributes/attr-bad-crate-attr.stderr b/tests/ui/attributes/attr-bad-crate-attr.stderr
index 69eabd32230..22522896bd1 100644
--- a/tests/ui/attributes/attr-bad-crate-attr.stderr
+++ b/tests/ui/attributes/attr-bad-crate-attr.stderr
@@ -1,5 +1,5 @@
 error: expected item after attributes
-  --> $DIR/attr-bad-crate-attr.rs:9:1
+  --> $DIR/attr-bad-crate-attr.rs:7:1
    |
 LL | #[attr = "val"] // Unterminated
    | ^^^^^^^^^^^^^^^
diff --git a/tests/ui/attributes/z-crate-attr/garbage.rs b/tests/ui/attributes/z-crate-attr/garbage.rs
index ec81dd1bcaa..69444e1935a 100644
--- a/tests/ui/attributes/z-crate-attr/garbage.rs
+++ b/tests/ui/attributes/z-crate-attr/garbage.rs
@@ -1,4 +1,7 @@
 // Show diagnostics for invalid tokens
 //@ compile-flags: -Zcrate-attr=`%~@$#
-//@ error-pattern:unknown start of token
+
 fn main() {}
+
+//~? ERROR unknown start of token: `
+//~? ERROR expected identifier, found `%`
diff --git a/tests/ui/attributes/z-crate-attr/injection.rs b/tests/ui/attributes/z-crate-attr/injection.rs
index 0c5c81ca71a..a91f9d2886e 100644
--- a/tests/ui/attributes/z-crate-attr/injection.rs
+++ b/tests/ui/attributes/z-crate-attr/injection.rs
@@ -1,3 +1,5 @@
 //@ compile-flags: '-Zcrate-attr=feature(yeet_expr)]fn main(){}#[inline'
-//@ error-pattern:unexpected closing delimiter
+
 fn foo() {}
+
+//~? ERROR unexpected closing delimiter: `]`
diff --git a/tests/ui/attributes/z-crate-attr/inner-attr.rs b/tests/ui/attributes/z-crate-attr/inner-attr.rs
index 522c906dcd8..47ecad70062 100644
--- a/tests/ui/attributes/z-crate-attr/inner-attr.rs
+++ b/tests/ui/attributes/z-crate-attr/inner-attr.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: -Zcrate-attr=#![feature(foo)]
-//@ error-pattern:expected identifier
 
 fn main() {}
+
+//~? ERROR expected identifier, found `#`
diff --git a/tests/ui/attributes/z-crate-attr/multiple.rs b/tests/ui/attributes/z-crate-attr/multiple.rs
index ee13253f625..47d35d2c3fd 100644
--- a/tests/ui/attributes/z-crate-attr/multiple.rs
+++ b/tests/ui/attributes/z-crate-attr/multiple.rs
@@ -1,3 +1,5 @@
 //@ compile-flags: -Zcrate-attr=feature(foo),feature(bar)
-//@ error-pattern:invalid crate attr
+
 fn main() {}
+
+//~? ERROR invalid crate attribute
diff --git a/tests/ui/attributes/z-crate-attr/unbalanced-paren.rs b/tests/ui/attributes/z-crate-attr/unbalanced-paren.rs
index fc1d7f39a59..77d5d698f65 100644
--- a/tests/ui/attributes/z-crate-attr/unbalanced-paren.rs
+++ b/tests/ui/attributes/z-crate-attr/unbalanced-paren.rs
@@ -1,4 +1,6 @@
 // Show diagnostics for unbalanced parens.
 //@ compile-flags: -Zcrate-attr=(
-//@ error-pattern:unclosed delimiter
+
 fn main() {}
+
+//~? ERROR this file contains an unclosed delimiter
diff --git a/tests/ui/binop/binop-bitxor-str.rs b/tests/ui/binop/binop-bitxor-str.rs
index d59e46167fe..3072fa6ae90 100644
--- a/tests/ui/binop/binop-bitxor-str.rs
+++ b/tests/ui/binop/binop-bitxor-str.rs
@@ -1,3 +1,2 @@
-//@ error-pattern:no implementation for `String ^ String`
-
 fn main() { let x = "a".to_string() ^ "b".to_string(); }
+//~^ ERROR no implementation for `String ^ String`
diff --git a/tests/ui/binop/binop-bitxor-str.stderr b/tests/ui/binop/binop-bitxor-str.stderr
index 9d9ec6c5af6..d4bb0c17bfa 100644
--- a/tests/ui/binop/binop-bitxor-str.stderr
+++ b/tests/ui/binop/binop-bitxor-str.stderr
@@ -1,5 +1,5 @@
 error[E0369]: no implementation for `String ^ String`
-  --> $DIR/binop-bitxor-str.rs:3:37
+  --> $DIR/binop-bitxor-str.rs:1:37
    |
 LL | fn main() { let x = "a".to_string() ^ "b".to_string(); }
    |                     --------------- ^ --------------- String
diff --git a/tests/ui/binop/binop-mul-bool.rs b/tests/ui/binop/binop-mul-bool.rs
index 0b4ed21a12d..706195d215c 100644
--- a/tests/ui/binop/binop-mul-bool.rs
+++ b/tests/ui/binop/binop-mul-bool.rs
@@ -1,3 +1 @@
-//@ error-pattern:cannot multiply `bool` by `bool`
-
-fn main() { let x = true * false; }
+fn main() { let x = true * false; } //~ ERROR cannot multiply `bool` by `bool`
diff --git a/tests/ui/binop/binop-mul-bool.stderr b/tests/ui/binop/binop-mul-bool.stderr
index 82d066f45a4..7fa70f65f56 100644
--- a/tests/ui/binop/binop-mul-bool.stderr
+++ b/tests/ui/binop/binop-mul-bool.stderr
@@ -1,5 +1,5 @@
 error[E0369]: cannot multiply `bool` by `bool`
-  --> $DIR/binop-mul-bool.rs:3:26
+  --> $DIR/binop-mul-bool.rs:1:26
    |
 LL | fn main() { let x = true * false; }
    |                     ---- ^ ----- bool
diff --git a/tests/ui/c-variadic/issue-86053-1.rs b/tests/ui/c-variadic/issue-86053-1.rs
index f952235be98..8eeb99a4cc1 100644
--- a/tests/ui/c-variadic/issue-86053-1.rs
+++ b/tests/ui/c-variadic/issue-86053-1.rs
@@ -1,12 +1,18 @@
 // Regression test for the ICE described in issue #86053.
-//@ error-pattern:unexpected `self` parameter in function
-//@ error-pattern:`...` must be the last argument of a C-variadic function
-//@ error-pattern:cannot find type `F` in this scope
-
 
 #![feature(c_variadic)]
 #![crate_type="lib"]
 
 fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
+    //~^ ERROR expected type, found `,`
+    //~| ERROR unexpected `self` parameter in function
+    //~| ERROR unexpected `self` parameter in function
+    //~| ERROR unexpected `self` parameter in function
     self , ... ,   self ,   self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
+    //~^ ERROR unexpected `self` parameter in function
+    //~| ERROR unexpected `self` parameter in function
+    //~| ERROR unexpected `self` parameter in function
+    //~| ERROR `...` must be the last argument of a C-variadic function
+    //~| ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
+    //~| ERROR cannot find type `F` in this scope
 }
diff --git a/tests/ui/c-variadic/issue-86053-1.stderr b/tests/ui/c-variadic/issue-86053-1.stderr
index ce31f0d300f..dc323f9a234 100644
--- a/tests/ui/c-variadic/issue-86053-1.stderr
+++ b/tests/ui/c-variadic/issue-86053-1.stderr
@@ -1,23 +1,23 @@
 error: expected type, found `,`
-  --> $DIR/issue-86053-1.rs:10:47
+  --> $DIR/issue-86053-1.rs:6:47
    |
 LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
    |                                               ^ expected type
 
 error: unexpected `self` parameter in function
-  --> $DIR/issue-86053-1.rs:10:51
+  --> $DIR/issue-86053-1.rs:6:51
    |
 LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
    |                                                   ^^^^ must be the first parameter of an associated function
 
 error: unexpected `self` parameter in function
-  --> $DIR/issue-86053-1.rs:10:58
+  --> $DIR/issue-86053-1.rs:6:58
    |
 LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
    |                                                          ^^^^ must be the first parameter of an associated function
 
 error: unexpected `self` parameter in function
-  --> $DIR/issue-86053-1.rs:10:67
+  --> $DIR/issue-86053-1.rs:6:67
    |
 LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
    |                                                                   ^^^^ must be the first parameter of an associated function
diff --git a/tests/ui/capture1.rs b/tests/ui/capture1.rs
index 9bf6532a7d3..4f8c04e3fa9 100644
--- a/tests/ui/capture1.rs
+++ b/tests/ui/capture1.rs
@@ -1,6 +1,4 @@
-//@ error-pattern: can't capture dynamic environment in a fn item
-
 fn main() {
     let bar: isize = 5;
-    fn foo() -> isize { return bar; }
+    fn foo() -> isize { return bar; } //~ ERROR can't capture dynamic environment in a fn item
 }
diff --git a/tests/ui/capture1.stderr b/tests/ui/capture1.stderr
index 067b85ba619..8027430de52 100644
--- a/tests/ui/capture1.stderr
+++ b/tests/ui/capture1.stderr
@@ -1,5 +1,5 @@
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/capture1.rs:5:32
+  --> $DIR/capture1.rs:3:32
    |
 LL |     fn foo() -> isize { return bar; }
    |                                ^^^
diff --git a/tests/ui/cast/cast-from-nil.rs b/tests/ui/cast/cast-from-nil.rs
index 8a677603aa9..65e1eb31b21 100644
--- a/tests/ui/cast/cast-from-nil.rs
+++ b/tests/ui/cast/cast-from-nil.rs
@@ -1,2 +1 @@
-//@ error-pattern: non-primitive cast: `()` as `u32`
-fn main() { let u = (assert!(true) as u32); }
+fn main() { let u = (assert!(true) as u32); } //~ ERROR non-primitive cast: `()` as `u32`
diff --git a/tests/ui/cast/cast-from-nil.stderr b/tests/ui/cast/cast-from-nil.stderr
index 991ff93a8bd..82c53d71e78 100644
--- a/tests/ui/cast/cast-from-nil.stderr
+++ b/tests/ui/cast/cast-from-nil.stderr
@@ -1,5 +1,5 @@
 error[E0605]: non-primitive cast: `()` as `u32`
-  --> $DIR/cast-from-nil.rs:2:21
+  --> $DIR/cast-from-nil.rs:1:21
    |
 LL | fn main() { let u = (assert!(true) as u32); }
    |                     ^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
diff --git a/tests/ui/cast/cast-to-nil.rs b/tests/ui/cast/cast-to-nil.rs
index d91f9a16a07..7cd864471dd 100644
--- a/tests/ui/cast/cast-to-nil.rs
+++ b/tests/ui/cast/cast-to-nil.rs
@@ -1,2 +1 @@
-//@ error-pattern: non-primitive cast: `u32` as `()`
-fn main() { let u = 0u32 as (); }
+fn main() { let u = 0u32 as (); } //~ ERROR non-primitive cast: `u32` as `()`
diff --git a/tests/ui/cast/cast-to-nil.stderr b/tests/ui/cast/cast-to-nil.stderr
index 14c75983b94..d7121a7adba 100644
--- a/tests/ui/cast/cast-to-nil.stderr
+++ b/tests/ui/cast/cast-to-nil.stderr
@@ -1,5 +1,5 @@
 error[E0605]: non-primitive cast: `u32` as `()`
-  --> $DIR/cast-to-nil.rs:2:21
+  --> $DIR/cast-to-nil.rs:1:21
    |
 LL | fn main() { let u = 0u32 as (); }
    |                     ^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
diff --git a/tests/ui/cfg/cfg_false_no_std-2.rs b/tests/ui/cfg/cfg_false_no_std-2.rs
index cd337565872..fa6042f5892 100644
--- a/tests/ui/cfg/cfg_false_no_std-2.rs
+++ b/tests/ui/cfg/cfg_false_no_std-2.rs
@@ -1,7 +1,6 @@
 // Error, the linked empty library is `no_std` and doesn't provide a panic handler.
 
 //@ dont-check-compiler-stderr
-//@ error-pattern: `#[panic_handler]` function required, but not found
 //@ aux-build: cfg_false_lib_no_std_before.rs
 
 #![no_std]
@@ -9,3 +8,6 @@
 extern crate cfg_false_lib_no_std_before as _;
 
 fn main() {}
+
+//~? ERROR `#[panic_handler]` function required, but not found
+//~? ERROR unwinding panics are not supported without std
diff --git a/tests/ui/codegen/mismatched-data-layouts.rs b/tests/ui/codegen/mismatched-data-layouts.rs
index 955f917ee33..194bcaa307f 100644
--- a/tests/ui/codegen/mismatched-data-layouts.rs
+++ b/tests/ui/codegen/mismatched-data-layouts.rs
@@ -3,7 +3,6 @@
 //@ build-fail
 //@ needs-llvm-components: x86
 //@ compile-flags: --crate-type=lib --target={{src-base}}/codegen/mismatched-data-layout.json -Z unstable-options
-//@ error-pattern: differs from LLVM target's
 //@ normalize-stderr: "`, `[A-Za-z0-9-:]*`" -> "`, `normalized data layout`"
 //@ normalize-stderr: "layout, `[A-Za-z0-9-:]*`" -> "layout, `normalized data layout`"
 
@@ -12,3 +11,5 @@
 
 #[lang = "sized"]
 trait Sized {}
+
+//~? ERROR differs from LLVM target's
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-3.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-3.rs
index c086b8d8c3f..ba55b1c08b1 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-3.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-3.rs
@@ -1,3 +1,5 @@
 //@ compile-flags: --cfg a::b
-//@ error-pattern: invalid `--cfg` argument: `a::b` (argument key must be an identifier)
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `a::b` (argument key must be an identifier)
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-5.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-5.rs
index 6f0bf8cf5fe..d64aeead79c 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-5.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-5.rs
@@ -1,3 +1,5 @@
 //@ compile-flags: --cfg a=10
-//@ error-pattern: invalid `--cfg` argument: `a=10` (argument value must be a string)
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `a=10` (argument value must be a string)
diff --git a/tests/ui/conditional-compilation/cfg-attr-cfg-2.rs b/tests/ui/conditional-compilation/cfg-attr-cfg-2.rs
index c801bbccedd..80735990015 100644
--- a/tests/ui/conditional-compilation/cfg-attr-cfg-2.rs
+++ b/tests/ui/conditional-compilation/cfg-attr-cfg-2.rs
@@ -1,8 +1,7 @@
-//@ error-pattern: `main` function not found
 //@ compile-flags: --cfg foo --check-cfg=cfg(foo,bar)
 
 // main is conditionally compiled, but the conditional compilation
 // is conditional too!
 
 #[cfg_attr(foo, cfg(bar))]
-fn main() { }
+fn main() { } //~ ERROR `main` function not found in crate `cfg_attr_cfg_2`
diff --git a/tests/ui/conditional-compilation/cfg-attr-cfg-2.stderr b/tests/ui/conditional-compilation/cfg-attr-cfg-2.stderr
index 64595241dc7..1febb430863 100644
--- a/tests/ui/conditional-compilation/cfg-attr-cfg-2.stderr
+++ b/tests/ui/conditional-compilation/cfg-attr-cfg-2.stderr
@@ -1,5 +1,5 @@
 error[E0601]: `main` function not found in crate `cfg_attr_cfg_2`
-  --> $DIR/cfg-attr-cfg-2.rs:8:14
+  --> $DIR/cfg-attr-cfg-2.rs:7:14
    |
 LL | fn main() { }
    |              ^ consider adding a `main` function to `$DIR/cfg-attr-cfg-2.rs`
diff --git a/tests/ui/conditional-compilation/cfg-in-crate-1.rs b/tests/ui/conditional-compilation/cfg-in-crate-1.rs
index ecd3722bf4c..a1faa2397a3 100644
--- a/tests/ui/conditional-compilation/cfg-in-crate-1.rs
+++ b/tests/ui/conditional-compilation/cfg-in-crate-1.rs
@@ -1,3 +1 @@
-//@ error-pattern: `main` function not found
-
-#![cfg(FALSE)]
+#![cfg(FALSE)] //~ ERROR `main` function not found in crate `cfg_in_crate_1`
diff --git a/tests/ui/conditional-compilation/cfg-in-crate-1.stderr b/tests/ui/conditional-compilation/cfg-in-crate-1.stderr
index 6067a3a921c..126e10cf040 100644
--- a/tests/ui/conditional-compilation/cfg-in-crate-1.stderr
+++ b/tests/ui/conditional-compilation/cfg-in-crate-1.stderr
@@ -1,5 +1,5 @@
 error[E0601]: `main` function not found in crate `cfg_in_crate_1`
-  --> $DIR/cfg-in-crate-1.rs:3:15
+  --> $DIR/cfg-in-crate-1.rs:1:15
    |
 LL | #![cfg(FALSE)]
    |               ^ consider adding a `main` function to `$DIR/cfg-in-crate-1.rs`
diff --git a/tests/ui/const-ptr/out_of_bounds_read.rs b/tests/ui/const-ptr/out_of_bounds_read.rs
index 312b53432b4..ccf45bf324a 100644
--- a/tests/ui/const-ptr/out_of_bounds_read.rs
+++ b/tests/ui/const-ptr/out_of_bounds_read.rs
@@ -1,5 +1,3 @@
-//@ error-pattern: evaluation of constant value failed
-
 fn main() {
     use std::ptr;
 
@@ -8,6 +6,9 @@ fn main() {
     const PAST_END_PTR: *const u32 = unsafe { DATA.as_ptr().add(1) };
 
     const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
+    //~^ ERROR evaluation of constant value failed
     const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
+    //~^ ERROR evaluation of constant value failed
     const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() };
+    //~^ ERROR evaluation of constant value failed
 }
diff --git a/tests/ui/const-ptr/out_of_bounds_read.stderr b/tests/ui/const-ptr/out_of_bounds_read.stderr
index 899e151c9b8..b396fc4d71b 100644
--- a/tests/ui/const-ptr/out_of_bounds_read.stderr
+++ b/tests/ui/const-ptr/out_of_bounds_read.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/out_of_bounds_read.rs:10:33
+  --> $DIR/out_of_bounds_read.rs:8:33
    |
 LL |     const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
@@ -8,7 +8,7 @@ note: inside `std::ptr::read::<u32>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/out_of_bounds_read.rs:11:39
+  --> $DIR/out_of_bounds_read.rs:10:39
    |
 LL |     const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
    |                                       ^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
diff --git a/tests/ui/consts/const-size_of-cycle.rs b/tests/ui/consts/const-size_of-cycle.rs
index cfb2294c445..f45d96d43f8 100644
--- a/tests/ui/consts/const-size_of-cycle.rs
+++ b/tests/ui/consts/const-size_of-cycle.rs
@@ -1,7 +1,6 @@
-//@ error-pattern: cycle detected
-
 struct Foo {
     bytes: [u8; std::mem::size_of::<Foo>()]
+    //~^ ERROR cycle detected when evaluating type-level constant
 }
 
 fn main() {}
diff --git a/tests/ui/consts/const-size_of-cycle.stderr b/tests/ui/consts/const-size_of-cycle.stderr
index cd0ea556425..bf17d76a092 100644
--- a/tests/ui/consts/const-size_of-cycle.stderr
+++ b/tests/ui/consts/const-size_of-cycle.stderr
@@ -1,11 +1,11 @@
 error[E0391]: cycle detected when evaluating type-level constant
-  --> $DIR/const-size_of-cycle.rs:4:17
+  --> $DIR/const-size_of-cycle.rs:2:17
    |
 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`...
-  --> $DIR/const-size_of-cycle.rs:4:17
+  --> $DIR/const-size_of-cycle.rs:2:17
    |
 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |     bytes: [u8; std::mem::size_of::<Foo>()]
    = note: ...which requires normalizing `[u8; std::mem::size_of::<Foo>()]`...
    = note: ...which again requires evaluating type-level constant, completing the cycle
 note: cycle used when checking that `Foo` is well-formed
-  --> $DIR/const-size_of-cycle.rs:3:1
+  --> $DIR/const-size_of-cycle.rs:1:1
    |
 LL | struct Foo {
    | ^^^^^^^^^^
diff --git a/tests/ui/consts/miri_unleashed/drop.rs b/tests/ui/consts/miri_unleashed/drop.rs
index 45ade4906b8..17d089222d9 100644
--- a/tests/ui/consts/miri_unleashed/drop.rs
+++ b/tests/ui/consts/miri_unleashed/drop.rs
@@ -14,4 +14,6 @@ static TEST_OK: () = {
 // The actual error is tested by the error-pattern above.
 static TEST_BAD: () = {
     let _v: Vec<i32> = Vec::new();
-};
+}; //~ ERROR could not evaluate static initializer
+
+//~? WARN skipping const checks
diff --git a/tests/ui/consts/timeout.rs b/tests/ui/consts/timeout.rs
index c4fb8bab663..8dab87ac8e1 100644
--- a/tests/ui/consts/timeout.rs
+++ b/tests/ui/consts/timeout.rs
@@ -3,7 +3,6 @@
 //! ICE.
 
 //@ compile-flags: --crate-type=lib -Ztiny-const-eval-limit
-//@ error-pattern: constant evaluation is taking a long time
 
 static ROOK_ATTACKS_TABLE: () = {
     0_u64.count_ones();
@@ -23,3 +22,5 @@ static ROOK_ATTACKS_TABLE: () = {
     0_u64.count_ones();
     0_u64.count_ones();
 };
+
+//~? ERROR constant evaluation is taking a long time
diff --git a/tests/ui/consts/timeout.stderr b/tests/ui/consts/timeout.stderr
index 6bfa06d86d1..ecefeff76e9 100644
--- a/tests/ui/consts/timeout.stderr
+++ b/tests/ui/consts/timeout.stderr
@@ -4,7 +4,7 @@ error: constant evaluation is taking a long time
    = note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
            If your compilation actually takes a long time, you can safely allow the lint.
 help: the constant being evaluated
-  --> $DIR/timeout.rs:8:1
+  --> $DIR/timeout.rs:7:1
    |
 LL | static ROOK_ATTACKS_TABLE: () = {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/crate_type_flag.rs b/tests/ui/crate_type_flag.rs
index 4f3cfbae45d..03bea3638e1 100644
--- a/tests/ui/crate_type_flag.rs
+++ b/tests/ui/crate_type_flag.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: --crate-type dynlib
-//@ error-pattern: unknown crate type: `dynlib`, expected one of: `lib`, `rlib`, `staticlib`, `dylib`, `cdylib`, `bin`, `proc-macro`
 
 fn main() {}
+
+//~? ERROR unknown crate type: `dynlib`
diff --git a/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs b/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs
index 3bff4471698..7f85cbf227a 100644
--- a/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs
+++ b/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs
@@ -1,9 +1,9 @@
+//~ ERROR values of the type `[u8; usize::MAX]` are too big for the target architecture
 // Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that
 // causes a layout error. See https://github.com/rust-lang/rust/issues/94961.
 
 //@ compile-flags:-C debuginfo=2
 //@ build-fail
-//@ error-pattern: too big for the target architecture
 
 #![crate_type = "rlib"]
 
diff --git a/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs b/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs
index 6a3f8f4c249..e9b021e4f48 100644
--- a/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs
+++ b/tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs
@@ -1,3 +1,4 @@
+//~ ERROR values of the type `[u8; usize::MAX]` are too big for the target architecture
 // Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that
 // causes a layout error.
 // This version of the test already ICE'd before the commit that introduce the ICE described in
@@ -5,7 +6,6 @@
 
 //@ compile-flags:-C debuginfo=2
 //@ build-fail
-//@ error-pattern: too big for the target architecture
 
 #![crate_type = "rlib"]
 
diff --git a/tests/ui/debuginfo/dwarf-versions.rs b/tests/ui/debuginfo/dwarf-versions.rs
index 806ade51a99..6030b2fcf3c 100644
--- a/tests/ui/debuginfo/dwarf-versions.rs
+++ b/tests/ui/debuginfo/dwarf-versions.rs
@@ -4,7 +4,6 @@
 //@ revisions: zero one two three four five six
 
 //@[zero] compile-flags: -Zdwarf-version=0
-//@[zero] error-pattern: requested DWARF version 0 is not supported
 
 //@[one] compile-flags: -Zdwarf-version=1
 //@[one] error-pattern: requested DWARF version 1 is not supported
@@ -22,7 +21,6 @@
 //@[five] check-pass
 
 //@[six] compile-flags: -Zdwarf-version=6
-//@[six] error-pattern: requested DWARF version 6 is not supported
 
 //@ compile-flags: -g --target x86_64-unknown-linux-gnu --crate-type cdylib
 //@ needs-llvm-components: x86
@@ -36,3 +34,7 @@
 pub trait Sized {}
 
 pub fn foo() {}
+
+//[zero]~? ERROR requested DWARF version 0 is not supported
+//[one]~? ERROR requested DWARF version 1 is not supported
+//[six]~? ERROR requested DWARF version 6 is not supported
diff --git a/tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs b/tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs
index 896bbac7d8e..75b8141cc38 100644
--- a/tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs
+++ b/tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs
@@ -1,6 +1,5 @@
 //@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
 //@ compile-flags: --crate-type cdylib -Csplit-debuginfo=packed
-//@ error-pattern: error: `-Csplit-debuginfo=packed` is unstable on this platform
 
 //@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
 //@[aarch64_gl] needs-llvm-components: aarch64
@@ -27,3 +26,5 @@
 
 #![no_core]
 #![no_std]
+
+//~? ERROR `-Csplit-debuginfo=packed` is unstable on this platform
diff --git a/tests/ui/debuginfo/windows_gnu_split_debuginfo_unpacked.rs b/tests/ui/debuginfo/windows_gnu_split_debuginfo_unpacked.rs
index 54a88c91217..3f4da555aad 100644
--- a/tests/ui/debuginfo/windows_gnu_split_debuginfo_unpacked.rs
+++ b/tests/ui/debuginfo/windows_gnu_split_debuginfo_unpacked.rs
@@ -1,6 +1,5 @@
 //@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
 //@ compile-flags: --crate-type cdylib -Csplit-debuginfo=unpacked
-//@ error-pattern: error: `-Csplit-debuginfo=unpacked` is unstable on this platform
 
 //@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
 //@[aarch64_gl] needs-llvm-components: aarch64
@@ -27,3 +26,5 @@
 
 #![no_core]
 #![no_std]
+
+//~? ERROR `-Csplit-debuginfo=unpacked` is unstable on this platform
diff --git a/tests/ui/deprecation/deprecation-lint-2.rs b/tests/ui/deprecation/deprecation-lint-2.rs
index 553b1afe45c..f22eebb53a0 100644
--- a/tests/ui/deprecation/deprecation-lint-2.rs
+++ b/tests/ui/deprecation/deprecation-lint-2.rs
@@ -1,5 +1,4 @@
 //@ aux-build:deprecation-lint.rs
-//@ error-pattern: use of deprecated function
 
 #![deny(deprecated)]
 
@@ -9,5 +8,5 @@ extern crate deprecation_lint;
 use deprecation_lint::*;
 
 fn main() {
-    macro_test!();
+    macro_test!(); //~ ERROR use of deprecated function `deprecation_lint::deprecated`: text
 }
diff --git a/tests/ui/deprecation/deprecation-lint-2.stderr b/tests/ui/deprecation/deprecation-lint-2.stderr
index 7d411c00445..ebc760bfe7b 100644
--- a/tests/ui/deprecation/deprecation-lint-2.stderr
+++ b/tests/ui/deprecation/deprecation-lint-2.stderr
@@ -1,11 +1,11 @@
 error: use of deprecated function `deprecation_lint::deprecated`: text
-  --> $DIR/deprecation-lint-2.rs:12:5
+  --> $DIR/deprecation-lint-2.rs:11:5
    |
 LL |     macro_test!();
    |     ^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/deprecation-lint-2.rs:4:9
+  --> $DIR/deprecation-lint-2.rs:3:9
    |
 LL | #![deny(deprecated)]
    |         ^^^^^^^^^^
diff --git a/tests/ui/deprecation/deprecation-lint-3.rs b/tests/ui/deprecation/deprecation-lint-3.rs
index f01fc924457..5a9ca9a2d0a 100644
--- a/tests/ui/deprecation/deprecation-lint-3.rs
+++ b/tests/ui/deprecation/deprecation-lint-3.rs
@@ -1,5 +1,4 @@
 //@ aux-build:deprecation-lint.rs
-//@ error-pattern: use of deprecated function
 
 #![deny(deprecated)]
 #![allow(warnings)]
@@ -11,4 +10,5 @@ use deprecation_lint::*;
 
 fn main() {
     macro_test_arg_nested!(deprecated_text);
+    //~^ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text
 }
diff --git a/tests/ui/deprecation/deprecation-lint-3.stderr b/tests/ui/deprecation/deprecation-lint-3.stderr
index 1723b7bbd05..8bfe08cf6d5 100644
--- a/tests/ui/deprecation/deprecation-lint-3.stderr
+++ b/tests/ui/deprecation/deprecation-lint-3.stderr
@@ -1,11 +1,11 @@
 error: use of deprecated function `deprecation_lint::deprecated_text`: text
-  --> $DIR/deprecation-lint-3.rs:13:28
+  --> $DIR/deprecation-lint-3.rs:12:28
    |
 LL |     macro_test_arg_nested!(deprecated_text);
    |                            ^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/deprecation-lint-3.rs:4:9
+  --> $DIR/deprecation-lint-3.rs:3:9
    |
 LL | #![deny(deprecated)]
    |         ^^^^^^^^^^
diff --git a/tests/ui/duplicate/dupe-symbols-4.rs b/tests/ui/duplicate/dupe-symbols-4.rs
index a9b7d689ad4..d961ba10e72 100644
--- a/tests/ui/duplicate/dupe-symbols-4.rs
+++ b/tests/ui/duplicate/dupe-symbols-4.rs
@@ -1,7 +1,5 @@
 //@ build-fail
 
-//
-//@ error-pattern: symbol `fail` is already defined
 #![crate_type="rlib"]
 #![allow(warnings)]
 
@@ -20,5 +18,5 @@ impl A for B {
 
 impl A for C {
     #[no_mangle]
-    fn fail(self) {}
+    fn fail(self) {} //~ ERROR symbol `fail` is already defined
 }
diff --git a/tests/ui/duplicate/dupe-symbols-4.stderr b/tests/ui/duplicate/dupe-symbols-4.stderr
index 4c5f1e7867f..e85d3f2b063 100644
--- a/tests/ui/duplicate/dupe-symbols-4.stderr
+++ b/tests/ui/duplicate/dupe-symbols-4.stderr
@@ -1,5 +1,5 @@
 error: symbol `fail` is already defined
-  --> $DIR/dupe-symbols-4.rs:23:5
+  --> $DIR/dupe-symbols-4.rs:21:5
    |
 LL |     fn fail(self) {}
    |     ^^^^^^^^^^^^^
diff --git a/tests/ui/duplicate/dupe-symbols-7.rs b/tests/ui/duplicate/dupe-symbols-7.rs
index 162c3c40446..ea17942493c 100644
--- a/tests/ui/duplicate/dupe-symbols-7.rs
+++ b/tests/ui/duplicate/dupe-symbols-7.rs
@@ -1,10 +1,7 @@
 //@ build-fail
 //@ ignore-wasi wasi does different things with the `main` symbol
 
-//
-//@ error-pattern: entry symbol `main` declared multiple times
-
 #![allow(warnings)]
 
 #[no_mangle]
-fn main(){}
+fn main(){} //~ ERROR entry symbol `main` declared multiple times
diff --git a/tests/ui/duplicate/dupe-symbols-7.stderr b/tests/ui/duplicate/dupe-symbols-7.stderr
index aa6213af2e4..d7503856939 100644
--- a/tests/ui/duplicate/dupe-symbols-7.stderr
+++ b/tests/ui/duplicate/dupe-symbols-7.stderr
@@ -1,5 +1,5 @@
 error: entry symbol `main` declared multiple times
-  --> $DIR/dupe-symbols-7.rs:10:1
+  --> $DIR/dupe-symbols-7.rs:7:1
    |
 LL | fn main(){}
    | ^^^^^^^^^
diff --git a/tests/ui/duplicate/dupe-symbols-8.rs b/tests/ui/duplicate/dupe-symbols-8.rs
index 258e91fa8c8..b3c635f38ed 100644
--- a/tests/ui/duplicate/dupe-symbols-8.rs
+++ b/tests/ui/duplicate/dupe-symbols-8.rs
@@ -1,11 +1,10 @@
 //@ build-fail
-//@ error-pattern: entry symbol `main` declared multiple times
 //@ ignore-wasi wasi does different things with the `main` symbol
 //
 // See #67946.
 
 #![allow(warnings)]
-fn main() {
+fn main() { //~ ERROR entry symbol `main` declared multiple times
     extern "Rust" {
      fn main();
     }
diff --git a/tests/ui/duplicate/dupe-symbols-8.stderr b/tests/ui/duplicate/dupe-symbols-8.stderr
index 0f47d3683b5..494fdcca327 100644
--- a/tests/ui/duplicate/dupe-symbols-8.stderr
+++ b/tests/ui/duplicate/dupe-symbols-8.stderr
@@ -1,5 +1,5 @@
 error: entry symbol `main` declared multiple times
-  --> $DIR/dupe-symbols-8.rs:8:1
+  --> $DIR/dupe-symbols-8.rs:7:1
    |
 LL | fn main() {
    | ^^^^^^^^^
diff --git a/tests/ui/elided-test.rs b/tests/ui/elided-test.rs
index 025b75c1b5c..2bedc25e17b 100644
--- a/tests/ui/elided-test.rs
+++ b/tests/ui/elided-test.rs
@@ -1,7 +1,5 @@
-//@ error-pattern: `main` function not found
-
 // Since we're not compiling a test runner this function should be elided
 // and the build will fail because main doesn't exist
 #[test]
 fn main() {
-}
+} //~ ERROR `main` function not found in crate `elided_test`
diff --git a/tests/ui/elided-test.stderr b/tests/ui/elided-test.stderr
index e323b8ba7ea..7aebe5d8264 100644
--- a/tests/ui/elided-test.stderr
+++ b/tests/ui/elided-test.stderr
@@ -1,5 +1,5 @@
 error[E0601]: `main` function not found in crate `elided_test`
-  --> $DIR/elided-test.rs:7:2
+  --> $DIR/elided-test.rs:5:2
    |
 LL | }
    |  ^ consider adding a `main` function to `$DIR/elided-test.rs`
diff --git a/tests/ui/error-codes/E0602.rs b/tests/ui/error-codes/E0602.rs
index 1849fd2d895..cba15bb92d4 100644
--- a/tests/ui/error-codes/E0602.rs
+++ b/tests/ui/error-codes/E0602.rs
@@ -1,8 +1,11 @@
 //@ compile-flags:-D bogus
 //@ check-pass
 
-//@ error-pattern:E0602
 //@ error-pattern:requested on the command line with `-D bogus`
 //@ error-pattern:`#[warn(unknown_lints)]` on by default
 
 fn main() {}
+
+//~? WARN unknown lint: `bogus`
+//~? WARN unknown lint: `bogus`
+//~? WARN unknown lint: `bogus`
diff --git a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
index 7aa66be0d09..b4f83f6bfc0 100644
--- a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
+++ b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
@@ -1,7 +1,7 @@
 error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
   --> $DIR/remap-path-prefix-reverse.rs:16:13
    |
-LL |     let _ = remapped_dep::SomeStruct; // ~ERROR E0423
+LL |     let _ = remapped_dep::SomeStruct;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
    |
   ::: remapped-aux/remapped_dep.rs:4:1
diff --git a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
index 7aa66be0d09..b4f83f6bfc0 100644
--- a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
+++ b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
@@ -1,7 +1,7 @@
 error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
   --> $DIR/remap-path-prefix-reverse.rs:16:13
    |
-LL |     let _ = remapped_dep::SomeStruct; // ~ERROR E0423
+LL |     let _ = remapped_dep::SomeStruct;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
    |
   ::: remapped-aux/remapped_dep.rs:4:1
diff --git a/tests/ui/errors/remap-path-prefix-reverse.rs b/tests/ui/errors/remap-path-prefix-reverse.rs
index 7743e38f50f..28fdabb8f4d 100644
--- a/tests/ui/errors/remap-path-prefix-reverse.rs
+++ b/tests/ui/errors/remap-path-prefix-reverse.rs
@@ -13,5 +13,6 @@ extern crate remapped_dep;
 fn main() {
     // The actual error is irrelevant. The important part it that is should show
     // a snippet of the dependency's source.
-    let _ = remapped_dep::SomeStruct; // ~ERROR E0423
+    let _ = remapped_dep::SomeStruct;
+    //~^ ERROR expected value, found struct `remapped_dep::SomeStruct`
 }
diff --git a/tests/ui/errors/remap-path-prefix-sysroot.rs b/tests/ui/errors/remap-path-prefix-sysroot.rs
index 7281e6da094..5e2e4fab51d 100644
--- a/tests/ui/errors/remap-path-prefix-sysroot.rs
+++ b/tests/ui/errors/remap-path-prefix-sysroot.rs
@@ -3,7 +3,6 @@
 //@ [with-remap]compile-flags: --remap-path-prefix={{rust-src-base}}=remapped
 //@ [with-remap]compile-flags: --remap-path-prefix={{src-base}}=remapped-tests-ui
 //@ [without-remap]compile-flags:
-//@ error-pattern: E0507
 
 // The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically
 // as the remapped revision will not begin with $SRC_DIR_REAL,
@@ -18,7 +17,10 @@ struct Worker {
 impl Drop for Worker {
     fn drop(&mut self) {
         self.thread.join().unwrap();
+        //[without-remap]~^ ERROR cannot move out of `self.thread` which is behind a mutable reference
     }
 }
 
 pub fn main(){}
+
+//[with-remap]~? ERROR cannot move out of `self.thread` which is behind a mutable reference
diff --git a/tests/ui/errors/remap-path-prefix.normal.stderr b/tests/ui/errors/remap-path-prefix.normal.stderr
index 46d33d26052..5a125a7024a 100644
--- a/tests/ui/errors/remap-path-prefix.normal.stderr
+++ b/tests/ui/errors/remap-path-prefix.normal.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `ferris` in this scope
-  --> remapped/errors/remap-path-prefix.rs:19:5
+  --> remapped/errors/remap-path-prefix.rs:15:5
    |
 LL |     ferris
    |     ^^^^^^ not found in this scope
diff --git a/tests/ui/errors/remap-path-prefix.rs b/tests/ui/errors/remap-path-prefix.rs
index 8809caa4d4f..7e38e16280f 100644
--- a/tests/ui/errors/remap-path-prefix.rs
+++ b/tests/ui/errors/remap-path-prefix.rs
@@ -7,14 +7,13 @@
 // The remapped paths are not normalized by compiletest.
 //@ normalize-stderr: "\\(errors)" -> "/$1"
 
-// The remapped paths aren't recognized by compiletest, so we
-// cannot use line-specific patterns.
-//@ error-pattern: E0425
-
 fn main() {
     // We cannot actually put an ERROR marker here because
     // the file name in the error message is not what the
     // test framework expects (since the filename gets remapped).
     // We still test the expected error in the stderr file.
-    ferris
+    ferris //[without-diagnostic-scope]~ ERROR cannot find value `ferris` in this scope
 }
+
+//[normal]~? ERROR cannot find value `ferris` in this scope
+//[with-diagnostic-scope]~? ERROR cannot find value `ferris` in this scope
diff --git a/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr b/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr
index 46d33d26052..5a125a7024a 100644
--- a/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr
+++ b/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `ferris` in this scope
-  --> remapped/errors/remap-path-prefix.rs:19:5
+  --> remapped/errors/remap-path-prefix.rs:15:5
    |
 LL |     ferris
    |     ^^^^^^ not found in this scope
diff --git a/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr b/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr
index 0badea6e27b..b6332685dbf 100644
--- a/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr
+++ b/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `ferris` in this scope
-  --> $DIR/remap-path-prefix.rs:19:5
+  --> $DIR/remap-path-prefix.rs:15:5
    |
 LL |     ferris
    |     ^^^^^^ not found in this scope
diff --git a/tests/ui/expr/if/if-typeck.rs b/tests/ui/expr/if/if-typeck.rs
index ba828f11e79..0985598f0f7 100644
--- a/tests/ui/expr/if/if-typeck.rs
+++ b/tests/ui/expr/if/if-typeck.rs
@@ -1,4 +1,3 @@
-//@ error-pattern:mismatched types
 // issue #513
 
 fn f() { }
@@ -6,5 +5,5 @@ fn f() { }
 fn main() {
 
     // f is not a bool
-    if f { }
+    if f { } //~ ERROR mismatched types
 }
diff --git a/tests/ui/expr/if/if-typeck.stderr b/tests/ui/expr/if/if-typeck.stderr
index 1be43a20105..bca00f890cb 100644
--- a/tests/ui/expr/if/if-typeck.stderr
+++ b/tests/ui/expr/if/if-typeck.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/if-typeck.rs:9:8
+  --> $DIR/if-typeck.rs:8:8
    |
 LL |     if f { }
    |        ^ expected `bool`, found fn item
diff --git a/tests/ui/ext-nonexistent.rs b/tests/ui/ext-nonexistent.rs
index a66407953a9..1293324b67e 100644
--- a/tests/ui/ext-nonexistent.rs
+++ b/tests/ui/ext-nonexistent.rs
@@ -1,2 +1,2 @@
-//@ error-pattern:cannot find macro
 fn main() { iamnotanextensionthatexists!(""); }
+//~^ ERROR cannot find macro `iamnotanextensionthatexists` in this scope
diff --git a/tests/ui/ext-nonexistent.stderr b/tests/ui/ext-nonexistent.stderr
index 8891e823e4a..edb59bba6e5 100644
--- a/tests/ui/ext-nonexistent.stderr
+++ b/tests/ui/ext-nonexistent.stderr
@@ -1,5 +1,5 @@
 error: cannot find macro `iamnotanextensionthatexists` in this scope
-  --> $DIR/ext-nonexistent.rs:2:13
+  --> $DIR/ext-nonexistent.rs:1:13
    |
 LL | fn main() { iamnotanextensionthatexists!(""); }
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/extern-flag/empty-extern-arg.rs b/tests/ui/extern-flag/empty-extern-arg.rs
index dea68b5b1ad..2dee721ed03 100644
--- a/tests/ui/extern-flag/empty-extern-arg.rs
+++ b/tests/ui/extern-flag/empty-extern-arg.rs
@@ -1,6 +1,9 @@
+//~ ERROR extern location for std does not exist
 //@ compile-flags: --extern std=
-//@ error-pattern: extern location for std does not exist
 //@ needs-unwind since it affects the error output
 //@ ignore-emscripten missing eh_catch_typeinfo lang item
 
 fn main() {}
+
+//~? ERROR `#[panic_handler]` function required, but not found
+//~? ERROR unwinding panics are not supported without std
diff --git a/tests/ui/extern-flag/invalid-crate-name-dashed.rs b/tests/ui/extern-flag/invalid-crate-name-dashed.rs
index b846214175e..b336cc84569 100644
--- a/tests/ui/extern-flag/invalid-crate-name-dashed.rs
+++ b/tests/ui/extern-flag/invalid-crate-name-dashed.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: --extern=my-awesome-library=libawesome.rlib
-//@ error-pattern: crate name `my-awesome-library` passed to `--extern` is not a valid ASCII identifier
 //@ error-pattern: consider replacing the dashes with underscores: `my_awesome_library`
 
 // In a sense, this is a regression test for issue #113035. We no longer suggest
@@ -8,3 +7,5 @@
 pub use my_awesome_library::*;
 
 fn main() {}
+
+//~? ERROR crate name `my-awesome-library` passed to `--extern` is not a valid ASCII identifier
diff --git a/tests/ui/extern-flag/invalid-crate-name-non-ascii.rs b/tests/ui/extern-flag/invalid-crate-name-non-ascii.rs
index 5231503820f..71818938283 100644
--- a/tests/ui/extern-flag/invalid-crate-name-non-ascii.rs
+++ b/tests/ui/extern-flag/invalid-crate-name-non-ascii.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: --extern čɍαţē=libnon_ascii.rlib
-//@ error-pattern: crate name `čɍαţē` passed to `--extern` is not a valid ASCII identifier
 
 fn main() {}
+
+//~? ERROR crate name `čɍαţē` passed to `--extern` is not a valid ASCII identifier
diff --git a/tests/ui/extern-flag/invalid-crate-name.rs b/tests/ui/extern-flag/invalid-crate-name.rs
index c7b5b637217..5d73e119673 100644
--- a/tests/ui/extern-flag/invalid-crate-name.rs
+++ b/tests/ui/extern-flag/invalid-crate-name.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: --extern=?#1%$
-//@ error-pattern: crate name `?#1%$` passed to `--extern` is not a valid ASCII identifier
 
 fn main() {}
+
+//~? ERROR crate name `?#1%$` passed to `--extern` is not a valid ASCII identifier
diff --git a/tests/ui/extern-flag/no-force-extern.rs b/tests/ui/extern-flag/no-force-extern.rs
index 11d2f91c7bb..c9317abe292 100644
--- a/tests/ui/extern-flag/no-force-extern.rs
+++ b/tests/ui/extern-flag/no-force-extern.rs
@@ -1,10 +1,12 @@
 //@ aux-crate:panic_handler=panic_handler.rs
 //@ ignore-cross-compile (needs dylibs and compiletest doesn't have a more specific header)
 // compile_flags: -Zunstable-options --crate-type dylib
-//@ error-pattern: `#[panic_handler]` function required, but not found
 //@ dont-check-compiler-stderr
 //@ edition: 2018
 
 #![no_std]
 
-fn foo() {}
+fn foo() {} //~ ERROR `main` function not found in crate `no_force_extern`
+
+//~? ERROR `#[panic_handler]` function required, but not found
+//~? ERROR unwinding panics are not supported without std
diff --git a/tests/ui/fn/fn-bad-block-type.rs b/tests/ui/fn/fn-bad-block-type.rs
index c7ad462f143..47ddc583c87 100644
--- a/tests/ui/fn/fn-bad-block-type.rs
+++ b/tests/ui/fn/fn-bad-block-type.rs
@@ -1,5 +1,3 @@
-//@ error-pattern:mismatched types
-
-fn f() -> isize { true }
+fn f() -> isize { true } //~ ERROR mismatched types
 
 fn main() { }
diff --git a/tests/ui/fn/fn-bad-block-type.stderr b/tests/ui/fn/fn-bad-block-type.stderr
index 6917bea6591..287caee4582 100644
--- a/tests/ui/fn/fn-bad-block-type.stderr
+++ b/tests/ui/fn/fn-bad-block-type.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/fn-bad-block-type.rs:3:19
+  --> $DIR/fn-bad-block-type.rs:1:19
    |
 LL | fn f() -> isize { true }
    |           -----   ^^^^ expected `isize`, found `bool`
diff --git a/tests/ui/imports/import-loop-2.rs b/tests/ui/imports/import-loop-2.rs
index d9a56cb1378..1bd0f06c671 100644
--- a/tests/ui/imports/import-loop-2.rs
+++ b/tests/ui/imports/import-loop-2.rs
@@ -1,11 +1,9 @@
-//@ error-pattern:import
-
 mod a {
     pub use b::x;
 }
 
 mod b {
-    pub use a::x;
+    pub use a::x; //~ ERROR unresolved import `a::x`
 
     fn main() { let y = x; }
 }
diff --git a/tests/ui/imports/import-loop-2.stderr b/tests/ui/imports/import-loop-2.stderr
index 1a95200a662..2521b6e7c04 100644
--- a/tests/ui/imports/import-loop-2.stderr
+++ b/tests/ui/imports/import-loop-2.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `a::x`
-  --> $DIR/import-loop-2.rs:8:13
+  --> $DIR/import-loop-2.rs:6:13
    |
 LL |     pub use a::x;
    |             ^^^^ no `x` in `a`
diff --git a/tests/ui/imports/import-loop.rs b/tests/ui/imports/import-loop.rs
index 1ba9e090033..fc5bd32adee 100644
--- a/tests/ui/imports/import-loop.rs
+++ b/tests/ui/imports/import-loop.rs
@@ -1,9 +1,7 @@
-//@ error-pattern:import
-
 use y::x;
 
 mod y {
-    pub use y::x;
+    pub use y::x; //~ ERROR unresolved import `y::x`
 }
 
 fn main() { }
diff --git a/tests/ui/imports/import-loop.stderr b/tests/ui/imports/import-loop.stderr
index 8ad2d6be4d2..801fc2552b6 100644
--- a/tests/ui/imports/import-loop.stderr
+++ b/tests/ui/imports/import-loop.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `y::x`
-  --> $DIR/import-loop.rs:6:13
+  --> $DIR/import-loop.rs:4:13
    |
 LL |     pub use y::x;
    |             ^^^^ no `x` in `y`
diff --git a/tests/ui/imports/import3.rs b/tests/ui/imports/import3.rs
index 71eea0ebb26..7bd6458cba1 100644
--- a/tests/ui/imports/import3.rs
+++ b/tests/ui/imports/import3.rs
@@ -1,4 +1,3 @@
-//@ error-pattern: unresolved
-use main::bar;
+use main::bar; //~ ERROR unresolved import `main`
 
 fn main() { println!("foo"); }
diff --git a/tests/ui/imports/import3.stderr b/tests/ui/imports/import3.stderr
index 7f581146781..871104ce50d 100644
--- a/tests/ui/imports/import3.stderr
+++ b/tests/ui/imports/import3.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `main`
-  --> $DIR/import3.rs:2:5
+  --> $DIR/import3.rs:1:5
    |
 LL | use main::bar;
    |     ^^^^ use of unresolved module or unlinked crate `main`
diff --git a/tests/ui/imports/import4.rs b/tests/ui/imports/import4.rs
index 8d727ced890..01535fc6f45 100644
--- a/tests/ui/imports/import4.rs
+++ b/tests/ui/imports/import4.rs
@@ -1,7 +1,4 @@
-//@ error-pattern: import
-
-
 mod a { pub use b::foo; }
-mod b { pub use a::foo; }
+mod b { pub use a::foo; } //~ ERROR unresolved import `a::foo`
 
 fn main() { println!("loop"); }
diff --git a/tests/ui/imports/import4.stderr b/tests/ui/imports/import4.stderr
index c99e8385118..c979d6c9ae2 100644
--- a/tests/ui/imports/import4.stderr
+++ b/tests/ui/imports/import4.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `a::foo`
-  --> $DIR/import4.rs:5:17
+  --> $DIR/import4.rs:2:17
    |
 LL | mod b { pub use a::foo; }
    |                 ^^^^^^ no `foo` in `a`
diff --git a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
index e28b8f373da..f50c4a5207a 100644
--- a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
+++ b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
@@ -1,8 +1,6 @@
+//~ ERROR reached the recursion limit while instantiating `<VirtualWrapper<VirtualWrapper<VirtualWrapper
 //@ build-fail
 
-//@ error-pattern: reached the recursion limit while instantiating
-//@ error-pattern: reached the recursion limit finding the struct tail
-
 // Regression test for #114484: This used to ICE during monomorphization, because we treated
 // `<VirtualWrapper<...> as Pointee>::Metadata` as a rigid projection after reaching the recursion
 // limit when finding the struct tail.
@@ -73,3 +71,16 @@ fn main() {
     let test = SomeData([0; 256]);
     test.virtualize();
 }
+
+//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
diff --git a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr
index 475e26fd0f0..59addc5cc4a 100644
--- a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr
+++ b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr
@@ -18,7 +18,7 @@ error: reached the recursion limit finding the struct tail for `[u8; 256]`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:18
    |
 LL |         unsafe { virtualize_my_trait(L, self) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -43,7 +43,7 @@ error: reached the recursion limit finding the struct tail for `SomeData<256>`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:18
    |
 LL |         unsafe { virtualize_my_trait(L, self) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -68,7 +68,7 @@ error: reached the recursion limit finding the struct tail for `VirtualWrapper<S
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:18
    |
 LL |         unsafe { virtualize_my_trait(L, self) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -76,7 +76,7 @@ LL |         unsafe { virtualize_my_trait(L, self) }
 error: reached the recursion limit while instantiating `<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<..., 1>, 1>, 1>, 1>, 1> as MyTrait>::virtualize`
    |
 note: `<VirtualWrapper<T, L> as MyTrait>::virtualize` defined here
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:25:5
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:23:5
    |
 LL |     fn virtualize(&self) -> &dyn MyTrait {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/instrument-xray/flags-always-never-1.rs b/tests/ui/instrument-xray/flags-always-never-1.rs
index 91032662e6b..97f03fca102 100644
--- a/tests/ui/instrument-xray/flags-always-never-1.rs
+++ b/tests/ui/instrument-xray/flags-always-never-1.rs
@@ -2,6 +2,7 @@
 //
 //@ needs-xray
 //@ compile-flags: -Z instrument-xray=always,never
-//@ error-pattern: incorrect value `always,never` for unstable option `instrument-xray`
 
 fn main() {}
+
+//~? ERROR incorrect value `always,never` for unstable option `instrument-xray`
diff --git a/tests/ui/instrument-xray/flags-dupe-always.rs b/tests/ui/instrument-xray/flags-dupe-always.rs
index 41e4f267b47..e3a5b3b1c3e 100644
--- a/tests/ui/instrument-xray/flags-dupe-always.rs
+++ b/tests/ui/instrument-xray/flags-dupe-always.rs
@@ -2,6 +2,7 @@
 //
 //@ needs-xray
 //@ compile-flags: -Z instrument-xray=always,always
-//@ error-pattern: incorrect value `always,always` for unstable option `instrument-xray`
 
 fn main() {}
+
+//~? ERROR incorrect value `always,always` for unstable option `instrument-xray`
diff --git a/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs b/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
index ba5ea28d40b..648bd144632 100644
--- a/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
+++ b/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
@@ -2,6 +2,7 @@
 //
 //@ needs-xray
 //@ compile-flags: -Z instrument-xray=ignore-loops,ignore-loops
-//@ error-pattern: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`
 
 fn main() {}
+
+//~? ERROR incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`
diff --git a/tests/ui/instrument-xray/target-not-supported.rs b/tests/ui/instrument-xray/target-not-supported.rs
index cdae26f993d..2045913b186 100644
--- a/tests/ui/instrument-xray/target-not-supported.rs
+++ b/tests/ui/instrument-xray/target-not-supported.rs
@@ -2,8 +2,9 @@
 //
 //@ needs-llvm-components: x86
 //@ compile-flags: -Z instrument-xray --target x86_64-apple-darwin
-//@ error-pattern: error: XRay instrumentation is not supported for this target
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//~? ERROR XRay instrumentation is not supported for this target
diff --git a/tests/ui/internal/internal-unstable-noallow.rs b/tests/ui/internal/internal-unstable-noallow.rs
index 57ddb93d880..507eeebddc0 100644
--- a/tests/ui/internal/internal-unstable-noallow.rs
+++ b/tests/ui/internal/internal-unstable-noallow.rs
@@ -4,20 +4,18 @@
 // the // ~ form.
 
 //@ aux-build:internal_unstable.rs
-//@ error-pattern:use of unstable library feature `function`
-//@ error-pattern:use of unstable library feature `struct_field`
-//@ error-pattern:use of unstable library feature `method`
-//@ error-pattern:use of unstable library feature `struct2_field`
 
 #[macro_use]
 extern crate internal_unstable;
 
 fn main() {
-    call_unstable_noallow!();
+    call_unstable_noallow!(); //~ ERROR use of unstable library feature `function`
 
-    construct_unstable_noallow!(0);
+    construct_unstable_noallow!(0); //~ ERROR use of unstable library feature `struct_field`
 
     |x: internal_unstable::Foo| { call_method_noallow!(x) };
+    //~^ ERROR use of unstable library feature `method`
 
     |x: internal_unstable::Bar| { access_field_noallow!(x) };
+    //~^ ERROR use of unstable library feature `struct2_field`
 }
diff --git a/tests/ui/internal/internal-unstable-noallow.stderr b/tests/ui/internal/internal-unstable-noallow.stderr
index 22f42abbd11..2cc55022ef3 100644
--- a/tests/ui/internal/internal-unstable-noallow.stderr
+++ b/tests/ui/internal/internal-unstable-noallow.stderr
@@ -1,5 +1,5 @@
 error[E0658]: use of unstable library feature `function`
-  --> $DIR/internal-unstable-noallow.rs:16:5
+  --> $DIR/internal-unstable-noallow.rs:12:5
    |
 LL |     call_unstable_noallow!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL |     call_unstable_noallow!();
    = note: this error originates in the macro `call_unstable_noallow` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature `struct_field`
-  --> $DIR/internal-unstable-noallow.rs:18:5
+  --> $DIR/internal-unstable-noallow.rs:14:5
    |
 LL |     construct_unstable_noallow!(0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     construct_unstable_noallow!(0);
    = note: this error originates in the macro `construct_unstable_noallow` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature `method`
-  --> $DIR/internal-unstable-noallow.rs:20:35
+  --> $DIR/internal-unstable-noallow.rs:16:35
    |
 LL |     |x: internal_unstable::Foo| { call_method_noallow!(x) };
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     |x: internal_unstable::Foo| { call_method_noallow!(x) };
    = note: this error originates in the macro `call_method_noallow` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature `struct2_field`
-  --> $DIR/internal-unstable-noallow.rs:22:35
+  --> $DIR/internal-unstable-noallow.rs:19:35
    |
 LL |     |x: internal_unstable::Bar| { access_field_noallow!(x) };
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/invalid-compile-flags/crate-type-flag.rs b/tests/ui/invalid-compile-flags/crate-type-flag.rs
index 01014307149..8ccce97f7bf 100644
--- a/tests/ui/invalid-compile-flags/crate-type-flag.rs
+++ b/tests/ui/invalid-compile-flags/crate-type-flag.rs
@@ -45,16 +45,17 @@
 // `proc-macro` is accepted, but `proc_macro` is not.
 //@ revisions: proc_underscore_macro
 //@[proc_underscore_macro] compile-flags: --crate-type=proc_macro
-//@[proc_underscore_macro] error-pattern: unknown crate type: `proc_macro`
 
 // Empty `--crate-type` not accepted.
 //@ revisions: empty_crate_type
 //@[empty_crate_type] compile-flags: --crate-type=
-//@[empty_crate_type] error-pattern: unknown crate type: ``
 
 // Random unknown crate type. Also check that we can handle non-ASCII.
 //@ revisions: unknown
 //@[unknown] compile-flags: --crate-type=🤡
-//@[unknown] error-pattern: unknown crate type: `🤡`
 
 fn main() {}
+
+//[proc_underscore_macro]~? ERROR unknown crate type: `proc_macro`
+//[empty_crate_type]~? ERROR unknown crate type: ``
+//[unknown]~? ERROR unknown crate type: `🤡`
diff --git a/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs b/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs
index 6a4ecb9d839..c7973c686da 100644
--- a/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs
+++ b/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs
@@ -13,8 +13,9 @@
 //@[aarch64] check-fail
 //@[aarch64] needs-llvm-components: aarch64
 //@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
-//@[aarch64] error-pattern: `-Zfunction-return` (except `keep`) is only supported on x86 and x86_64
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//[aarch64]~? ERROR `-Zfunction-return` (except `keep`) is only supported on x86 and x86_64
diff --git a/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs b/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs
index f4be36e08f0..fa3958c1f98 100644
--- a/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs
+++ b/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs
@@ -14,8 +14,9 @@
 
 //@[large] check-fail
 //@[large] compile-flags: -Ccode-model=large
-//@[large] error-pattern: `-Zfunction-return=thunk-extern` is only supported on non-large code models
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//[large]~? ERROR `-Zfunction-return=thunk-extern` is only supported on non-large code models
diff --git a/tests/ui/invalid-compile-flags/reg-struct-return/requires-x86.rs b/tests/ui/invalid-compile-flags/reg-struct-return/requires-x86.rs
index b5e34bece32..436442ee729 100644
--- a/tests/ui/invalid-compile-flags/reg-struct-return/requires-x86.rs
+++ b/tests/ui/invalid-compile-flags/reg-struct-return/requires-x86.rs
@@ -9,13 +9,14 @@
 //@[x86_64] check-fail
 //@[x86_64] needs-llvm-components: x86
 //@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
-//@[x86_64] error-pattern: `-Zreg-struct-return` is only supported on x86
 
 //@[aarch64] check-fail
 //@[aarch64] needs-llvm-components: aarch64
 //@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
-//@[aarch64] error-pattern: `-Zreg-struct-return` is only supported on x86
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//[x86_64]~? ERROR `-Zreg-struct-return` is only supported on x86
+//[aarch64]~? ERROR `-Zreg-struct-return` is only supported on x86
diff --git a/tests/ui/invalid-compile-flags/regparm/regparm-valid-values.rs b/tests/ui/invalid-compile-flags/regparm/regparm-valid-values.rs
index b548d678520..a66dfe85977 100644
--- a/tests/ui/invalid-compile-flags/regparm/regparm-valid-values.rs
+++ b/tests/ui/invalid-compile-flags/regparm/regparm-valid-values.rs
@@ -17,8 +17,9 @@
 
 //@[regparm4] check-fail
 //@[regparm4] compile-flags: -Zregparm=4
-//@[regparm4] error-pattern: `-Zregparm=4` is unsupported (valid values 0-3)
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//[regparm4]~? ERROR `-Zregparm=4` is unsupported (valid values 0-3)
diff --git a/tests/ui/invalid-compile-flags/regparm/requires-x86.rs b/tests/ui/invalid-compile-flags/regparm/requires-x86.rs
index ce6e437fb47..32c4b5af357 100644
--- a/tests/ui/invalid-compile-flags/regparm/requires-x86.rs
+++ b/tests/ui/invalid-compile-flags/regparm/requires-x86.rs
@@ -9,13 +9,14 @@
 //@[x86_64] check-fail
 //@[x86_64] needs-llvm-components: x86
 //@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
-//@[x86_64] error-pattern: `-Zregparm=N` is only supported on x86
 
 //@[aarch64] check-fail
 //@[aarch64] needs-llvm-components: aarch64
 //@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
-//@[aarch64] error-pattern: `-Zregparm=N` is only supported on x86
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//[x86_64]~? ERROR `-Zregparm=N` is only supported on x86
+//[aarch64]~? ERROR `-Zregparm=N` is only supported on x86
diff --git a/tests/ui/invalid/issue-114435-layout-type-err.rs b/tests/ui/invalid/issue-114435-layout-type-err.rs
index 2a86839e416..07f310478d3 100644
--- a/tests/ui/invalid/issue-114435-layout-type-err.rs
+++ b/tests/ui/invalid/issue-114435-layout-type-err.rs
@@ -1,6 +1,5 @@
 //@ check-fail
 //@ compile-flags: --crate-type lib -Cdebuginfo=2
-//@ error-pattern: recursion limit
 
 #![recursion_limit = "10"]
 macro_rules! link {
@@ -41,3 +40,5 @@ link!(J, K);
 link!(K, Bottom);
 
 fn main() {}
+
+//~? ERROR reached the recursion limit finding the struct tail for `Bottom`
diff --git a/tests/ui/io-checks/non-ice-error-on-worker-io-fail.rs b/tests/ui/io-checks/non-ice-error-on-worker-io-fail.rs
index 7cae77eb67f..5a5d0086aa9 100644
--- a/tests/ui/io-checks/non-ice-error-on-worker-io-fail.rs
+++ b/tests/ui/io-checks/non-ice-error-on-worker-io-fail.rs
@@ -16,8 +16,6 @@
 // rely on the checking of the normalized stderr output as our actual
 // "verification" of the diagnostic).
 
-//@ error-pattern: error
-
 // On Mac OS X, we get an error like the below
 //@ normalize-stderr: "failed to write bytecode to ./does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying ./does-not-exist/"
 
@@ -29,3 +27,5 @@
 //@ ignore-arm - the file-system issues do not replicate here, at least on armhf-gnu
 
 #![crate_type = "lib"]
+
+//~? ERROR /does-not-exist/
diff --git a/tests/ui/issues/issue-37131.rs b/tests/ui/issues/issue-37131.rs
index 3ea14672e23..16681ac21d1 100644
--- a/tests/ui/issues/issue-37131.rs
+++ b/tests/ui/issues/issue-37131.rs
@@ -1,3 +1,4 @@
+//~ ERROR can't find crate for `std`
 // Tests that compiling for a target which is not installed will result in a helpful
 // error message.
 
diff --git a/tests/ui/lang-items/lang-item-missing.rs b/tests/ui/lang-items/lang-item-missing.rs
index 5b832a5bb8f..75e203d04f2 100644
--- a/tests/ui/lang-items/lang-item-missing.rs
+++ b/tests/ui/lang-items/lang-item-missing.rs
@@ -1,13 +1,11 @@
 // Test that a missing lang item (in this case `sized`) does not cause an ICE,
 // see #17392.
 
-//@ error-pattern: requires `sized` lang_item
-
 #![feature(lang_items, no_core)]
 #![no_core]
 #![no_main]
 
 #[no_mangle]
-extern "C" fn main(_argc: i32, _argv: *const *const u8) -> i32 {
+extern "C" fn main(_argc: i32, _argv: *const *const u8) -> i32 { //~ ERROR requires `sized` lang_item
     loop {}
 }
diff --git a/tests/ui/lang-items/lang-item-missing.stderr b/tests/ui/lang-items/lang-item-missing.stderr
index 63bca95adf7..85e9eaafe72 100644
--- a/tests/ui/lang-items/lang-item-missing.stderr
+++ b/tests/ui/lang-items/lang-item-missing.stderr
@@ -1,5 +1,5 @@
 error: requires `sized` lang_item
-  --> $DIR/lang-item-missing.rs:11:60
+  --> $DIR/lang-item-missing.rs:9:60
    |
 LL | extern "C" fn main(_argc: i32, _argv: *const *const u8) -> i32 {
    |                                                            ^^^
diff --git a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs b/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs
index 9b634ee8ee3..f92a00e602c 100644
--- a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs
+++ b/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs
@@ -1,5 +1,3 @@
-//@ error-pattern: requires `copy` lang_item
-
 #![feature(lang_items, no_core)]
 #![no_core]
 #![no_main]
@@ -11,5 +9,5 @@ struct S;
 
 #[no_mangle]
 extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
-    argc
+    argc //~ ERROR requires `copy` lang_item
 }
diff --git a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr b/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr
index 3dc7716ecd2..9b25b1db292 100644
--- a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr
+++ b/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr
@@ -1,5 +1,5 @@
 error: requires `copy` lang_item
-  --> $DIR/missing-copy-lang-item-issue-19660.rs:14:5
+  --> $DIR/missing-copy-lang-item-issue-19660.rs:12:5
    |
 LL |     argc
    |     ^^^^
diff --git a/tests/ui/layout/size-of-val-raw-too-big.rs b/tests/ui/layout/size-of-val-raw-too-big.rs
index dfca6d6eb76..566b01255fa 100644
--- a/tests/ui/layout/size-of-val-raw-too-big.rs
+++ b/tests/ui/layout/size-of-val-raw-too-big.rs
@@ -1,7 +1,8 @@
+//~ ERROR values of the type `Example` are too big for the target architecture
 //@ build-fail
 //@ compile-flags: --crate-type lib
 //@ only-32bit Layout computation rejects this layout for different reasons on 64-bit.
-//@ error-pattern: too big for the target architecture
+
 #![feature(core_intrinsics)]
 #![allow(internal_features)]
 
diff --git a/tests/ui/layout/unknown-when-no-type-parameter.rs b/tests/ui/layout/unknown-when-no-type-parameter.rs
index 94c32cf262f..500b7938eeb 100644
--- a/tests/ui/layout/unknown-when-no-type-parameter.rs
+++ b/tests/ui/layout/unknown-when-no-type-parameter.rs
@@ -1,6 +1,5 @@
 #![feature(trivial_bounds)]
 
-//@ error-pattern: error[E0080]: evaluation of constant value failed
 //@ error-pattern: the type `<() as Project>::Assoc` has an unknown layout
 
 trait Project {
@@ -8,7 +7,7 @@ trait Project {
 }
 
 fn foo() where (): Project {
-    [(); size_of::<<() as Project>::Assoc>()];
+    [(); size_of::<<() as Project>::Assoc>()]; //~ ERROR evaluation of constant value failed
 }
 
 fn main() {}
diff --git a/tests/ui/layout/unknown-when-no-type-parameter.stderr b/tests/ui/layout/unknown-when-no-type-parameter.stderr
index 9e414d224bb..a2dbb191ee2 100644
--- a/tests/ui/layout/unknown-when-no-type-parameter.stderr
+++ b/tests/ui/layout/unknown-when-no-type-parameter.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/unknown-when-no-type-parameter.rs:11:10
+  --> $DIR/unknown-when-no-type-parameter.rs:10:10
    |
 LL |     [(); size_of::<<() as Project>::Assoc>()];
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `<() as Project>::Assoc` has an unknown layout
diff --git a/tests/ui/limits/issue-17913.rs b/tests/ui/limits/issue-17913.rs
index 5407902daba..85deab4bc4c 100644
--- a/tests/ui/limits/issue-17913.rs
+++ b/tests/ui/limits/issue-17913.rs
@@ -1,6 +1,5 @@
 //@ build-fail
 //@ normalize-stderr: "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
-//@ error-pattern: too big for the target architecture
 
 #[cfg(target_pointer_width = "64")]
 fn main() {
@@ -15,3 +14,5 @@ fn main() {
     let a: Box<_> = Box::new([&n; 0xFFFFFFFF_usize]);
     println!("{}", a[0xFFFFFF_usize]);
 }
+
+//~? ERROR are too big for the target architecture
diff --git a/tests/ui/limits/issue-55878.rs b/tests/ui/limits/issue-55878.rs
index db4a2724452..614ff328bf5 100644
--- a/tests/ui/limits/issue-55878.rs
+++ b/tests/ui/limits/issue-55878.rs
@@ -1,6 +1,6 @@
 //@ build-fail
 
-//@ error-pattern: are too big for the target architecture
 fn main() {
     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
+    //~^ ERROR evaluation of constant value failed
 }
diff --git a/tests/ui/limits/issue-55878.stderr b/tests/ui/limits/issue-55878.stderr
index d705b3daf79..9b3922d7933 100644
--- a/tests/ui/limits/issue-55878.stderr
+++ b/tests/ui/limits/issue-55878.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-55878.rs:5:26
+  --> $DIR/issue-55878.rs:4:26
    |
 LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; usize::MAX]` are too big for the target architecture
diff --git a/tests/ui/link-native-libs/empty-kind-1.rs b/tests/ui/link-native-libs/empty-kind-1.rs
index d9b8d8a7f7d..04e7e3c2c7b 100644
--- a/tests/ui/link-native-libs/empty-kind-1.rs
+++ b/tests/ui/link-native-libs/empty-kind-1.rs
@@ -1,6 +1,7 @@
 // Unspecified kind should fail with an error
 
 //@ compile-flags: -l =mylib
-//@ error-pattern: unknown library kind ``, expected one of: static, dylib, framework, link-arg
 
 fn main() {}
+
+//~? ERROR unknown library kind ``
diff --git a/tests/ui/link-native-libs/empty-kind-2.rs b/tests/ui/link-native-libs/empty-kind-2.rs
index 16cb3b917e4..1436c086dfd 100644
--- a/tests/ui/link-native-libs/empty-kind-2.rs
+++ b/tests/ui/link-native-libs/empty-kind-2.rs
@@ -1,6 +1,7 @@
 // Unspecified kind should fail with an error
 
 //@ compile-flags: -l :+bundle=mylib
-//@ error-pattern: unknown library kind ``, expected one of: static, dylib, framework, link-arg
 
 fn main() {}
+
+//~? ERROR unknown library kind ``
diff --git a/tests/ui/link-native-libs/link-arg-error.rs b/tests/ui/link-native-libs/link-arg-error.rs
index 4defb108178..9d9dcc27ccb 100644
--- a/tests/ui/link-native-libs/link-arg-error.rs
+++ b/tests/ui/link-native-libs/link-arg-error.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: -l link-arg:+bundle=arg -Z unstable-options
-//@ error-pattern: linking modifier `bundle` is only compatible with `static` linking kind
 
 fn main() {}
+
+//~? ERROR linking modifier `bundle` is only compatible with `static` linking kind
diff --git a/tests/ui/link-native-libs/manual-link-bad-form.rs b/tests/ui/link-native-libs/manual-link-bad-form.rs
index 0f5723adec9..71e80c60dec 100644
--- a/tests/ui/link-native-libs/manual-link-bad-form.rs
+++ b/tests/ui/link-native-libs/manual-link-bad-form.rs
@@ -1,5 +1,6 @@
 //@ compile-flags:-l static=
-//@ error-pattern: library name must not be empty
 
 fn main() {
 }
+
+//~? ERROR library name must not be empty
diff --git a/tests/ui/link-native-libs/manual-link-bad-kind.rs b/tests/ui/link-native-libs/manual-link-bad-kind.rs
index d070faa6574..8b5f478e80a 100644
--- a/tests/ui/link-native-libs/manual-link-bad-kind.rs
+++ b/tests/ui/link-native-libs/manual-link-bad-kind.rs
@@ -1,5 +1,6 @@
 //@ compile-flags:-l bar=foo
-//@ error-pattern: unknown library kind `bar`, expected one of: static, dylib, framework, link-arg
 
 fn main() {
 }
+
+//~? ERROR unknown library kind `bar`
diff --git a/tests/ui/link-native-libs/manual-link-bad-search-path.rs b/tests/ui/link-native-libs/manual-link-bad-search-path.rs
index c9ced4734fc..cc4a5ef2267 100644
--- a/tests/ui/link-native-libs/manual-link-bad-search-path.rs
+++ b/tests/ui/link-native-libs/manual-link-bad-search-path.rs
@@ -1,5 +1,6 @@
 //@ compile-flags:-L native=
-//@ error-pattern: empty search path given via `-L`
 
 fn main() {
 }
+
+//~? ERROR empty search path given via `-L`
diff --git a/tests/ui/link-native-libs/manual-link-framework.rs b/tests/ui/link-native-libs/manual-link-framework.rs
index 43cdda0a4e6..b3c3d6a7c3c 100644
--- a/tests/ui/link-native-libs/manual-link-framework.rs
+++ b/tests/ui/link-native-libs/manual-link-framework.rs
@@ -1,5 +1,6 @@
 //@ ignore-apple
 //@ compile-flags:-l framework=foo
-//@ error-pattern: library kind `framework` is only supported on Apple targets
 
 fn main() {}
+
+//~? ERROR library kind `framework` is only supported on Apple targets
diff --git a/tests/ui/link-native-libs/manual-link-unsupported-kind.rs b/tests/ui/link-native-libs/manual-link-unsupported-kind.rs
index b5b9e3e6577..3dfe9bdebc5 100644
--- a/tests/ui/link-native-libs/manual-link-unsupported-kind.rs
+++ b/tests/ui/link-native-libs/manual-link-unsupported-kind.rs
@@ -1,5 +1,6 @@
 //@ compile-flags:-l raw-dylib=foo
-//@ error-pattern: unknown library kind `raw-dylib`, expected one of: static, dylib, framework, link-arg
 
 fn main() {
 }
+
+//~? ERROR unknown library kind `raw-dylib`
diff --git a/tests/ui/link-native-libs/modifiers-override-3.rs b/tests/ui/link-native-libs/modifiers-override-3.rs
index d05735ad616..3d269dbd812 100644
--- a/tests/ui/link-native-libs/modifiers-override-3.rs
+++ b/tests/ui/link-native-libs/modifiers-override-3.rs
@@ -2,6 +2,7 @@
 // overrides another command line library with modifiers.
 
 //@ compile-flags:-lstatic:+whole-archive=foo -lstatic:+whole-archive=foo
-//@ error-pattern: overriding linking modifiers from command line is not supported
 
 fn main() {}
+
+//~? ERROR overriding linking modifiers from command line is not supported
diff --git a/tests/ui/link-native-libs/suggest-libname-only-1.rs b/tests/ui/link-native-libs/suggest-libname-only-1.rs
index 328181fb5cb..4ccfa086bde 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-1.rs
+++ b/tests/ui/link-native-libs/suggest-libname-only-1.rs
@@ -1,9 +1,10 @@
 //@ build-fail
 //@ compile-flags: --crate-type rlib
-//@ error-pattern: could not find native static library `libfoo.a`
 //@ error-pattern: only provide the library name `foo`, not the full filename
 
 #[link(name = "libfoo.a", kind = "static")]
-extern { }
+extern { } //~ WARN extern declarations without an explicit ABI are deprecated
 
 pub fn main() { }
+
+//~? ERROR could not find native static library `libfoo.a`
diff --git a/tests/ui/link-native-libs/suggest-libname-only-1.stderr b/tests/ui/link-native-libs/suggest-libname-only-1.stderr
index 47f7d92c9f9..85a3599e8db 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-1.stderr
+++ b/tests/ui/link-native-libs/suggest-libname-only-1.stderr
@@ -1,5 +1,5 @@
 warning: extern declarations without an explicit ABI are deprecated
-  --> $DIR/suggest-libname-only-1.rs:7:1
+  --> $DIR/suggest-libname-only-1.rs:6:1
    |
 LL | extern { }
    | ^^^^^^ help: explicitly specify the "C" ABI: `extern "C"`
diff --git a/tests/ui/link-native-libs/suggest-libname-only-2.rs b/tests/ui/link-native-libs/suggest-libname-only-2.rs
index 7ed106e4ab4..c35b4a674b7 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-2.rs
+++ b/tests/ui/link-native-libs/suggest-libname-only-2.rs
@@ -1,9 +1,10 @@
 //@ build-fail
 //@ compile-flags: --crate-type rlib
-//@ error-pattern: could not find native static library `bar.lib`
 //@ error-pattern: only provide the library name `bar`, not the full filename
 
 #[link(name = "bar.lib", kind = "static")]
-extern { }
+extern { } //~ WARN extern declarations without an explicit ABI are deprecated
 
 pub fn main() { }
+
+//~? ERROR could not find native static library `bar.lib`
diff --git a/tests/ui/link-native-libs/suggest-libname-only-2.stderr b/tests/ui/link-native-libs/suggest-libname-only-2.stderr
index a2d8f4c8191..d5c88931ad5 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-2.stderr
+++ b/tests/ui/link-native-libs/suggest-libname-only-2.stderr
@@ -1,5 +1,5 @@
 warning: extern declarations without an explicit ABI are deprecated
-  --> $DIR/suggest-libname-only-2.rs:7:1
+  --> $DIR/suggest-libname-only-2.rs:6:1
    |
 LL | extern { }
    | ^^^^^^ help: explicitly specify the "C" ABI: `extern "C"`
diff --git a/tests/ui/linkage-attr/incompatible-flavor.rs b/tests/ui/linkage-attr/incompatible-flavor.rs
index acf720bc97a..7f583f47e2f 100644
--- a/tests/ui/linkage-attr/incompatible-flavor.rs
+++ b/tests/ui/linkage-attr/incompatible-flavor.rs
@@ -1,6 +1,7 @@
 //@ compile-flags: --target=x86_64-unknown-linux-gnu -C linker-flavor=msvc --crate-type=rlib
-//@ error-pattern: linker flavor `msvc` is incompatible with the current target
 //@ needs-llvm-components:
 
 #![feature(no_core)]
 #![no_core]
+
+//~? ERROR linker flavor `msvc` is incompatible with the current target
diff --git a/tests/ui/linkage-attr/issue-10755.rs b/tests/ui/linkage-attr/issue-10755.rs
index 58d5b5ead57..509f484adf8 100644
--- a/tests/ui/linkage-attr/issue-10755.rs
+++ b/tests/ui/linkage-attr/issue-10755.rs
@@ -1,10 +1,11 @@
 //@ build-fail
 //@ dont-check-compiler-stderr
 //@ compile-flags: -C linker=llllll
-//@ error-pattern: `llllll`
 
 // Before, the error-pattern checked for "not found". On WSL with appendWindowsPath=true, running
 // in invalid command returns a PermissionDenied instead.
 
 fn main() {
 }
+
+//~? ERROR `llllll`
diff --git a/tests/ui/linkage-attr/raw-dylib/elf/multiple-libraries.rs b/tests/ui/linkage-attr/raw-dylib/elf/multiple-libraries.rs
index f4715ff2d3d..030b95198f5 100644
--- a/tests/ui/linkage-attr/raw-dylib/elf/multiple-libraries.rs
+++ b/tests/ui/linkage-attr/raw-dylib/elf/multiple-libraries.rs
@@ -35,3 +35,5 @@ fn main() {
   meooooooooooooooow();
   woooooooooooooooooof();
 }
+
+//[without]~? ERROR linking with `
diff --git a/tests/ui/linkage-attr/raw-dylib/elf/single-symbol.rs b/tests/ui/linkage-attr/raw-dylib/elf/single-symbol.rs
index fe9c7884e54..20de4afcee0 100644
--- a/tests/ui/linkage-attr/raw-dylib/elf/single-symbol.rs
+++ b/tests/ui/linkage-attr/raw-dylib/elf/single-symbol.rs
@@ -26,3 +26,5 @@ unsafe extern "C" {
 fn main() {
   meooooooooooooooow();
 }
+
+//[without]~? ERROR linking with `
diff --git a/tests/ui/linkage-attr/raw-dylib/elf/verbatim.rs b/tests/ui/linkage-attr/raw-dylib/elf/verbatim.rs
index 72cba18d841..302ec0edeaa 100644
--- a/tests/ui/linkage-attr/raw-dylib/elf/verbatim.rs
+++ b/tests/ui/linkage-attr/raw-dylib/elf/verbatim.rs
@@ -27,3 +27,5 @@ unsafe extern "C" {
 fn main() {
   meooooooooooooooow();
 }
+
+//[without]~? ERROR linking with `
diff --git a/tests/ui/linkage-attr/unstable-flavor.rs b/tests/ui/linkage-attr/unstable-flavor.rs
index 82d9dff3874..6aa9efb58d1 100644
--- a/tests/ui/linkage-attr/unstable-flavor.rs
+++ b/tests/ui/linkage-attr/unstable-flavor.rs
@@ -4,11 +4,12 @@
 //
 //@ revisions: bpf ptx
 //@ [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf --crate-type=rlib
-//@ [bpf] error-pattern: linker flavor `bpf` is unstable, the `-Z unstable-options` flag
 //@ [bpf] needs-llvm-components:
 //@ [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx --crate-type=rlib
-//@ [ptx] error-pattern: linker flavor `ptx` is unstable, the `-Z unstable-options` flag
 //@ [ptx] needs-llvm-components:
 
 #![feature(no_core)]
 #![no_core]
+
+//[bpf]~? ERROR the linker flavor `bpf` is unstable
+//[ptx]~? ERROR the linker flavor `ptx` is unstable
diff --git a/tests/ui/lint/bad-lint-cap.rs b/tests/ui/lint/bad-lint-cap.rs
index aab3f723796..c219cb1b665 100644
--- a/tests/ui/lint/bad-lint-cap.rs
+++ b/tests/ui/lint/bad-lint-cap.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: --cap-lints test
-//@ error-pattern: unknown lint level: `test`
 
 fn main() {}
+
+//~? ERROR unknown lint level: `test`
diff --git a/tests/ui/lint/cli-unknown-force-warn.rs b/tests/ui/lint/cli-unknown-force-warn.rs
index 007f8dd8732..330d5570e21 100644
--- a/tests/ui/lint/cli-unknown-force-warn.rs
+++ b/tests/ui/lint/cli-unknown-force-warn.rs
@@ -4,8 +4,11 @@
 //@ check-pass
 //@ compile-flags: --force-warn foo-qux
 
-//@ error-pattern: unknown lint: `foo_qux`
 //@ error-pattern: requested on the command line with `--force-warn foo_qux`
 //@ error-pattern: `#[warn(unknown_lints)]` on by default
 
 fn main() {}
+
+//~? WARN unknown lint: `foo_qux`
+//~? WARN unknown lint: `foo_qux`
+//~? WARN unknown lint: `foo_qux`
diff --git a/tests/ui/lint/command-line-register-unknown-lint-tool.rs b/tests/ui/lint/command-line-register-unknown-lint-tool.rs
index b4e9a067fe2..a517f4c7ea6 100644
--- a/tests/ui/lint/command-line-register-unknown-lint-tool.rs
+++ b/tests/ui/lint/command-line-register-unknown-lint-tool.rs
@@ -1,4 +1,7 @@
 //@ compile-flags: -A unknown_tool::foo
-//@ error-pattern: unknown lint tool: `unknown_tool`
 
 fn main() {}
+
+//~? ERROR unknown lint tool: `unknown_tool`
+//~? ERROR unknown lint tool: `unknown_tool`
+//~? ERROR unknown lint tool: `unknown_tool`
diff --git a/tests/ui/lint/force-warn/warnings-lint-group.rs b/tests/ui/lint/force-warn/warnings-lint-group.rs
index 944070527a1..28de42639d3 100644
--- a/tests/ui/lint/force-warn/warnings-lint-group.rs
+++ b/tests/ui/lint/force-warn/warnings-lint-group.rs
@@ -1,5 +1,8 @@
 // --force-warn warnings is an error
 //@ compile-flags: --force-warn warnings
-//@ error-pattern: `warnings` lint group is not supported
 
 fn main() {}
+
+//~? ERROR `warnings` lint group is not supported with ´--force-warn´
+//~? ERROR `warnings` lint group is not supported with ´--force-warn´
+//~? ERROR `warnings` lint group is not supported with ´--force-warn´
diff --git a/tests/ui/lint/issue-104897.rs b/tests/ui/lint/issue-104897.rs
index 3cfe94bbd22..99bc1cf3a42 100644
--- a/tests/ui/lint/issue-104897.rs
+++ b/tests/ui/lint/issue-104897.rs
@@ -1,5 +1,2 @@
-//@ error-pattern: this file contains an unclosed delimiter
-//@ error-pattern: this file contains an unclosed delimiter
-//@ error-pattern: this file contains an unclosed delimiter
-
+//~v ERROR this file contains an unclosed delimiter
 fn f(){(print!(á
diff --git a/tests/ui/lint/issue-104897.stderr b/tests/ui/lint/issue-104897.stderr
index 584902ee4c0..ebc794bfb73 100644
--- a/tests/ui/lint/issue-104897.stderr
+++ b/tests/ui/lint/issue-104897.stderr
@@ -1,5 +1,5 @@
 error: this file contains an unclosed delimiter
-  --> $DIR/issue-104897.rs:5:18
+  --> $DIR/issue-104897.rs:2:18
    |
 LL | fn f(){(print!(á
    |       --      - ^
diff --git a/tests/ui/lint/lint-pre-expansion-extern-module.rs b/tests/ui/lint/lint-pre-expansion-extern-module.rs
index b76879ccbb8..f1ab0cf3b74 100644
--- a/tests/ui/lint/lint-pre-expansion-extern-module.rs
+++ b/tests/ui/lint/lint-pre-expansion-extern-module.rs
@@ -1,7 +1,9 @@
 //@ check-pass
 //@ compile-flags: -W rust-2018-compatibility
-//@ error-pattern: `try` is a keyword in the 2018 edition
 
 fn main() {}
 
 mod lint_pre_expansion_extern_module_aux;
+
+//~? WARN `try` is a keyword in the 2018 edition
+//~? WARN this is accepted in the current edition
diff --git a/tests/ui/lint/lint-removed-cmdline-deny.rs b/tests/ui/lint/lint-removed-cmdline-deny.rs
index e56a95d292a..6616781d5cb 100644
--- a/tests/ui/lint/lint-removed-cmdline-deny.rs
+++ b/tests/ui/lint/lint-removed-cmdline-deny.rs
@@ -3,11 +3,14 @@
 
 //@ compile-flags:-D renamed-and-removed-lints -D raw_pointer_derive
 
-//@ error-pattern:lint `raw_pointer_derive` has been removed
 //@ error-pattern:requested on the command line with `-D raw_pointer_derive`
 //@ error-pattern:requested on the command line with `-D renamed-and-removed-lints`
 
 #![warn(unused)]
 
 #[deny(warnings)]
-fn main() { let unused = (); }
+fn main() { let unused = (); } //~ ERROR unused variable: `unused`
+
+//~? ERROR lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
+//~? ERROR lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
+//~? ERROR lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
diff --git a/tests/ui/lint/lint-removed-cmdline-deny.stderr b/tests/ui/lint/lint-removed-cmdline-deny.stderr
index 3321afa7fcd..27a3504a16a 100644
--- a/tests/ui/lint/lint-removed-cmdline-deny.stderr
+++ b/tests/ui/lint/lint-removed-cmdline-deny.stderr
@@ -14,13 +14,13 @@ error: lint `raw_pointer_derive` has been removed: using derive with raw pointer
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-removed-cmdline-deny.rs:13:17
+  --> $DIR/lint-removed-cmdline-deny.rs:12:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-removed-cmdline-deny.rs:12:8
+  --> $DIR/lint-removed-cmdline-deny.rs:11:8
    |
 LL | #[deny(warnings)]
    |        ^^^^^^^^
diff --git a/tests/ui/lint/lint-removed-cmdline.rs b/tests/ui/lint/lint-removed-cmdline.rs
index 3c9d3eb8e7b..4dde3dbc381 100644
--- a/tests/ui/lint/lint-removed-cmdline.rs
+++ b/tests/ui/lint/lint-removed-cmdline.rs
@@ -3,11 +3,14 @@
 
 //@ compile-flags:-D raw_pointer_derive
 
-//@ error-pattern:lint `raw_pointer_derive` has been removed
 //@ error-pattern:`#[warn(renamed_and_removed_lints)]` on by default
 //@ error-pattern:requested on the command line with `-D raw_pointer_derive`
 
 #![warn(unused)]
 
 #[deny(warnings)]
-fn main() { let unused = (); }
+fn main() { let unused = (); } //~ ERROR unused variable: `unused`
+
+//~? WARN lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
+//~? WARN lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
+//~? WARN lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
diff --git a/tests/ui/lint/lint-removed-cmdline.stderr b/tests/ui/lint/lint-removed-cmdline.stderr
index fd63433c308..7994f9bcfd9 100644
--- a/tests/ui/lint/lint-removed-cmdline.stderr
+++ b/tests/ui/lint/lint-removed-cmdline.stderr
@@ -14,13 +14,13 @@ warning: lint `raw_pointer_derive` has been removed: using derive with raw point
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-removed-cmdline.rs:13:17
+  --> $DIR/lint-removed-cmdline.rs:12:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-removed-cmdline.rs:12:8
+  --> $DIR/lint-removed-cmdline.rs:11:8
    |
 LL | #[deny(warnings)]
    |        ^^^^^^^^
diff --git a/tests/ui/lint/lint-renamed-cmdline-deny.rs b/tests/ui/lint/lint-renamed-cmdline-deny.rs
index 13500d006f8..0ea4ce40817 100644
--- a/tests/ui/lint/lint-renamed-cmdline-deny.rs
+++ b/tests/ui/lint/lint-renamed-cmdline-deny.rs
@@ -1,10 +1,12 @@
 //@ compile-flags:-D renamed-and-removed-lints -D bare_trait_object
 
-//@ error-pattern:lint `bare_trait_object` has been renamed to `bare_trait_objects`
 //@ error-pattern:use the new name `bare_trait_objects`
 //@ error-pattern:requested on the command line with `-D bare_trait_object`
 //@ error-pattern:requested on the command line with `-D renamed-and-removed-lints`
-//@ error-pattern:unused
 
 #[deny(unused)]
-fn main() { let unused = (); }
+fn main() { let unused = (); } //~ ERROR unused variable: `unused`
+
+//~? ERROR lint `bare_trait_object` has been renamed to `bare_trait_objects`
+//~? ERROR lint `bare_trait_object` has been renamed to `bare_trait_objects`
+//~? ERROR lint `bare_trait_object` has been renamed to `bare_trait_objects`
diff --git a/tests/ui/lint/lint-renamed-cmdline-deny.stderr b/tests/ui/lint/lint-renamed-cmdline-deny.stderr
index 0e182a4e5de..a49cdc84f9e 100644
--- a/tests/ui/lint/lint-renamed-cmdline-deny.stderr
+++ b/tests/ui/lint/lint-renamed-cmdline-deny.stderr
@@ -17,13 +17,13 @@ error: lint `bare_trait_object` has been renamed to `bare_trait_objects`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-renamed-cmdline-deny.rs:10:17
+  --> $DIR/lint-renamed-cmdline-deny.rs:8:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-renamed-cmdline-deny.rs:9:8
+  --> $DIR/lint-renamed-cmdline-deny.rs:7:8
    |
 LL | #[deny(unused)]
    |        ^^^^^^
diff --git a/tests/ui/lint/lint-renamed-cmdline.rs b/tests/ui/lint/lint-renamed-cmdline.rs
index 7adea98a609..45df7b6d640 100644
--- a/tests/ui/lint/lint-renamed-cmdline.rs
+++ b/tests/ui/lint/lint-renamed-cmdline.rs
@@ -1,9 +1,11 @@
 //@ compile-flags:-D bare_trait_object
 
-//@ error-pattern:lint `bare_trait_object` has been renamed to `bare_trait_objects`
 //@ error-pattern:requested on the command line with `-D bare_trait_object`
 //@ error-pattern:`#[warn(renamed_and_removed_lints)]` on by default
-//@ error-pattern:unused
 
 #[deny(unused)]
-fn main() { let unused = (); }
+fn main() { let unused = (); } //~ ERROR unused variable: `unused`
+
+//~? WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
+//~? WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
+//~? WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
diff --git a/tests/ui/lint/lint-renamed-cmdline.stderr b/tests/ui/lint/lint-renamed-cmdline.stderr
index d6bb72f34dc..901e7a642d1 100644
--- a/tests/ui/lint/lint-renamed-cmdline.stderr
+++ b/tests/ui/lint/lint-renamed-cmdline.stderr
@@ -17,13 +17,13 @@ warning: lint `bare_trait_object` has been renamed to `bare_trait_objects`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-renamed-cmdline.rs:9:17
+  --> $DIR/lint-renamed-cmdline.rs:7:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-renamed-cmdline.rs:8:8
+  --> $DIR/lint-renamed-cmdline.rs:6:8
    |
 LL | #[deny(unused)]
    |        ^^^^^^
diff --git a/tests/ui/lint/lint-stability2.rs b/tests/ui/lint/lint-stability2.rs
index 254ec8f9bee..056ff5a3e0a 100644
--- a/tests/ui/lint/lint-stability2.rs
+++ b/tests/ui/lint/lint-stability2.rs
@@ -1,5 +1,4 @@
 //@ aux-build:lint_stability.rs
-//@ error-pattern: use of deprecated function
 
 #![deny(deprecated)]
 
@@ -9,5 +8,5 @@ extern crate lint_stability;
 use lint_stability::*;
 
 fn main() {
-    macro_test!();
+    macro_test!(); //~ ERROR use of deprecated function `lint_stability::deprecated`: text
 }
diff --git a/tests/ui/lint/lint-stability2.stderr b/tests/ui/lint/lint-stability2.stderr
index 3df0c428167..fa1bce716fc 100644
--- a/tests/ui/lint/lint-stability2.stderr
+++ b/tests/ui/lint/lint-stability2.stderr
@@ -1,11 +1,11 @@
 error: use of deprecated function `lint_stability::deprecated`: text
-  --> $DIR/lint-stability2.rs:12:5
+  --> $DIR/lint-stability2.rs:11:5
    |
 LL |     macro_test!();
    |     ^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/lint-stability2.rs:4:9
+  --> $DIR/lint-stability2.rs:3:9
    |
 LL | #![deny(deprecated)]
    |         ^^^^^^^^^^
diff --git a/tests/ui/lint/lint-stability3.rs b/tests/ui/lint/lint-stability3.rs
index 3c5652ae030..1ca346f746a 100644
--- a/tests/ui/lint/lint-stability3.rs
+++ b/tests/ui/lint/lint-stability3.rs
@@ -1,5 +1,4 @@
 //@ aux-build:lint_stability.rs
-//@ error-pattern: use of deprecated function
 
 #![deny(deprecated)]
 #![allow(warnings)]
@@ -11,4 +10,5 @@ use lint_stability::*;
 
 fn main() {
     macro_test_arg_nested!(deprecated_text);
+    //~^ ERROR use of deprecated function `lint_stability::deprecated_text`: text
 }
diff --git a/tests/ui/lint/lint-stability3.stderr b/tests/ui/lint/lint-stability3.stderr
index 3a2af452ce2..85f14c6fc17 100644
--- a/tests/ui/lint/lint-stability3.stderr
+++ b/tests/ui/lint/lint-stability3.stderr
@@ -1,11 +1,11 @@
 error: use of deprecated function `lint_stability::deprecated_text`: text
-  --> $DIR/lint-stability3.rs:13:28
+  --> $DIR/lint-stability3.rs:12:28
    |
 LL |     macro_test_arg_nested!(deprecated_text);
    |                            ^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/lint-stability3.rs:4:9
+  --> $DIR/lint-stability3.rs:3:9
    |
 LL | #![deny(deprecated)]
    |         ^^^^^^^^^^
diff --git a/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs b/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs
index c92c3999ce9..e2f7c73eacf 100644
--- a/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs
+++ b/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs
@@ -1,9 +1,15 @@
 //@ compile-flags:-D unknown-lints -D bogus -D dead_cod
 
-//@ error-pattern:unknown lint: `bogus`
 //@ error-pattern:requested on the command line with `-D bogus`
 //@ error-pattern:requested on the command line with `-D dead_cod`
 //@ error-pattern:requested on the command line with `-D unknown-lints`
 //@ error-pattern:did you mean: `dead_code`
 
 fn main() { }
+
+//~? ERROR unknown lint: `bogus`
+//~? ERROR unknown lint: `dead_cod`
+//~? ERROR unknown lint: `bogus`
+//~? ERROR unknown lint: `dead_cod`
+//~? ERROR unknown lint: `bogus`
+//~? ERROR unknown lint: `dead_cod`
diff --git a/tests/ui/lint/lint-unknown-lint-cmdline.rs b/tests/ui/lint/lint-unknown-lint-cmdline.rs
index 202c617235f..931e945a1a3 100644
--- a/tests/ui/lint/lint-unknown-lint-cmdline.rs
+++ b/tests/ui/lint/lint-unknown-lint-cmdline.rs
@@ -1,11 +1,16 @@
 //@ check-pass
 //@ compile-flags:-D bogus -D dead_cod
 
-//@ error-pattern:unknown lint: `bogus`
 //@ error-pattern:requested on the command line with `-D bogus`
 //@ error-pattern:`#[warn(unknown_lints)]` on by default
-//@ error-pattern:unknown lint: `dead_cod`
 //@ error-pattern:requested on the command line with `-D dead_cod`
 //@ error-pattern:did you mean: `dead_code`
 
 fn main() { }
+
+//~? WARN unknown lint: `bogus`
+//~? WARN unknown lint: `dead_cod`
+//~? WARN unknown lint: `bogus`
+//~? WARN unknown lint: `dead_cod`
+//~? WARN unknown lint: `bogus`
+//~? WARN unknown lint: `dead_cod`
diff --git a/tests/ui/lint/unused_parens_multibyte_recovery.rs b/tests/ui/lint/unused_parens_multibyte_recovery.rs
index 630b25d192a..8f53c7ad262 100644
--- a/tests/ui/lint/unused_parens_multibyte_recovery.rs
+++ b/tests/ui/lint/unused_parens_multibyte_recovery.rs
@@ -1,10 +1,7 @@
 // ignore-tidy-trailing-newlines
-//
-//@ error-pattern: this file contains an unclosed delimiter
-//@ error-pattern: this file contains an unclosed delimiter
-//@ error-pattern: this file contains an unclosed delimiter
-//
+
 // Verify that unused parens lint does not try to create a span
 // which points in the middle of a multibyte character.
 
+//~v ERROR this file contains an unclosed delimiter
 fn f(){(print!(á
\ No newline at end of file
diff --git a/tests/ui/lint/unused_parens_multibyte_recovery.stderr b/tests/ui/lint/unused_parens_multibyte_recovery.stderr
index ef4089f31f4..770fd6f084e 100644
--- a/tests/ui/lint/unused_parens_multibyte_recovery.stderr
+++ b/tests/ui/lint/unused_parens_multibyte_recovery.stderr
@@ -1,5 +1,5 @@
 error: this file contains an unclosed delimiter
-  --> $DIR/unused_parens_multibyte_recovery.rs:10:17
+  --> $DIR/unused_parens_multibyte_recovery.rs:7:17
    |
 LL | fn f(){(print!(á
    |       --      - ^
diff --git a/tests/ui/lto/issue-11154.rs b/tests/ui/lto/issue-11154.rs
index 914b0b73e47..7770aeccd6a 100644
--- a/tests/ui/lto/issue-11154.rs
+++ b/tests/ui/lto/issue-11154.rs
@@ -1,6 +1,6 @@
 //@ build-fail
 //@ compile-flags: -C lto -C prefer-dynamic
 
-//@ error-pattern: cannot prefer dynamic linking
-
 fn main() {}
+
+//~? ERROR cannot prefer dynamic linking when performing LTO
diff --git a/tests/ui/lto/lto-duplicate-symbols.rs b/tests/ui/lto/lto-duplicate-symbols.rs
index 27bdde418f8..a62ab2e2217 100644
--- a/tests/ui/lto/lto-duplicate-symbols.rs
+++ b/tests/ui/lto/lto-duplicate-symbols.rs
@@ -1,7 +1,6 @@
 //@ build-fail
 //@ aux-build:lto-duplicate-symbols1.rs
 //@ aux-build:lto-duplicate-symbols2.rs
-//@ error-pattern:Linking globals named 'foo': symbol multiply defined!
 //@ compile-flags: -C lto
 //@ no-prefer-dynamic
 //@ normalize-stderr: "lto-duplicate-symbols2\.lto_duplicate_symbols2\.[0-9a-zA-Z]+-cgu" -> "lto-duplicate-symbols2.lto_duplicate_symbols2.HASH-cgu"
@@ -9,3 +8,6 @@ extern crate lto_duplicate_symbols1;
 extern crate lto_duplicate_symbols2;
 
 fn main() {}
+
+//~? WARN Linking globals named 'foo': symbol multiply defined
+//~? ERROR failed to load bitcode of module "lto-duplicate-symbols2.lto_duplicate_symbols2
diff --git a/tests/ui/macros/not-utf8.rs b/tests/ui/macros/not-utf8.rs
index ad8ac39d230..0993c068860 100644
--- a/tests/ui/macros/not-utf8.rs
+++ b/tests/ui/macros/not-utf8.rs
@@ -1,7 +1,7 @@
-//@ error-pattern: did not contain valid UTF-8
 //@ reference: input.encoding.utf8
 //@ reference: input.encoding.invalid
 
 fn foo() {
     include!("not-utf8.bin");
+    //~^ ERROR couldn't read `$DIR/not-utf8.bin`: stream did not contain valid UTF-8
 }
diff --git a/tests/ui/macros/not-utf8.stderr b/tests/ui/macros/not-utf8.stderr
index d466d5087d4..c310e70935e 100644
--- a/tests/ui/macros/not-utf8.stderr
+++ b/tests/ui/macros/not-utf8.stderr
@@ -1,5 +1,5 @@
 error: couldn't read `$DIR/not-utf8.bin`: stream did not contain valid UTF-8
-  --> $DIR/not-utf8.rs:6:5
+  --> $DIR/not-utf8.rs:5:5
    |
 LL |     include!("not-utf8.bin");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/macros/unreachable-arg.edition_2021.stderr b/tests/ui/macros/unreachable-arg.edition_2021.stderr
index ddaa2b9c1ef..fa776070789 100644
--- a/tests/ui/macros/unreachable-arg.edition_2021.stderr
+++ b/tests/ui/macros/unreachable-arg.edition_2021.stderr
@@ -1,5 +1,5 @@
 error: format argument must be a string literal
-  --> $DIR/unreachable-arg.rs:15:18
+  --> $DIR/unreachable-arg.rs:14:18
    |
 LL |     unreachable!(a);
    |                  ^
diff --git a/tests/ui/macros/unreachable-arg.rs b/tests/ui/macros/unreachable-arg.rs
index 702bd053ab0..d18272c8072 100644
--- a/tests/ui/macros/unreachable-arg.rs
+++ b/tests/ui/macros/unreachable-arg.rs
@@ -6,11 +6,10 @@
 //@ [edition_2015]run-fail
 //@ [edition_2021]check-fail
 //@ [edition_2015]error-pattern:internal error: entered unreachable code: hello
-//@ [edition_2021]error-pattern:format argument must be a string literal
 
 #![allow(non_fmt_panics)]
 
 fn main() {
     let a = "hello";
-    unreachable!(a);
+    unreachable!(a); //[edition_2021]~ ERROR format argument must be a string literal
 }
diff --git a/tests/ui/macros/unreachable-format-args.edition_2015.stderr b/tests/ui/macros/unreachable-format-args.edition_2015.stderr
index 9104848a58b..e2286b72e64 100644
--- a/tests/ui/macros/unreachable-format-args.edition_2015.stderr
+++ b/tests/ui/macros/unreachable-format-args.edition_2015.stderr
@@ -1,5 +1,5 @@
 error: there is no argument named `x`
-  --> $DIR/unreachable-format-args.rs:13:5
+  --> $DIR/unreachable-format-args.rs:12:5
    |
 LL |     unreachable!("x is {x} and y is {y}", y = 0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/macros/unreachable-format-args.rs b/tests/ui/macros/unreachable-format-args.rs
index 856fc992685..79a851348ff 100644
--- a/tests/ui/macros/unreachable-format-args.rs
+++ b/tests/ui/macros/unreachable-format-args.rs
@@ -5,10 +5,10 @@
 //@ [edition_2021]edition:2021
 //@ [edition_2015]check-fail
 //@ [edition_2021]run-fail
-//@ [edition_2015]error-pattern:there is no argument named `x`
 //@ [edition_2021]error-pattern:internal error: entered unreachable code: x is 5 and y is 0
 
 fn main() {
     let x = 5;
     unreachable!("x is {x} and y is {y}", y = 0);
+    //[edition_2015]~^ ERROR there is no argument named `x`
 }
diff --git a/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs b/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs
index da56fe03184..94e6900bf40 100644
--- a/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs
+++ b/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs
@@ -1,7 +1,4 @@
 // check that we don't generate a span that points beyond EOF
 
-//@ error-pattern: unclosed delimiter
-//@ error-pattern: unclosed delimiter
-//@ error-pattern: unclosed delimiter
-
+//~v ERROR this file contains an unclosed delimiter
 fn a(){{{
diff --git a/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.stderr b/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.stderr
index d9748843fd7..9a86c267340 100644
--- a/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.stderr
+++ b/tests/ui/malformed/issue-107423-unused-delim-only-one-no-pair.stderr
@@ -1,5 +1,5 @@
 error: this file contains an unclosed delimiter
-  --> $DIR/issue-107423-unused-delim-only-one-no-pair.rs:7:11
+  --> $DIR/issue-107423-unused-delim-only-one-no-pair.rs:4:11
    |
 LL | fn a(){{{
    |       ---^
diff --git a/tests/ui/minus-string.rs b/tests/ui/minus-string.rs
index 8d9b8d8bbf4..b83347b937e 100644
--- a/tests/ui/minus-string.rs
+++ b/tests/ui/minus-string.rs
@@ -1,3 +1 @@
-//@ error-pattern:cannot apply unary operator `-` to type `String`
-
-fn main() { -"foo".to_string(); }
+fn main() { -"foo".to_string(); } //~ ERROR cannot apply unary operator `-` to type `String`
diff --git a/tests/ui/minus-string.stderr b/tests/ui/minus-string.stderr
index cf63ec24416..153965c810e 100644
--- a/tests/ui/minus-string.stderr
+++ b/tests/ui/minus-string.stderr
@@ -1,5 +1,5 @@
 error[E0600]: cannot apply unary operator `-` to type `String`
-  --> $DIR/minus-string.rs:3:13
+  --> $DIR/minus-string.rs:1:13
    |
 LL | fn main() { -"foo".to_string(); }
    |             ^^^^^^^^^^^^^^^^^^ cannot apply unary operator `-`
diff --git a/tests/ui/mir/enable_passes_validation.rs b/tests/ui/mir/enable_passes_validation.rs
index 405ada77183..b97ddfba37f 100644
--- a/tests/ui/mir/enable_passes_validation.rs
+++ b/tests/ui/mir/enable_passes_validation.rs
@@ -1,24 +1,25 @@
 //@ revisions: empty unprefixed all_unknown all_known mixed
 
 //@[empty] compile-flags: -Zmir-enable-passes=
-//@[empty] error-pattern error: incorrect value `` for unstable option `mir-enable-passes` - a comma-separated list of strings, with elements beginning with + or - was expected
 
 //@[unprefixed] compile-flags: -Zmir-enable-passes=CheckAlignment
-//@[unprefixed] error-pattern error: incorrect value `CheckAlignment` for unstable option `mir-enable-passes` - a comma-separated list of strings, with elements beginning with + or - was expected
 
 //@[all_unknown] check-pass
 //@[all_unknown] compile-flags: -Zmir-enable-passes=+ThisPass,-DoesNotExist
-//@[all_unknown] error-pattern: warning: MIR pass `ThisPass` is unknown and will be ignored
-//@[all_unknown] error-pattern: warning: MIR pass `DoesNotExist` is unknown and will be ignored
 
 //@[all_known] check-pass
 //@[all_known] compile-flags: -Zmir-enable-passes=+CheckAlignment,+LowerIntrinsics
 
 //@[mixed] check-pass
 //@[mixed] compile-flags: -Zmir-enable-passes=+ThisPassDoesNotExist,+CheckAlignment
-//@[mixed] error-pattern: warning: MIR pass `ThisPassDoesNotExist` is unknown and will be ignored
 
 fn main() {}
 
 //[empty]~? ERROR incorrect value `` for unstable option `mir-enable-passes`
 //[unprefixed]~? ERROR incorrect value `CheckAlignment` for unstable option `mir-enable-passes`
+//[mixed]~? WARN MIR pass `ThisPassDoesNotExist` is unknown and will be ignored
+//[mixed]~? WARN MIR pass `ThisPassDoesNotExist` is unknown and will be ignored
+//[all_unknown]~? MIR pass `ThisPass` is unknown and will be ignored
+//[all_unknown]~? MIR pass `DoesNotExist` is unknown and will be ignored
+//[all_unknown]~? MIR pass `ThisPass` is unknown and will be ignored
+//[all_unknown]~? MIR pass `DoesNotExist` is unknown and will be ignored
diff --git a/tests/ui/mir/lint/assignment-overlap.rs b/tests/ui/mir/lint/assignment-overlap.rs
index 6396cccd4e8..950279b1555 100644
--- a/tests/ui/mir/lint/assignment-overlap.rs
+++ b/tests/ui/mir/lint/assignment-overlap.rs
@@ -12,7 +12,7 @@ pub fn main() {
     mir! {
         let a: [u8; 1024];
         {
-            a = a;
+            a = a; //~ ERROR broken MIR
             Return()
         }
     }
diff --git a/tests/ui/mir/lint/call-overlap.rs b/tests/ui/mir/lint/call-overlap.rs
index def78ea1e3b..3c42e04e3ec 100644
--- a/tests/ui/mir/lint/call-overlap.rs
+++ b/tests/ui/mir/lint/call-overlap.rs
@@ -12,7 +12,7 @@ pub fn main() {
     mir! {
         let a: [u8; 1024];
         {
-            Call(a = f(Move(a)), ReturnTo(bb1), UnwindUnreachable())
+            Call(a = f(Move(a)), ReturnTo(bb1), UnwindUnreachable()) //~ ERROR broken MIR
         }
         bb1 = {
             Return()
diff --git a/tests/ui/mir/lint/no-storage.rs b/tests/ui/mir/lint/no-storage.rs
index a6af8646f6e..68c1a2d2aab 100644
--- a/tests/ui/mir/lint/no-storage.rs
+++ b/tests/ui/mir/lint/no-storage.rs
@@ -21,7 +21,7 @@ pub fn f(a: bool) {
             Goto(bb3)
         }
         bb3 = {
-            b = ();
+            b = (); //~ ERROR broken MIR
             RET = b;
             StorageDead(b);
             Return()
diff --git a/tests/ui/mir/lint/storage-live.rs b/tests/ui/mir/lint/storage-live.rs
index 3e0cc4ee061..19d046b619c 100644
--- a/tests/ui/mir/lint/storage-live.rs
+++ b/tests/ui/mir/lint/storage-live.rs
@@ -20,7 +20,7 @@ fn multiple_storage() {
         let a: usize;
         {
             StorageLive(a);
-            StorageLive(a);
+            StorageLive(a); //~ ERROR broken MIR
             Return()
         }
     }
diff --git a/tests/ui/mir/lint/storage-return.rs b/tests/ui/mir/lint/storage-return.rs
index d51aee9518f..3bbd0045d9d 100644
--- a/tests/ui/mir/lint/storage-return.rs
+++ b/tests/ui/mir/lint/storage-return.rs
@@ -13,7 +13,7 @@ fn main() {
         {
             StorageLive(a);
             RET = a;
-            Return()
+            Return() //~ ERROR broken MIR
         }
     }
 }
diff --git a/tests/ui/mir/validate/noncleanup-cleanup.rs b/tests/ui/mir/validate/noncleanup-cleanup.rs
index b46bb46952b..3010a3804ce 100644
--- a/tests/ui/mir/validate/noncleanup-cleanup.rs
+++ b/tests/ui/mir/validate/noncleanup-cleanup.rs
@@ -2,16 +2,16 @@
 //
 //@ failure-status: 101
 //@ dont-check-compiler-stderr
-//@ error-pattern: cleanuppad mismatch
+
 #![feature(custom_mir, core_intrinsics)]
 extern crate core;
 use core::intrinsics::mir::*;
 
 #[custom_mir(dialect = "built")]
-pub fn main() {
+pub fn main() { //~ WARN function cannot return without recursing
     mir! {
         {
-            Call(RET = main(), ReturnTo(block), UnwindCleanup(block))
+            Call(RET = main(), ReturnTo(block), UnwindCleanup(block)) //~ ERROR cleanuppad mismatch
         }
         block = {
             Return()
diff --git a/tests/ui/mir/validate/noncleanup-resume.rs b/tests/ui/mir/validate/noncleanup-resume.rs
index b2a0e92e068..a80e99e2967 100644
--- a/tests/ui/mir/validate/noncleanup-resume.rs
+++ b/tests/ui/mir/validate/noncleanup-resume.rs
@@ -2,7 +2,7 @@
 //
 //@ failure-status: 101
 //@ dont-check-compiler-stderr
-//@ error-pattern: resume on non-cleanup block
+
 #![feature(custom_mir, core_intrinsics)]
 extern crate core;
 use core::intrinsics::mir::*;
@@ -11,7 +11,7 @@ use core::intrinsics::mir::*;
 pub fn main() {
     mir! {
         {
-            UnwindResume()
+            UnwindResume() //~ ERROR resume on non-cleanup block
         }
     }
 }
diff --git a/tests/ui/mir/validate/noncleanup-terminate.rs b/tests/ui/mir/validate/noncleanup-terminate.rs
index 24cf75e7d8e..859c5e71c0e 100644
--- a/tests/ui/mir/validate/noncleanup-terminate.rs
+++ b/tests/ui/mir/validate/noncleanup-terminate.rs
@@ -2,7 +2,7 @@
 //
 //@ failure-status: 101
 //@ dont-check-compiler-stderr
-//@ error-pattern: terminate on non-cleanup block
+
 #![feature(custom_mir, core_intrinsics)]
 extern crate core;
 use core::intrinsics::mir::*;
@@ -11,7 +11,7 @@ use core::intrinsics::mir::*;
 pub fn main() {
     mir! {
         {
-            UnwindTerminate(ReasonAbi)
+            UnwindTerminate(ReasonAbi) //~ ERROR terminate on non-cleanup block
         }
     }
 }
diff --git a/tests/ui/missing/missing-main.rs b/tests/ui/missing/missing-main.rs
index 3cafca09afb..2b8995fb8ff 100644
--- a/tests/ui/missing/missing-main.rs
+++ b/tests/ui/missing/missing-main.rs
@@ -1,2 +1 @@
-//@ error-pattern: `main` function not found
-fn mian() { }
+fn mian() { } //~ ERROR `main` function not found in crate `missing_main`
diff --git a/tests/ui/missing/missing-main.stderr b/tests/ui/missing/missing-main.stderr
index 2139981eac0..51a299d6a85 100644
--- a/tests/ui/missing/missing-main.stderr
+++ b/tests/ui/missing/missing-main.stderr
@@ -1,5 +1,5 @@
 error[E0601]: `main` function not found in crate `missing_main`
-  --> $DIR/missing-main.rs:2:14
+  --> $DIR/missing-main.rs:1:14
    |
 LL | fn mian() { }
    |              ^ consider adding a `main` function to `$DIR/missing-main.rs`
diff --git a/tests/ui/missing/missing-return.rs b/tests/ui/missing/missing-return.rs
index defd8a3bb78..5d9839a969c 100644
--- a/tests/ui/missing/missing-return.rs
+++ b/tests/ui/missing/missing-return.rs
@@ -1,5 +1,5 @@
 //@ error-pattern: return
 
-fn f() -> isize { }
+fn f() -> isize { } //~ ERROR mismatched types
 
 fn main() { f(); }
diff --git a/tests/ui/nested-ty-params.rs b/tests/ui/nested-ty-params.rs
index b7cedf97c91..866e6230f9e 100644
--- a/tests/ui/nested-ty-params.rs
+++ b/tests/ui/nested-ty-params.rs
@@ -1,6 +1,8 @@
 //@ error-pattern:can't use generic parameters from outer item
 fn hd<U>(v: Vec<U> ) -> U {
     fn hd1(w: [U]) -> U { return w[0]; }
+    //~^ ERROR can't use generic parameters from outer item
+    //~| ERROR can't use generic parameters from outer item
 
     return hd1(v);
 }
diff --git a/tests/ui/no-capture-arc.rs b/tests/ui/no-capture-arc.rs
index aafb170c7e1..9c957a4e01b 100644
--- a/tests/ui/no-capture-arc.rs
+++ b/tests/ui/no-capture-arc.rs
@@ -1,5 +1,3 @@
-//@ error-pattern: borrow of moved value
-
 use std::sync::Arc;
 use std::thread;
 
@@ -11,7 +9,7 @@ fn main() {
         assert_eq!((*arc_v)[3], 4);
     });
 
-    assert_eq!((*arc_v)[2], 3);
+    assert_eq!((*arc_v)[2], 3); //~ ERROR borrow of moved value: `arc_v`
 
     println!("{:?}", *arc_v);
 }
diff --git a/tests/ui/no-capture-arc.stderr b/tests/ui/no-capture-arc.stderr
index 4a51ddb67a3..9c1f5c65066 100644
--- a/tests/ui/no-capture-arc.stderr
+++ b/tests/ui/no-capture-arc.stderr
@@ -1,5 +1,5 @@
 error[E0382]: borrow of moved value: `arc_v`
-  --> $DIR/no-capture-arc.rs:14:18
+  --> $DIR/no-capture-arc.rs:12:18
    |
 LL |     let arc_v = Arc::new(v);
    |         ----- move occurs because `arc_v` has type `Arc<Vec<i32>>`, which does not implement the `Copy` trait
diff --git a/tests/ui/no_std/no-std-no-start-binary.rs b/tests/ui/no_std/no-std-no-start-binary.rs
index 5c8a0e6c0b8..df68b99346a 100644
--- a/tests/ui/no_std/no-std-no-start-binary.rs
+++ b/tests/ui/no_std/no-std-no-start-binary.rs
@@ -11,3 +11,5 @@ fn handler(_info: &core::panic::PanicInfo<'_>) -> ! {
 }
 
 fn main() {}
+
+//~? ERROR using `fn main` requires the standard library
diff --git a/tests/ui/no_std/no-std-unwind-binary.rs b/tests/ui/no_std/no-std-unwind-binary.rs
index 74c80d75c3e..cb1dc4427ae 100644
--- a/tests/ui/no_std/no-std-unwind-binary.rs
+++ b/tests/ui/no_std/no-std-unwind-binary.rs
@@ -1,4 +1,3 @@
-//@ error-pattern:unwinding panics are not supported without std
 //@ needs-unwind
 //@ compile-flags: -Cpanic=unwind
 
@@ -13,3 +12,5 @@ fn handler(_info: &core::panic::PanicInfo<'_>) -> ! {
 }
 
 fn main() {}
+
+//~? ERROR unwinding panics are not supported without std
diff --git a/tests/ui/packed/packed-struct-generic-transmute.rs b/tests/ui/packed/packed-struct-generic-transmute.rs
index ed655a1d483..17e72bebc7d 100644
--- a/tests/ui/packed/packed-struct-generic-transmute.rs
+++ b/tests/ui/packed/packed-struct-generic-transmute.rs
@@ -22,6 +22,7 @@ fn main() {
     let foo = Foo { bar: [1u8, 2, 3, 4, 5], baz: 10i32 };
     unsafe {
         let oof: Oof<[u8; 5], i32> = mem::transmute(foo);
+        //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
         println!("{:?} {:?}", &oof.rab[..], oof.zab);
     }
 }
diff --git a/tests/ui/packed/packed-struct-transmute.rs b/tests/ui/packed/packed-struct-transmute.rs
index 98feeea8871..5ad6524ff81 100644
--- a/tests/ui/packed/packed-struct-transmute.rs
+++ b/tests/ui/packed/packed-struct-transmute.rs
@@ -24,6 +24,7 @@ fn main() {
     let foo = Foo { bar: 1, baz: 10 };
     unsafe {
         let oof: Oof = mem::transmute(foo);
+        //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
         println!("{:?}", oof);
     }
 }
diff --git a/tests/ui/panic-handler/panic-handler-missing.rs b/tests/ui/panic-handler/panic-handler-missing.rs
index 09fbd9a69cf..ab617f93a99 100644
--- a/tests/ui/panic-handler/panic-handler-missing.rs
+++ b/tests/ui/panic-handler/panic-handler-missing.rs
@@ -1,5 +1,4 @@
 //@ dont-check-compiler-stderr
-//@ error-pattern: `#[panic_handler]` function required, but not found
 
 #![feature(lang_items)]
 #![no_main]
@@ -7,3 +6,5 @@
 
 #[lang = "eh_personality"]
 fn eh() {}
+
+//~? ERROR `#[panic_handler]` function required, but not found
diff --git a/tests/ui/panic-handler/panic-handler-std.rs b/tests/ui/panic-handler/panic-handler-std.rs
index 4eb05b5365f..f6a4b60461c 100644
--- a/tests/ui/panic-handler/panic-handler-std.rs
+++ b/tests/ui/panic-handler/panic-handler-std.rs
@@ -1,12 +1,11 @@
 //@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
-//@ error-pattern: found duplicate lang item `panic_impl`
 
 extern crate core;
 
 use core::panic::PanicInfo;
 
 #[panic_handler]
-fn panic(info: PanicInfo) -> ! {
+fn panic(info: PanicInfo) -> ! { //~ ERROR found duplicate lang item `panic_impl`
     loop {}
 }
 
diff --git a/tests/ui/panic-handler/panic-handler-std.stderr b/tests/ui/panic-handler/panic-handler-std.stderr
index caae16118ef..48c216ce27e 100644
--- a/tests/ui/panic-handler/panic-handler-std.stderr
+++ b/tests/ui/panic-handler/panic-handler-std.stderr
@@ -1,5 +1,5 @@
 error[E0152]: found duplicate lang item `panic_impl`
-  --> $DIR/panic-handler-std.rs:9:1
+  --> $DIR/panic-handler-std.rs:8:1
    |
 LL | / fn panic(info: PanicInfo) -> ! {
 LL | |     loop {}
diff --git a/tests/ui/panic-handler/weak-lang-item.rs b/tests/ui/panic-handler/weak-lang-item.rs
index 605e1bdd94b..cc5ccb75104 100644
--- a/tests/ui/panic-handler/weak-lang-item.rs
+++ b/tests/ui/panic-handler/weak-lang-item.rs
@@ -1,12 +1,13 @@
 //@ aux-build:weak-lang-items.rs
-//@ error-pattern: `#[panic_handler]` function required, but not found
-//@ error-pattern: unwinding panics are not supported without std
 //@ needs-unwind since it affects the error output
 //@ ignore-emscripten missing eh_catch_typeinfo lang item
 
 #![no_std]
 
-extern crate core;
+extern crate core; //~ ERROR the name `core` is defined multiple times
 extern crate weak_lang_items;
 
 fn main() {}
+
+//~? ERROR `#[panic_handler]` function required, but not found
+//~? ERROR unwinding panics are not supported without std
diff --git a/tests/ui/panic-handler/weak-lang-item.stderr b/tests/ui/panic-handler/weak-lang-item.stderr
index 5dcb37df689..5acd3e31870 100644
--- a/tests/ui/panic-handler/weak-lang-item.stderr
+++ b/tests/ui/panic-handler/weak-lang-item.stderr
@@ -1,5 +1,5 @@
 error[E0259]: the name `core` is defined multiple times
-  --> $DIR/weak-lang-item.rs:9:1
+  --> $DIR/weak-lang-item.rs:7:1
    |
 LL | extern crate core;
    | ^^^^^^^^^^^^^^^^^^ `core` reimported here
diff --git a/tests/ui/panic-runtime/abort-link-to-unwind-dylib.rs b/tests/ui/panic-runtime/abort-link-to-unwind-dylib.rs
index 2939835b0f4..8b782413f6a 100644
--- a/tests/ui/panic-runtime/abort-link-to-unwind-dylib.rs
+++ b/tests/ui/panic-runtime/abort-link-to-unwind-dylib.rs
@@ -4,7 +4,6 @@
 //@ ignore-musl - no dylibs here
 //@ ignore-emscripten
 //@ ignore-sgx no dynamic lib support
-//@ error-pattern:`panic_unwind` is not compiled with this crate's panic strategy
 
 // This is a test where the local crate, compiled with `panic=abort`, links to
 // the standard library **dynamically** which is already linked against
@@ -16,3 +15,5 @@
 
 fn main() {
 }
+
+//~? ERROR the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`
diff --git a/tests/ui/panic-runtime/bad-panic-flag1.rs b/tests/ui/panic-runtime/bad-panic-flag1.rs
index 82b7c2f723b..117935847cb 100644
--- a/tests/ui/panic-runtime/bad-panic-flag1.rs
+++ b/tests/ui/panic-runtime/bad-panic-flag1.rs
@@ -1,4 +1,5 @@
 //@ compile-flags:-C panic=foo
-//@ error-pattern:either `unwind` or `abort` was expected
 
 fn main() {}
+
+//~? ERROR incorrect value `foo` for codegen option `panic` - either `unwind` or `abort` was expected
diff --git a/tests/ui/panic-runtime/bad-panic-flag2.rs b/tests/ui/panic-runtime/bad-panic-flag2.rs
index 3875325deae..b5d0442a033 100644
--- a/tests/ui/panic-runtime/bad-panic-flag2.rs
+++ b/tests/ui/panic-runtime/bad-panic-flag2.rs
@@ -1,4 +1,5 @@
 //@ compile-flags:-C panic
-//@ error-pattern:requires either `unwind` or `abort`
 
 fn main() {}
+
+//~? ERROR codegen option `panic` requires either `unwind` or `abort`
diff --git a/tests/ui/panic-runtime/need-abort-got-unwind.rs b/tests/ui/panic-runtime/need-abort-got-unwind.rs
index 74b7edd968f..afd08426395 100644
--- a/tests/ui/panic-runtime/need-abort-got-unwind.rs
+++ b/tests/ui/panic-runtime/need-abort-got-unwind.rs
@@ -1,8 +1,9 @@
 //@ build-fail
 //@ needs-unwind
-//@ error-pattern:is incompatible with this crate's strategy of `unwind`
 //@ aux-build:needs-abort.rs
 
 extern crate needs_abort;
 
 fn main() {}
+
+//~? ERROR the crate `needs_abort` requires panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
diff --git a/tests/ui/panic-runtime/need-unwind-got-abort.rs b/tests/ui/panic-runtime/need-unwind-got-abort.rs
index 6bc41509b6b..bc65e9ab3d9 100644
--- a/tests/ui/panic-runtime/need-unwind-got-abort.rs
+++ b/tests/ui/panic-runtime/need-unwind-got-abort.rs
@@ -1,5 +1,4 @@
 //@ build-fail
-//@ error-pattern:is incompatible with this crate's strategy of `abort`
 //@ aux-build:needs-unwind.rs
 //@ compile-flags:-C panic=abort
 //@ no-prefer-dynamic
@@ -7,3 +6,5 @@
 extern crate needs_unwind;
 
 fn main() {}
+
+//~? ERROR the crate `needs_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`
diff --git a/tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs b/tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs
index d0a82bd8507..eb00c071702 100644
--- a/tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs
+++ b/tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs
@@ -1,8 +1,9 @@
 //@ dont-check-compiler-stderr
 //@ aux-build:needs-panic-runtime.rs
 //@ aux-build:depends.rs
-//@ error-pattern:cannot depend on a crate that needs a panic runtime
 
 extern crate depends;
 
 fn main() {}
+
+//~? ERROR the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime`
diff --git a/tests/ui/panic-runtime/transitive-link-a-bunch.rs b/tests/ui/panic-runtime/transitive-link-a-bunch.rs
index 15557d35bc5..2a0b9e3fa63 100644
--- a/tests/ui/panic-runtime/transitive-link-a-bunch.rs
+++ b/tests/ui/panic-runtime/transitive-link-a-bunch.rs
@@ -5,7 +5,6 @@
 //@ aux-build:wants-panic-runtime-unwind.rs
 //@ aux-build:wants-panic-runtime-abort.rs
 //@ aux-build:panic-runtime-lang-items.rs
-//@ error-pattern: is not compiled with this crate's panic strategy `unwind`
 
 #![no_std]
 #![no_main]
@@ -13,3 +12,7 @@
 extern crate wants_panic_runtime_unwind;
 extern crate wants_panic_runtime_abort;
 extern crate panic_runtime_lang_items;
+
+//~? ERROR cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_abort
+//~? ERROR the linked panic runtime `panic_runtime_abort` is not compiled with this crate's panic strategy `unwind`
+//~? ERROR the crate `wants_panic_runtime_abort` requires panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
diff --git a/tests/ui/panic-runtime/two-panic-runtimes.rs b/tests/ui/panic-runtime/two-panic-runtimes.rs
index 3608dca2124..37d041a8c7b 100644
--- a/tests/ui/panic-runtime/two-panic-runtimes.rs
+++ b/tests/ui/panic-runtime/two-panic-runtimes.rs
@@ -1,6 +1,5 @@
 //@ build-fail
 //@ dont-check-compiler-stderr
-//@ error-pattern:cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_unwind2
 //@ aux-build:panic-runtime-unwind.rs
 //@ aux-build:panic-runtime-unwind2.rs
 //@ aux-build:panic-runtime-lang-items.rs
@@ -13,3 +12,5 @@ extern crate panic_runtime_unwind2;
 extern crate panic_runtime_lang_items;
 
 fn main() {}
+
+//~? ERROR cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_unwind2
diff --git a/tests/ui/panic-runtime/want-abort-got-unwind.rs b/tests/ui/panic-runtime/want-abort-got-unwind.rs
index ad9fa52f3d4..76e15a1e16e 100644
--- a/tests/ui/panic-runtime/want-abort-got-unwind.rs
+++ b/tests/ui/panic-runtime/want-abort-got-unwind.rs
@@ -1,9 +1,12 @@
 //@ build-fail
 //@ dont-check-compiler-stderr
-//@ error-pattern:is not compiled with this crate's panic strategy `abort`
 //@ aux-build:panic-runtime-unwind.rs
 //@ compile-flags:-C panic=abort
 
 extern crate panic_runtime_unwind;
 
 fn main() {}
+
+//~? ERROR cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind
+//~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`
+//~? ERROR the crate `panic_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`
diff --git a/tests/ui/panic-runtime/want-abort-got-unwind2.rs b/tests/ui/panic-runtime/want-abort-got-unwind2.rs
index d63161db55c..53cba457424 100644
--- a/tests/ui/panic-runtime/want-abort-got-unwind2.rs
+++ b/tests/ui/panic-runtime/want-abort-got-unwind2.rs
@@ -1,6 +1,5 @@
 //@ build-fail
 //@ dont-check-compiler-stderr
-//@ error-pattern:is not compiled with this crate's panic strategy `abort`
 //@ aux-build:panic-runtime-unwind.rs
 //@ aux-build:wants-panic-runtime-unwind.rs
 //@ compile-flags:-C panic=abort
@@ -8,3 +7,7 @@
 extern crate wants_panic_runtime_unwind;
 
 fn main() {}
+
+//~? ERROR cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind
+//~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`
+//~? ERROR the crate `panic_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`
diff --git a/tests/ui/panic-runtime/want-unwind-got-abort.rs b/tests/ui/panic-runtime/want-unwind-got-abort.rs
index 93342a09182..497d1eafda5 100644
--- a/tests/ui/panic-runtime/want-unwind-got-abort.rs
+++ b/tests/ui/panic-runtime/want-unwind-got-abort.rs
@@ -1,6 +1,5 @@
 //@ build-fail
 //@ needs-unwind
-//@ error-pattern:is not compiled with this crate's panic strategy `unwind`
 //@ aux-build:panic-runtime-abort.rs
 //@ aux-build:panic-runtime-lang-items.rs
 
@@ -9,3 +8,5 @@
 
 extern crate panic_runtime_abort;
 extern crate panic_runtime_lang_items;
+
+//~? ERROR the linked panic runtime `panic_runtime_abort` is not compiled with this crate's panic strategy `unwind`
diff --git a/tests/ui/panic-runtime/want-unwind-got-abort2.rs b/tests/ui/panic-runtime/want-unwind-got-abort2.rs
index ee3f221d09c..2609545336c 100644
--- a/tests/ui/panic-runtime/want-unwind-got-abort2.rs
+++ b/tests/ui/panic-runtime/want-unwind-got-abort2.rs
@@ -1,6 +1,5 @@
 //@ build-fail
 //@ needs-unwind
-//@ error-pattern:is incompatible with this crate's strategy of `unwind`
 //@ aux-build:panic-runtime-abort.rs
 //@ aux-build:wants-panic-runtime-abort.rs
 //@ aux-build:panic-runtime-lang-items.rs
@@ -10,3 +9,6 @@
 
 extern crate wants_panic_runtime_abort;
 extern crate panic_runtime_lang_items;
+
+//~? ERROR the linked panic runtime `panic_runtime_abort` is not compiled with this crate's panic strategy `unwind`
+//~? ERROR the crate `wants_panic_runtime_abort` requires panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
diff --git a/tests/ui/panics/default-backtrace-ice.rs b/tests/ui/panics/default-backtrace-ice.rs
index 9933f548758..cf8b0cea849 100644
--- a/tests/ui/panics/default-backtrace-ice.rs
+++ b/tests/ui/panics/default-backtrace-ice.rs
@@ -20,4 +20,4 @@
 // Ignored on msvc because the `__rust_{begin,end}_short_backtrace` symbols
 // aren't reliable.
 
-fn main() { missing_ident; }
+fn main() { missing_ident; } //~ ERROR cannot find value `missing_ident` in this scope
diff --git a/tests/ui/parser/attribute/attr-dangling-in-fn.rs b/tests/ui/parser/attribute/attr-dangling-in-fn.rs
index d59f90aed5d..b1436b8d89d 100644
--- a/tests/ui/parser/attribute/attr-dangling-in-fn.rs
+++ b/tests/ui/parser/attribute/attr-dangling-in-fn.rs
@@ -1,7 +1,5 @@
-//@ error-pattern:expected statement
-
 fn f() {
-  #[foo = "bar"]
+  #[foo = "bar"] //~ ERROR expected statement after outer attribute
 }
 
 fn main() {
diff --git a/tests/ui/parser/attribute/attr-dangling-in-fn.stderr b/tests/ui/parser/attribute/attr-dangling-in-fn.stderr
index c7b948ea8f7..3e9413f5357 100644
--- a/tests/ui/parser/attribute/attr-dangling-in-fn.stderr
+++ b/tests/ui/parser/attribute/attr-dangling-in-fn.stderr
@@ -1,5 +1,5 @@
 error: expected statement after outer attribute
-  --> $DIR/attr-dangling-in-fn.rs:4:3
+  --> $DIR/attr-dangling-in-fn.rs:2:3
    |
 LL |   #[foo = "bar"]
    |   ^^^^^^^^^^^^^^
diff --git a/tests/ui/parser/attribute/attr-dangling-in-mod.rs b/tests/ui/parser/attribute/attr-dangling-in-mod.rs
index 001ac1135f6..17bc7e547d9 100644
--- a/tests/ui/parser/attribute/attr-dangling-in-mod.rs
+++ b/tests/ui/parser/attribute/attr-dangling-in-mod.rs
@@ -1,6 +1,4 @@
-//@ error-pattern:expected item
-
 fn main() {
 }
 
-#[foo = "bar"]
+#[foo = "bar"] //~ ERROR expected item after attributes
diff --git a/tests/ui/parser/attribute/attr-dangling-in-mod.stderr b/tests/ui/parser/attribute/attr-dangling-in-mod.stderr
index 882400c1d6f..22cc092109d 100644
--- a/tests/ui/parser/attribute/attr-dangling-in-mod.stderr
+++ b/tests/ui/parser/attribute/attr-dangling-in-mod.stderr
@@ -1,5 +1,5 @@
 error: expected item after attributes
-  --> $DIR/attr-dangling-in-mod.rs:6:1
+  --> $DIR/attr-dangling-in-mod.rs:4:1
    |
 LL | #[foo = "bar"]
    | ^^^^^^^^^^^^^^
diff --git a/tests/ui/parser/circular_modules_main.rs b/tests/ui/parser/circular_modules_main.rs
index d5cdff34a26..c130c6792b8 100644
--- a/tests/ui/parser/circular_modules_main.rs
+++ b/tests/ui/parser/circular_modules_main.rs
@@ -1,5 +1,3 @@
-//@ error-pattern: circular modules
-
 #[path = "circular_modules_hello.rs"]
 mod circular_modules_hello;
 
@@ -10,3 +8,5 @@ pub fn hi_str() -> String {
 fn main() {
     circular_modules_hello::say_hello();
 }
+
+//~? ERROR circular modules: $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs
diff --git a/tests/ui/parser/class-implements-bad-trait.rs b/tests/ui/parser/class-implements-bad-trait.rs
index 152fe09b51c..e30c1bc3a7f 100644
--- a/tests/ui/parser/class-implements-bad-trait.rs
+++ b/tests/ui/parser/class-implements-bad-trait.rs
@@ -1,5 +1,4 @@
-//@ error-pattern:nonexistent
-class cat : nonexistent {
+class cat : nonexistent { //~ ERROR expected one of `!` or `::`, found `cat`
   let meows: usize;
   new(in_x : usize) { self.meows = in_x; }
 }
diff --git a/tests/ui/parser/class-implements-bad-trait.stderr b/tests/ui/parser/class-implements-bad-trait.stderr
index 5290e3594d5..5cdb85a8cff 100644
--- a/tests/ui/parser/class-implements-bad-trait.stderr
+++ b/tests/ui/parser/class-implements-bad-trait.stderr
@@ -1,5 +1,5 @@
 error: expected one of `!` or `::`, found `cat`
-  --> $DIR/class-implements-bad-trait.rs:2:7
+  --> $DIR/class-implements-bad-trait.rs:1:7
    |
 LL | class cat : nonexistent {
    |       ^^^ expected one of `!` or `::`
diff --git a/tests/ui/parser/import-from-path.rs b/tests/ui/parser/import-from-path.rs
index 54349d4971e..0d38c7224c5 100644
--- a/tests/ui/parser/import-from-path.rs
+++ b/tests/ui/parser/import-from-path.rs
@@ -1,2 +1 @@
-//@ error-pattern:expected
-use foo::{bar}::baz
+use foo::{bar}::baz //~ ERROR expected `;`, found `::`
diff --git a/tests/ui/parser/import-from-path.stderr b/tests/ui/parser/import-from-path.stderr
index b63e48d6679..f70c3b2e870 100644
--- a/tests/ui/parser/import-from-path.stderr
+++ b/tests/ui/parser/import-from-path.stderr
@@ -1,5 +1,5 @@
 error: expected `;`, found `::`
-  --> $DIR/import-from-path.rs:2:15
+  --> $DIR/import-from-path.rs:1:15
    |
 LL | use foo::{bar}::baz
    |               ^^ expected `;`
diff --git a/tests/ui/parser/import-from-rename.rs b/tests/ui/parser/import-from-rename.rs
index f6a4bb55553..4929b270e45 100644
--- a/tests/ui/parser/import-from-rename.rs
+++ b/tests/ui/parser/import-from-rename.rs
@@ -1,6 +1,4 @@
-//@ error-pattern:expected
-
-use foo::{bar} as baz;
+use foo::{bar} as baz; //~ ERROR expected `;`, found keyword `as`
 
 mod foo {
     pub fn bar() {}
diff --git a/tests/ui/parser/import-from-rename.stderr b/tests/ui/parser/import-from-rename.stderr
index 2f267a8d026..3289f1bdbe7 100644
--- a/tests/ui/parser/import-from-rename.stderr
+++ b/tests/ui/parser/import-from-rename.stderr
@@ -1,5 +1,5 @@
 error: expected `;`, found keyword `as`
-  --> $DIR/import-from-rename.rs:3:16
+  --> $DIR/import-from-rename.rs:1:16
    |
 LL | use foo::{bar} as baz;
    |                ^^ expected `;`
diff --git a/tests/ui/parser/import-glob-path.rs b/tests/ui/parser/import-glob-path.rs
index cb854de0cff..3f1c98fcade 100644
--- a/tests/ui/parser/import-glob-path.rs
+++ b/tests/ui/parser/import-glob-path.rs
@@ -1,2 +1 @@
-//@ error-pattern:expected
-use foo::*::bar
+use foo::*::bar //~ ERROR expected `;`, found `::`
diff --git a/tests/ui/parser/import-glob-path.stderr b/tests/ui/parser/import-glob-path.stderr
index 3bde32d1ea4..04f8a6e96fa 100644
--- a/tests/ui/parser/import-glob-path.stderr
+++ b/tests/ui/parser/import-glob-path.stderr
@@ -1,5 +1,5 @@
 error: expected `;`, found `::`
-  --> $DIR/import-glob-path.rs:2:11
+  --> $DIR/import-glob-path.rs:1:11
    |
 LL | use foo::*::bar
    |           ^^ expected `;`
diff --git a/tests/ui/parser/import-glob-rename.rs b/tests/ui/parser/import-glob-rename.rs
index 899818b15b6..5027a75f881 100644
--- a/tests/ui/parser/import-glob-rename.rs
+++ b/tests/ui/parser/import-glob-rename.rs
@@ -1,6 +1,4 @@
-//@ error-pattern:expected
-
-use foo::* as baz;
+use foo::* as baz; //~ ERROR expected `;`, found keyword `as`
 
 mod foo {
     pub fn bar() {}
diff --git a/tests/ui/parser/import-glob-rename.stderr b/tests/ui/parser/import-glob-rename.stderr
index 24e6c3f0006..2a5f2b66404 100644
--- a/tests/ui/parser/import-glob-rename.stderr
+++ b/tests/ui/parser/import-glob-rename.stderr
@@ -1,5 +1,5 @@
 error: expected `;`, found keyword `as`
-  --> $DIR/import-glob-rename.rs:3:12
+  --> $DIR/import-glob-rename.rs:1:12
    |
 LL | use foo::* as baz;
    |            ^^ expected `;`
diff --git a/tests/ui/parser/issues/circular-module-with-doc-comment-issue-97589/circular-module-with-doc-comment-issue-97589.rs b/tests/ui/parser/issues/circular-module-with-doc-comment-issue-97589/circular-module-with-doc-comment-issue-97589.rs
index ff28548b795..9c164813de2 100644
--- a/tests/ui/parser/issues/circular-module-with-doc-comment-issue-97589/circular-module-with-doc-comment-issue-97589.rs
+++ b/tests/ui/parser/issues/circular-module-with-doc-comment-issue-97589/circular-module-with-doc-comment-issue-97589.rs
@@ -1,6 +1,7 @@
-//@ error-pattern: circular modules
 // Regression test for #97589: a doc-comment on a circular module bypassed cycle detection
 
 #![crate_type = "lib"]
 
 pub mod recursive;
+
+//~? ERROR circular modules: $DIR/recursive.rs -> $DIR/recursive.rs
diff --git a/tests/ui/parser/issues/issue-21146.rs b/tests/ui/parser/issues/issue-21146.rs
index 81112808b21..95cae47939f 100644
--- a/tests/ui/parser/issues/issue-21146.rs
+++ b/tests/ui/parser/issues/issue-21146.rs
@@ -1,3 +1,4 @@
-//@ error-pattern: expected one of `!` or `::`, found `<eof>`
 include!("auxiliary/issue-21146-inc.rs");
 fn main() {}
+
+//~? ERROR expected one of `!` or `::`, found `<eof>`
diff --git a/tests/ui/parser/issues/issue-66473.rs b/tests/ui/parser/issues/issue-66473.rs
index baa00f95e12..d0786add1af 100644
--- a/tests/ui/parser/issues/issue-66473.rs
+++ b/tests/ui/parser/issues/issue-66473.rs
Binary files differdiff --git a/tests/ui/parser/issues/issue-66473.stderr b/tests/ui/parser/issues/issue-66473.stderr
index ba38c4fa1b7..65b2d5a34ee 100644
--- a/tests/ui/parser/issues/issue-66473.stderr
+++ b/tests/ui/parser/issues/issue-66473.stderr
@@ -1,11 +1,11 @@
 error: unknown start of token: \u{348}
-  --> $DIR/issue-66473.rs:4:2
+  --> $DIR/issue-66473.rs:1:2
    |
 LL | #͈␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀
    |  ^
 
 error: unknown start of token: \u{0}
-  --> $DIR/issue-66473.rs:4:3
+  --> $DIR/issue-66473.rs:1:3
    |
 LL | #͈␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀
    |  ^^^^^^^^^^^^^^^^^^
@@ -14,19 +14,19 @@ LL | #͈␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀
    = note: character appears 17 more times
 
 error: unknown start of token: \u{1d}
-  --> $DIR/issue-66473.rs:5:2
+  --> $DIR/issue-66473.rs:4:2
    |
 LL | ␋␝6␝␀␀
    |  ^
 
 error: unknown start of token: \u{1d}
-  --> $DIR/issue-66473.rs:5:4
+  --> $DIR/issue-66473.rs:4:4
    |
 LL | ␋␝6␝␀␀
    |    ^
 
 error: unknown start of token: \u{0}
-  --> $DIR/issue-66473.rs:5:5
+  --> $DIR/issue-66473.rs:4:5
    |
 LL | ␋␝6␝␀␀
    |     ^^
@@ -35,10 +35,11 @@ LL | ␋␝6␝␀␀
    = note: character appears once more
 
 error: expected one of `!` or `[`, found `6`
-  --> $DIR/issue-66473.rs:5:3
+  --> $DIR/issue-66473.rs:4:3
    |
 LL | #͈␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀
    |  - expected one of `!` or `[`
+...
 LL | ␋␝6␝␀␀
    |   ^ unexpected token
 
diff --git a/tests/ui/parser/issues/issue-68629.rs b/tests/ui/parser/issues/issue-68629.rs
index d353d1f56ce..d1ea4ca8b03 100644
--- a/tests/ui/parser/issues/issue-68629.rs
+++ b/tests/ui/parser/issues/issue-68629.rs
Binary files differdiff --git a/tests/ui/parser/issues/issue-68629.stderr b/tests/ui/parser/issues/issue-68629.stderr
index f003f378179..373ad142778 100644
--- a/tests/ui/parser/issues/issue-68629.stderr
+++ b/tests/ui/parser/issues/issue-68629.stderr
@@ -1,17 +1,17 @@
 error: unknown start of token: \u{1c}
-  --> $DIR/issue-68629.rs:4:1
+  --> $DIR/issue-68629.rs:6:1
    |
 LL | ␜␟ts␀![{i
    | ^
 
 error: unknown start of token: \u{1f}
-  --> $DIR/issue-68629.rs:4:2
+  --> $DIR/issue-68629.rs:6:2
    |
 LL | ␜␟ts␀![{i
    |  ^
 
 error: unknown start of token: \u{0}
-  --> $DIR/issue-68629.rs:4:5
+  --> $DIR/issue-68629.rs:6:5
    |
 LL | ␜␟ts␀![{i
    |     ^
@@ -19,7 +19,7 @@ LL | ␜␟ts␀![{i
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/issue-68629.rs:5:1
+  --> $DIR/issue-68629.rs:7:1
    |
 LL | ␀␀  fn rݻoa>rݻm
    | ^^
@@ -28,7 +28,7 @@ LL | ␀␀  fn rݻoa>rݻm
    = note: character appears once more
 
 error: this file contains an unclosed delimiter
-  --> $DIR/issue-68629.rs:5:17
+  --> $DIR/issue-68629.rs:7:17
    |
 LL | ␜␟ts␀![{i
    |       -- unclosed delimiter
diff --git a/tests/ui/parser/issues/issue-68730.rs b/tests/ui/parser/issues/issue-68730.rs
index f7f11cbc98b..9cf51b720eb 100644
--- a/tests/ui/parser/issues/issue-68730.rs
+++ b/tests/ui/parser/issues/issue-68730.rs
Binary files differdiff --git a/tests/ui/parser/issues/issue-68730.stderr b/tests/ui/parser/issues/issue-68730.stderr
index 838a6569bdc..1e01e02bdb7 100644
--- a/tests/ui/parser/issues/issue-68730.stderr
+++ b/tests/ui/parser/issues/issue-68730.stderr
@@ -1,5 +1,5 @@
 error: unknown start of token: \u{0}
-  --> $DIR/issue-68730.rs:5:5
+  --> $DIR/issue-68730.rs:8:5
    |
 LL | enum␀em␀˂˂
    |     ^
@@ -7,7 +7,7 @@ LL | enum␀em␀˂˂
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/issue-68730.rs:5:8
+  --> $DIR/issue-68730.rs:8:8
    |
 LL | enum␀em␀˂˂
    |        ^
@@ -15,7 +15,7 @@ LL | enum␀em␀˂˂
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{2c2}
-  --> $DIR/issue-68730.rs:5:9
+  --> $DIR/issue-68730.rs:8:9
    |
 LL | enum␀em␀˂˂
    |         ^^
@@ -28,7 +28,7 @@ LL + enum␀em␀<<
    |
 
 error: unknown start of token: \u{2c2}
-  --> $DIR/issue-68730.rs:5:10
+  --> $DIR/issue-68730.rs:8:10
    |
 LL | enum␀em␀˂˂
    |          ^
@@ -40,7 +40,7 @@ LL + enum␀em␀˂<
    |
 
 error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `<`
-  --> $DIR/issue-68730.rs:5:10
+  --> $DIR/issue-68730.rs:8:10
    |
 LL | enum␀em␀˂˂
    |          ^ expected one of `#`, `>`, `const`, identifier, or lifetime
diff --git a/tests/ui/parser/shebang/shebang-split.rs b/tests/ui/parser/shebang/shebang-split.rs
index 470bb669143..eb8f0f769c8 100644
--- a/tests/ui/parser/shebang/shebang-split.rs
+++ b/tests/ui/parser/shebang/shebang-split.rs
@@ -1,5 +1,4 @@
 // empty line
 # !/bin/env
-
+//~^ ERROR expected `[`, found `/`
 // checks that diagnostics for shebang lookalikes is not present
-//@ error-pattern: expected `[`\n\n
diff --git a/tests/ui/parser/utf16-be-without-bom.rs b/tests/ui/parser/utf16-be-without-bom.rs
index f5fe8dc5a8c..538728735f0 100644
--- a/tests/ui/parser/utf16-be-without-bom.rs
+++ b/tests/ui/parser/utf16-be-without-bom.rs
Binary files differdiff --git a/tests/ui/parser/utf16-be-without-bom.stderr b/tests/ui/parser/utf16-be-without-bom.stderr
index 0493bcbc77a..467e0ed7313 100644
--- a/tests/ui/parser/utf16-be-without-bom.stderr
+++ b/tests/ui/parser/utf16-be-without-bom.stderr
@@ -1,5 +1,5 @@
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:1
+  --> $DIR/utf16-be-without-bom.rs:6:1
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    | ^
@@ -7,7 +7,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:3
+  --> $DIR/utf16-be-without-bom.rs:6:3
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |   ^
@@ -15,7 +15,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:5
+  --> $DIR/utf16-be-without-bom.rs:6:5
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |     ^
@@ -23,7 +23,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:7
+  --> $DIR/utf16-be-without-bom.rs:6:7
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |       ^
@@ -31,7 +31,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:9
+  --> $DIR/utf16-be-without-bom.rs:6:9
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |         ^
@@ -39,7 +39,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:11
+  --> $DIR/utf16-be-without-bom.rs:6:11
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |           ^
@@ -47,7 +47,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:13
+  --> $DIR/utf16-be-without-bom.rs:6:13
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |             ^
@@ -55,7 +55,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:15
+  --> $DIR/utf16-be-without-bom.rs:6:15
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |               ^
@@ -63,7 +63,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:17
+  --> $DIR/utf16-be-without-bom.rs:6:17
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                 ^
@@ -71,7 +71,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:19
+  --> $DIR/utf16-be-without-bom.rs:6:19
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                   ^
@@ -79,7 +79,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:21
+  --> $DIR/utf16-be-without-bom.rs:6:21
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                     ^
@@ -87,7 +87,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:23
+  --> $DIR/utf16-be-without-bom.rs:6:23
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                       ^
@@ -95,7 +95,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-be-without-bom.rs:5:25
+  --> $DIR/utf16-be-without-bom.rs:6:25
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                         ^
@@ -103,7 +103,7 @@ LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: expected one of `!` or `::`, found `n`
-  --> $DIR/utf16-be-without-bom.rs:5:4
+  --> $DIR/utf16-be-without-bom.rs:6:4
    |
 LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |    ^ expected one of `!` or `::`
diff --git a/tests/ui/parser/utf16-le-without-bom.rs b/tests/ui/parser/utf16-le-without-bom.rs
index 8c781b27dc0..fc413663c9c 100644
--- a/tests/ui/parser/utf16-le-without-bom.rs
+++ b/tests/ui/parser/utf16-le-without-bom.rs
Binary files differdiff --git a/tests/ui/parser/utf16-le-without-bom.stderr b/tests/ui/parser/utf16-le-without-bom.stderr
index 4b195ed0da1..701379d4067 100644
--- a/tests/ui/parser/utf16-le-without-bom.stderr
+++ b/tests/ui/parser/utf16-le-without-bom.stderr
@@ -1,5 +1,5 @@
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:2
+  --> $DIR/utf16-le-without-bom.rs:6:2
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |  ^
@@ -7,7 +7,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:4
+  --> $DIR/utf16-le-without-bom.rs:6:4
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |    ^
@@ -15,7 +15,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:6
+  --> $DIR/utf16-le-without-bom.rs:6:6
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |      ^
@@ -23,7 +23,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:8
+  --> $DIR/utf16-le-without-bom.rs:6:8
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |        ^
@@ -31,7 +31,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:10
+  --> $DIR/utf16-le-without-bom.rs:6:10
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |          ^
@@ -39,7 +39,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:12
+  --> $DIR/utf16-le-without-bom.rs:6:12
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |            ^
@@ -47,7 +47,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:14
+  --> $DIR/utf16-le-without-bom.rs:6:14
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |              ^
@@ -55,7 +55,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:16
+  --> $DIR/utf16-le-without-bom.rs:6:16
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                ^
@@ -63,7 +63,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:18
+  --> $DIR/utf16-le-without-bom.rs:6:18
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                  ^
@@ -71,7 +71,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:20
+  --> $DIR/utf16-le-without-bom.rs:6:20
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                    ^
@@ -79,7 +79,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:22
+  --> $DIR/utf16-le-without-bom.rs:6:22
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                      ^
@@ -87,7 +87,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:5:24
+  --> $DIR/utf16-le-without-bom.rs:6:24
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |                        ^
@@ -95,7 +95,7 @@ LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: unknown start of token: \u{0}
-  --> $DIR/utf16-le-without-bom.rs:6:1
+  --> $DIR/utf16-le-without-bom.rs:7:1
    |
 LL | ␀
    | ^
@@ -103,7 +103,7 @@ LL | ␀
    = help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
 
 error: expected one of `!` or `::`, found `n`
-  --> $DIR/utf16-le-without-bom.rs:5:3
+  --> $DIR/utf16-le-without-bom.rs:6:3
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
    |   ^ expected one of `!` or `::`
diff --git a/tests/ui/print-request/print-lints-help.rs b/tests/ui/print-request/print-lints-help.rs
index 420eae27ed4..6dd88a701c3 100644
--- a/tests/ui/print-request/print-lints-help.rs
+++ b/tests/ui/print-request/print-lints-help.rs
@@ -2,6 +2,7 @@
 //! `--print=lints` (which is not a valid print request).
 
 //@ compile-flags: --print lints
-//@ error-pattern: error: unknown print request: `lints`
 //@ error-pattern: help: use `-Whelp` to print a list of lints
 //@ error-pattern: help: for more information, see the rustc book
+
+//~? ERROR unknown print request: `lints`
diff --git a/tests/ui/print-request/stability.rs b/tests/ui/print-request/stability.rs
index 0ec0886e941..22f279802cd 100644
--- a/tests/ui/print-request/stability.rs
+++ b/tests/ui/print-request/stability.rs
@@ -16,7 +16,6 @@
 
 //@ revisions: all_target_specs_json
 //@[all_target_specs_json] compile-flags: --print=all-target-specs-json
-//@[all_target_specs_json] error-pattern: the `-Z unstable-options` flag must also be passed
 
 //@ revisions: crate_root_lint_levels
 //@[crate_root_lint_levels] compile-flags: --print=crate-root-lint-levels
@@ -24,15 +23,12 @@
 
 //@ revisions: check_cfg
 //@[check_cfg] compile-flags: --print=check-cfg
-//@[check_cfg] error-pattern: the `-Z unstable-options` flag must also be passed
 
 //@ revisions: supported_crate_types
 //@[supported_crate_types] compile-flags: --print=supported-crate-types
-//@[supported_crate_types] error-pattern: the `-Z unstable-options` flag must also be passed
 
 //@ revisions: target_spec_json
 //@[target_spec_json] compile-flags: --print=target-spec-json
-//@[target_spec_json] error-pattern: the `-Z unstable-options` flag must also be passed
 
 // =======================
 // Stable print requests
@@ -109,3 +105,8 @@
 //@[tls_models] check-pass
 
 fn main() {}
+
+//[all_target_specs_json]~? ERROR the `-Z unstable-options` flag must also be passed to enable the `all-target-specs-json` print option
+//[check_cfg]~? ERROR the `-Z unstable-options` flag must also be passed to enable the `check-cfg` print option
+//[supported_crate_types]~? ERROR the `-Z unstable-options` flag must also be passed to enable the `supported-crate-types` print option
+//[target_spec_json]~? ERROR the `-Z unstable-options` flag must also be passed to enable the `target-spec-json` print option
diff --git a/tests/ui/privacy/private-inferred-type-3.rs b/tests/ui/privacy/private-inferred-type-3.rs
index 7bf6bea4b0f..820b0cbb30f 100644
--- a/tests/ui/privacy/private-inferred-type-3.rs
+++ b/tests/ui/privacy/private-inferred-type-3.rs
@@ -1,17 +1,16 @@
 //@ aux-build:private-inferred-type.rs
 
-//@ error-pattern:type `fn() {ext::priv_fn}` is private
-//@ error-pattern:static `ext::PRIV_STATIC` is private
-//@ error-pattern:type `ext::PrivEnum` is private
-//@ error-pattern:type `fn() {<u8 as ext::PrivTrait>::method}` is private
-//@ error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private
-//@ error-pattern:type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private
-//@ error-pattern:type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
-
 #![feature(decl_macro)]
 
 extern crate private_inferred_type as ext;
 
 fn main() {
     ext::m!();
+    //~^ ERROR type `fn() {ext::priv_fn}` is private
+    //~| ERROR static `ext::PRIV_STATIC` is private
+    //~| ERROR type `ext::PrivEnum` is private
+    //~| ERROR type `fn() {<u8 as ext::PrivTrait>::method}` is private
+    //~| ERROR type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private
+    //~| ERROR type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private
+    //~| ERROR type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
 }
diff --git a/tests/ui/privacy/private-inferred-type-3.stderr b/tests/ui/privacy/private-inferred-type-3.stderr
index 42faeb4bf34..0b4899c8d3d 100644
--- a/tests/ui/privacy/private-inferred-type-3.stderr
+++ b/tests/ui/privacy/private-inferred-type-3.stderr
@@ -1,5 +1,5 @@
 error: type `fn() {ext::priv_fn}` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private type
@@ -7,7 +7,7 @@ LL |     ext::m!();
    = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: static `ext::PRIV_STATIC` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private static
@@ -15,7 +15,7 @@ LL |     ext::m!();
    = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: type `ext::PrivEnum` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private type
@@ -23,7 +23,7 @@ LL |     ext::m!();
    = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: type `fn() {<u8 as ext::PrivTrait>::method}` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private type
@@ -31,7 +31,7 @@ LL |     ext::m!();
    = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private type
@@ -39,7 +39,7 @@ LL |     ext::m!();
    = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private type
@@ -47,7 +47,7 @@ LL |     ext::m!();
    = note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
-  --> $DIR/private-inferred-type-3.rs:16:5
+  --> $DIR/private-inferred-type-3.rs:8:5
    |
 LL |     ext::m!();
    |     ^^^^^^^^^ private type
diff --git a/tests/ui/proc-macro/export-macro.rs b/tests/ui/proc-macro/export-macro.rs
index e6001d06f0f..33bf8cfb255 100644
--- a/tests/ui/proc-macro/export-macro.rs
+++ b/tests/ui/proc-macro/export-macro.rs
@@ -1,11 +1,9 @@
-//@ error-pattern: cannot export macro_rules! macros from a `proc-macro` crate
-
 //@ force-host
 //@ no-prefer-dynamic
 
 #![crate_type = "proc-macro"]
 
 #[macro_export]
-macro_rules! foo {
+macro_rules! foo { //~ ERROR cannot export macro_rules! macros from a `proc-macro` crate type
     ($e:expr) => ($e)
 }
diff --git a/tests/ui/proc-macro/export-macro.stderr b/tests/ui/proc-macro/export-macro.stderr
index 410770eca08..be586d50459 100644
--- a/tests/ui/proc-macro/export-macro.stderr
+++ b/tests/ui/proc-macro/export-macro.stderr
@@ -1,5 +1,5 @@
 error: cannot export macro_rules! macros from a `proc-macro` crate type currently
-  --> $DIR/export-macro.rs:9:1
+  --> $DIR/export-macro.rs:7:1
    |
 LL | macro_rules! foo {
    | ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs
index 6afafb7114a..df236cce6d2 100644
--- a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs
+++ b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs
@@ -4,8 +4,10 @@
 //@ edition:2018
 //@ proc-macro: issue-59191.rs
 //@ needs-unwind (affects error output)
-//@ error-pattern: error: `#[panic_handler]` function required
 
 #![feature(custom_inner_attributes)]
 #![issue_59191::no_main]
 #![issue_59191::no_main]
+
+//~? ERROR `#[panic_handler]` function required, but not found
+//~? ERROR unwinding panics are not supported without std
diff --git a/tests/ui/proc-macro/panic-abort.rs b/tests/ui/proc-macro/panic-abort.rs
index 40d8aec5ef6..58e1d006433 100644
--- a/tests/ui/proc-macro/panic-abort.rs
+++ b/tests/ui/proc-macro/panic-abort.rs
@@ -1,4 +1,5 @@
-//@ error-pattern: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
 //@ compile-flags: --crate-type proc-macro -Cpanic=abort
 //@ force-host
 //@ check-pass
+
+//~? WARN building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
diff --git a/tests/ui/proc-macro/two-crate-types-1.rs b/tests/ui/proc-macro/two-crate-types-1.rs
index 432b0a601b2..9d21a430537 100644
--- a/tests/ui/proc-macro/two-crate-types-1.rs
+++ b/tests/ui/proc-macro/two-crate-types-1.rs
@@ -1,7 +1,7 @@
-//@ error-pattern: cannot mix `proc-macro` crate type with others
-
 //@ force-host
 //@ no-prefer-dynamic
 
 #![crate_type = "proc-macro"]
 #![crate_type = "rlib"]
+
+//~? ERROR cannot mix `proc-macro` crate type with others
diff --git a/tests/ui/proc-macro/two-crate-types-2.rs b/tests/ui/proc-macro/two-crate-types-2.rs
index 491c5c71d76..c4cc0b4d80d 100644
--- a/tests/ui/proc-macro/two-crate-types-2.rs
+++ b/tests/ui/proc-macro/two-crate-types-2.rs
@@ -1,3 +1,4 @@
-//@ error-pattern: cannot mix `proc-macro` crate type with others
 //@ compile-flags: --crate-type rlib --crate-type proc-macro
 //@ force-host
+
+//~? ERROR cannot mix `proc-macro` crate type with others
diff --git a/tests/ui/reachable/unreachable-code-ret.rs b/tests/ui/reachable/unreachable-code-ret.rs
index ed9fbd5c5a2..746c4d53e7b 100644
--- a/tests/ui/reachable/unreachable-code-ret.rs
+++ b/tests/ui/reachable/unreachable-code-ret.rs
@@ -1,8 +1,6 @@
-//@ error-pattern: unreachable statement
-
 #![deny(unreachable_code)]
 
 fn main() {
     return;
-    println!("Paul is dead");
+    println!("Paul is dead"); //~ ERROR unreachable statement
 }
diff --git a/tests/ui/reachable/unreachable-code-ret.stderr b/tests/ui/reachable/unreachable-code-ret.stderr
index 824515a2271..d86def536df 100644
--- a/tests/ui/reachable/unreachable-code-ret.stderr
+++ b/tests/ui/reachable/unreachable-code-ret.stderr
@@ -1,5 +1,5 @@
 error: unreachable statement
-  --> $DIR/unreachable-code-ret.rs:7:5
+  --> $DIR/unreachable-code-ret.rs:5:5
    |
 LL |     return;
    |     ------ any code following this expression is unreachable
@@ -7,7 +7,7 @@ LL |     println!("Paul is dead");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
    |
 note: the lint level is defined here
-  --> $DIR/unreachable-code-ret.rs:3:9
+  --> $DIR/unreachable-code-ret.rs:1:9
    |
 LL | #![deny(unreachable_code)]
    |         ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/resolve/bad-env-capture.rs b/tests/ui/resolve/bad-env-capture.rs
index ccd98b6ef06..a0efe88e2a9 100644
--- a/tests/ui/resolve/bad-env-capture.rs
+++ b/tests/ui/resolve/bad-env-capture.rs
@@ -1,6 +1,8 @@
-//@ error-pattern: can't capture dynamic environment in a fn item
 fn foo() {
     let x: isize;
     fn bar() { log(debug, x); }
+    //~^ ERROR can't capture dynamic environment in a fn item
+    //~| ERROR cannot find value `debug` in this scope
+    //~| ERROR cannot find function `log` in this scope
 }
 fn main() { foo(); }
diff --git a/tests/ui/resolve/bad-env-capture.stderr b/tests/ui/resolve/bad-env-capture.stderr
index 59b1fabfd7c..a3a15ca245b 100644
--- a/tests/ui/resolve/bad-env-capture.stderr
+++ b/tests/ui/resolve/bad-env-capture.stderr
@@ -1,5 +1,5 @@
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/bad-env-capture.rs:4:27
+  --> $DIR/bad-env-capture.rs:3:27
    |
 LL |     fn bar() { log(debug, x); }
    |                           ^
@@ -7,13 +7,13 @@ LL |     fn bar() { log(debug, x); }
    = help: use the `|| { ... }` closure form instead
 
 error[E0425]: cannot find value `debug` in this scope
-  --> $DIR/bad-env-capture.rs:4:20
+  --> $DIR/bad-env-capture.rs:3:20
    |
 LL |     fn bar() { log(debug, x); }
    |                    ^^^^^ not found in this scope
 
 error[E0425]: cannot find function `log` in this scope
-  --> $DIR/bad-env-capture.rs:4:16
+  --> $DIR/bad-env-capture.rs:3:16
    |
 LL |     fn bar() { log(debug, x); }
    |                ^^^ not found in this scope
diff --git a/tests/ui/resolve/bad-env-capture2.rs b/tests/ui/resolve/bad-env-capture2.rs
index 84d1832be60..8298e6fcd24 100644
--- a/tests/ui/resolve/bad-env-capture2.rs
+++ b/tests/ui/resolve/bad-env-capture2.rs
@@ -1,5 +1,7 @@
-//@ error-pattern: can't capture dynamic environment in a fn item
 fn foo(x: isize) {
     fn bar() { log(debug, x); }
+    //~^ ERROR can't capture dynamic environment in a fn item
+    //~| ERROR cannot find value `debug` in this scope
+    //~| ERROR cannot find function `log` in this scope
 }
 fn main() { foo(2); }
diff --git a/tests/ui/resolve/bad-env-capture2.stderr b/tests/ui/resolve/bad-env-capture2.stderr
index 811c259de6b..403fe2d32b9 100644
--- a/tests/ui/resolve/bad-env-capture2.stderr
+++ b/tests/ui/resolve/bad-env-capture2.stderr
@@ -1,5 +1,5 @@
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/bad-env-capture2.rs:3:27
+  --> $DIR/bad-env-capture2.rs:2:27
    |
 LL |     fn bar() { log(debug, x); }
    |                           ^
@@ -7,13 +7,13 @@ LL |     fn bar() { log(debug, x); }
    = help: use the `|| { ... }` closure form instead
 
 error[E0425]: cannot find value `debug` in this scope
-  --> $DIR/bad-env-capture2.rs:3:20
+  --> $DIR/bad-env-capture2.rs:2:20
    |
 LL |     fn bar() { log(debug, x); }
    |                    ^^^^^ not found in this scope
 
 error[E0425]: cannot find function `log` in this scope
-  --> $DIR/bad-env-capture2.rs:3:16
+  --> $DIR/bad-env-capture2.rs:2:16
    |
 LL |     fn bar() { log(debug, x); }
    |                ^^^ not found in this scope
diff --git a/tests/ui/resolve/bad-env-capture3.rs b/tests/ui/resolve/bad-env-capture3.rs
index 849b84cb1ab..8f5440d3339 100644
--- a/tests/ui/resolve/bad-env-capture3.rs
+++ b/tests/ui/resolve/bad-env-capture3.rs
@@ -1,7 +1,9 @@
-//@ error-pattern: can't capture dynamic environment in a fn item
 fn foo(x: isize) {
     fn mth() {
         fn bar() { log(debug, x); }
+        //~^ ERROR can't capture dynamic environment in a fn item
+        //~| ERROR cannot find value `debug` in this scope
+        //~| ERROR cannot find function `log` in this scope
     }
 }
 
diff --git a/tests/ui/resolve/bad-env-capture3.stderr b/tests/ui/resolve/bad-env-capture3.stderr
index eab37fde96e..962eb72ee68 100644
--- a/tests/ui/resolve/bad-env-capture3.stderr
+++ b/tests/ui/resolve/bad-env-capture3.stderr
@@ -1,5 +1,5 @@
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/bad-env-capture3.rs:4:31
+  --> $DIR/bad-env-capture3.rs:3:31
    |
 LL |         fn bar() { log(debug, x); }
    |                               ^
@@ -7,13 +7,13 @@ LL |         fn bar() { log(debug, x); }
    = help: use the `|| { ... }` closure form instead
 
 error[E0425]: cannot find value `debug` in this scope
-  --> $DIR/bad-env-capture3.rs:4:24
+  --> $DIR/bad-env-capture3.rs:3:24
    |
 LL |         fn bar() { log(debug, x); }
    |                        ^^^^^ not found in this scope
 
 error[E0425]: cannot find function `log` in this scope
-  --> $DIR/bad-env-capture3.rs:4:20
+  --> $DIR/bad-env-capture3.rs:3:20
    |
 LL |         fn bar() { log(debug, x); }
    |                    ^^^ not found in this scope
diff --git a/tests/ui/return/ret-non-nil.rs b/tests/ui/return/ret-non-nil.rs
index 1d039ffe18c..b9a53086b3c 100644
--- a/tests/ui/return/ret-non-nil.rs
+++ b/tests/ui/return/ret-non-nil.rs
@@ -1,7 +1,5 @@
-//@ error-pattern: `return;` in a function whose return type is not `()`
-
 fn f() { return; }
 
-fn g() -> isize { return; }
+fn g() -> isize { return; } //~ ERROR `return;` in a function whose return type is not `()`
 
 fn main() { f(); g(); }
diff --git a/tests/ui/return/ret-non-nil.stderr b/tests/ui/return/ret-non-nil.stderr
index 802900e61a3..44edecf501f 100644
--- a/tests/ui/return/ret-non-nil.stderr
+++ b/tests/ui/return/ret-non-nil.stderr
@@ -1,5 +1,5 @@
 error[E0069]: `return;` in a function whose return type is not `()`
-  --> $DIR/ret-non-nil.rs:5:19
+  --> $DIR/ret-non-nil.rs:3:19
    |
 LL | fn g() -> isize { return; }
    |           -----   ^^^^^^ return type is not `()`
diff --git a/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs
index d54b428bf22..9dc856959c0 100644
--- a/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: -l foo:bar
-//@ error-pattern: renaming of the library `foo` was specified
 
 #![crate_type = "lib"]
+
+//~? ERROR renaming of the library `foo` was specified
diff --git a/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs
index ec1a246245e..69132895510 100644
--- a/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs
@@ -1,7 +1,8 @@
 //@ compile-flags: -l foo:bar -l foo:baz
-//@ error-pattern: multiple renamings were specified for library
 
 #![crate_type = "lib"]
 
 #[link(name = "foo")]
 extern "C" {}
+
+//~? ERROR multiple renamings were specified for library `foo`
diff --git a/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs
index 2a13d22e22a..e1fec305932 100644
--- a/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -l dylib=foo:bar
-//@ error-pattern: overriding linking modifiers from command line is not supported
 
 #![feature(native_link_modifiers_as_needed)]
 
@@ -7,3 +6,4 @@
 
 #[link(name = "foo", kind = "dylib", modifiers = "-as-needed")]
 extern "C" {}
+//~^ ERROR overriding linking modifiers from command line is not supported
diff --git a/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr
index ce145689f90..84b197a9b98 100644
--- a/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr
@@ -1,5 +1,5 @@
 error: overriding linking modifiers from command line is not supported
-  --> $DIR/rename-modifiers.rs:9:1
+  --> $DIR/rename-modifiers.rs:8:1
    |
 LL | extern "C" {}
    | ^^^^^^^^^^^^^
diff --git a/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs
index 39205a11dd7..6fee80f0294 100644
--- a/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs
+++ b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs
@@ -1,7 +1,8 @@
 //@ compile-flags: -l foo:
-//@ error-pattern: an empty renaming target was specified for library
 
 #![crate_type = "lib"]
 
 #[link(name = "foo")]
 extern "C" {}
+
+//~? ERROR an empty renaming target was specified for library `foo`
diff --git a/tests/ui/rmeta/rmeta_bin.rs b/tests/ui/rmeta/rmeta_bin.rs
index c7d2050cd59..9eb65241faf 100644
--- a/tests/ui/rmeta/rmeta_bin.rs
+++ b/tests/ui/rmeta/rmeta_bin.rs
@@ -2,7 +2,6 @@
 //@ compile-flags: --crate-type=bin
 //@ aux-build:rmeta-meta.rs
 //@ no-prefer-dynamic
-//@ error-pattern: crate `rmeta_meta` required to be available in rlib format, but was not found
 
 // Check that building a bin crate fails if a dependent crate is metadata-only.
 
@@ -12,3 +11,5 @@ use rmeta_meta::Foo;
 fn main() {
     let _ = Foo { field: 42 };
 }
+
+//~? ERROR crate `rmeta_meta` required to be available in rlib format, but was not found in this form
diff --git a/tests/ui/rmeta/rmeta_lib.rs b/tests/ui/rmeta/rmeta_lib.rs
index 1be4ee8de79..d1a2b653ed8 100644
--- a/tests/ui/rmeta/rmeta_lib.rs
+++ b/tests/ui/rmeta/rmeta_lib.rs
@@ -1,7 +1,6 @@
 //@ build-fail
 //@ aux-build:rmeta-meta.rs
 //@ no-prefer-dynamic
-//@ error-pattern: crate `rmeta_meta` required to be available in rlib format, but was not found
 
 // Check that building a non-metadata crate fails if a dependent crate is
 // metadata-only.
@@ -12,3 +11,5 @@ use rmeta_meta::Foo;
 fn main() {
     let _ = Foo { field: 42 };
 }
+
+//~? ERROR crate `rmeta_meta` required to be available in rlib format, but was not found in this form
diff --git a/tests/ui/sanitizer/incompatible.rs b/tests/ui/sanitizer/incompatible.rs
index d000abb26ac..c706a5a2e4e 100644
--- a/tests/ui/sanitizer/incompatible.rs
+++ b/tests/ui/sanitizer/incompatible.rs
@@ -1,7 +1,8 @@
 //@ compile-flags: -Z sanitizer=address -Z sanitizer=memory --target x86_64-unknown-linux-gnu
 //@ needs-llvm-components: x86
-//@ error-pattern: error: `-Zsanitizer=address` is incompatible with `-Zsanitizer=memory`
 
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//~? ERROR `-Zsanitizer=address` is incompatible with `-Zsanitizer=memory`
diff --git a/tests/ui/sanitizer/unsupported-target.rs b/tests/ui/sanitizer/unsupported-target.rs
index 7c7dc24b5d9..14925548e92 100644
--- a/tests/ui/sanitizer/unsupported-target.rs
+++ b/tests/ui/sanitizer/unsupported-target.rs
@@ -1,6 +1,8 @@
 //@ compile-flags: -Z sanitizer=leak --target i686-unknown-linux-gnu
 //@ needs-llvm-components: x86
-//@ error-pattern: error: leak sanitizer is not supported for this target
+
 #![feature(no_core)]
 #![no_core]
 #![no_main]
+
+//~? ERROR leak sanitizer is not supported for this target
diff --git a/tests/ui/simd/monomorphize-too-long.rs b/tests/ui/simd/monomorphize-too-long.rs
index 4bcde782292..4fac987b0b5 100644
--- a/tests/ui/simd/monomorphize-too-long.rs
+++ b/tests/ui/simd/monomorphize-too-long.rs
@@ -1,5 +1,4 @@
 //@ build-fail
-//@ error-pattern: monomorphising SIMD type `Simd<u16, 54321>` of length greater than 32768
 
 #![feature(repr_simd)]
 
@@ -9,3 +8,5 @@ struct Simd<T, const N: usize>([T; N]);
 fn main() {
     let _too_big = Simd([1_u16; 54321]);
 }
+
+//~? ERROR monomorphising SIMD type `Simd<u16, 54321>` of length greater than 32768
diff --git a/tests/ui/simd/monomorphize-zero-length.rs b/tests/ui/simd/monomorphize-zero-length.rs
index 44b4cfc0bcf..d38870c572d 100644
--- a/tests/ui/simd/monomorphize-zero-length.rs
+++ b/tests/ui/simd/monomorphize-zero-length.rs
@@ -1,5 +1,4 @@
 //@ build-fail
-//@ error-pattern: monomorphising SIMD type `Simd<f64, 0>` of zero length
 
 #![feature(repr_simd)]
 
@@ -9,3 +8,5 @@ struct Simd<T, const N: usize>([T; N]);
 fn main() {
     let _empty = Simd([1.0; 0]);
 }
+
+//~? ERROR monomorphising SIMD type `Simd<f64, 0>` of zero length
diff --git a/tests/ui/simd/type-generic-monomorphisation-empty.rs b/tests/ui/simd/type-generic-monomorphisation-empty.rs
index 4700f642065..c08dc9fe3df 100644
--- a/tests/ui/simd/type-generic-monomorphisation-empty.rs
+++ b/tests/ui/simd/type-generic-monomorphisation-empty.rs
@@ -2,11 +2,11 @@
 
 #![feature(repr_simd, intrinsics)]
 
-//@ error-pattern:monomorphising SIMD type `Simd<0>` of zero length
-
 #[repr(simd)]
 struct Simd<const N: usize>([f32; N]);
 
 fn main() {
     let _ = Simd::<0>([]);
 }
+
+//~? ERROR monomorphising SIMD type `Simd<0>` of zero length
diff --git a/tests/ui/simd/type-generic-monomorphisation-non-primitive.rs b/tests/ui/simd/type-generic-monomorphisation-non-primitive.rs
index a2f6998c6d9..7924aeb8684 100644
--- a/tests/ui/simd/type-generic-monomorphisation-non-primitive.rs
+++ b/tests/ui/simd/type-generic-monomorphisation-non-primitive.rs
@@ -4,11 +4,11 @@
 
 struct E;
 
-//@ error-pattern:monomorphising SIMD type `S<E>` with a non-primitive-scalar (integer/float/pointer) element type `E`
-
 #[repr(simd)]
 struct S<T>([T; 4]);
 
 fn main() {
     let _v: Option<S<E>> = None;
 }
+
+//~? ERROR monomorphising SIMD type `S<E>` with a non-primitive-scalar (integer/float/pointer) element type `E`
diff --git a/tests/ui/simd/type-generic-monomorphisation-oversized.rs b/tests/ui/simd/type-generic-monomorphisation-oversized.rs
index 9949f913c44..efe3480317c 100644
--- a/tests/ui/simd/type-generic-monomorphisation-oversized.rs
+++ b/tests/ui/simd/type-generic-monomorphisation-oversized.rs
@@ -2,11 +2,11 @@
 
 #![feature(repr_simd, intrinsics)]
 
-//@ error-pattern:monomorphising SIMD type `Simd<65536>` of length greater than 32768
-
 #[repr(simd)]
 struct Simd<const N: usize>([f32; N]);
 
 fn main() {
     let _ = Simd::<65536>([0.; 65536]);
 }
+
+//~? ERROR monomorphising SIMD type `Simd<65536>` of length greater than 32768
diff --git a/tests/ui/simd/type-generic-monomorphisation-wide-ptr.rs b/tests/ui/simd/type-generic-monomorphisation-wide-ptr.rs
index 18fc0753430..97640514dee 100644
--- a/tests/ui/simd/type-generic-monomorphisation-wide-ptr.rs
+++ b/tests/ui/simd/type-generic-monomorphisation-wide-ptr.rs
@@ -2,11 +2,11 @@
 
 #![feature(repr_simd)]
 
-//@ error-pattern:monomorphising SIMD type `S<*mut [u8]>` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
-
 #[repr(simd)]
 struct S<T>([T; 4]);
 
 fn main() {
     let _v: Option<S<*mut [u8]>> = None;
 }
+
+//~? ERROR monomorphising SIMD type `S<*mut [u8]>` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
diff --git a/tests/ui/simd/type-generic-monomorphisation.rs b/tests/ui/simd/type-generic-monomorphisation.rs
index 8b8d645a264..2563b917e34 100644
--- a/tests/ui/simd/type-generic-monomorphisation.rs
+++ b/tests/ui/simd/type-generic-monomorphisation.rs
@@ -2,9 +2,6 @@
 
 #![feature(repr_simd, intrinsics)]
 
-
-//@ error-pattern:monomorphising SIMD type `Simd2<X>` with a non-primitive-scalar (integer/float/pointer) element type `X`
-
 struct X(Vec<i32>);
 #[repr(simd)]
 struct Simd2<T>([T; 2]);
@@ -12,3 +9,5 @@ struct Simd2<T>([T; 2]);
 fn main() {
     let _ = Simd2([X(vec![]), X(vec![])]);
 }
+
+//~? ERROR monomorphising SIMD type `Simd2<X>` with a non-primitive-scalar (integer/float/pointer) element type `X`
diff --git a/tests/ui/simd/type-wide-ptr.rs b/tests/ui/simd/type-wide-ptr.rs
index 41d9fac26ad..5740a4e8318 100644
--- a/tests/ui/simd/type-wide-ptr.rs
+++ b/tests/ui/simd/type-wide-ptr.rs
@@ -2,11 +2,11 @@
 
 #![feature(repr_simd)]
 
-//@ error-pattern:monomorphising SIMD type `S` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
-
 #[repr(simd)]
 struct S([*mut [u8]; 4]);
 
 fn main() {
     let _v: Option<S> = None;
 }
+
+//~? ERROR monomorphising SIMD type `S` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]`
diff --git a/tests/ui/tail-typeck.rs b/tests/ui/tail-typeck.rs
index feef58a3388..1deb43c9496 100644
--- a/tests/ui/tail-typeck.rs
+++ b/tests/ui/tail-typeck.rs
@@ -1,6 +1,4 @@
-//@ error-pattern: mismatched types
-
-fn f() -> isize { return g(); }
+fn f() -> isize { return g(); } //~ ERROR mismatched types
 
 fn g() -> usize { return 0; }
 
diff --git a/tests/ui/tail-typeck.stderr b/tests/ui/tail-typeck.stderr
index 0e470a7b405..3cfbfa0fb56 100644
--- a/tests/ui/tail-typeck.stderr
+++ b/tests/ui/tail-typeck.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/tail-typeck.rs:3:26
+  --> $DIR/tail-typeck.rs:1:26
    |
 LL | fn f() -> isize { return g(); }
    |           -----          ^^^ expected `isize`, found `usize`
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
index 81f138b175f..12e7e3bc45b 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
@@ -5,9 +5,11 @@
 //@ compile-flags: -Ctarget-feature=-sse
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: must be enabled to ensure that the ABI
+
 #![feature(no_core, lang_items)]
 #![no_core]
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `sse2` must be enabled to ensure that the ABI of the current target can be implemented correctly
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
index 7242bcc85bf..33e4f12694f 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
@@ -3,9 +3,11 @@
 //@ compile-flags: -Ctarget-feature=-neon
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: must be enabled to ensure that the ABI
+
 #![feature(no_core, lang_items)]
 #![no_core]
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `neon` must be enabled to ensure that the ABI of the current target can be implemented correctly
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
index 7eebcf05dc0..e1bd25ffad1 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
@@ -4,9 +4,12 @@
 //@ compile-flags: -Ctarget-feature=-x87
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: must be enabled to ensure that the ABI
+
 #![feature(no_core, lang_items)]
 #![no_core]
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `x87` must be enabled to ensure that the ABI of the current target can be implemented correctly
+//~? WARN unstable feature specified for `-Ctarget-feature`: `x87`
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
index f277a309cd6..4ccc6e0e941 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
+++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
@@ -4,9 +4,12 @@
 //@ compile-flags: -Ctarget-feature=+soft-float
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: must be disabled to ensure that the ABI
+
 #![feature(no_core, lang_items, riscv_target_feature)]
 #![no_core]
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `soft-float` must be disabled to ensure that the ABI of the current target can be implemented correctl
+//~? WARN unstable feature specified for `-Ctarget-feature`: `soft-float`
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs b/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
index cf85c521228..fda0b1c08cb 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
@@ -10,3 +10,5 @@
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `forced-atomics` cannot be disabled with `-Ctarget-feature`: unsound because it changes the ABI of atomic operations
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag.rs b/tests/ui/target-feature/forbidden-target-feature-flag.rs
index 245841eb039..a04d7e34753 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-flag.rs
@@ -4,9 +4,11 @@
 //@ compile-flags: -Ctarget-feature=+forced-atomics
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: unsound because it changes the ABI
+
 #![feature(no_core, lang_items)]
 #![no_core]
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `forced-atomics` cannot be enabled with `-Ctarget-feature`: unsound because it changes the ABI of atomic operations
diff --git a/tests/ui/target-feature/target-cpu-lacks-required-target-feature.rs b/tests/ui/target-feature/target-cpu-lacks-required-target-feature.rs
index 28d026c1a9a..be6cd2b6faf 100644
--- a/tests/ui/target-feature/target-cpu-lacks-required-target-feature.rs
+++ b/tests/ui/target-feature/target-cpu-lacks-required-target-feature.rs
@@ -3,10 +3,11 @@
 //@ compile-flags: -Ctarget-cpu=pentium
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: must be enabled
 
 #![feature(no_core, lang_items)]
 #![no_core]
 
 #[lang = "sized"]
 pub trait Sized {}
+
+//~? WARN target feature `sse2` must be enabled to ensure that the ABI of the current target can be implemented correctly
diff --git a/tests/ui/target-feature/tied-features-no-implication.pacg.stderr b/tests/ui/target-feature/tied-features-no-implication.pacg.stderr
index 0e31dea24ea..4ff42d31e94 100644
--- a/tests/ui/target-feature/tied-features-no-implication.pacg.stderr
+++ b/tests/ui/target-feature/tied-features-no-implication.pacg.stderr
@@ -1,10 +1,10 @@
 error[E0428]: the name `foo` is defined multiple times
-  --> $DIR/tied-features-no-implication.rs:28:1
+  --> $DIR/tied-features-no-implication.rs:27:1
    |
 LL | fn foo() {}
    | -------- previous definition of the value `foo` here
 ...
-LL | pub unsafe fn foo() {
+LL | pub unsafe fn foo() {}
    | ^^^^^^^^^^^^^^^^^^^ `foo` redefined here
    |
    = note: `foo` must be defined only once in the value namespace of this module
diff --git a/tests/ui/target-feature/tied-features-no-implication.rs b/tests/ui/target-feature/tied-features-no-implication.rs
index 157b50bb0d3..1625f71431a 100644
--- a/tests/ui/target-feature/tied-features-no-implication.rs
+++ b/tests/ui/target-feature/tied-features-no-implication.rs
@@ -2,9 +2,8 @@
 //@ compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
 //@ needs-llvm-components: aarch64
 //@[paca] compile-flags: -Ctarget-feature=+paca
-//@[paca] error-pattern: the target features paca, pacg must all be either enabled or disabled together
 //@[pacg] compile-flags: -Ctarget-feature=+pacg
-//@[pacg] error-pattern: the name `foo` is defined multiple times
+
 #![feature(no_core, lang_items)]
 #![no_core]
 
@@ -25,5 +24,6 @@ fn foo() {}
 // be).
 
 #[cfg(target_feature = "pacg")]
-pub unsafe fn foo() {
-}
+pub unsafe fn foo() {} //[pacg]~ ERROR the name `foo` is defined multiple times
+
+//[paca]~? ERROR the target features paca, pacg must all be either enabled or disabled together
diff --git a/tests/ui/test-attrs/test-panic-abort-disabled.rs b/tests/ui/test-attrs/test-panic-abort-disabled.rs
index e83be65f925..cb1b2af9e26 100644
--- a/tests/ui/test-attrs/test-panic-abort-disabled.rs
+++ b/tests/ui/test-attrs/test-panic-abort-disabled.rs
@@ -1,4 +1,3 @@
-//@ error-pattern:building tests with panic=abort is not supported
 //@ no-prefer-dynamic
 //@ compile-flags: --test -Cpanic=abort -Zpanic-abort-tests=no
 //@ run-flags: --test-threads=1
@@ -18,3 +17,5 @@ fn it_works() {
 fn it_panics() {
     assert_eq!(1 + 1, 4);
 }
+
+//~? ERROR building tests with panic=abort is not supported without `-Zpanic_abort_tests`
diff --git a/tests/ui/track-diagnostics/track.rs b/tests/ui/track-diagnostics/track.rs
index 9e81cb53fc1..78ff85489be 100644
--- a/tests/ui/track-diagnostics/track.rs
+++ b/tests/ui/track-diagnostics/track.rs
@@ -15,4 +15,7 @@
 
 fn main() {
     break rust
+    //~^ ERROR cannot find value `rust` in this scope
+    //~| ERROR `break` outside of a loop or labeled block
+    //~| ERROR It looks like you're trying to break rust; would you like some ICE?
 }
diff --git a/tests/ui/track-diagnostics/track2.rs b/tests/ui/track-diagnostics/track2.rs
index 5805fd21220..f51a42cf86f 100644
--- a/tests/ui/track-diagnostics/track2.rs
+++ b/tests/ui/track-diagnostics/track2.rs
@@ -6,5 +6,5 @@
 //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
 
 fn main() {
-    let _moved @ _from = String::from("foo");
+    let _moved @ _from = String::from("foo"); //~ ERROR use of moved value
 }
diff --git a/tests/ui/track-diagnostics/track3.rs b/tests/ui/track-diagnostics/track3.rs
index bac1fc7e184..428067572af 100644
--- a/tests/ui/track-diagnostics/track3.rs
+++ b/tests/ui/track-diagnostics/track3.rs
@@ -7,4 +7,6 @@
 
 fn main() {
     let _unimported = Blah { field: u8 };
+    //~^ ERROR cannot find struct, variant or union type `Blah` in this scope
+    //~| ERROR expected value, found builtin type `u8`
 }
diff --git a/tests/ui/track-diagnostics/track4.rs b/tests/ui/track-diagnostics/track4.rs
index ec9e3efa481..b6edfdba259 100644
--- a/tests/ui/track-diagnostics/track4.rs
+++ b/tests/ui/track-diagnostics/track4.rs
@@ -5,7 +5,7 @@
 // updating everytime someone adds or removes a line.
 //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
 
-pub onion {
+pub onion { //~ ERROR missing `enum` for enum definition
     Owo(u8),
     Uwu(i8),
 }
diff --git a/tests/ui/track-diagnostics/track5.rs b/tests/ui/track-diagnostics/track5.rs
index e72e3482ad3..800bb21b2b1 100644
--- a/tests/ui/track-diagnostics/track5.rs
+++ b/tests/ui/track-diagnostics/track5.rs
@@ -5,4 +5,4 @@
 // updating everytime someone adds or removes a line.
 //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
 
-}
+} //~ ERROR unexpected closing delimiter: `}`
diff --git a/tests/ui/track-diagnostics/track6.rs b/tests/ui/track-diagnostics/track6.rs
index e4d124a22e4..55db2ecf939 100644
--- a/tests/ui/track-diagnostics/track6.rs
+++ b/tests/ui/track-diagnostics/track6.rs
@@ -11,7 +11,7 @@ pub trait Foo {
 }
 
 impl <T> Foo for T {
-    default fn bar() {}
+    default fn bar() {} //~ ERROR specialization is unstable
 }
 
 fn main() {}
diff --git a/tests/ui/traits/solver-cycles/129541-recursive-struct.rs b/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
index 1f5d0a772a2..723179302e3 100644
--- a/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
+++ b/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
@@ -4,7 +4,6 @@
 //@ ignore-compare-mode-next-solver (explicit revisions)
 //@[unique_next] compile-flags: -Znext-solver
 //@[multiple_next] compile-flags: -Znext-solver
-//@ error-pattern: reached the recursion limit finding the struct tail for `<[Hello] as Normalize>::Assoc`
 
 trait Bound {}
 trait Normalize {
@@ -25,3 +24,5 @@ struct Hello {
 }
 
 fn main() {}
+
+//~? ERROR reached the recursion limit finding the struct tail for `<[Hello] as Normalize>::Assoc`
diff --git a/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs b/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs
index 0b75bb23faf..cfb2d7c5218 100644
--- a/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs
+++ b/tests/ui/treat-err-as-bug/panic-causes-oom-112708.rs
@@ -6,5 +6,5 @@
 
 fn main() {
     #[deny(while_true)]
-    while true {}
+    while true {} //~ ERROR denote infinite loops with `loop { ... }`
 }
diff --git a/tests/ui/treat-err-as-bug/span_delayed_bug.rs b/tests/ui/treat-err-as-bug/span_delayed_bug.rs
index 88a9d07c94c..a242d11129f 100644
--- a/tests/ui/treat-err-as-bug/span_delayed_bug.rs
+++ b/tests/ui/treat-err-as-bug/span_delayed_bug.rs
@@ -9,4 +9,4 @@
 #![feature(rustc_attrs)]
 
 #[rustc_delayed_bug_from_inside_query]
-fn main() {}
+fn main() {} //~ ERROR delayed bug triggered by #[rustc_delayed_bug_from_inside_query]
diff --git a/tests/ui/type/issue-91268.rs b/tests/ui/type/issue-91268.rs
index 16d5b241145..6297880702e 100644
--- a/tests/ui/type/issue-91268.rs
+++ b/tests/ui/type/issue-91268.rs
@@ -1,5 +1,6 @@
-//@ error-pattern: this file contains an unclosed delimiter
 // ignore-tidy-trailing-newlines
 // `ţ` must be the last character in this file, it cannot be followed by a newline
+
+//~vv ERROR this file contains an unclosed delimiter
 fn main() {
     0: u8(ţ
\ No newline at end of file
diff --git a/tests/ui/type/issue-91268.stderr b/tests/ui/type/issue-91268.stderr
index 395559442d1..db7b5a188cf 100644
--- a/tests/ui/type/issue-91268.stderr
+++ b/tests/ui/type/issue-91268.stderr
@@ -1,5 +1,5 @@
 error: this file contains an unclosed delimiter
-  --> $DIR/issue-91268.rs:5:12
+  --> $DIR/issue-91268.rs:6:12
    |
 LL | fn main() {
    |           - unclosed delimiter
diff --git a/tests/ui/type/type-arg-out-of-scope.rs b/tests/ui/type/type-arg-out-of-scope.rs
index 3f8a6ff1016..05ed54ec832 100644
--- a/tests/ui/type/type-arg-out-of-scope.rs
+++ b/tests/ui/type/type-arg-out-of-scope.rs
@@ -1,5 +1,6 @@
-//@ error-pattern:can't use generic parameters from outer item
 fn foo<T>(x: T) {
     fn bar(f: Box<dyn FnMut(T) -> T>) { }
+    //~^ ERROR can't use generic parameters from outer item
+    //~| ERROR can't use generic parameters from outer item
 }
 fn main() { foo(1); }
diff --git a/tests/ui/type/type-arg-out-of-scope.stderr b/tests/ui/type/type-arg-out-of-scope.stderr
index 8665001e243..fcaaca1770f 100644
--- a/tests/ui/type/type-arg-out-of-scope.stderr
+++ b/tests/ui/type/type-arg-out-of-scope.stderr
@@ -1,5 +1,5 @@
 error[E0401]: can't use generic parameters from outer item
-  --> $DIR/type-arg-out-of-scope.rs:3:29
+  --> $DIR/type-arg-out-of-scope.rs:2:29
    |
 LL | fn foo<T>(x: T) {
    |        - type parameter from outer item
@@ -9,7 +9,7 @@ LL |     fn bar(f: Box<dyn FnMut(T) -> T>) { }
    |           help: try introducing a local generic parameter here: `<T>`
 
 error[E0401]: can't use generic parameters from outer item
-  --> $DIR/type-arg-out-of-scope.rs:3:35
+  --> $DIR/type-arg-out-of-scope.rs:2:35
    |
 LL | fn foo<T>(x: T) {
    |        - type parameter from outer item
diff --git a/tests/ui/typeck/issue-91334.rs b/tests/ui/typeck/issue-91334.rs
index ec0d4ad70f1..c820014ff93 100644
--- a/tests/ui/typeck/issue-91334.rs
+++ b/tests/ui/typeck/issue-91334.rs
@@ -1,7 +1,7 @@
 // Regression test for the ICE described in issue #91334.
 
-//@ error-pattern: this file contains an unclosed delimiter
-
 #![feature(coroutines)]
 
+//~vv ERROR mismatched closing delimiter: `)`
+//~v ERROR this file contains an unclosed delimiter
 fn f(){||yield(((){),
diff --git a/tests/ui/typeck/output-type-mismatch.rs b/tests/ui/typeck/output-type-mismatch.rs
index d5691c9c353..0d7c7d1dfe1 100644
--- a/tests/ui/typeck/output-type-mismatch.rs
+++ b/tests/ui/typeck/output-type-mismatch.rs
@@ -1,5 +1,3 @@
-//@ error-pattern: mismatched types
-
 fn f() { }
 
-fn main() { let i: isize; i = f(); }
+fn main() { let i: isize; i = f(); } //~ ERROR mismatched types
diff --git a/tests/ui/typeck/output-type-mismatch.stderr b/tests/ui/typeck/output-type-mismatch.stderr
index c6df6650654..ba50cd4e6d7 100644
--- a/tests/ui/typeck/output-type-mismatch.stderr
+++ b/tests/ui/typeck/output-type-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/output-type-mismatch.rs:5:31
+  --> $DIR/output-type-mismatch.rs:3:31
    |
 LL | fn main() { let i: isize; i = f(); }
    |                    -----      ^^^ expected `isize`, found `()`
diff --git a/tests/ui/typeck/while-type-error.rs b/tests/ui/typeck/while-type-error.rs
index ca3b8921f54..abc607516e6 100644
--- a/tests/ui/typeck/while-type-error.rs
+++ b/tests/ui/typeck/while-type-error.rs
@@ -1,3 +1 @@
-//@ error-pattern: mismatched types
-
-fn main() { while main { } }
+fn main() { while main { } } //~ ERROR mismatched types
diff --git a/tests/ui/typeck/while-type-error.stderr b/tests/ui/typeck/while-type-error.stderr
index b67ec561531..4bd86aafc17 100644
--- a/tests/ui/typeck/while-type-error.stderr
+++ b/tests/ui/typeck/while-type-error.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/while-type-error.rs:3:19
+  --> $DIR/while-type-error.rs:1:19
    |
 LL | fn main() { while main { } }
    |                   ^^^^ expected `bool`, found fn item
diff --git a/tests/ui/typeck/wrong-ret-type.rs b/tests/ui/typeck/wrong-ret-type.rs
index b83aefad1e9..2d6751a823c 100644
--- a/tests/ui/typeck/wrong-ret-type.rs
+++ b/tests/ui/typeck/wrong-ret-type.rs
@@ -1,3 +1,2 @@
-//@ error-pattern: mismatched types
-fn mk_int() -> usize { let i: isize = 3; return i; }
+fn mk_int() -> usize { let i: isize = 3; return i; } //~ ERROR mismatched types
 fn main() { }
diff --git a/tests/ui/typeck/wrong-ret-type.stderr b/tests/ui/typeck/wrong-ret-type.stderr
index 33a094ce95d..918eb2d5c88 100644
--- a/tests/ui/typeck/wrong-ret-type.stderr
+++ b/tests/ui/typeck/wrong-ret-type.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/wrong-ret-type.rs:2:49
+  --> $DIR/wrong-ret-type.rs:1:49
    |
 LL | fn mk_int() -> usize { let i: isize = 3; return i; }
    |                -----                            ^ expected `usize`, found `isize`
diff --git a/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
index 7bd4df47220..9304e20b429 100644
--- a/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
+++ b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
@@ -1,6 +1,6 @@
+//~ ERROR unknown lint: `test_unstable_lint`
 //@ check-fail
 //@ compile-flags: -Dunknown_lints -Atest_unstable_lint
-//@ error-pattern: unknown lint: `test_unstable_lint`
 //@ error-pattern: the `test_unstable_lint` lint is unstable
 
 fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
index 995f65ef83d..76983419c68 100644
--- a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
+++ b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
@@ -1,6 +1,6 @@
+//~ WARN unknown lint: `test_unstable_lint`
 //@ check-pass
 //@ compile-flags: -Wunknown_lints -Atest_unstable_lint
-//@ error-pattern: unknown lint: `test_unstable_lint`
 //@ error-pattern: the `test_unstable_lint` lint is unstable
 
 fn main() {}
diff --git a/tests/ui/use/use-meta-mismatch.rs b/tests/ui/use/use-meta-mismatch.rs
index 2c5ae9cd9a1..8d15e46375c 100644
--- a/tests/ui/use/use-meta-mismatch.rs
+++ b/tests/ui/use/use-meta-mismatch.rs
@@ -1,5 +1,3 @@
-//@ error-pattern:can't find crate for `fake_crate`
-
-extern crate fake_crate as extra;
+extern crate fake_crate as extra; //~ ERROR can't find crate for `fake_crate`
 
 fn main() { }
diff --git a/tests/ui/use/use-meta-mismatch.stderr b/tests/ui/use/use-meta-mismatch.stderr
index b793229e5fd..ffc471fa722 100644
--- a/tests/ui/use/use-meta-mismatch.stderr
+++ b/tests/ui/use/use-meta-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0463]: can't find crate for `fake_crate`
-  --> $DIR/use-meta-mismatch.rs:3:1
+  --> $DIR/use-meta-mismatch.rs:1:1
    |
 LL | extern crate fake_crate as extra;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
diff --git a/tests/ui/windows-subsystem/windows-subsystem-invalid.rs b/tests/ui/windows-subsystem/windows-subsystem-invalid.rs
index c6a6dd00a92..4dadfc6fd5d 100644
--- a/tests/ui/windows-subsystem/windows-subsystem-invalid.rs
+++ b/tests/ui/windows-subsystem/windows-subsystem-invalid.rs
@@ -1,5 +1,5 @@
-//@ error-pattern: invalid windows subsystem `wrong`, only `windows` and `console` are allowed
-
 #![windows_subsystem = "wrong"]
 
 fn main() {}
+
+//~? ERROR invalid windows subsystem `wrong`