about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-01 00:53:19 +0000
committerbors <bors@rust-lang.org>2025-03-01 00:53:19 +0000
commit30508faeb3248d399079513b6e0107af30a43948 (patch)
tree8010a4be6772a8d6d0799f8aa372ecd29dc6abe3
parentaa3c2d73eff57d6b019c26a1e9aa8afd8bc186ad (diff)
parent0cb9827d706dea0afdbdf3701aa3ff78b16b5a4b (diff)
downloadrust-30508faeb3248d399079513b6e0107af30a43948.tar.gz
rust-30508faeb3248d399079513b6e0107af30a43948.zip
Auto merge of #137796 - jieyouxu:rollup-qt9yr1g, r=jieyouxu
Rollup of 10 pull requests

Successful merges:

 - #134943 (Add FileCheck annotations to mir-opt/issues)
 - #137017 (Don't error when adding a staticlib with bitcode files compiled by newer LLVM)
 - #137197 (Update some comparison codegen tests now that they pass in LLVM20)
 - #137540 (Fix (more) test directives that were accidentally ignored)
 - #137551 (import `simd_` intrinsics)
 - #137599 (tests: use minicore more)
 - #137673 (Fix Windows `Command` search path bug)
 - #137676 (linker: Fix escaping style for response files on Windows)
 - #137693 (Re-enable `--generate-link-to-defintion` for tools internal rustdoc)
 - #137770 (Fix sized constraint for unsafe binder)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_codegen_llvm/src/back/archive.rs25
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs8
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs9
-rw-r--r--library/core/src/cmp.rs8
-rw-r--r--library/core/src/intrinsics/simd.rs4
-rw-r--r--library/std/src/sys/pal/windows/process.rs3
-rw-r--r--src/bootstrap/src/core/build_steps/doc.rs4
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs20
-rw-r--r--src/bootstrap/src/core/builder/cargo.rs6
-rw-r--r--src/bootstrap/src/core/builder/mod.rs2
-rw-r--r--src/bootstrap/src/utils/helpers.rs14
-rw-r--r--tests/assembly/aarch64-pointer-auth.rs5
-rw-r--r--tests/assembly/cmse.rs8
-rw-r--r--tests/assembly/dwarf4.rs7
-rw-r--r--tests/assembly/dwarf5.rs7
-rw-r--r--tests/assembly/pic-relocation-model.rs7
-rw-r--r--tests/assembly/pie-relocation-model.rs7
-rw-r--r--tests/assembly/powerpc64-struct-abi.rs17
-rw-r--r--tests/assembly/riscv-soft-abi-with-float-features.rs12
-rw-r--r--tests/assembly/s390x-backchain-toggle.rs5
-rw-r--r--tests/assembly/simd-bitmask.rs9
-rw-r--r--tests/assembly/simd-intrinsic-gather.rs9
-rw-r--r--tests/assembly/simd-intrinsic-mask-load.rs10
-rw-r--r--tests/assembly/simd-intrinsic-mask-reduce.rs9
-rw-r--r--tests/assembly/simd-intrinsic-mask-store.rs10
-rw-r--r--tests/assembly/simd-intrinsic-scatter.rs9
-rw-r--r--tests/assembly/simd-intrinsic-select.rs9
-rw-r--r--tests/assembly/sparc-struct-abi.rs8
-rw-r--r--tests/assembly/stack-probes.rs9
-rw-r--r--tests/assembly/stack-protector/stack-protector-target-support.rs7
-rw-r--r--tests/assembly/static-relocation-model.rs17
-rw-r--r--tests/assembly/target-feature-multiple.rs8
-rw-r--r--tests/assembly/targets/targets-amdgpu.rs5
-rw-r--r--tests/assembly/targets/targets-elf.rs5
-rw-r--r--tests/assembly/targets/targets-macho.rs5
-rw-r--r--tests/assembly/targets/targets-nvptx.rs5
-rw-r--r--tests/assembly/targets/targets-pe.rs5
-rw-r--r--tests/auxiliary/minicore.rs66
-rw-r--r--tests/codegen/aarch64-softfloat.rs9
-rw-r--r--tests/codegen/aarch64-struct-align-128.rs9
-rw-r--r--tests/codegen/abi-efiapi.rs9
-rw-r--r--tests/codegen/abi-repr-ext.rs9
-rw-r--r--tests/codegen/abi-sysv64.rs8
-rw-r--r--tests/codegen/abi-win64-zst.rs1
-rw-r--r--tests/codegen/abi-x86-interrupt.rs8
-rw-r--r--tests/codegen/avr/avr-func-addrspace.rs42
-rw-r--r--tests/codegen/branch-protection-old-llvm.rs5
-rw-r--r--tests/codegen/branch-protection.rs5
-rw-r--r--tests/codegen/cast-target-abi.rs9
-rw-r--r--tests/codegen/cf-protection.rs5
-rw-r--r--tests/codegen/cffi/ffi-out-of-bounds-loads.rs9
-rw-r--r--tests/codegen/comparison-operators-2-struct.rs61
-rw-r--r--tests/codegen/comparison-operators-2-tuple.rs38
-rw-r--r--tests/codegen/default-requires-uwtable.rs5
-rw-r--r--tests/codegen/fastcall-inreg.rs7
-rw-r--r--tests/codegen/fixed-x18.rs5
-rw-r--r--tests/codegen/frame-pointer.rs9
-rw-r--r--tests/codegen/function-return.rs5
-rw-r--r--tests/codegen/gpu-kernel-abi.rs9
-rw-r--r--tests/codegen/intrinsics/nontemporal.rs10
-rw-r--r--tests/codegen/issues/issue-84268.rs7
-rw-r--r--tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs9
-rw-r--r--tests/codegen/macos/i686-macosx-deployment-target.rs10
-rw-r--r--tests/codegen/macos/i686-no-macosx-deployment-target.rs10
-rw-r--r--tests/codegen/macos/x86_64-macosx-deployment-target.rs10
-rw-r--r--tests/codegen/macos/x86_64-no-macosx-deployment-target.rs10
-rw-r--r--tests/codegen/naked-fn/instruction-set.rs12
-rw-r--r--tests/codegen/naked-fn/naked-functions.rs12
-rw-r--r--tests/codegen/no-jump-tables.rs5
-rw-r--r--tests/codegen/powerpc64le-struct-align-128.rs9
-rw-r--r--tests/codegen/regparm-inreg.rs8
-rw-r--r--tests/codegen/repr/transparent-byval-struct-ptr.rs10
-rw-r--r--tests/codegen/repr/transparent-imm-array.rs11
-rw-r--r--tests/codegen/repr/transparent-mips64.rs10
-rw-r--r--tests/codegen/repr/transparent-opaque-ptr.rs10
-rw-r--r--tests/codegen/repr/transparent-sparc64.rs11
-rw-r--r--tests/codegen/repr/transparent-sysv64.rs9
-rw-r--r--tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs16
-rw-r--r--tests/codegen/riscv-abi/riscv64-lp64d-abi.rs9
-rw-r--r--tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs9
-rw-r--r--tests/codegen/riscv-target-abi.rs5
-rw-r--r--tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs5
-rw-r--r--tests/codegen/sanitizer/kasan-emits-instrumentation.rs10
-rw-r--r--tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs7
-rw-r--r--tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs7
-rw-r--r--tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs7
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs9
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs9
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs9
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs9
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs9
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs9
-rw-r--r--tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs26
-rw-r--r--tests/codegen/sanitizer/riscv64-shadow-call-stack.rs5
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs10
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs104
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs23
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs19
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs9
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs20
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs10
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs10
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs2
-rw-r--r--tests/codegen/simd/simd_arith_offset.rs6
-rw-r--r--tests/codegen/some-abis-do-extend-params-to-32-bits.rs9
-rw-r--r--tests/codegen/sparc-struct-abi.rs9
-rw-r--r--tests/codegen/stack-probes-inline.rs5
-rw-r--r--tests/codegen/target-feature-overrides.rs7
-rw-r--r--tests/codegen/tied-features-strength.rs5
-rw-r--r--tests/incremental/issue-61530.rs8
-rw-r--r--tests/mir-opt/issues/issue_75439.rs6
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs8
-rw-r--r--tests/run-make/rustdoc-scrape-examples-multiple/src/lib.rs7
-rw-r--r--tests/run-make/rustdoc-scrape-examples-ordering/src/lib.rs8
-rw-r--r--tests/run-make/rustdoc-scrape-examples-remap/src/lib.rs4
-rw-r--r--tests/run-make/rustdoc-scrape-examples-test/src/lib.rs2
-rw-r--r--tests/run-make/rustdoc-scrape-examples-whitespace/src/lib.rs2
-rw-r--r--tests/run-make/rustdoc-themes/foo.rs6
-rw-r--r--tests/run-make/rustdoc-with-out-dir-option/src/lib.rs2
-rw-r--r--tests/run-make/rustdoc-with-output-option/src/lib.rs2
-rw-r--r--tests/run-make/rustdoc-with-short-out-dir-option/src/lib.rs2
-rw-r--r--tests/run-make/staticlib-broken-bitcode/rmake.rs23
-rw-r--r--tests/run-make/staticlib-broken-bitcode/rust_lib.rs6
-rw-r--r--tests/rustdoc-ui/unused-extern-crate.rs3
-rw-r--r--tests/rustdoc/auxiliary/panic-item.rs (renamed from tests/rustdoc-ui/auxiliary/panic-item.rs)0
-rw-r--r--tests/rustdoc/unused-extern-crate.rs2
-rw-r--r--tests/ui/abi/arm-unadjusted-intrinsic.rs16
-rw-r--r--tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr4
-rw-r--r--tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr4
-rw-r--r--tests/ui/abi/riscv-discoverability-guidance.rs12
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.rs7
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.rs7
-rw-r--r--tests/ui/abi/sparcv8plus.sparc.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparcv8plus.stderr2
-rw-r--r--tests/ui/abi/unsupported.aarch64.stderr58
-rw-r--r--tests/ui/abi/unsupported.arm.stderr52
-rw-r--r--tests/ui/abi/unsupported.i686.stderr40
-rw-r--r--tests/ui/abi/unsupported.riscv32.stderr52
-rw-r--r--tests/ui/abi/unsupported.riscv64.stderr52
-rw-r--r--tests/ui/abi/unsupported.rs7
-rw-r--r--tests/ui/abi/unsupported.x64.stderr52
-rw-r--r--tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs14
-rw-r--r--tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr8
-rw-r--r--tests/ui/borrowck/issue-92157.rs26
-rw-r--r--tests/ui/borrowck/issue-92157.stderr2
-rw-r--r--tests/ui/c-variadic/variadic-ffi-1.rs6
-rw-r--r--tests/ui/c-variadic/variadic-ffi-1.stderr26
-rw-r--r--tests/ui/check-cfg/my-awesome-platform.json2
-rw-r--r--tests/ui/check-cfg/values-target-json.rs5
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/callback-as-argument.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr18
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.stderr10
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.rs1
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.stderr18
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs6
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.stderr2
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs6
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.stderr2
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr18
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.stderr10
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.rs1
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.stderr18
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr2
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs9
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr2
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr2
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/via-registers.rs10
-rw-r--r--tests/ui/consts/const-eval/simd/insert_extract.rs27
-rw-r--r--tests/ui/deriving/deriving-with-helper.rs7
-rw-r--r--tests/ui/error-codes/E0511.rs10
-rw-r--r--tests/ui/error-codes/E0511.stderr6
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-avr-interrupt.stderr28
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr14
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-x86-interrupt.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-abi-x86-interrupt.stderr14
-rw-r--r--tests/ui/feature-gates/feature-gate-abi.rs8
-rw-r--r--tests/ui/feature-gates/feature-gate-abi.stderr54
-rw-r--r--tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs8
-rw-r--r--tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr26
-rw-r--r--tests/ui/feature-gates/feature-gate-abi_ptx.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-abi_ptx.stderr14
-rw-r--r--tests/ui/feature-gates/feature-gate-asm_experimental_arch.rs12
-rw-r--r--tests/ui/feature-gates/feature-gate-asm_experimental_arch.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs12
-rw-r--r--tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-vectorcall.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-vectorcall.stderr14
-rw-r--r--tests/ui/force-inlining/asm.rs14
-rw-r--r--tests/ui/force-inlining/asm.stderr8
-rw-r--r--tests/ui/inline-const/collect-scopes-in-pat.rs2
-rw-r--r--tests/ui/intrinsics/bad-intrinsic-monomorphization.rs6
-rw-r--r--tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr10
-rw-r--r--tests/ui/layout/hexagon-enum.rs5
-rw-r--r--tests/ui/layout/hexagon-enum.stderr10
-rw-r--r--tests/ui/layout/thumb-enum.rs5
-rw-r--r--tests/ui/layout/thumb-enum.stderr10
-rw-r--r--tests/ui/layout/too-big-with-padding.rs9
-rw-r--r--tests/ui/layout/too-big-with-padding.stderr2
-rw-r--r--tests/ui/mir/checks_without_panic_impl.rs5
-rw-r--r--tests/ui/process/win-command-child-path.rs72
-rw-r--r--tests/ui/repr/16-bit-repr-c-enum.rs9
-rw-r--r--tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr6
-rw-r--r--tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr6
-rw-r--r--tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr6
-rw-r--r--tests/ui/repr/repr-c-dead-variants.rs7
-rw-r--r--tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr6
-rw-r--r--tests/ui/repr/repr_align_greater_usize.msp430.stderr4
-rw-r--r--tests/ui/repr/repr_align_greater_usize.rs5
-rw-r--r--tests/ui/sanitizer/cfg-kasan.rs5
-rw-r--r--tests/ui/sanitizer/cfg.rs7
-rw-r--r--tests/ui/simd/array-trait.rs13
-rw-r--r--tests/ui/simd/array-type.rs11
-rw-r--r--tests/ui/simd/generics.rs10
-rw-r--r--tests/ui/simd/intrinsic/float-math-pass.rs48
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.rs54
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.stderr48
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-pass.rs50
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs12
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr4
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs11
-rw-r--r--tests/ui/simd/intrinsic/generic-as.rs6
-rw-r--r--tests/ui/simd/intrinsic/generic-bitmask-pass.rs9
-rw-r--r--tests/ui/simd/intrinsic/generic-bitmask.rs10
-rw-r--r--tests/ui/simd/intrinsic/generic-bitmask.stderr10
-rw-r--r--tests/ui/simd/intrinsic/generic-bswap-byte.rs7
-rw-r--r--tests/ui/simd/intrinsic/generic-cast-pass.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-cast-pointer-width.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-cast.rs10
-rw-r--r--tests/ui/simd/intrinsic/generic-cast.stderr8
-rw-r--r--tests/ui/simd/intrinsic/generic-comparison-pass.rs22
-rw-r--r--tests/ui/simd/intrinsic/generic-comparison.rs33
-rw-r--r--tests/ui/simd/intrinsic/generic-comparison.stderr36
-rw-r--r--tests/ui/simd/intrinsic/generic-elements-pass.rs13
-rw-r--r--tests/ui/simd/intrinsic/generic-elements.rs29
-rw-r--r--tests/ui/simd/intrinsic/generic-elements.stderr42
-rw-r--r--tests/ui/simd/intrinsic/generic-gather-pass.rs62
-rw-r--r--tests/ui/simd/intrinsic/generic-reduction-pass.rs38
-rw-r--r--tests/ui/simd/intrinsic/generic-reduction.rs25
-rw-r--r--tests/ui/simd/intrinsic/generic-reduction.stderr20
-rw-r--r--tests/ui/simd/intrinsic/generic-select-pass.rs12
-rw-r--r--tests/ui/simd/intrinsic/generic-select.rs12
-rw-r--r--tests/ui/simd/intrinsic/generic-select.stderr16
-rw-r--r--tests/ui/simd/intrinsic/generic-shuffle.rs8
-rw-r--r--tests/ui/simd/intrinsic/generic-shuffle.stderr8
-rw-r--r--tests/ui/simd/intrinsic/inlining-issue67557-ice.rs5
-rw-r--r--tests/ui/simd/intrinsic/inlining-issue67557.rs6
-rw-r--r--tests/ui/simd/intrinsic/issue-85855.rs3
-rw-r--r--tests/ui/simd/intrinsic/issue-85855.stderr6
-rw-r--r--tests/ui/simd/intrinsic/ptr-cast.rs12
-rw-r--r--tests/ui/simd/issue-105439.rs8
-rw-r--r--tests/ui/simd/issue-39720.rs7
-rw-r--r--tests/ui/simd/issue-85915-simd-ptrs.rs17
-rw-r--r--tests/ui/simd/issue-89193.rs23
-rw-r--r--tests/ui/simd/masked-load-store-build-fail.rs73
-rw-r--r--tests/ui/simd/masked-load-store-build-fail.stderr80
-rw-r--r--tests/ui/simd/masked-load-store-check-fail.rs25
-rw-r--r--tests/ui/simd/masked-load-store-check-fail.stderr56
-rw-r--r--tests/ui/simd/masked-load-store.rs15
-rw-r--r--tests/ui/simd/monomorphize-shuffle-index.generic.stderr2
-rw-r--r--tests/ui/simd/monomorphize-shuffle-index.rs18
-rw-r--r--tests/ui/simd/repr_packed.rs7
-rw-r--r--tests/ui/simd/shuffle.rs5
-rw-r--r--tests/ui/simd/simd-bitmask-notpow2.rs9
-rw-r--r--tests/ui/simd/simd-bitmask.rs9
-rw-r--r--tests/ui/static/static_sized_requirement.rs7
-rw-r--r--tests/ui/target-feature/no-llvm-leaks.rs9
-rw-r--r--tests/ui/target-feature/tied-features.rs5
-rw-r--r--tests/ui/target-feature/tied-features.stderr6
-rw-r--r--tests/ui/unsafe-binders/binder-sized-crit.rs18
-rw-r--r--tests/ui/unsafe-binders/binder-sized-crit.stderr11
300 files changed, 1614 insertions, 2162 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs
index 93553f3f364..0a161442933 100644
--- a/compiler/rustc_codegen_llvm/src/back/archive.rs
+++ b/compiler/rustc_codegen_llvm/src/back/archive.rs
@@ -132,14 +132,33 @@ fn get_llvm_object_symbols(
     if err.is_null() {
         return Ok(true);
     } else {
-        return Err(unsafe { *Box::from_raw(err as *mut io::Error) });
+        let error = unsafe { *Box::from_raw(err as *mut io::Error) };
+        // These are the magic constants for LLVM bitcode files:
+        // https://github.com/llvm/llvm-project/blob/7eadc1960d199676f04add402bb0aa6f65b7b234/llvm/lib/BinaryFormat/Magic.cpp#L90-L97
+        if buf.starts_with(&[0xDE, 0xCE, 0x17, 0x0B]) || buf.starts_with(&[b'B', b'C', 0xC0, 0xDE])
+        {
+            // For LLVM bitcode, failure to read the symbols is not fatal. The bitcode may have been
+            // produced by a newer LLVM version that the one linked to rustc. This is fine provided
+            // that the linker does use said newer LLVM version. We skip writing the symbols for the
+            // bitcode to the symbol table of the archive. Traditional linkers don't like this, but
+            // newer linkers like lld, mold and wild ignore the symbol table anyway, so if they link
+            // against a new enough LLVM it will work out in the end.
+            // LLVM's archive writer also has this same behavior of only warning about invalid
+            // bitcode since https://github.com/llvm/llvm-project/pull/96848
+
+            // We don't have access to the DiagCtxt here to produce a nice warning in the correct format.
+            eprintln!("warning: Failed to read symbol table from LLVM bitcode: {}", error);
+            return Ok(true);
+        } else {
+            return Err(error);
+        }
     }
 
     unsafe extern "C" fn callback(state: *mut c_void, symbol_name: *const c_char) -> *mut c_void {
         let f = unsafe { &mut *(state as *mut &mut dyn FnMut(&[u8]) -> io::Result<()>) };
         match f(unsafe { CStr::from_ptr(symbol_name) }.to_bytes()) {
             Ok(()) => std::ptr::null_mut(),
-            Err(err) => Box::into_raw(Box::new(err)) as *mut c_void,
+            Err(err) => Box::into_raw(Box::new(err) as Box<io::Error>) as *mut c_void,
         }
     }
 
@@ -148,7 +167,7 @@ fn get_llvm_object_symbols(
         Box::into_raw(Box::new(io::Error::new(
             io::ErrorKind::Other,
             format!("LLVM error: {}", error.to_string_lossy()),
-        ))) as *mut c_void
+        )) as Box<io::Error>) as *mut c_void
     }
 }
 
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index b090730ac6b..5054ae561c0 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1726,8 +1726,12 @@ fn exec_linker(
         args.push_str(
             &Escape {
                 arg: arg.to_str().unwrap(),
-                // LLD also uses MSVC-like parsing for @-files by default when running on windows hosts
-                is_like_msvc: sess.target.is_like_msvc || (cfg!(windows) && flavor.uses_lld()),
+                // Windows-style escaping for @-files is used by
+                // - all linkers targeting MSVC-like targets, including LLD
+                // - all LLD flavors running on Windows hosts
+                // С/С++ compilers use Posix-style escaping (except clang-cl, which we do not use).
+                is_like_msvc: sess.target.is_like_msvc
+                    || (cfg!(windows) && flavor.uses_lld() && !flavor.uses_cc()),
             }
             .to_string(),
         );
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs
index 8ed45b4e541..8610c30ab70 100644
--- a/compiler/rustc_ty_utils/src/ty.rs
+++ b/compiler/rustc_ty_utils/src/ty.rs
@@ -37,8 +37,6 @@ fn sized_constraint_for_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'
         | Never
         | Dynamic(_, _, ty::DynStar) => None,
 
-        UnsafeBinder(_) => todo!(),
-
         // these are never sized
         Str | Slice(..) | Dynamic(_, _, ty::Dyn) | Foreign(..) => Some(ty),
 
@@ -52,9 +50,14 @@ fn sized_constraint_for_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'
             sized_constraint_for_ty(tcx, ty)
         }),
 
-        // these can be sized or unsized
+        // these can be sized or unsized.
         Param(..) | Alias(..) | Error(_) => Some(ty),
 
+        // We cannot instantiate the binder, so just return the *original* type back,
+        // but only if the inner type has a sized constraint. Thus we skip the binder,
+        // but don't actually use the result from `sized_constraint_for_ty`.
+        UnsafeBinder(inner_ty) => sized_constraint_for_ty(tcx, inner_ty.skip_binder()).map(|_| ty),
+
         Placeholder(..) | Bound(..) | Infer(..) => {
             bug!("unexpected type `{ty:?}` in sized_constraint_for_ty")
         }
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs
index 594236cf1d9..c8ced78c4d7 100644
--- a/library/core/src/cmp.rs
+++ b/library/core/src/cmp.rs
@@ -1369,7 +1369,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_diagnostic_item = "cmp_partialord_lt"]
     fn lt(&self, other: &Rhs) -> bool {
-        matches!(self.partial_cmp(other), Some(Less))
+        self.partial_cmp(other).is_some_and(Ordering::is_lt)
     }
 
     /// Tests less than or equal to (for `self` and `other`) and is used by the
@@ -1387,7 +1387,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_diagnostic_item = "cmp_partialord_le"]
     fn le(&self, other: &Rhs) -> bool {
-        matches!(self.partial_cmp(other), Some(Less | Equal))
+        self.partial_cmp(other).is_some_and(Ordering::is_le)
     }
 
     /// Tests greater than (for `self` and `other`) and is used by the `>`
@@ -1405,7 +1405,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_diagnostic_item = "cmp_partialord_gt"]
     fn gt(&self, other: &Rhs) -> bool {
-        matches!(self.partial_cmp(other), Some(Greater))
+        self.partial_cmp(other).is_some_and(Ordering::is_gt)
     }
 
     /// Tests greater than or equal to (for `self` and `other`) and is used by
@@ -1423,7 +1423,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_diagnostic_item = "cmp_partialord_ge"]
     fn ge(&self, other: &Rhs) -> bool {
-        matches!(self.partial_cmp(other), Some(Greater | Equal))
+        self.partial_cmp(other).is_some_and(Ordering::is_ge)
     }
 }
 
diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs
index 3bde183fefb..3881cf90ad7 100644
--- a/library/core/src/intrinsics/simd.rs
+++ b/library/core/src/intrinsics/simd.rs
@@ -11,7 +11,7 @@
 /// `idx` must be in-bounds of the vector.
 #[rustc_intrinsic]
 #[rustc_nounwind]
-pub unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T;
+pub const unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T;
 
 /// Extracts an element from a vector.
 ///
@@ -22,7 +22,7 @@ pub unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T;
 /// `idx` must be in-bounds of the vector.
 #[rustc_intrinsic]
 #[rustc_nounwind]
-pub unsafe fn simd_extract<T, U>(_x: T, _idx: u32) -> U;
+pub const unsafe fn simd_extract<T, U>(_x: T, _idx: u32) -> U;
 
 /// Adds two simd vectors elementwise.
 ///
diff --git a/library/std/src/sys/pal/windows/process.rs b/library/std/src/sys/pal/windows/process.rs
index a41dfbfe601..6eff471f386 100644
--- a/library/std/src/sys/pal/windows/process.rs
+++ b/library/std/src/sys/pal/windows/process.rs
@@ -260,9 +260,10 @@ impl Command {
         needs_stdin: bool,
         proc_thread_attribute_list: Option<&ProcThreadAttributeList<'_>>,
     ) -> io::Result<(Process, StdioPipes)> {
+        let env_saw_path = self.env.have_changed_path();
         let maybe_env = self.env.capture_if_changed();
 
-        let child_paths = if let Some(env) = maybe_env.as_ref() {
+        let child_paths = if env_saw_path && let Some(env) = maybe_env.as_ref() {
             env.get(&EnvKey::new("PATH")).map(|s| s.as_os_str())
         } else {
             None
diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
index aee56fe78e2..8e913f68184 100644
--- a/src/bootstrap/src/core/build_steps/doc.rs
+++ b/src/bootstrap/src/core/build_steps/doc.rs
@@ -987,9 +987,7 @@ macro_rules! tool_doc {
                 cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
                 cargo.rustdocflag("--enable-index-page");
                 cargo.rustdocflag("--show-type-layout");
-                // FIXME: `--generate-link-to-definition` tries to resolve cfged out code
-                // see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
-                // cargo.rustdocflag("--generate-link-to-definition");
+                cargo.rustdocflag("--generate-link-to-definition");
 
                 let out_dir = builder.stage_out(compiler, Mode::ToolRustc).join(target).join("doc");
                 $(for krate in $crates {
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 709711d9d34..c9fa2e9ba96 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -269,7 +269,13 @@ impl Step for Cargotest {
             .args(builder.config.test_args())
             .env("RUSTC", builder.rustc(compiler))
             .env("RUSTDOC", builder.rustdoc(compiler));
-        add_rustdoc_cargo_linker_args(&mut cmd, builder, compiler.host, LldThreads::No);
+        add_rustdoc_cargo_linker_args(
+            &mut cmd,
+            builder,
+            compiler.host,
+            LldThreads::No,
+            compiler.stage,
+        );
         cmd.delay_failure().run(builder);
     }
 }
@@ -847,7 +853,7 @@ impl Step for RustdocTheme {
             .env("CFG_RELEASE_CHANNEL", &builder.config.channel)
             .env("RUSTDOC_REAL", builder.rustdoc(self.compiler))
             .env("RUSTC_BOOTSTRAP", "1");
-        cmd.args(linker_args(builder, self.compiler.host, LldThreads::No));
+        cmd.args(linker_args(builder, self.compiler.host, LldThreads::No, self.compiler.stage));
 
         cmd.delay_failure().run(builder);
     }
@@ -1023,7 +1029,13 @@ impl Step for RustdocGUI {
         cmd.env("RUSTDOC", builder.rustdoc(self.compiler))
             .env("RUSTC", builder.rustc(self.compiler));
 
-        add_rustdoc_cargo_linker_args(&mut cmd, builder, self.compiler.host, LldThreads::No);
+        add_rustdoc_cargo_linker_args(
+            &mut cmd,
+            builder,
+            self.compiler.host,
+            LldThreads::No,
+            self.compiler.stage,
+        );
 
         for path in &builder.paths {
             if let Some(p) = helpers::is_valid_test_suite_arg(path, "tests/rustdoc-gui", builder) {
@@ -1887,7 +1899,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
 
         let mut hostflags = flags.clone();
         hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
-        hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No));
+        hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No, compiler.stage));
 
         let mut targetflags = flags;
         targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 0aab9f04fea..d1d52d82eaa 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -260,7 +260,7 @@ impl Cargo {
             }
         }
 
-        for arg in linker_args(builder, compiler.host, LldThreads::Yes) {
+        for arg in linker_args(builder, compiler.host, LldThreads::Yes, 0) {
             self.hostflags.arg(&arg);
         }
 
@@ -270,10 +270,10 @@ impl Cargo {
         }
         // We want to set -Clinker using Cargo, therefore we only call `linker_flags` and not
         // `linker_args` here.
-        for flag in linker_flags(builder, target, LldThreads::Yes) {
+        for flag in linker_flags(builder, target, LldThreads::Yes, compiler.stage) {
             self.rustflags.arg(&flag);
         }
-        for arg in linker_args(builder, target, LldThreads::Yes) {
+        for arg in linker_args(builder, target, LldThreads::Yes, compiler.stage) {
             self.rustdocflags.arg(&arg);
         }
 
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
index 9c04f097bee..c8e2856bdc8 100644
--- a/src/bootstrap/src/core/builder/mod.rs
+++ b/src/bootstrap/src/core/builder/mod.rs
@@ -1462,7 +1462,7 @@ impl<'a> Builder<'a> {
             cmd.arg("-Dwarnings");
         }
         cmd.arg("-Znormalize-docs");
-        cmd.args(linker_args(self, compiler.host, LldThreads::Yes));
+        cmd.args(linker_args(self, compiler.host, LldThreads::Yes, compiler.stage));
         cmd
     }
 
diff --git a/src/bootstrap/src/utils/helpers.rs b/src/bootstrap/src/utils/helpers.rs
index 3fee397da09..7ad308cd067 100644
--- a/src/bootstrap/src/utils/helpers.rs
+++ b/src/bootstrap/src/utils/helpers.rs
@@ -430,8 +430,9 @@ pub fn linker_args(
     builder: &Builder<'_>,
     target: TargetSelection,
     lld_threads: LldThreads,
+    stage: u32,
 ) -> Vec<String> {
-    let mut args = linker_flags(builder, target, lld_threads);
+    let mut args = linker_flags(builder, target, lld_threads, stage);
 
     if let Some(linker) = builder.linker(target) {
         args.push(format!("-Clinker={}", linker.display()));
@@ -446,12 +447,18 @@ pub fn linker_flags(
     builder: &Builder<'_>,
     target: TargetSelection,
     lld_threads: LldThreads,
+    stage: u32,
 ) -> Vec<String> {
     let mut args = vec![];
     if !builder.is_lld_direct_linker(target) && builder.config.lld_mode.is_used() {
         match builder.config.lld_mode {
             LldMode::External => {
-                args.push("-Clinker-flavor=gnu-lld-cc".to_string());
+                // cfg(bootstrap) - remove after updating bootstrap compiler (#137498)
+                if stage == 0 && target.is_windows() {
+                    args.push("-Clink-arg=-fuse-ld=lld".to_string());
+                } else {
+                    args.push("-Clinker-flavor=gnu-lld-cc".to_string());
+                }
                 // FIXME(kobzol): remove this flag once MCP510 gets stabilized
                 args.push("-Zunstable-options".to_string());
             }
@@ -479,8 +486,9 @@ pub fn add_rustdoc_cargo_linker_args(
     builder: &Builder<'_>,
     target: TargetSelection,
     lld_threads: LldThreads,
+    stage: u32,
 ) {
-    let args = linker_args(builder, target, lld_threads);
+    let args = linker_args(builder, target, lld_threads, stage);
     let mut flags = cmd
         .get_envs()
         .find_map(|(k, v)| if k == OsStr::new("RUSTDOCFLAGS") { v } else { None })
diff --git a/tests/assembly/aarch64-pointer-auth.rs b/tests/assembly/aarch64-pointer-auth.rs
index 344e9e74bc2..8c006982679 100644
--- a/tests/assembly/aarch64-pointer-auth.rs
+++ b/tests/assembly/aarch64-pointer-auth.rs
@@ -1,5 +1,6 @@
 // Test that PAC instructions are emitted when branch-protection is specified.
 
+//@ add-core-stubs
 //@ revisions: PACRET PAUTHLR_NOP PAUTHLR
 //@ assembly-output: emit-asm
 //@ needs-llvm-components: aarch64
@@ -14,8 +15,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // PACRET: hint #25
 // PACRET: hint #29
diff --git a/tests/assembly/cmse.rs b/tests/assembly/cmse.rs
index e0ada8dc2f1..2984df92225 100644
--- a/tests/assembly/cmse.rs
+++ b/tests/assembly/cmse.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: hard soft
 //@ assembly-output: emit-asm
 //@ [hard] compile-flags: --target thumbv8m.main-none-eabihf --crate-type lib -Copt-level=1
@@ -7,10 +8,9 @@
 #![crate_type = "lib"]
 #![feature(abi_c_cmse_nonsecure_call, cmse_nonsecure_entry, no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
+
+extern crate minicore;
+use minicore::*;
 
 // CHECK-LABEL: __acle_se_entry_point:
 // CHECK-NEXT: entry_point:
diff --git a/tests/assembly/dwarf4.rs b/tests/assembly/dwarf4.rs
index 22be8e5603f..6013adf3386 100644
--- a/tests/assembly/dwarf4.rs
+++ b/tests/assembly/dwarf4.rs
@@ -1,5 +1,6 @@
 // Makes sure that `-Z dwarf-version=4` causes `rustc` to emit DWARF version 4.
 //@ assembly-output: emit-asm
+//@ add-core-stubs
 //@ compile-flags: -g --target x86_64-unknown-linux-gnu -Z dwarf-version=4 -Copt-level=0
 //@ needs-llvm-components: x86
 
@@ -7,10 +8,8 @@
 #![crate_type = "rlib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 pub fn wibble() {}
 
diff --git a/tests/assembly/dwarf5.rs b/tests/assembly/dwarf5.rs
index 35f2716e9fa..9cd596e7834 100644
--- a/tests/assembly/dwarf5.rs
+++ b/tests/assembly/dwarf5.rs
@@ -1,4 +1,5 @@
 // Makes sure that `-Z dwarf-version=5` causes `rustc` to emit DWARF version 5.
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 //@ compile-flags: -g --target x86_64-unknown-linux-gnu -Z dwarf-version=5 -Copt-level=0
 //@ needs-llvm-components: x86
@@ -7,10 +8,8 @@
 #![crate_type = "rlib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 pub fn wibble() {}
 
diff --git a/tests/assembly/pic-relocation-model.rs b/tests/assembly/pic-relocation-model.rs
index 73db94791ec..d35cd968389 100644
--- a/tests/assembly/pic-relocation-model.rs
+++ b/tests/assembly/pic-relocation-model.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x64
 //@ assembly-output: emit-asm
 //@ [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=pic
@@ -7,10 +8,8 @@
 #![no_core]
 #![crate_type = "rlib"]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK-LABEL: call_other_fn:
 // CHECK:       {{(jmpq|callq)}} *other_fn@GOTPCREL(%rip)
diff --git a/tests/assembly/pie-relocation-model.rs b/tests/assembly/pie-relocation-model.rs
index e632b4dd582..5c74b34eb31 100644
--- a/tests/assembly/pie-relocation-model.rs
+++ b/tests/assembly/pie-relocation-model.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x64
 //@ assembly-output: emit-asm
 //@ [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=pie
@@ -7,10 +8,8 @@
 #![no_core]
 #![crate_type = "rlib"]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK-LABEL: call_other_fn:
 // With PIE local functions are called "directly".
diff --git a/tests/assembly/powerpc64-struct-abi.rs b/tests/assembly/powerpc64-struct-abi.rs
index 0332eb94d8a..eb27afc4f23 100644
--- a/tests/assembly/powerpc64-struct-abi.rs
+++ b/tests/assembly/powerpc64-struct-abi.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: elfv1-be elfv2-be elfv2-le aix
 //@ assembly-output: emit-asm
 //@ compile-flags: -Copt-level=3
@@ -20,21 +21,9 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
-#[lang = "copy"]
-trait Copy {}
-
-#[lang = "freeze"]
-trait Freeze {}
-
-#[lang = "unpin"]
-trait Unpin {}
-
-impl Copy for u8 {}
-impl Copy for u16 {}
-impl Copy for u32 {}
 impl Copy for FiveU32s {}
 impl Copy for FiveU16s {}
 impl Copy for ThreeU8s {}
diff --git a/tests/assembly/riscv-soft-abi-with-float-features.rs b/tests/assembly/riscv-soft-abi-with-float-features.rs
index 8ccfa72a7b6..72cbd3841c1 100644
--- a/tests/assembly/riscv-soft-abi-with-float-features.rs
+++ b/tests/assembly/riscv-soft-abi-with-float-features.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 //@ compile-flags: --target riscv64imac-unknown-none-elf -Ctarget-feature=+f,+d
 //@ needs-llvm-components: riscv
@@ -9,15 +10,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for f16 {}
-impl Copy for f32 {}
-impl Copy for f64 {}
+extern crate minicore;
+use minicore::*;
 
 // This test checks that the floats are all returned in `a0` as required by the `lp64` ABI.
 
diff --git a/tests/assembly/s390x-backchain-toggle.rs b/tests/assembly/s390x-backchain-toggle.rs
index 7ef0292d911..83c7b82d0d4 100644
--- a/tests/assembly/s390x-backchain-toggle.rs
+++ b/tests/assembly/s390x-backchain-toggle.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: enable-backchain disable-backchain
 //@ assembly-output: emit-asm
 //@ compile-flags: -Copt-level=3 --crate-type=lib --target=s390x-unknown-linux-gnu
@@ -8,8 +9,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 extern "C" {
     fn extern_func();
diff --git a/tests/assembly/simd-bitmask.rs b/tests/assembly/simd-bitmask.rs
index 4a829c4dd98..a632791153b 100644
--- a/tests/assembly/simd-bitmask.rs
+++ b/tests/assembly/simd-bitmask.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86 x86-avx2 x86-avx512 aarch64
 //@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 //@ [x86] needs-llvm-components: x86
@@ -16,12 +17,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct m8x16([i8; 16]);
diff --git a/tests/assembly/simd-intrinsic-gather.rs b/tests/assembly/simd-intrinsic-gather.rs
index 3152de35f29..8c17a58046d 100644
--- a/tests/assembly/simd-intrinsic-gather.rs
+++ b/tests/assembly/simd-intrinsic-gather.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86-avx512
 //@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 //@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
@@ -9,12 +10,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct f64x4([f64; 4]);
diff --git a/tests/assembly/simd-intrinsic-mask-load.rs b/tests/assembly/simd-intrinsic-mask-load.rs
index efe3e3752fa..a0d0514c014 100644
--- a/tests/assembly/simd-intrinsic-mask-load.rs
+++ b/tests/assembly/simd-intrinsic-mask-load.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86-avx2 x86-avx512
 //@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 //@ [x86-avx2] compile-flags: -C target-feature=+avx2
@@ -12,13 +13,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
-impl<T: ?Sized> Copy for *const T {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct i8x16([i8; 16]);
diff --git a/tests/assembly/simd-intrinsic-mask-reduce.rs b/tests/assembly/simd-intrinsic-mask-reduce.rs
index 4d4adda6c24..959c4ddefdb 100644
--- a/tests/assembly/simd-intrinsic-mask-reduce.rs
+++ b/tests/assembly/simd-intrinsic-mask-reduce.rs
@@ -1,4 +1,5 @@
 // verify that simd mask reductions do not introduce additional bit shift operations
+//@ add-core-stubs
 //@ revisions: x86 aarch64
 //@ [x86] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 // Set the base cpu explicitly, in case the default has been changed.
@@ -13,12 +14,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct mask8x16([i8; 16]);
diff --git a/tests/assembly/simd-intrinsic-mask-store.rs b/tests/assembly/simd-intrinsic-mask-store.rs
index f5d924f24a7..4be9194943c 100644
--- a/tests/assembly/simd-intrinsic-mask-store.rs
+++ b/tests/assembly/simd-intrinsic-mask-store.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86-avx2 x86-avx512
 //@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 //@ [x86-avx2] compile-flags: -C target-feature=+avx2
@@ -12,13 +13,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
-impl<T: ?Sized> Copy for *mut T {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct i8x16([i8; 16]);
diff --git a/tests/assembly/simd-intrinsic-scatter.rs b/tests/assembly/simd-intrinsic-scatter.rs
index 5f52ababd19..715de04af4d 100644
--- a/tests/assembly/simd-intrinsic-scatter.rs
+++ b/tests/assembly/simd-intrinsic-scatter.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86-avx512
 //@ [x86-avx512] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 //@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
@@ -9,12 +10,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct f64x4([f64; 4]);
diff --git a/tests/assembly/simd-intrinsic-select.rs b/tests/assembly/simd-intrinsic-select.rs
index 74784a77213..7f1e42662bf 100644
--- a/tests/assembly/simd-intrinsic-select.rs
+++ b/tests/assembly/simd-intrinsic-select.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86-avx2 x86-avx512 aarch64
 //@ [x86-avx2] compile-flags: --target=x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
 //@ [x86-avx2] compile-flags: -C target-feature=+avx2
@@ -14,12 +15,8 @@
 #![no_core]
 #![allow(non_camel_case_types)]
 
-// Because we don't have core yet.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(simd)]
 pub struct i8x16([i8; 16]);
diff --git a/tests/assembly/sparc-struct-abi.rs b/tests/assembly/sparc-struct-abi.rs
index 3a254f17964..b1594428811 100644
--- a/tests/assembly/sparc-struct-abi.rs
+++ b/tests/assembly/sparc-struct-abi.rs
@@ -2,6 +2,7 @@
 // - float structure members are passes in floating point registers
 // (#86163)
 
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 //@ needs-llvm-components: sparc
 //@ compile-flags: --target=sparcv9-sun-solaris -Copt-level=3
@@ -9,11 +10,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl Copy for f32 {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Franta {
diff --git a/tests/assembly/stack-probes.rs b/tests/assembly/stack-probes.rs
index e0931157ce1..de245431f47 100644
--- a/tests/assembly/stack-probes.rs
+++ b/tests/assembly/stack-probes.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86_64 i686 aarch64
 //@ assembly-output: emit-asm
 //@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu -C llvm-args=-x86-asm-syntax=intel
@@ -11,12 +12,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for u8 {}
+extern crate minicore;
+use minicore::*;
 
 // Check that inline-asm stack probes are generated correctly.
 // To avoid making this test fragile to slight asm changes,
diff --git a/tests/assembly/stack-protector/stack-protector-target-support.rs b/tests/assembly/stack-protector/stack-protector-target-support.rs
index 74a609dcdcc..e9ba0f9ba89 100644
--- a/tests/assembly/stack-protector/stack-protector-target-support.rs
+++ b/tests/assembly/stack-protector/stack-protector-target-support.rs
@@ -1,6 +1,7 @@
 // Test that stack smash protection code is emitted for all tier1 and tier2
 // targets, with the exception of nvptx64-nvidia-cuda
 //
+//@ add-core-stubs
 //@ revisions: r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23
 //@ revisions: r24 r25 r26 r27 r28 r29 r30 r31 r32 r33     r35 r36 r37 r38 r39 r40 r41 r42 r43 r44
 //@ revisions: r45 r46 r47 r48 r49 r50 r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63 r64 r65
@@ -183,10 +184,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub fn foo() {
diff --git a/tests/assembly/static-relocation-model.rs b/tests/assembly/static-relocation-model.rs
index eafdfd485ba..53fa18852b6 100644
--- a/tests/assembly/static-relocation-model.rs
+++ b/tests/assembly/static-relocation-model.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x64 A64 ppc64le
 //@ assembly-output: emit-asm
 //@ [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=static
@@ -11,20 +12,8 @@
 #![no_core]
 #![crate_type = "rlib"]
 
-#[lang = "sized"]
-trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
-
-#[lang = "sync"]
-trait Sync {}
-
-#[lang = "drop_in_place"]
-fn drop_in_place<T>(_: *mut T) {}
-
-impl Copy for u8 {}
-impl Sync for u8 {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub static PIERIS: u8 = 42;
diff --git a/tests/assembly/target-feature-multiple.rs b/tests/assembly/target-feature-multiple.rs
index 83c38568647..bc432d21931 100644
--- a/tests/assembly/target-feature-multiple.rs
+++ b/tests/assembly/target-feature-multiple.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 //@ needs-llvm-components: x86
 //@ revisions: TWOFLAGS SINGLEFLAG
@@ -19,11 +20,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for u32 {}
+extern crate minicore;
+use minicore::*;
 
 // Use of these requires target features to be enabled
 extern "unadjusted" {
diff --git a/tests/assembly/targets/targets-amdgpu.rs b/tests/assembly/targets/targets-amdgpu.rs
index 501eed2e247..1d10b8fc315 100644
--- a/tests/assembly/targets/targets-amdgpu.rs
+++ b/tests/assembly/targets/targets-amdgpu.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 // ignore-tidy-linelength
 //@ revisions: amdgcn_amd_amdhsa
@@ -11,8 +12,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 pub fn test() -> u8 {
     42
diff --git a/tests/assembly/targets/targets-elf.rs b/tests/assembly/targets/targets-elf.rs
index 3e73d2c6eb7..dc564c60f80 100644
--- a/tests/assembly/targets/targets-elf.rs
+++ b/tests/assembly/targets/targets-elf.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 // ignore-tidy-linelength
 //@ revisions: aarch64_be_unknown_linux_gnu
@@ -709,8 +710,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // Force linkage to ensure code is actually generated
 #[no_mangle]
diff --git a/tests/assembly/targets/targets-macho.rs b/tests/assembly/targets/targets-macho.rs
index 25e9059afeb..92bde1c6971 100644
--- a/tests/assembly/targets/targets-macho.rs
+++ b/tests/assembly/targets/targets-macho.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 // ignore-tidy-linelength
 //@ revisions: aarch64_apple_darwin
@@ -80,8 +81,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // Force linkage to ensure code is actually generated
 #[no_mangle]
diff --git a/tests/assembly/targets/targets-nvptx.rs b/tests/assembly/targets/targets-nvptx.rs
index 9048191affa..49c12aebaaa 100644
--- a/tests/assembly/targets/targets-nvptx.rs
+++ b/tests/assembly/targets/targets-nvptx.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 // ignore-tidy-linelength
 //@ revisions: nvptx64_nvidia_cuda
@@ -11,8 +12,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 pub fn test() -> u8 {
     42
diff --git a/tests/assembly/targets/targets-pe.rs b/tests/assembly/targets/targets-pe.rs
index b74d0181c4d..f895b79ba50 100644
--- a/tests/assembly/targets/targets-pe.rs
+++ b/tests/assembly/targets/targets-pe.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ assembly-output: emit-asm
 // ignore-tidy-linelength
 //@ revisions: aarch64_pc_windows_msvc
@@ -95,8 +96,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 pub fn test() -> u8 {
     42
diff --git a/tests/auxiliary/minicore.rs b/tests/auxiliary/minicore.rs
index 0aa8b6b8f89..03aa8476508 100644
--- a/tests/auxiliary/minicore.rs
+++ b/tests/auxiliary/minicore.rs
@@ -25,7 +25,8 @@
     naked_functions,
     f16,
     f128,
-    asm_experimental_arch
+    asm_experimental_arch,
+    unboxed_closures
 )]
 #![allow(unused, improper_ctypes_definitions, internal_features)]
 #![no_std]
@@ -61,7 +62,7 @@ pub auto trait Unpin {}
 
 impl_marker_trait!(
     Copy => [
-        bool, char,
+        char, bool,
         isize, i8, i16, i32, i64, i128,
         usize, u8, u16, u32, u64, u128,
         f16, f32, f64, f128,
@@ -102,6 +103,9 @@ pub struct UnsafeCell<T: ?Sized> {
 }
 impl<T: ?Sized> !Freeze for UnsafeCell<T> {}
 
+#[lang = "tuple_trait"]
+pub trait Tuple {}
+
 #[rustc_builtin_macro]
 pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
     /* compiler built-in */
@@ -129,3 +133,61 @@ macro_rules! stringify {
         /* compiler built-in */
     };
 }
+
+#[lang = "add"]
+pub trait Add<Rhs = Self> {
+    type Output;
+
+    fn add(self, _: Rhs) -> Self::Output;
+}
+
+impl Add<isize> for isize {
+    type Output = isize;
+
+    fn add(self, other: isize) -> isize {
+        7 // avoid needing to add all of the overflow handling and panic language items
+    }
+}
+
+#[lang = "sync"]
+trait Sync {}
+impl Sync for u8 {}
+
+#[lang = "drop_in_place"]
+fn drop_in_place<T>(_: *mut T) {}
+
+#[lang = "fn_once"]
+pub trait FnOnce<Args: Tuple> {
+    #[lang = "fn_once_output"]
+    type Output;
+
+    extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+}
+
+#[lang = "fn_mut"]
+pub trait FnMut<Args: Tuple>: FnOnce<Args> {
+    extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
+}
+
+#[lang = "fn"]
+pub trait Fn<Args: Tuple>: FnMut<Args> {
+    extern "rust-call" fn call(&self, args: Args) -> Self::Output;
+}
+
+#[lang = "dispatch_from_dyn"]
+trait DispatchFromDyn<T> {}
+
+impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {}
+
+#[lang = "unsize"]
+trait Unsize<T: ?Sized> {}
+
+#[lang = "coerce_unsized"]
+pub trait CoerceUnsized<T: ?Sized> {}
+
+impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
+
+#[lang = "drop"]
+trait Drop {
+    fn drop(&mut self);
+}
diff --git a/tests/codegen/aarch64-softfloat.rs b/tests/codegen/aarch64-softfloat.rs
index 85380a6c472..4f5366e047f 100644
--- a/tests/codegen/aarch64-softfloat.rs
+++ b/tests/codegen/aarch64-softfloat.rs
@@ -1,15 +1,12 @@
+//@ add-core-stubs
 //@ compile-flags: --target aarch64-unknown-none-softfloat -Zmerge-functions=disabled
 //@ needs-llvm-components: aarch64
 #![crate_type = "lib"]
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for f32 {}
-impl Copy for f64 {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: i64 @pass_f64_C(i64 {{[^,]*}})
 #[no_mangle]
diff --git a/tests/codegen/aarch64-struct-align-128.rs b/tests/codegen/aarch64-struct-align-128.rs
index 3fed19d96b1..ba1d19680f4 100644
--- a/tests/codegen/aarch64-struct-align-128.rs
+++ b/tests/codegen/aarch64-struct-align-128.rs
@@ -1,5 +1,6 @@
 // Test that structs aligned to 128 bits are passed with the correct ABI on aarch64.
 
+//@ add-core-stubs
 //@ revisions: linux darwin win
 //@[linux] compile-flags: --target aarch64-unknown-linux-gnu
 //@[darwin] compile-flags: --target aarch64-apple-darwin
@@ -12,12 +13,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // Passed as `[i64 x 2]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
 #[repr(C)]
diff --git a/tests/codegen/abi-efiapi.rs b/tests/codegen/abi-efiapi.rs
index 986d042268a..1736f0daf0f 100644
--- a/tests/codegen/abi-efiapi.rs
+++ b/tests/codegen/abi-efiapi.rs
@@ -1,5 +1,6 @@
 // Checks if the correct annotation for the efiapi ABI is passed to llvm.
 
+//@ add-core-stubs
 //@ revisions:x86_64 i686 aarch64 arm riscv
 //@[x86_64] compile-flags: --target x86_64-unknown-uefi
 //@[x86_64] needs-llvm-components: aarch64 arm riscv
@@ -17,12 +18,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 //x86_64: define win64cc void @has_efiapi
 //i686: define void @has_efiapi
diff --git a/tests/codegen/abi-repr-ext.rs b/tests/codegen/abi-repr-ext.rs
index b06d225ed70..1da28a94d9d 100644
--- a/tests/codegen/abi-repr-ext.rs
+++ b/tests/codegen/abi-repr-ext.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3
 
 //@ revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv
@@ -24,12 +25,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(i8)]
 pub enum Type {
diff --git a/tests/codegen/abi-sysv64.rs b/tests/codegen/abi-sysv64.rs
index ec555ee5f1d..7ade17f2bae 100644
--- a/tests/codegen/abi-sysv64.rs
+++ b/tests/codegen/abi-sysv64.rs
@@ -2,6 +2,7 @@
 // llvm. Also checks that the abi-sysv64 feature gate allows usage
 // of the sysv64 abi.
 //
+//@ add-core-stubs
 //@ needs-llvm-components: x86
 //@ compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0
 
@@ -9,11 +10,8 @@
 #![no_core]
 #![feature(abi_x86_interrupt, no_core, lang_items)]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for i64 {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define x86_64_sysvcc i64 @has_sysv64_abi
 #[no_mangle]
diff --git a/tests/codegen/abi-win64-zst.rs b/tests/codegen/abi-win64-zst.rs
index 825a5c1b09c..e46f9666d42 100644
--- a/tests/codegen/abi-win64-zst.rs
+++ b/tests/codegen/abi-win64-zst.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Z merge-functions=disabled
 //@ add-core-stubs
 
diff --git a/tests/codegen/abi-x86-interrupt.rs b/tests/codegen/abi-x86-interrupt.rs
index b8f3ebb99dd..255ccba2c11 100644
--- a/tests/codegen/abi-x86-interrupt.rs
+++ b/tests/codegen/abi-x86-interrupt.rs
@@ -2,6 +2,7 @@
 // llvm. Also checks that the abi_x86_interrupt feature gate allows usage
 // of the x86-interrupt abi.
 
+//@ add-core-stubs
 //@ needs-llvm-components: x86
 //@ compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0
 
@@ -9,11 +10,8 @@
 #![no_core]
 #![feature(abi_x86_interrupt, no_core, lang_items)]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for i64 {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define x86_intrcc i64 @has_x86_interrupt_abi
 #[no_mangle]
diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen/avr/avr-func-addrspace.rs
index 2ec7c86b5f4..2ae2f40d7b3 100644
--- a/tests/codegen/avr/avr-func-addrspace.rs
+++ b/tests/codegen/avr/avr-func-addrspace.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 --target=avr-none -C target-cpu=atmega328p --crate-type=rlib -C panic=abort
 //@ needs-llvm-components: avr
 
@@ -13,45 +14,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl<T: ?Sized> Copy for *const T {}
-#[lang = "legacy_receiver"]
-pub trait LegacyReceiver {}
-#[lang = "tuple_trait"]
-pub trait Tuple {}
-
-pub struct Result<T, E> {
-    _a: T,
-    _b: E,
-}
-
-impl Copy for usize {}
-impl Copy for &usize {}
-
-#[lang = "drop_in_place"]
-pub unsafe fn drop_in_place<T: ?Sized>(_: *mut T) {}
-
-#[lang = "fn_once"]
-pub trait FnOnce<Args: Tuple> {
-    #[lang = "fn_once_output"]
-    type Output;
-
-    extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
-}
-
-#[lang = "fn_mut"]
-pub trait FnMut<Args: Tuple>: FnOnce<Args> {
-    extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
-}
-
-#[lang = "fn"]
-pub trait Fn<Args: Tuple>: FnOnce<Args> {
-    /// Performs the call operation.
-    extern "rust-call" fn call(&self, args: Args) -> Self::Output;
-}
+extern crate minicore;
+use minicore::*;
 
 extern "rust-intrinsic" {
     pub fn transmute<Src, Dst>(src: Src) -> Dst;
diff --git a/tests/codegen/branch-protection-old-llvm.rs b/tests/codegen/branch-protection-old-llvm.rs
index 1846f35479d..14b34ac5018 100644
--- a/tests/codegen/branch-protection-old-llvm.rs
+++ b/tests/codegen/branch-protection-old-llvm.rs
@@ -1,5 +1,6 @@
 // Test that the correct module flags are emitted with different branch protection flags.
 
+//@ add-core-stubs
 //@ revisions: BTI PACRET LEAF BKEY NONE
 //@ needs-llvm-components: aarch64
 //@ [BTI] compile-flags: -Z branch-protection=bti
@@ -13,8 +14,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // A basic test function.
 pub fn test() {}
diff --git a/tests/codegen/branch-protection.rs b/tests/codegen/branch-protection.rs
index 945bad05625..ae14eae9ae0 100644
--- a/tests/codegen/branch-protection.rs
+++ b/tests/codegen/branch-protection.rs
@@ -1,5 +1,6 @@
 // Test that the correct module flags are emitted with different branch protection flags.
 
+//@ add-core-stubs
 //@ revisions: BTI PACRET LEAF BKEY PAUTHLR PAUTHLR_BKEY PAUTHLR_LEAF PAUTHLR_BTI NONE
 //@ needs-llvm-components: aarch64
 //@ [BTI] compile-flags: -Z branch-protection=bti
@@ -17,8 +18,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // A basic test function.
 // CHECK: @test(){{.*}} [[ATTR:#[0-9]+]] {
diff --git a/tests/codegen/cast-target-abi.rs b/tests/codegen/cast-target-abi.rs
index a0801eb9826..186198bc631 100644
--- a/tests/codegen/cast-target-abi.rs
+++ b/tests/codegen/cast-target-abi.rs
@@ -1,4 +1,5 @@
 // ignore-tidy-linelength
+//@ add-core-stubs
 //@ revisions:aarch64 loongarch64 powerpc64 sparc64 x86_64
 //@ min-llvm-version: 19
 //@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
@@ -21,12 +22,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // This struct will be passed as a single `i64` or `i32`.
 // This may be (if `i64)) larger than the Rust layout, which is just `{ i16, i16 }`.
diff --git a/tests/codegen/cf-protection.rs b/tests/codegen/cf-protection.rs
index 244d1eb2544..f1349a5dcb9 100644
--- a/tests/codegen/cf-protection.rs
+++ b/tests/codegen/cf-protection.rs
@@ -1,5 +1,6 @@
 // Test that the correct module flags are emitted with different control-flow protection flags.
 
+//@ add-core-stubs
 //@ revisions: undefined none branch return full
 //@ needs-llvm-components: x86
 //@ [undefined] compile-flags:
@@ -13,8 +14,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // A basic test function.
 pub fn test() {}
diff --git a/tests/codegen/cffi/ffi-out-of-bounds-loads.rs b/tests/codegen/cffi/ffi-out-of-bounds-loads.rs
index ae8d8383f5b..404f6237849 100644
--- a/tests/codegen/cffi/ffi-out-of-bounds-loads.rs
+++ b/tests/codegen/cffi/ffi-out-of-bounds-loads.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: linux apple
 //@ min-llvm-version: 19
 //@ compile-flags: -Copt-level=0 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
@@ -14,12 +15,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 struct S {
diff --git a/tests/codegen/comparison-operators-2-struct.rs b/tests/codegen/comparison-operators-2-struct.rs
new file mode 100644
index 00000000000..e179066ebfd
--- /dev/null
+++ b/tests/codegen/comparison-operators-2-struct.rs
@@ -0,0 +1,61 @@
+//@ compile-flags: -C opt-level=1
+//@ min-llvm-version: 20
+
+// The `derive(PartialOrd)` for a 2-field type doesn't override `lt`/`le`/`gt`/`ge`.
+// This double-checks that the `Option<Ordering>` intermediate values used
+// in the operators for such a type all optimize away.
+
+#![crate_type = "lib"]
+
+use std::cmp::Ordering;
+
+#[derive(PartialOrd, PartialEq)]
+pub struct Foo(i32, u32);
+
+// CHECK-LABEL: @check_lt(
+// CHECK-SAME: i32{{.+}}%[[A0:.+]], i32{{.+}}%[[A1:.+]], i32{{.+}}%[[B0:.+]], i32{{.+}}%[[B1:.+]])
+#[no_mangle]
+pub fn check_lt(a: Foo, b: Foo) -> bool {
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R0:.+]] = icmp slt i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R1:.+]] = icmp ult i32 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[R1]], i1 %[[R0]]
+    // CHECK-NEXT: ret i1 %[[R]]
+    a < b
+}
+
+// CHECK-LABEL: @check_le(
+// CHECK-SAME: i32{{.+}}%[[A0:.+]], i32{{.+}}%[[A1:.+]], i32{{.+}}%[[B0:.+]], i32{{.+}}%[[B1:.+]])
+#[no_mangle]
+pub fn check_le(a: Foo, b: Foo) -> bool {
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R0:.+]] = icmp sle i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R1:.+]] = icmp ule i32 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[R1]], i1 %[[R0]]
+    // CHECK-NEXT: ret i1 %[[R]]
+    a <= b
+}
+
+// CHECK-LABEL: @check_gt(
+// CHECK-SAME: i32{{.+}}%[[A0:.+]], i32{{.+}}%[[A1:.+]], i32{{.+}}%[[B0:.+]], i32{{.+}}%[[B1:.+]])
+#[no_mangle]
+pub fn check_gt(a: Foo, b: Foo) -> bool {
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R0:.+]] = icmp sgt i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R1:.+]] = icmp ugt i32 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[R1]], i1 %[[R0]]
+    // CHECK-NEXT: ret i1 %[[R]]
+    a > b
+}
+
+// CHECK-LABEL: @check_ge(
+// CHECK-SAME: i32{{.+}}%[[A0:.+]], i32{{.+}}%[[A1:.+]], i32{{.+}}%[[B0:.+]], i32{{.+}}%[[B1:.+]])
+#[no_mangle]
+pub fn check_ge(a: Foo, b: Foo) -> bool {
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R0:.+]] = icmp sge i32 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[R1:.+]] = icmp uge i32 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[R1]], i1 %[[R0]]
+    // CHECK-NEXT: ret i1 %[[R]]
+    a >= b
+}
diff --git a/tests/codegen/comparison-operators-2-tuple.rs b/tests/codegen/comparison-operators-2-tuple.rs
index 8e2915e84eb..91a99f9b91f 100644
--- a/tests/codegen/comparison-operators-2-tuple.rs
+++ b/tests/codegen/comparison-operators-2-tuple.rs
@@ -1,5 +1,6 @@
 //@ compile-flags: -C opt-level=1 -Z merge-functions=disabled
 //@ only-x86_64
+//@ min-llvm-version: 20
 
 #![crate_type = "lib"]
 
@@ -65,12 +66,7 @@ pub fn check_ge_direct(a: TwoTuple, b: TwoTuple) -> bool {
 }
 
 //
-// These ones are harder, since there are more intermediate values to remove.
-//
-// `<` seems to be getting lucky right now, so test that doesn't regress.
-//
-// The others, however, aren't managing to optimize away the extra `select`s yet.
-// See <https://github.com/rust-lang/rust/issues/106107> for more about this.
+// These used to not optimize as well, but thanks to LLVM 20 they work now 🎉
 //
 
 // CHECK-LABEL: @check_lt_via_cmp
@@ -89,11 +85,11 @@ pub fn check_lt_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
 // CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
 #[no_mangle]
 pub fn check_le_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
-    // FIXME-CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
-    // FIXME-CHECK-DAG: %[[CMP0:.+]] = icmp sle i16 %[[A0]], %[[B0]]
-    // FIXME-CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]]
-    // FIXME-CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
-    // FIXME-CHECK: ret i1 %[[R]]
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[CMP0:.+]] = icmp sle i16 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+    // CHECK: ret i1 %[[R]]
     Ord::cmp(&a, &b).is_le()
 }
 
@@ -101,11 +97,11 @@ pub fn check_le_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
 // CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
 #[no_mangle]
 pub fn check_gt_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
-    // FIXME-CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
-    // FIXME-CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
-    // FIXME-CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]]
-    // FIXME-CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
-    // FIXME-CHECK: ret i1 %[[R]]
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+    // CHECK: ret i1 %[[R]]
     Ord::cmp(&a, &b).is_gt()
 }
 
@@ -113,10 +109,10 @@ pub fn check_gt_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
 // CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
 #[no_mangle]
 pub fn check_ge_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
-    // FIXME-CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
-    // FIXME-CHECK-DAG: %[[CMP0:.+]] = icmp sge i16 %[[A0]], %[[B0]]
-    // FIXME-CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]]
-    // FIXME-CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
-    // FIXME-CHECK: ret i1 %[[R]]
+    // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[CMP0:.+]] = icmp sge i16 %[[A0]], %[[B0]]
+    // CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]]
+    // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+    // CHECK: ret i1 %[[R]]
     Ord::cmp(&a, &b).is_ge()
 }
diff --git a/tests/codegen/default-requires-uwtable.rs b/tests/codegen/default-requires-uwtable.rs
index 3cb35cea022..54a6e171db6 100644
--- a/tests/codegen/default-requires-uwtable.rs
+++ b/tests/codegen/default-requires-uwtable.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: WINDOWS_ ANDROID_
 //@ compile-flags: -C panic=abort -Copt-level=0
 //@ [WINDOWS_] compile-flags: --target=x86_64-pc-windows-msvc
@@ -9,8 +10,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: attributes #{{.*}} uwtable
 pub fn foo() {}
diff --git a/tests/codegen/fastcall-inreg.rs b/tests/codegen/fastcall-inreg.rs
index 00b390bf1bf..066943d6e7e 100644
--- a/tests/codegen/fastcall-inreg.rs
+++ b/tests/codegen/fastcall-inreg.rs
@@ -2,6 +2,7 @@
 // as "inreg" like the C/C++ compilers for the platforms.
 // x86 only.
 
+//@ add-core-stubs
 //@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3
 //@ needs-llvm-components: x86
 
@@ -9,10 +10,8 @@
 #![no_core]
 #![feature(no_core, lang_items)]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 pub mod tests {
     // CHECK: @f1(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
diff --git a/tests/codegen/fixed-x18.rs b/tests/codegen/fixed-x18.rs
index 4997a39a726..a5767cfa456 100644
--- a/tests/codegen/fixed-x18.rs
+++ b/tests/codegen/fixed-x18.rs
@@ -1,6 +1,7 @@
 // Test that the `reserve-x18` target feature is (not) emitted when
 // the `-Zfixed-x18` flag is (not) set.
 
+//@ add-core-stubs
 //@ revisions: unset set
 //@ needs-llvm-components: aarch64
 //@ compile-flags: --target aarch64-unknown-none
@@ -10,8 +11,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub fn foo() {
diff --git a/tests/codegen/frame-pointer.rs b/tests/codegen/frame-pointer.rs
index da81c2e9cd9..1f7c9a59c98 100644
--- a/tests/codegen/frame-pointer.rs
+++ b/tests/codegen/frame-pointer.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --crate-type=rlib -Copt-level=0
 //@ revisions: aarch64-apple aarch64-linux force x64-apple x64-linux
 //@ [aarch64-apple] needs-llvm-components: aarch64
@@ -13,11 +14,9 @@
 
 #![feature(no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
 #[no_mangle]
diff --git a/tests/codegen/function-return.rs b/tests/codegen/function-return.rs
index 2b9de4e1478..4127f516038 100644
--- a/tests/codegen/function-return.rs
+++ b/tests/codegen/function-return.rs
@@ -1,6 +1,7 @@
 // Test that the `fn_ret_thunk_extern` function attribute is (not) emitted when
 // the `-Zfunction-return={keep,thunk-extern}` flag is (not) set.
 
+//@ add-core-stubs
 //@ revisions: unset keep thunk-extern keep-thunk-extern thunk-extern-keep
 //@ needs-llvm-components: x86
 //@ compile-flags: --target x86_64-unknown-linux-gnu
@@ -13,8 +14,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub fn foo() {
diff --git a/tests/codegen/gpu-kernel-abi.rs b/tests/codegen/gpu-kernel-abi.rs
index fba17936494..8ac376d9338 100644
--- a/tests/codegen/gpu-kernel-abi.rs
+++ b/tests/codegen/gpu-kernel-abi.rs
@@ -1,17 +1,14 @@
 // Checks that the gpu-kernel calling convention correctly translates to LLVM calling conventions.
 
+//@ add-core-stubs
 //@ revisions: nvptx
 //@ [nvptx] compile-flags: --crate-type=rlib --target=nvptx64-nvidia-cuda
 //@ [nvptx] needs-llvm-components: nvptx
 #![feature(no_core, lang_items, abi_gpu_kernel)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // nvptx: define ptx_kernel void @fun(i32
 #[no_mangle]
diff --git a/tests/codegen/intrinsics/nontemporal.rs b/tests/codegen/intrinsics/nontemporal.rs
index af8892d30e7..1d4fae83c29 100644
--- a/tests/codegen/intrinsics/nontemporal.rs
+++ b/tests/codegen/intrinsics/nontemporal.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3
 //@revisions: with_nontemporal without_nontemporal
 //@[with_nontemporal] compile-flags: --target aarch64-unknown-linux-gnu
@@ -14,13 +15,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-
-impl Copy for u32 {}
-impl<T> Copy for *mut T {}
+extern crate minicore;
+use minicore::*;
 
 extern "rust-intrinsic" {
     pub fn nontemporal_store<T>(ptr: *mut T, val: T);
diff --git a/tests/codegen/issues/issue-84268.rs b/tests/codegen/issues/issue-84268.rs
index 8a8ea9d1ccf..1dc55a909ad 100644
--- a/tests/codegen/issues/issue-84268.rs
+++ b/tests/codegen/issues/issue-84268.rs
@@ -1,10 +1,7 @@
 //@ compile-flags: -Copt-level=3 --crate-type=rlib
-#![feature(intrinsics, repr_simd)]
+#![feature(core_intrinsics, repr_simd)]
 
-extern "rust-intrinsic" {
-    fn simd_fabs<T>(x: T) -> T;
-    fn simd_eq<T, U>(x: T, y: T) -> U;
-}
+use std::intrinsics::simd::{simd_eq, simd_fabs};
 
 #[repr(simd)]
 pub struct V([f32; 4]);
diff --git a/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs b/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs
index b11bd657c18..93c8d60930b 100644
--- a/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs
+++ b/tests/codegen/loongarch-abi/loongarch64-lp64d-abi.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target loongarch64-unknown-linux-gnu
 //@ needs-llvm-components: loongarch
 
@@ -6,12 +7,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 noundef zeroext %i)
 #[no_mangle]
diff --git a/tests/codegen/macos/i686-macosx-deployment-target.rs b/tests/codegen/macos/i686-macosx-deployment-target.rs
index 1f44bdfc648..cfa91e61cb0 100644
--- a/tests/codegen/macos/i686-macosx-deployment-target.rs
+++ b/tests/codegen/macos/i686-macosx-deployment-target.rs
@@ -1,19 +1,15 @@
-//
 // Checks that we correctly modify the target when MACOSX_DEPLOYMENT_TARGET is set.
 // See issue #60235.
 
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 --target=i686-apple-darwin --crate-type=rlib
 //@ needs-llvm-components: x86
 //@ rustc-env:MACOSX_DEPLOYMENT_TARGET=10.14
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Bool {
diff --git a/tests/codegen/macos/i686-no-macosx-deployment-target.rs b/tests/codegen/macos/i686-no-macosx-deployment-target.rs
index a09773e0b9e..25ec5f6acbb 100644
--- a/tests/codegen/macos/i686-no-macosx-deployment-target.rs
+++ b/tests/codegen/macos/i686-no-macosx-deployment-target.rs
@@ -1,19 +1,15 @@
-//
 // Checks that we leave the target alone MACOSX_DEPLOYMENT_TARGET is unset.
 // See issue #60235.
 
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 --target=i686-apple-darwin --crate-type=rlib
 //@ needs-llvm-components: x86
 //@ unset-rustc-env:MACOSX_DEPLOYMENT_TARGET
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Bool {
diff --git a/tests/codegen/macos/x86_64-macosx-deployment-target.rs b/tests/codegen/macos/x86_64-macosx-deployment-target.rs
index bd8c027a9fb..8ea95ba0575 100644
--- a/tests/codegen/macos/x86_64-macosx-deployment-target.rs
+++ b/tests/codegen/macos/x86_64-macosx-deployment-target.rs
@@ -1,19 +1,15 @@
-//
 // Checks that we correctly modify the target when MACOSX_DEPLOYMENT_TARGET is set.
 // See issue #60235.
 
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 --target=x86_64-apple-darwin --crate-type=rlib
 //@ needs-llvm-components: x86
 //@ rustc-env:MACOSX_DEPLOYMENT_TARGET=10.14
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Bool {
diff --git a/tests/codegen/macos/x86_64-no-macosx-deployment-target.rs b/tests/codegen/macos/x86_64-no-macosx-deployment-target.rs
index ff4a8fc46f9..474094957ae 100644
--- a/tests/codegen/macos/x86_64-no-macosx-deployment-target.rs
+++ b/tests/codegen/macos/x86_64-no-macosx-deployment-target.rs
@@ -1,19 +1,15 @@
-//
 // Checks that we leave the target alone when MACOSX_DEPLOYMENT_TARGET is unset.
 // See issue #60235.
 
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 --target=x86_64-apple-darwin --crate-type=rlib
 //@ needs-llvm-components: x86
 //@ unset-rustc-env:MACOSX_DEPLOYMENT_TARGET
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Bool {
diff --git a/tests/codegen/naked-fn/instruction-set.rs b/tests/codegen/naked-fn/instruction-set.rs
index 5b790b2034c..a7b4c22a59b 100644
--- a/tests/codegen/naked-fn/instruction-set.rs
+++ b/tests/codegen/naked-fn/instruction-set.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: arm-mode thumb-mode
 //@ [arm-mode] compile-flags: --target armv5te-none-eabi
 //@ [thumb-mode] compile-flags: --target thumbv5te-none-eabi
@@ -8,15 +9,8 @@
 #![feature(no_core, lang_items, rustc_attrs, naked_functions)]
 #![no_core]
 
-#[rustc_builtin_macro]
-macro_rules! naked_asm {
-    () => {};
-}
-
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // arm-mode: .arm
 // thumb-mode: .thumb
diff --git a/tests/codegen/naked-fn/naked-functions.rs b/tests/codegen/naked-fn/naked-functions.rs
index f505d27d48c..6483e27c97a 100644
--- a/tests/codegen/naked-fn/naked-functions.rs
+++ b/tests/codegen/naked-fn/naked-functions.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: linux win macos thumb
 //
 //@[linux] compile-flags: --target x86_64-unknown-linux-gnu
@@ -13,15 +14,8 @@
 #![feature(no_core, lang_items, rustc_attrs, naked_functions)]
 #![no_core]
 
-#[rustc_builtin_macro]
-macro_rules! naked_asm {
-    () => {};
-}
-
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // linux,win: .intel_syntax
 //
diff --git a/tests/codegen/no-jump-tables.rs b/tests/codegen/no-jump-tables.rs
index 654da2cec11..e49de7e9dc1 100644
--- a/tests/codegen/no-jump-tables.rs
+++ b/tests/codegen/no-jump-tables.rs
@@ -1,6 +1,7 @@
 // Test that the `no-jump-tables` function attribute are (not) emitted when
 // the `-Zno-jump-tables` flag is (not) set.
 
+//@ add-core-stubs
 //@ revisions: unset set
 //@ needs-llvm-components: x86
 //@ compile-flags: --target x86_64-unknown-linux-gnu
@@ -10,8 +11,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub fn foo() {
diff --git a/tests/codegen/powerpc64le-struct-align-128.rs b/tests/codegen/powerpc64le-struct-align-128.rs
index 3981cd12129..c1c1ac26485 100644
--- a/tests/codegen/powerpc64le-struct-align-128.rs
+++ b/tests/codegen/powerpc64le-struct-align-128.rs
@@ -1,6 +1,7 @@
 // Test that structs aligned to 128 bits are passed with the correct ABI on powerpc64le.
 // This is similar to aarch64-struct-align-128.rs, but for ppc.
 
+//@ add-core-stubs
 //@ compile-flags: --target powerpc64le-unknown-linux-gnu
 //@ needs-llvm-components: powerpc
 
@@ -8,12 +9,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Align8 {
diff --git a/tests/codegen/regparm-inreg.rs b/tests/codegen/regparm-inreg.rs
index 82e15731128..8dae3a83e4e 100644
--- a/tests/codegen/regparm-inreg.rs
+++ b/tests/codegen/regparm-inreg.rs
@@ -2,6 +2,7 @@
 // marks function arguments as "inreg" like the C/C++ compilers for the platforms.
 // x86 only.
 
+//@ add-core-stubs
 //@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3
 //@ needs-llvm-components: x86
 
@@ -14,10 +15,9 @@
 #![crate_type = "lib"]
 #![no_core]
 #![feature(no_core, lang_items, repr_simd)]
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+
+extern crate minicore;
+use minicore::*;
 
 pub mod tests {
     // regparm doesn't work for "fastcall" calling conv (only 2 inregs)
diff --git a/tests/codegen/repr/transparent-byval-struct-ptr.rs b/tests/codegen/repr/transparent-byval-struct-ptr.rs
index f9cfeb90390..0918884144f 100644
--- a/tests/codegen/repr/transparent-byval-struct-ptr.rs
+++ b/tests/codegen/repr/transparent-byval-struct-ptr.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: i686-linux i686-freebsd x64-linux x64-apple
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 
@@ -21,14 +22,9 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
-impl Copy for [u32; 16] {}
 impl Copy for BigS {}
 impl Copy for BigU {}
 
diff --git a/tests/codegen/repr/transparent-imm-array.rs b/tests/codegen/repr/transparent-imm-array.rs
index f790d093cf4..6dad0447784 100644
--- a/tests/codegen/repr/transparent-imm-array.rs
+++ b/tests/codegen/repr/transparent-imm-array.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: arm-linux arm-android armv7-linux armv7-android mips thumb sparc
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 
@@ -27,14 +28,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for [u32; 16] {}
+extern crate minicore;
+use minicore::*;
 impl Copy for BigS {}
 impl Copy for BigU {}
 
diff --git a/tests/codegen/repr/transparent-mips64.rs b/tests/codegen/repr/transparent-mips64.rs
index 7282654b856..98901350154 100644
--- a/tests/codegen/repr/transparent-mips64.rs
+++ b/tests/codegen/repr/transparent-mips64.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: mips64 mips64el
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 
@@ -13,14 +14,9 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
-impl Copy for [u32; 16] {}
 impl Copy for BigS {}
 impl Copy for BigU {}
 
diff --git a/tests/codegen/repr/transparent-opaque-ptr.rs b/tests/codegen/repr/transparent-opaque-ptr.rs
index 798b7e01bba..7911370c478 100644
--- a/tests/codegen/repr/transparent-opaque-ptr.rs
+++ b/tests/codegen/repr/transparent-opaque-ptr.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: aarch64-linux aarch64-darwin wasm32-wasip1
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 
@@ -19,14 +20,9 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
-impl Copy for [u32; 16] {}
 impl Copy for BigS {}
 impl Copy for BigU {}
 
diff --git a/tests/codegen/repr/transparent-sparc64.rs b/tests/codegen/repr/transparent-sparc64.rs
index 05c090bd672..62bfc8a5fce 100644
--- a/tests/codegen/repr/transparent-sparc64.rs
+++ b/tests/codegen/repr/transparent-sparc64.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target sparc64-unknown-linux-gnu
 //@ needs-llvm-components: sparc
 
@@ -8,14 +9,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for [u32; 16] {}
+extern crate minicore;
+use minicore::*;
 impl Copy for BigS {}
 impl Copy for BigU {}
 
diff --git a/tests/codegen/repr/transparent-sysv64.rs b/tests/codegen/repr/transparent-sysv64.rs
index 99c855db962..3efc3f7c391 100644
--- a/tests/codegen/repr/transparent-sysv64.rs
+++ b/tests/codegen/repr/transparent-sysv64.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: linux apple win
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 
@@ -13,12 +14,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Rgb8 {
diff --git a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
index 46f747ad407..df99f6969fc 100644
--- a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
+++ b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target riscv64gc-unknown-linux-gnu -Copt-level=3 -C no-prepopulate-passes -C panic=abort
 //@ needs-llvm-components: riscv
 
@@ -6,19 +7,8 @@
 #![feature(no_core, lang_items)]
 #![allow(improper_ctypes)]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for bool {}
-impl Copy for i8 {}
-impl Copy for u8 {}
-impl Copy for i32 {}
-impl Copy for i64 {}
-impl Copy for u64 {}
-impl Copy for f32 {}
-impl Copy for f64 {}
-impl<T> Copy for *mut T {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define void @f_void()
 #[no_mangle]
diff --git a/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs
index bef8fe0c044..d768ab9381a 100644
--- a/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs
+++ b/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
 //@ needs-llvm-components: riscv
 
@@ -6,12 +7,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 noundef zeroext %i)
 #[no_mangle]
diff --git a/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
index 214370f424c..361f0322690 100644
--- a/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
+++ b/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
 //@ needs-llvm-components: riscv
 
@@ -6,12 +7,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: define void @f_fpr_tracking(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 noundef zeroext %i)
 #[no_mangle]
diff --git a/tests/codegen/riscv-target-abi.rs b/tests/codegen/riscv-target-abi.rs
index 88da4ece7ba..d41fcb4dd84 100644
--- a/tests/codegen/riscv-target-abi.rs
+++ b/tests/codegen/riscv-target-abi.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions:riscv64gc riscv32gc riscv32imac
 
 //@[riscv64gc] compile-flags: --target=riscv64gc-unknown-linux-gnu
@@ -16,5 +17,5 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
diff --git a/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs b/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs
index e2e14ab14a8..e1d7dc2d631 100644
--- a/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs
+++ b/tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: aarch64 android
 //@[aarch64] compile-flags: --target aarch64-unknown-none -Zfixed-x18 -Zsanitizer=shadow-call-stack
 //@[aarch64] needs-llvm-components: aarch64
@@ -9,8 +10,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: ; Function Attrs:{{.*}}shadowcallstack
 #[no_mangle]
diff --git a/tests/codegen/sanitizer/kasan-emits-instrumentation.rs b/tests/codegen/sanitizer/kasan-emits-instrumentation.rs
index 56ee875286a..774c9ab53f1 100644
--- a/tests/codegen/sanitizer/kasan-emits-instrumentation.rs
+++ b/tests/codegen/sanitizer/kasan-emits-instrumentation.rs
@@ -1,5 +1,6 @@
 // Verifies that `-Zsanitizer=kernel-address` emits sanitizer instrumentation.
 
+//@ add-core-stubs
 //@ compile-flags: -Zsanitizer=kernel-address -Copt-level=0
 //@ revisions: aarch64 riscv64imac riscv64gc x86_64
 //@[aarch64] compile-flags: --target aarch64-unknown-none
@@ -15,13 +16,8 @@
 #![feature(no_core, no_sanitize, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for u8 {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK-LABEL: ; kasan_emits_instrumentation::unsanitized
 // CHECK-NEXT:  ; Function Attrs:
diff --git a/tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs b/tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs
index d48e4016a16..0be1ff19774 100644
--- a/tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs
+++ b/tests/codegen/sanitizer/kcfi/add-cfi-normalize-integers-flag.rs
@@ -1,5 +1,6 @@
 // Verifies that "cfi-normalize-integers" module flag is added.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,10 +12,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo() {}
 
diff --git a/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs b/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs
index 013de74f8d6..eabe0409c9a 100644
--- a/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs
+++ b/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs
@@ -1,5 +1,6 @@
 // Verifies that "kcfi" module flag is added.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,10 +12,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo() {}
 
diff --git a/tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs b/tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs
index b4924719f4c..2f18c9d84b9 100644
--- a/tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs
+++ b/tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs
@@ -1,5 +1,6 @@
 // Verifies that "kcfi-offset" module flag is added.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,10 +12,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo() {}
 
diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs
index ba2e397f6da..6b40918dd3a 100644
--- a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs
@@ -1,5 +1,6 @@
 // Verifies that KCFI operand bundles are omitted.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,12 +12,8 @@
 #![feature(no_core, no_sanitize, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for i32 {}
+extern crate minicore;
+use minicore::*;
 
 #[no_sanitize(kcfi)]
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs
index 4e95bdf4d7c..942b50deb02 100644
--- a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs
@@ -1,5 +1,6 @@
 // Verifies that generalized KCFI type metadata for functions are emitted.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,12 +12,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for i32 {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs
index 31b43b50988..c89d9bdd121 100644
--- a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs
@@ -1,5 +1,6 @@
 // Verifies that normalized and generalized KCFI type metadata for functions are emitted.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,12 +12,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for i32 {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs
index 4755f6062aa..220cae1a4fa 100644
--- a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs
@@ -1,5 +1,6 @@
 // Verifies that normalized KCFI type metadata for functions are emitted.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,12 +12,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for i32 {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs
index be9760bd9af..bb9a0005903 100644
--- a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs
@@ -1,5 +1,6 @@
 // Verifies that KCFI type metadata for functions are emitted.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,12 +12,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for i32 {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
diff --git a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs
index c9c94cdb329..8b844b99142 100644
--- a/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs
@@ -1,5 +1,6 @@
 // Verifies that KCFI operand bundles are emitted.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,12 +12,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for i32 {}
+extern crate minicore;
+use minicore::*;
 
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
diff --git a/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs b/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs
index 5ab55a46726..15c107bea15 100644
--- a/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs
+++ b/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs
@@ -1,5 +1,6 @@
 // Verifies that type metadata identifiers for trait objects are emitted correctly.
 //
+//@ add-core-stubs
 //@ revisions: aarch64 x86_64
 //@ [aarch64] compile-flags: --target aarch64-unknown-none
 //@ [aarch64] needs-llvm-components: aarch64
@@ -11,29 +12,8 @@
 #![feature(arbitrary_self_types, no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl<T: ?Sized> Copy for &T {}
-#[lang = "legacy_receiver"]
-trait LegacyReceiver {}
-#[lang = "dispatch_from_dyn"]
-trait DispatchFromDyn<T> {}
-impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {}
-#[lang = "unsize"]
-trait Unsize<T: ?Sized> {}
-#[lang = "coerce_unsized"]
-pub trait CoerceUnsized<T: ?Sized> {}
-impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "drop_in_place"]
-fn drop_in_place_fn<T>() {}
-#[lang = "drop"]
-trait Drop {
-    fn drop(&mut self);
-}
+extern crate minicore;
+use minicore::*;
 
 pub trait Trait1 {
     fn foo(&self);
diff --git a/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs b/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs
index 5833b832ba4..945e46218d0 100644
--- a/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs
+++ b/tests/codegen/sanitizer/riscv64-shadow-call-stack.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target riscv64imac-unknown-none-elf -Zsanitizer=shadow-call-stack
 //@ needs-llvm-components: riscv
 
@@ -6,8 +7,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 // CHECK: ; Function Attrs:{{.*}}shadowcallstack
 // CHECK: define dso_local void @foo() unnamed_addr #0
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs
index 4a5a6391c05..485ba92272d 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-abs.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fabs;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fabs<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fabs_32x2
 #[no_mangle]
 pub unsafe fn fabs_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs
index 89e54f579ff..e8bda7c29c4 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_ceil;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_ceil<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @ceil_32x2
 #[no_mangle]
 pub unsafe fn ceil_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs
index b40fd5365de..8dc967bc3ad 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-cos.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fcos;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fcos<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fcos_32x2
 #[no_mangle]
 pub unsafe fn fcos_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs
index fef003dde5b..00caca2f294 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fexp;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fexp<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @exp_32x2
 #[no_mangle]
 pub unsafe fn exp_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs
index 779c0fc403a..eda4053189c 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-exp2.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fexp2;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fexp2<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @exp2_32x2
 #[no_mangle]
 pub unsafe fn exp2_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs
index b2bd27a5b75..ad69d4cdd88 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-floor.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_floor;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_floor<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @floor_32x2
 #[no_mangle]
 pub unsafe fn floor_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs
index 37f4782626a..cbeefdc31c0 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fma.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fma;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fma<T>(x: T, b: T, c: T) -> T;
-}
-
 // CHECK-LABEL: @fma_32x2
 #[no_mangle]
 pub unsafe fn fma_32x2(a: f32x2, b: f32x2, c: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs
index 336adf6db73..618daa4b44d 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-fsqrt.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fsqrt;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fsqrt<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fsqrt_32x2
 #[no_mangle]
 pub unsafe fn fsqrt_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs
index 8e97abc3a66..98a481e4004 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_flog;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_flog<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @log_32x2
 #[no_mangle]
 pub unsafe fn log_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs
index 1d4d4dc24e9..9108cd963f0 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_flog10;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_flog10<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @log10_32x2
 #[no_mangle]
 pub unsafe fn log10_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs
index 28f2f151617..2b20850dbd9 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-log2.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_flog2;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_flog2<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @log2_32x2
 #[no_mangle]
 pub unsafe fn log2_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
index 50c51bebe37..ce07b212e84 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
@@ -1,19 +1,15 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_fmax, simd_fmin};
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x4(pub [f32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_fmin<T>(x: T, y: T) -> T;
-    fn simd_fmax<T>(x: T, y: T) -> T;
-}
-
 // CHECK-LABEL: @fmin
 #[no_mangle]
 pub unsafe fn fmin(a: f32x4, b: f32x4) -> f32x4 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs
index 4173809e3a9..7de26b415bb 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-float-sin.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_fsin;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x2(pub [f32; 2]);
@@ -21,10 +22,6 @@ pub struct f32x8(pub [f32; 8]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x16(pub [f32; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_fsin<T>(x: T) -> T;
-}
-
 // CHECK-LABEL: @fsin_32x2
 #[no_mangle]
 pub unsafe fn fsin_32x2(a: f32x2) -> f32x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs
index a5afa27876a..ecf5eb24ee5 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-arithmetic-saturating.rs
@@ -1,71 +1,71 @@
 //@ compile-flags: -C no-prepopulate-passes
-//
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 #![deny(unused)]
 
-// signed integer types
+use std::intrinsics::simd::{simd_saturating_add, simd_saturating_sub};
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x2([i8; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x4([i8; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x8([i8; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x16([i8; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x32([i8; 32]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i8x64([i8; 64]);
+#[rustfmt::skip]
+mod types {
+    // signed integer types
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x2([i16; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x4([i16; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x8([i16; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x16([i16; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i16x32([i16; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x2([i8; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x4([i8; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x8([i8; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x16([i8; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x32([i8; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i8x64([i8; 64]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x2([i32; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x4([i32; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x8([i32; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i32x16([i32; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x2([i16; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x4([i16; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x8([i16; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x16([i16; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i16x32([i16; 32]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i64x2([i64; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i64x4([i64; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i64x8([i64; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x2([i32; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x4([i32; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x8([i32; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i32x16([i32; 16]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i128x2([i128; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct i128x4([i128; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x2([i64; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x4([i64; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i64x8([i64; 8]);
 
-// unsigned integer types
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i128x2([i128; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct i128x4([i128; 4]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x2([u8; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x4([u8; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x8([u8; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x16([u8; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x32([u8; 32]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u8x64([u8; 64]);
+    // unsigned integer types
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x2([u16; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x4([u16; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x8([u16; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x16([u16; 16]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u16x32([u16; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x2([u8; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x4([u8; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x8([u8; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x16([u8; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x32([u8; 32]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u8x64([u8; 64]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x2([u32; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x4([u32; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x8([u32; 8]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u32x16([u32; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x2([u16; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x4([u16; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x8([u16; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x16([u16; 16]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u16x32([u16; 32]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u64x2([u64; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u64x4([u64; 4]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u64x8([u64; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x2([u32; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x4([u32; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x8([u32; 8]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u32x16([u32; 16]);
 
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u128x2([u128; 2]);
-#[repr(simd)] #[derive(Copy, Clone)] pub struct u128x4([u128; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x2([u64; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x4([u64; 4]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u64x8([u64; 8]);
 
-extern "rust-intrinsic" {
-    fn simd_saturating_add<T>(x: T, y: T) -> T;
-    fn simd_saturating_sub<T>(x: T, y: T) -> T;
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u128x2([u128; 2]);
+    #[repr(simd)] #[derive(Copy, Clone)] pub struct u128x4([u128; 4]);
 }
 
+use types::*;
+
 // NOTE(eddyb) `%{{x|0}}` is used because on some targets (e.g. WASM)
 // SIMD vectors are passed directly, resulting in `%x` being a vector,
 // while on others they're passed indirectly, resulting in `%x` being
@@ -213,8 +213,6 @@ pub unsafe fn sadd_i128x4(x: i128x4, y: i128x4) -> i128x4 {
     simd_saturating_add(x, y)
 }
 
-
-
 // CHECK-LABEL: @uadd_u8x2
 #[no_mangle]
 pub unsafe fn uadd_u8x2(x: u8x2, y: u8x2) -> u8x2 {
@@ -355,10 +353,6 @@ pub unsafe fn uadd_u128x4(x: u128x4, y: u128x4) -> u128x4 {
     simd_saturating_add(x, y)
 }
 
-
-
-
-
 // CHECK-LABEL: @ssub_i8x2
 #[no_mangle]
 pub unsafe fn ssub_i8x2(x: i8x2, y: i8x2) -> i8x2 {
@@ -499,8 +493,6 @@ pub unsafe fn ssub_i128x4(x: i128x4, y: i128x4) -> i128x4 {
     simd_saturating_sub(x, y)
 }
 
-
-
 // CHECK-LABEL: @usub_u8x2
 #[no_mangle]
 pub unsafe fn usub_u8x2(x: u8x2, y: u8x2) -> u8x2 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs
index e9112f1f321..a2c40aa91b5 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-bitmask.rs
@@ -2,10 +2,11 @@
 //
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_bitmask;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct u32x2([u32; 2]);
@@ -18,10 +19,6 @@ pub struct i32x2([i32; 2]);
 #[derive(Copy, Clone)]
 pub struct i8x16([i8; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_bitmask<T, U>(x: T) -> U;
-}
-
 // NOTE(eddyb) `%{{x|1}}` is used because on some targets (e.g. WASM)
 // SIMD vectors are passed directly, resulting in `%x` being a vector,
 // while on others they're passed indirectly, resulting in `%x` being
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
index 7f99f695bf4..9bb46a3546b 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
@@ -3,10 +3,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_gather;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -15,14 +16,13 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_gather<T, P, M>(value: T, pointers: P, mask: M) -> T;
-}
-
 // CHECK-LABEL: @gather_f32x2
 #[no_mangle]
-pub unsafe fn gather_f32x2(pointers: Vec2<*const f32>, mask: Vec2<i32>,
-                           values: Vec2<f32>) -> Vec2<f32> {
+pub unsafe fn gather_f32x2(
+    pointers: Vec2<*const f32>,
+    mask: Vec2<i32>,
+    values: Vec2<f32>,
+) -> Vec2<f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x float> {{.*}})
@@ -31,8 +31,11 @@ pub unsafe fn gather_f32x2(pointers: Vec2<*const f32>, mask: Vec2<i32>,
 
 // CHECK-LABEL: @gather_pf32x2
 #[no_mangle]
-pub unsafe fn gather_pf32x2(pointers: Vec2<*const *const f32>, mask: Vec2<i32>,
-                           values: Vec2<*const f32>) -> Vec2<*const f32> {
+pub unsafe fn gather_pf32x2(
+    pointers: Vec2<*const *const f32>,
+    mask: Vec2<i32>,
+    values: Vec2<*const f32>,
+) -> Vec2<*const f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call <2 x ptr> @llvm.masked.gather.v2p0.v2p0(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]], <2 x ptr> {{.*}})
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
index 7f46630e920..fcc4cb5d630 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-load.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_masked_load;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -13,14 +14,9 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-}
-
 // CHECK-LABEL: @load_f32x2
 #[no_mangle]
-pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32,
-                         values: Vec2<f32>) -> Vec2<f32> {
+pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32, values: Vec2<f32>) -> Vec2<f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call <2 x float> @llvm.masked.load.v2f32.p0(ptr {{.*}}, i32 4, <2 x i1> [[B]], <2 x float> {{.*}})
@@ -29,8 +25,11 @@ pub unsafe fn load_f32x2(mask: Vec2<i32>, pointer: *const f32,
 
 // CHECK-LABEL: @load_pf32x4
 #[no_mangle]
-pub unsafe fn load_pf32x4(mask: Vec4<i32>, pointer: *const *const f32,
-                          values: Vec4<*const f32>) -> Vec4<*const f32> {
+pub unsafe fn load_pf32x4(
+    mask: Vec4<i32>,
+    pointer: *const *const f32,
+    values: Vec4<*const f32>,
+) -> Vec4<*const f32> {
     // CHECK: [[A:%[0-9]+]] = lshr <4 x i32> {{.*}}, {{<i32 31, i32 31, i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <4 x i32> [[A]] to <4 x i1>
     // CHECK: call <4 x ptr> @llvm.masked.load.v4p0.p0(ptr {{.*}}, i32 {{.*}}, <4 x i1> [[B]], <4 x ptr> {{.*}})
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
index 0d43234f1e2..04f4a0c6382 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-masked-store.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_masked_store;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -13,10 +14,6 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
-}
-
 // CHECK-LABEL: @store_f32x2
 #[no_mangle]
 pub unsafe fn store_f32x2(mask: Vec2<i32>, pointer: *mut f32, values: Vec2<f32>) {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
index ef7827bd96f..9506f8f6d3a 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
@@ -3,10 +3,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_scatter;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec2<T>(pub [T; 2]);
@@ -15,25 +16,22 @@ pub struct Vec2<T>(pub [T; 2]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct Vec4<T>(pub [T; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_scatter<T, P, M>(value: T, pointers: P, mask: M);
-}
-
 // CHECK-LABEL: @scatter_f32x2
 #[no_mangle]
-pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2<i32>,
-                            values: Vec2<f32>) {
+pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2<i32>, values: Vec2<f32>) {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call void @llvm.masked.scatter.v2f32.v2p0(<2 x float> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]]
     simd_scatter(values, pointers, mask)
 }
 
-
 // CHECK-LABEL: @scatter_pf32x2
 #[no_mangle]
-pub unsafe fn scatter_pf32x2(pointers: Vec2<*mut *const f32>, mask: Vec2<i32>,
-                             values: Vec2<*const f32>) {
+pub unsafe fn scatter_pf32x2(
+    pointers: Vec2<*mut *const f32>,
+    mask: Vec2<i32>,
+    values: Vec2<*const f32>,
+) {
     // CHECK: [[A:%[0-9]+]] = lshr <2 x i32> {{.*}}, {{<i32 31, i32 31>|splat \(i32 31\)}}
     // CHECK: [[B:%[0-9]+]] = trunc <2 x i32> [[A]] to <2 x i1>
     // CHECK: call void @llvm.masked.scatter.v2p0.v2p0(<2 x ptr> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> [[B]]
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs
index 33ed2b437f9..71279d9f0ea 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-select.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_select, simd_select_bitmask};
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct f32x4(pub [f32; 4]);
@@ -21,11 +22,6 @@ pub struct b8x4(pub [i8; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 pub struct i32x4([i32; 4]);
 
-extern "rust-intrinsic" {
-    fn simd_select<T, U>(x: T, a: U, b: U) -> U;
-    fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
-}
-
 // CHECK-LABEL: @select_m8
 #[no_mangle]
 pub unsafe fn select_m8(m: b8x4, a: f32x4, b: f32x4) -> f32x4 {
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs
index 92067db9b15..269fe41225e 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-mask-reduce.rs
@@ -1,10 +1,11 @@
 //@ compile-flags: -C no-prepopulate-passes
-//
 
 #![crate_type = "lib"]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_reduce_all, simd_reduce_any};
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct mask32x2([i32; 2]);
@@ -13,11 +14,6 @@ pub struct mask32x2([i32; 2]);
 #[derive(Copy, Clone)]
 pub struct mask8x16([i8; 16]);
 
-extern "rust-intrinsic" {
-    fn simd_reduce_all<T>(x: T) -> bool;
-    fn simd_reduce_any<T>(x: T) -> bool;
-}
-
 // NOTE(eddyb) `%{{x|1}}` is used because on some targets (e.g. WASM)
 // SIMD vectors are passed directly, resulting in `%x` being a vector,
 // while on others they're passed indirectly, resulting in `%x` being
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
index 0d21d510557..d3853361de9 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
@@ -12,7 +12,7 @@
 
 #![crate_type = "lib"]
 #![allow(non_camel_case_types)]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
diff --git a/tests/codegen/simd/simd_arith_offset.rs b/tests/codegen/simd/simd_arith_offset.rs
index e14fce1d418..b8af6fce332 100644
--- a/tests/codegen/simd/simd_arith_offset.rs
+++ b/tests/codegen/simd/simd_arith_offset.rs
@@ -3,11 +3,9 @@
 //
 
 #![crate_type = "lib"]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-extern "rust-intrinsic" {
-    pub(crate) fn simd_arith_offset<T, U>(ptrs: T, offsets: U) -> T;
-}
+use std::intrinsics::simd::simd_arith_offset;
 
 /// A vector of *const T.
 #[derive(Debug, Copy, Clone)]
diff --git a/tests/codegen/some-abis-do-extend-params-to-32-bits.rs b/tests/codegen/some-abis-do-extend-params-to-32-bits.rs
index 10970cacdcf..6ca6697588f 100644
--- a/tests/codegen/some-abis-do-extend-params-to-32-bits.rs
+++ b/tests/codegen/some-abis-do-extend-params-to-32-bits.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: -Cno-prepopulate-passes -Copt-level=0
 
 //@ revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv
@@ -24,12 +25,8 @@
 #![no_std]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 // The patterns in this file are written in the style of a table to make the
 // uniformities and distinctions more apparent.
diff --git a/tests/codegen/sparc-struct-abi.rs b/tests/codegen/sparc-struct-abi.rs
index 0a8720c4fca..32d2c5bb0ef 100644
--- a/tests/codegen/sparc-struct-abi.rs
+++ b/tests/codegen/sparc-struct-abi.rs
@@ -1,17 +1,14 @@
 // Checks that we correctly codegen extern "C" functions returning structs.
 // See issues #52638 and #86163.
 
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 --target=sparc64-unknown-linux-gnu --crate-type=rlib
 //@ needs-llvm-components: sparc
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "freeze"]
-trait Freeze {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 pub struct Bool {
diff --git a/tests/codegen/stack-probes-inline.rs b/tests/codegen/stack-probes-inline.rs
index c5073b9cc22..746272b0994 100644
--- a/tests/codegen/stack-probes-inline.rs
+++ b/tests/codegen/stack-probes-inline.rs
@@ -1,6 +1,7 @@
 // Check the "probe-stack" attribute for targets with `StackProbeType::Inline`,
 // or `StackProbeType::InlineOrCall` when running on newer LLVM.
 
+//@ add-core-stubs
 //@ compile-flags: -C no-prepopulate-passes
 //@ revisions: aarch64 powerpc powerpc64 powerpc64le s390x i686 x86_64
 //@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
@@ -22,8 +23,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub fn foo() {
diff --git a/tests/codegen/target-feature-overrides.rs b/tests/codegen/target-feature-overrides.rs
index f38a1ae72de..0fc1e0136b3 100644
--- a/tests/codegen/target-feature-overrides.rs
+++ b/tests/codegen/target-feature-overrides.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: COMPAT INCOMPAT
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=x86_64-unknown-linux-gnu -Copt-level=3
@@ -9,10 +10,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 extern "C" {
     fn peach() -> u32;
diff --git a/tests/codegen/tied-features-strength.rs b/tests/codegen/tied-features-strength.rs
index 1b2b63c3d1a..8b1f3b14fc3 100644
--- a/tests/codegen/tied-features-strength.rs
+++ b/tests/codegen/tied-features-strength.rs
@@ -1,4 +1,5 @@
 // ignore-tidy-linelength
+//@ add-core-stubs
 //@ revisions: ENABLE_SVE DISABLE_SVE DISABLE_NEON ENABLE_NEON
 //@ compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
 //@ needs-llvm-components: aarch64
@@ -22,7 +23,7 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 pub fn test() {}
diff --git a/tests/incremental/issue-61530.rs b/tests/incremental/issue-61530.rs
index 71ac39d0e03..673556a9d02 100644
--- a/tests/incremental/issue-61530.rs
+++ b/tests/incremental/issue-61530.rs
@@ -1,14 +1,12 @@
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 //@ revisions:rpass1 rpass2
 
+use std::intrinsics::simd::simd_shuffle;
+
 #[repr(simd)]
 struct I32x2([i32; 2]);
 
-extern "rust-intrinsic" {
-    fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-}
-
 #[repr(simd)]
 struct SimdShuffleIdx<const LEN: usize>([u32; LEN]);
 
diff --git a/tests/mir-opt/issues/issue_75439.rs b/tests/mir-opt/issues/issue_75439.rs
index ea763dd1b10..d7883f0dc71 100644
--- a/tests/mir-opt/issues/issue_75439.rs
+++ b/tests/mir-opt/issues/issue_75439.rs
@@ -1,10 +1,14 @@
-// skip-filecheck
 // EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff
 //@ ignore-endian-big
 
 use std::mem::transmute;
 
 pub fn foo(bytes: [u8; 16]) -> Option<[u8; 4]> {
+    // CHECK-LABEL: fn foo(
+    // CHECK: bb2: {
+    // CHECK-NEXT: 0: [[bb:bb[0-9]+]],
+    // CHECK-SAME: {{[0-9]+}}: [[bb]],
+
     // big endian `u32`s
     let dwords: [u32; 4] = unsafe { transmute(bytes) };
     const FF: u32 = 0x0000_ffff_u32.to_be();
diff --git a/tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs
index 26ab1390a49..3ec2cf66fa3 100644
--- a/tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs
@@ -1,8 +1,8 @@
 // Scraped example should only include line numbers for items b and c in ex.rs
-// @!has foobar/fn.f.html '//*[@class="src-line-numbers"]' '14'
-// @has foobar/fn.f.html '//*[@class="src-line-numbers"]' '15'
-// @has foobar/fn.f.html '//*[@class="src-line-numbers"]' '21'
-// @!has foobar/fn.f.html '//*[@class="src-line-numbers"]' '22'
+//@ !has foobar/fn.f.html '//span[@data-nosnippet]' '14'
+//@ has foobar/fn.f.html '//span[@data-nosnippet]' '15'
+//@ has foobar/fn.f.html '//span[@data-nosnippet]' '21'
+//@ !has foobar/fn.f.html '//span[@data-nosnippet]' '22'
 
 pub fn f() {}
 
diff --git a/tests/run-make/rustdoc-scrape-examples-multiple/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-multiple/src/lib.rs
index bdfeda92d79..25600915f5f 100644
--- a/tests/run-make/rustdoc-scrape-examples-multiple/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-multiple/src/lib.rs
@@ -1,6 +1,5 @@
-// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//*[@class="prev"]' ''
-// @has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' ''
-// @has src/ex/ex.rs.html
-// @has foobar/fn.ok.html '//a[@href="../src/ex/ex.rs.html#2"]' ''
+//@ has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' ''
+//@ has src/ex/ex.rs.html
+//@ has foobar/fn.ok.html '//a[@href="../src/ex/ex.rs.html#2"]' ''
 
 pub fn ok() {}
diff --git a/tests/run-make/rustdoc-scrape-examples-ordering/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-ordering/src/lib.rs
index c53c987a7cb..c957263c048 100644
--- a/tests/run-make/rustdoc-scrape-examples-ordering/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-ordering/src/lib.rs
@@ -1,6 +1,6 @@
-// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' 'ex2'
-// @has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' 'ex1'
-// @has foobar/fn.ok.html '//*[@class="highlight focus"]' 'ok'
-// @has foobar/fn.ok.html '//*[@class="highlight"]' 'ok'
+//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' 'ex2'
+//@ has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' 'ex1'
+//@ has foobar/fn.ok.html '//*[@class="highlight focus"]' 'ok'
+//@ has foobar/fn.ok.html '//*[@class="highlight"]' 'ok'
 
 pub fn ok(_x: i32) {}
diff --git a/tests/run-make/rustdoc-scrape-examples-remap/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-remap/src/lib.rs
index f525a4270dd..e1dc4f91506 100644
--- a/tests/run-make/rustdoc-scrape-examples-remap/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-remap/src/lib.rs
@@ -1,5 +1,5 @@
-// @has foobar/b/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
-// @has foobar/c/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
+//@ has foobar/b/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
+//@ has foobar/c/fn.foo.html '//*[@class="scraped-example expanded"]' 'ex.rs'
 
 #[path = "a.rs"]
 pub mod b;
diff --git a/tests/run-make/rustdoc-scrape-examples-test/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-test/src/lib.rs
index 22be1ad4101..93d56b7e972 100644
--- a/tests/run-make/rustdoc-scrape-examples-test/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-test/src/lib.rs
@@ -1,3 +1,3 @@
-// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' ''
+//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]' ''
 
 pub fn ok() {}
diff --git a/tests/run-make/rustdoc-scrape-examples-whitespace/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-whitespace/src/lib.rs
index 28c34716c2f..8fc3a5e41d2 100644
--- a/tests/run-make/rustdoc-scrape-examples-whitespace/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-whitespace/src/lib.rs
@@ -1,3 +1,3 @@
-// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//code' '  '
+//@ has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//code' '  '
 
 pub fn ok() {}
diff --git a/tests/run-make/rustdoc-themes/foo.rs b/tests/run-make/rustdoc-themes/foo.rs
index 8b1e75b0ae1..555429b07df 100644
--- a/tests/run-make/rustdoc-themes/foo.rs
+++ b/tests/run-make/rustdoc-themes/foo.rs
@@ -1,4 +1,4 @@
-// @has test.css
-// @has foo/struct.Foo.html
-// @has - '//*[@name="rustdoc-vars"]/@data-themes' 'test'
+//@ has test.css
+//@ has foo/struct.Foo.html
+//@ has - '//*[@name="rustdoc-vars"]/@data-themes' 'test'
 pub struct Foo;
diff --git a/tests/run-make/rustdoc-with-out-dir-option/src/lib.rs b/tests/run-make/rustdoc-with-out-dir-option/src/lib.rs
index 044bb6acb19..98753560d3a 100644
--- a/tests/run-make/rustdoc-with-out-dir-option/src/lib.rs
+++ b/tests/run-make/rustdoc-with-out-dir-option/src/lib.rs
@@ -1,2 +1,2 @@
-// @has foobar/fn.ok.html
+//@ has foobar/fn.ok.html
 pub fn ok() {}
diff --git a/tests/run-make/rustdoc-with-output-option/src/lib.rs b/tests/run-make/rustdoc-with-output-option/src/lib.rs
index 044bb6acb19..98753560d3a 100644
--- a/tests/run-make/rustdoc-with-output-option/src/lib.rs
+++ b/tests/run-make/rustdoc-with-output-option/src/lib.rs
@@ -1,2 +1,2 @@
-// @has foobar/fn.ok.html
+//@ has foobar/fn.ok.html
 pub fn ok() {}
diff --git a/tests/run-make/rustdoc-with-short-out-dir-option/src/lib.rs b/tests/run-make/rustdoc-with-short-out-dir-option/src/lib.rs
index 044bb6acb19..98753560d3a 100644
--- a/tests/run-make/rustdoc-with-short-out-dir-option/src/lib.rs
+++ b/tests/run-make/rustdoc-with-short-out-dir-option/src/lib.rs
@@ -1,2 +1,2 @@
-// @has foobar/fn.ok.html
+//@ has foobar/fn.ok.html
 pub fn ok() {}
diff --git a/tests/run-make/staticlib-broken-bitcode/rmake.rs b/tests/run-make/staticlib-broken-bitcode/rmake.rs
new file mode 100644
index 00000000000..17d17c1f0f5
--- /dev/null
+++ b/tests/run-make/staticlib-broken-bitcode/rmake.rs
@@ -0,0 +1,23 @@
+// Regression test for https://github.com/rust-lang/rust/issues/128955#issuecomment-2657811196
+// which checks that rustc can read an archive containing LLVM bitcode with a
+// newer version from the one rustc links against.
+use run_make_support::{llvm_ar, path, rfs, rustc, static_lib_name};
+
+fn main() {
+    rfs::create_dir("archive");
+
+    let mut bitcode = b"BC\xC0\xDE".to_vec();
+    bitcode.extend(std::iter::repeat(b'a').take(50));
+    rfs::write("archive/invalid_bitcode.o", &bitcode);
+
+    llvm_ar()
+        .arg("rcuS") // like obj_to_ar() except skips creating a symbol table
+        .output_input(
+            path("archive").join(static_lib_name("thin_archive")),
+            "archive/invalid_bitcode.o",
+        )
+        .run();
+
+    // Build an rlib which includes the members of this thin archive
+    rustc().input("rust_lib.rs").library_search_path("archive").run();
+}
diff --git a/tests/run-make/staticlib-broken-bitcode/rust_lib.rs b/tests/run-make/staticlib-broken-bitcode/rust_lib.rs
new file mode 100644
index 00000000000..c76b0f25433
--- /dev/null
+++ b/tests/run-make/staticlib-broken-bitcode/rust_lib.rs
@@ -0,0 +1,6 @@
+#![crate_type = "rlib"]
+
+#[link(name = "thin_archive", kind = "static")]
+extern "C" {
+    pub fn simple_fn();
+}
diff --git a/tests/rustdoc-ui/unused-extern-crate.rs b/tests/rustdoc-ui/unused-extern-crate.rs
deleted file mode 100644
index 240dd1f00e2..00000000000
--- a/tests/rustdoc-ui/unused-extern-crate.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//@ check-pass
-//@ aux-crate:panic_item=panic-item.rs
-// @has unused_extern_crate/index.html
diff --git a/tests/rustdoc-ui/auxiliary/panic-item.rs b/tests/rustdoc/auxiliary/panic-item.rs
index ccf784f7284..ccf784f7284 100644
--- a/tests/rustdoc-ui/auxiliary/panic-item.rs
+++ b/tests/rustdoc/auxiliary/panic-item.rs
diff --git a/tests/rustdoc/unused-extern-crate.rs b/tests/rustdoc/unused-extern-crate.rs
new file mode 100644
index 00000000000..cdc00fd313a
--- /dev/null
+++ b/tests/rustdoc/unused-extern-crate.rs
@@ -0,0 +1,2 @@
+//@ aux-crate:panic_item=panic-item.rs
+//@ has unused_extern_crate/index.html
diff --git a/tests/ui/abi/arm-unadjusted-intrinsic.rs b/tests/ui/abi/arm-unadjusted-intrinsic.rs
index 533cd40b30a..dcf0d9f39f6 100644
--- a/tests/ui/abi/arm-unadjusted-intrinsic.rs
+++ b/tests/ui/abi/arm-unadjusted-intrinsic.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ build-pass
 //@ revisions: arm
 //@[arm] compile-flags: --target arm-unknown-linux-gnueabi
@@ -14,19 +15,8 @@
 #![crate_type = "lib"]
 #![allow(non_camel_case_types)]
 
-/// To work cross-target this test must be no_core.
-/// This little prelude supplies what we need.
-#[lang = "sized"]
-pub trait Sized {}
-
-#[lang = "copy"]
-pub trait Copy: Sized {}
-impl Copy for i8 {}
-impl<T: ?Sized> Copy for *const T {}
-impl<T: ?Sized> Copy for *mut T {}
-
-// I hate no_core tests!
-impl<T: Copy, const N: usize> Copy for [T; N] {}
+extern crate minicore;
+use minicore::*;
 
 // Regression test for https://github.com/rust-lang/rust/issues/118124.
 
diff --git a/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr b/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr
index e1f43347985..02620da3a21 100644
--- a/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr
+++ b/tests/ui/abi/riscv-discoverability-guidance.riscv32.stderr
@@ -1,5 +1,5 @@
 error[E0703]: invalid ABI: found `riscv-interrupt`
-  --> $DIR/riscv-discoverability-guidance.rs:17:8
+  --> $DIR/riscv-discoverability-guidance.rs:15:8
    |
 LL | extern "riscv-interrupt" fn isr() {}
    |        ^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | extern "riscv-interrupt" fn isr() {}
    = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
 
 error[E0703]: invalid ABI: found `riscv-interrupt-u`
-  --> $DIR/riscv-discoverability-guidance.rs:22:8
+  --> $DIR/riscv-discoverability-guidance.rs:20:8
    |
 LL | extern "riscv-interrupt-u" fn isr_U() {}
    |        ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr b/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr
index e1f43347985..02620da3a21 100644
--- a/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr
+++ b/tests/ui/abi/riscv-discoverability-guidance.riscv64.stderr
@@ -1,5 +1,5 @@
 error[E0703]: invalid ABI: found `riscv-interrupt`
-  --> $DIR/riscv-discoverability-guidance.rs:17:8
+  --> $DIR/riscv-discoverability-guidance.rs:15:8
    |
 LL | extern "riscv-interrupt" fn isr() {}
    |        ^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | extern "riscv-interrupt" fn isr() {}
    = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
 
 error[E0703]: invalid ABI: found `riscv-interrupt-u`
-  --> $DIR/riscv-discoverability-guidance.rs:22:8
+  --> $DIR/riscv-discoverability-guidance.rs:20:8
    |
 LL | extern "riscv-interrupt-u" fn isr_U() {}
    |        ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/riscv-discoverability-guidance.rs b/tests/ui/abi/riscv-discoverability-guidance.rs
index dec5059b0a7..41cce35aefa 100644
--- a/tests/ui/abi/riscv-discoverability-guidance.rs
+++ b/tests/ui/abi/riscv-discoverability-guidance.rs
@@ -1,4 +1,5 @@
 // ignore-tidy-linelength
+//@ add-core-stubs
 //@ revisions: riscv32 riscv64
 //
 //@ [riscv32] needs-llvm-components: riscv
@@ -6,13 +7,10 @@
 //@ [riscv64] needs-llvm-components: riscv
 //@ [riscv64] compile-flags: --target=riscv64gc-unknown-none-elf -C target-feature=-unaligned-scalar-mem --crate-type=rlib
 #![no_core]
-#![feature(
-    no_core,
-    lang_items,
-    abi_riscv_interrupt
-)]
-#[lang = "sized"]
-trait Sized {}
+#![feature(no_core, lang_items, abi_riscv_interrupt)]
+
+extern crate minicore;
+use minicore::*;
 
 extern "riscv-interrupt" fn isr() {}
 //~^ ERROR invalid ABI
diff --git a/tests/ui/abi/sparcv8plus-llvm19.rs b/tests/ui/abi/sparcv8plus-llvm19.rs
index a884e5ca06f..3d6d8568b6e 100644
--- a/tests/ui/abi/sparcv8plus-llvm19.rs
+++ b/tests/ui/abi/sparcv8plus-llvm19.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: sparc sparcv8plus sparc_cpu_v9 sparc_feature_v8plus sparc_cpu_v9_feature_v8plus
 //@[sparc] compile-flags: --target sparc-unknown-none-elf
 //@[sparc] needs-llvm-components: sparc
@@ -15,10 +16,8 @@
 #![feature(no_core, rustc_attrs, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[rustc_builtin_macro]
 macro_rules! compile_error {
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr
index 7eedf26135f..d3462ae87d3 100644
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr
+++ b/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr
@@ -1,5 +1,5 @@
 error: -v8plus,-v9
-  --> $DIR/sparcv8plus-llvm19.rs:29:1
+  --> $DIR/sparcv8plus-llvm19.rs:28:1
    |
 LL | compile_error!("-v8plus,-v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr
index ac61df35678..9891aec94b8 100644
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr
+++ b/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus-llvm19.rs:34:1
+  --> $DIR/sparcv8plus-llvm19.rs:33:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr
index ac61df35678..9891aec94b8 100644
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr
+++ b/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus-llvm19.rs:34:1
+  --> $DIR/sparcv8plus-llvm19.rs:33:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr
index 1bf7a3ad76a..dbcdb8ed121 100644
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr
+++ b/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,-v9 (FIXME)
-  --> $DIR/sparcv8plus-llvm19.rs:39:1
+  --> $DIR/sparcv8plus-llvm19.rs:38:1
    |
 LL | compile_error!("+v8plus,-v9 (FIXME)");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr
index ac61df35678..9891aec94b8 100644
--- a/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr
+++ b/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus-llvm19.rs:34:1
+  --> $DIR/sparcv8plus-llvm19.rs:33:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.rs b/tests/ui/abi/sparcv8plus.rs
index a78ae0cd328..6c17f721838 100644
--- a/tests/ui/abi/sparcv8plus.rs
+++ b/tests/ui/abi/sparcv8plus.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: sparc sparcv8plus sparc_cpu_v9 sparc_feature_v8plus sparc_cpu_v9_feature_v8plus
 //@[sparc] compile-flags: --target sparc-unknown-none-elf
 //@[sparc] needs-llvm-components: sparc
@@ -15,10 +16,8 @@
 #![feature(no_core, rustc_attrs, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 #[rustc_builtin_macro]
 macro_rules! compile_error {
diff --git a/tests/ui/abi/sparcv8plus.sparc.stderr b/tests/ui/abi/sparcv8plus.sparc.stderr
index 6d14ff53ab9..e2aa89a9273 100644
--- a/tests/ui/abi/sparcv8plus.sparc.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc.stderr
@@ -1,5 +1,5 @@
 error: -v8plus,-v9
-  --> $DIR/sparcv8plus.rs:29:1
+  --> $DIR/sparcv8plus.rs:28:1
    |
 LL | compile_error!("-v8plus,-v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr b/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
index 00fd7ef4ea8..2c5699f2dec 100644
--- a/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
@@ -1,5 +1,5 @@
 error: -v8plus,+v9
-  --> $DIR/sparcv8plus.rs:42:1
+  --> $DIR/sparcv8plus.rs:41:1
    |
 LL | compile_error!("-v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr
index a3c74e67f8f..4b96e4421f9 100644
--- a/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus.rs:33:1
+  --> $DIR/sparcv8plus.rs:32:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
index 84f560d158c..dfdec88961b 100644
--- a/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,-v9 (FIXME)
-  --> $DIR/sparcv8plus.rs:38:1
+  --> $DIR/sparcv8plus.rs:37:1
    |
 LL | compile_error!("+v8plus,-v9 (FIXME)");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparcv8plus.stderr b/tests/ui/abi/sparcv8plus.sparcv8plus.stderr
index a3c74e67f8f..4b96e4421f9 100644
--- a/tests/ui/abi/sparcv8plus.sparcv8plus.stderr
+++ b/tests/ui/abi/sparcv8plus.sparcv8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus.rs:33:1
+  --> $DIR/sparcv8plus.rs:32:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/unsupported.aarch64.stderr b/tests/ui/abi/unsupported.aarch64.stderr
index 2eb6ab08232..01f071f1f31 100644
--- a/tests/ui/abi/unsupported.aarch64.stderr
+++ b/tests/ui/abi/unsupported.aarch64.stderr
@@ -1,5 +1,5 @@
 warning: the calling convention "ptx-kernel" is not supported on this target
-  --> $DIR/unsupported.rs:36:15
+  --> $DIR/unsupported.rs:35:15
    |
 LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:41:1
+  --> $DIR/unsupported.rs:40:1
    |
 LL | extern "ptx-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "aapcs" is not supported on this target
-  --> $DIR/unsupported.rs:52:17
+  --> $DIR/unsupported.rs:51:17
    |
 LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:65:1
+  --> $DIR/unsupported.rs:64:1
    |
 LL | extern "aapcs" {}
    | ^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "msp430-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:74:18
+  --> $DIR/unsupported.rs:73:18
    |
 LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:79:1
+  --> $DIR/unsupported.rs:78:1
    |
 LL | extern "msp430-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "avr-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:84:15
+  --> $DIR/unsupported.rs:83:15
    |
 LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:89:1
+  --> $DIR/unsupported.rs:88:1
    |
 LL | extern "avr-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "riscv-interrupt-m" is not supported on this target
-  --> $DIR/unsupported.rs:97:17
+  --> $DIR/unsupported.rs:96:17
    |
 LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:108:1
+  --> $DIR/unsupported.rs:107:1
    |
 LL | extern "riscv-interrupt-m" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "x86-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:119:15
+  --> $DIR/unsupported.rs:118:15
    |
 LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:130:1
+  --> $DIR/unsupported.rs:129:1
    |
 LL | extern "x86-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "thiscall" is not supported on this target
-  --> $DIR/unsupported.rs:142:20
+  --> $DIR/unsupported.rs:141:20
    |
 LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    |                    ^^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:155:1
+  --> $DIR/unsupported.rs:154:1
    |
 LL | extern "thiscall" {}
    | ^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "stdcall" is not supported on this target
-  --> $DIR/unsupported.rs:168:19
+  --> $DIR/unsupported.rs:167:19
    |
 LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    |                   ^^^^^^^^^^^^^^^^^^^^^
@@ -114,13 +114,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:181:1
+  --> $DIR/unsupported.rs:180:1
    |
 LL | extern "stdcall" {}
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
-  --> $DIR/unsupported.rs:188:21
+  --> $DIR/unsupported.rs:187:21
    |
 LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -129,7 +129,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
-  --> $DIR/unsupported.rs:196:22
+  --> $DIR/unsupported.rs:195:22
    |
 LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -138,67 +138,67 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:201:1
+  --> $DIR/unsupported.rs:200:1
    |
 LL | extern "C-cmse-nonsecure-entry" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:34:1
+  --> $DIR/unsupported.rs:33:1
    |
 LL | extern "ptx-kernel" fn ptx() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:43:1
+  --> $DIR/unsupported.rs:42:1
    |
 LL | extern "gpu-kernel" fn gpu() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:46:1
+  --> $DIR/unsupported.rs:45:1
    |
 LL | extern "aapcs" fn aapcs() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:72:1
+  --> $DIR/unsupported.rs:71:1
    |
 LL | extern "msp430-interrupt" fn msp430() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:82:1
+  --> $DIR/unsupported.rs:81:1
    |
 LL | extern "avr-interrupt" fn avr() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:92:1
+  --> $DIR/unsupported.rs:91:1
    |
 LL | extern "riscv-interrupt-m" fn riscv() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:114:1
+  --> $DIR/unsupported.rs:113:1
    |
 LL | extern "x86-interrupt" fn x86() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:136:1
+  --> $DIR/unsupported.rs:135:1
    |
 LL | extern "thiscall" fn thiscall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:162:1
+  --> $DIR/unsupported.rs:161:1
    |
 LL | extern "stdcall" fn stdcall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:194:1
+  --> $DIR/unsupported.rs:193:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/unsupported.arm.stderr b/tests/ui/abi/unsupported.arm.stderr
index ee878379cc6..dfb4b573349 100644
--- a/tests/ui/abi/unsupported.arm.stderr
+++ b/tests/ui/abi/unsupported.arm.stderr
@@ -1,5 +1,5 @@
 warning: the calling convention "ptx-kernel" is not supported on this target
-  --> $DIR/unsupported.rs:36:15
+  --> $DIR/unsupported.rs:35:15
    |
 LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:41:1
+  --> $DIR/unsupported.rs:40:1
    |
 LL | extern "ptx-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "msp430-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:74:18
+  --> $DIR/unsupported.rs:73:18
    |
 LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:79:1
+  --> $DIR/unsupported.rs:78:1
    |
 LL | extern "msp430-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "avr-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:84:15
+  --> $DIR/unsupported.rs:83:15
    |
 LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:89:1
+  --> $DIR/unsupported.rs:88:1
    |
 LL | extern "avr-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "riscv-interrupt-m" is not supported on this target
-  --> $DIR/unsupported.rs:97:17
+  --> $DIR/unsupported.rs:96:17
    |
 LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:108:1
+  --> $DIR/unsupported.rs:107:1
    |
 LL | extern "riscv-interrupt-m" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "x86-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:119:15
+  --> $DIR/unsupported.rs:118:15
    |
 LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:130:1
+  --> $DIR/unsupported.rs:129:1
    |
 LL | extern "x86-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "thiscall" is not supported on this target
-  --> $DIR/unsupported.rs:142:20
+  --> $DIR/unsupported.rs:141:20
    |
 LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    |                    ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:155:1
+  --> $DIR/unsupported.rs:154:1
    |
 LL | extern "thiscall" {}
    | ^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "stdcall" is not supported on this target
-  --> $DIR/unsupported.rs:168:19
+  --> $DIR/unsupported.rs:167:19
    |
 LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    |                   ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:181:1
+  --> $DIR/unsupported.rs:180:1
    |
 LL | extern "stdcall" {}
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
-  --> $DIR/unsupported.rs:188:21
+  --> $DIR/unsupported.rs:187:21
    |
 LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
-  --> $DIR/unsupported.rs:196:22
+  --> $DIR/unsupported.rs:195:22
    |
 LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,61 +123,61 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:201:1
+  --> $DIR/unsupported.rs:200:1
    |
 LL | extern "C-cmse-nonsecure-entry" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:34:1
+  --> $DIR/unsupported.rs:33:1
    |
 LL | extern "ptx-kernel" fn ptx() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:43:1
+  --> $DIR/unsupported.rs:42:1
    |
 LL | extern "gpu-kernel" fn gpu() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:72:1
+  --> $DIR/unsupported.rs:71:1
    |
 LL | extern "msp430-interrupt" fn msp430() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:82:1
+  --> $DIR/unsupported.rs:81:1
    |
 LL | extern "avr-interrupt" fn avr() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:92:1
+  --> $DIR/unsupported.rs:91:1
    |
 LL | extern "riscv-interrupt-m" fn riscv() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:114:1
+  --> $DIR/unsupported.rs:113:1
    |
 LL | extern "x86-interrupt" fn x86() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:136:1
+  --> $DIR/unsupported.rs:135:1
    |
 LL | extern "thiscall" fn thiscall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:162:1
+  --> $DIR/unsupported.rs:161:1
    |
 LL | extern "stdcall" fn stdcall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:194:1
+  --> $DIR/unsupported.rs:193:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/unsupported.i686.stderr b/tests/ui/abi/unsupported.i686.stderr
index 02b2cdd356f..d7b76a4730b 100644
--- a/tests/ui/abi/unsupported.i686.stderr
+++ b/tests/ui/abi/unsupported.i686.stderr
@@ -1,5 +1,5 @@
 warning: the calling convention "ptx-kernel" is not supported on this target
-  --> $DIR/unsupported.rs:36:15
+  --> $DIR/unsupported.rs:35:15
    |
 LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:41:1
+  --> $DIR/unsupported.rs:40:1
    |
 LL | extern "ptx-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "aapcs" is not supported on this target
-  --> $DIR/unsupported.rs:52:17
+  --> $DIR/unsupported.rs:51:17
    |
 LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:65:1
+  --> $DIR/unsupported.rs:64:1
    |
 LL | extern "aapcs" {}
    | ^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "msp430-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:74:18
+  --> $DIR/unsupported.rs:73:18
    |
 LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:79:1
+  --> $DIR/unsupported.rs:78:1
    |
 LL | extern "msp430-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "avr-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:84:15
+  --> $DIR/unsupported.rs:83:15
    |
 LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:89:1
+  --> $DIR/unsupported.rs:88:1
    |
 LL | extern "avr-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "riscv-interrupt-m" is not supported on this target
-  --> $DIR/unsupported.rs:97:17
+  --> $DIR/unsupported.rs:96:17
    |
 LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:108:1
+  --> $DIR/unsupported.rs:107:1
    |
 LL | extern "riscv-interrupt-m" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
-  --> $DIR/unsupported.rs:188:21
+  --> $DIR/unsupported.rs:187:21
    |
 LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,7 +84,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
-  --> $DIR/unsupported.rs:196:22
+  --> $DIR/unsupported.rs:195:22
    |
 LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -93,49 +93,49 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:201:1
+  --> $DIR/unsupported.rs:200:1
    |
 LL | extern "C-cmse-nonsecure-entry" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:34:1
+  --> $DIR/unsupported.rs:33:1
    |
 LL | extern "ptx-kernel" fn ptx() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:43:1
+  --> $DIR/unsupported.rs:42:1
    |
 LL | extern "gpu-kernel" fn gpu() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:46:1
+  --> $DIR/unsupported.rs:45:1
    |
 LL | extern "aapcs" fn aapcs() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:72:1
+  --> $DIR/unsupported.rs:71:1
    |
 LL | extern "msp430-interrupt" fn msp430() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:82:1
+  --> $DIR/unsupported.rs:81:1
    |
 LL | extern "avr-interrupt" fn avr() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:92:1
+  --> $DIR/unsupported.rs:91:1
    |
 LL | extern "riscv-interrupt-m" fn riscv() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:194:1
+  --> $DIR/unsupported.rs:193:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/unsupported.riscv32.stderr b/tests/ui/abi/unsupported.riscv32.stderr
index abf403da8bd..eef2ead4f0f 100644
--- a/tests/ui/abi/unsupported.riscv32.stderr
+++ b/tests/ui/abi/unsupported.riscv32.stderr
@@ -1,5 +1,5 @@
 warning: the calling convention "ptx-kernel" is not supported on this target
-  --> $DIR/unsupported.rs:36:15
+  --> $DIR/unsupported.rs:35:15
    |
 LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:41:1
+  --> $DIR/unsupported.rs:40:1
    |
 LL | extern "ptx-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "aapcs" is not supported on this target
-  --> $DIR/unsupported.rs:52:17
+  --> $DIR/unsupported.rs:51:17
    |
 LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:65:1
+  --> $DIR/unsupported.rs:64:1
    |
 LL | extern "aapcs" {}
    | ^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "msp430-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:74:18
+  --> $DIR/unsupported.rs:73:18
    |
 LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:79:1
+  --> $DIR/unsupported.rs:78:1
    |
 LL | extern "msp430-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "avr-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:84:15
+  --> $DIR/unsupported.rs:83:15
    |
 LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:89:1
+  --> $DIR/unsupported.rs:88:1
    |
 LL | extern "avr-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "x86-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:119:15
+  --> $DIR/unsupported.rs:118:15
    |
 LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:130:1
+  --> $DIR/unsupported.rs:129:1
    |
 LL | extern "x86-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "thiscall" is not supported on this target
-  --> $DIR/unsupported.rs:142:20
+  --> $DIR/unsupported.rs:141:20
    |
 LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    |                    ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:155:1
+  --> $DIR/unsupported.rs:154:1
    |
 LL | extern "thiscall" {}
    | ^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "stdcall" is not supported on this target
-  --> $DIR/unsupported.rs:168:19
+  --> $DIR/unsupported.rs:167:19
    |
 LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    |                   ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:181:1
+  --> $DIR/unsupported.rs:180:1
    |
 LL | extern "stdcall" {}
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
-  --> $DIR/unsupported.rs:188:21
+  --> $DIR/unsupported.rs:187:21
    |
 LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
-  --> $DIR/unsupported.rs:196:22
+  --> $DIR/unsupported.rs:195:22
    |
 LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,61 +123,61 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:201:1
+  --> $DIR/unsupported.rs:200:1
    |
 LL | extern "C-cmse-nonsecure-entry" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:34:1
+  --> $DIR/unsupported.rs:33:1
    |
 LL | extern "ptx-kernel" fn ptx() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:43:1
+  --> $DIR/unsupported.rs:42:1
    |
 LL | extern "gpu-kernel" fn gpu() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:46:1
+  --> $DIR/unsupported.rs:45:1
    |
 LL | extern "aapcs" fn aapcs() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:72:1
+  --> $DIR/unsupported.rs:71:1
    |
 LL | extern "msp430-interrupt" fn msp430() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:82:1
+  --> $DIR/unsupported.rs:81:1
    |
 LL | extern "avr-interrupt" fn avr() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:114:1
+  --> $DIR/unsupported.rs:113:1
    |
 LL | extern "x86-interrupt" fn x86() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:136:1
+  --> $DIR/unsupported.rs:135:1
    |
 LL | extern "thiscall" fn thiscall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:162:1
+  --> $DIR/unsupported.rs:161:1
    |
 LL | extern "stdcall" fn stdcall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:194:1
+  --> $DIR/unsupported.rs:193:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/unsupported.riscv64.stderr b/tests/ui/abi/unsupported.riscv64.stderr
index abf403da8bd..eef2ead4f0f 100644
--- a/tests/ui/abi/unsupported.riscv64.stderr
+++ b/tests/ui/abi/unsupported.riscv64.stderr
@@ -1,5 +1,5 @@
 warning: the calling convention "ptx-kernel" is not supported on this target
-  --> $DIR/unsupported.rs:36:15
+  --> $DIR/unsupported.rs:35:15
    |
 LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:41:1
+  --> $DIR/unsupported.rs:40:1
    |
 LL | extern "ptx-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "aapcs" is not supported on this target
-  --> $DIR/unsupported.rs:52:17
+  --> $DIR/unsupported.rs:51:17
    |
 LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:65:1
+  --> $DIR/unsupported.rs:64:1
    |
 LL | extern "aapcs" {}
    | ^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "msp430-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:74:18
+  --> $DIR/unsupported.rs:73:18
    |
 LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:79:1
+  --> $DIR/unsupported.rs:78:1
    |
 LL | extern "msp430-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "avr-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:84:15
+  --> $DIR/unsupported.rs:83:15
    |
 LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:89:1
+  --> $DIR/unsupported.rs:88:1
    |
 LL | extern "avr-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "x86-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:119:15
+  --> $DIR/unsupported.rs:118:15
    |
 LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn x86_ptr(f: extern "x86-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:130:1
+  --> $DIR/unsupported.rs:129:1
    |
 LL | extern "x86-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "thiscall" is not supported on this target
-  --> $DIR/unsupported.rs:142:20
+  --> $DIR/unsupported.rs:141:20
    |
 LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    |                    ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:155:1
+  --> $DIR/unsupported.rs:154:1
    |
 LL | extern "thiscall" {}
    | ^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "stdcall" is not supported on this target
-  --> $DIR/unsupported.rs:168:19
+  --> $DIR/unsupported.rs:167:19
    |
 LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    |                   ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:181:1
+  --> $DIR/unsupported.rs:180:1
    |
 LL | extern "stdcall" {}
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
-  --> $DIR/unsupported.rs:188:21
+  --> $DIR/unsupported.rs:187:21
    |
 LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
-  --> $DIR/unsupported.rs:196:22
+  --> $DIR/unsupported.rs:195:22
    |
 LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,61 +123,61 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:201:1
+  --> $DIR/unsupported.rs:200:1
    |
 LL | extern "C-cmse-nonsecure-entry" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:34:1
+  --> $DIR/unsupported.rs:33:1
    |
 LL | extern "ptx-kernel" fn ptx() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:43:1
+  --> $DIR/unsupported.rs:42:1
    |
 LL | extern "gpu-kernel" fn gpu() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:46:1
+  --> $DIR/unsupported.rs:45:1
    |
 LL | extern "aapcs" fn aapcs() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:72:1
+  --> $DIR/unsupported.rs:71:1
    |
 LL | extern "msp430-interrupt" fn msp430() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:82:1
+  --> $DIR/unsupported.rs:81:1
    |
 LL | extern "avr-interrupt" fn avr() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:114:1
+  --> $DIR/unsupported.rs:113:1
    |
 LL | extern "x86-interrupt" fn x86() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:136:1
+  --> $DIR/unsupported.rs:135:1
    |
 LL | extern "thiscall" fn thiscall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:162:1
+  --> $DIR/unsupported.rs:161:1
    |
 LL | extern "stdcall" fn stdcall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:194:1
+  --> $DIR/unsupported.rs:193:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/unsupported.rs b/tests/ui/abi/unsupported.rs
index 7d4142f0dee..84646502f6f 100644
--- a/tests/ui/abi/unsupported.rs
+++ b/tests/ui/abi/unsupported.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x64 i686 aarch64 arm riscv32 riscv64
 //
 //@ [x64] needs-llvm-components: x86
@@ -25,11 +26,9 @@
     abi_c_cmse_nonsecure_call,
     cmse_nonsecure_entry
 )]
-#[lang = "sized"]
-trait Sized {}
 
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 extern "ptx-kernel" fn ptx() {}
 //~^ ERROR is not a supported ABI
diff --git a/tests/ui/abi/unsupported.x64.stderr b/tests/ui/abi/unsupported.x64.stderr
index 824a33c948a..80613d83e58 100644
--- a/tests/ui/abi/unsupported.x64.stderr
+++ b/tests/ui/abi/unsupported.x64.stderr
@@ -1,5 +1,5 @@
 warning: the calling convention "ptx-kernel" is not supported on this target
-  --> $DIR/unsupported.rs:36:15
+  --> $DIR/unsupported.rs:35:15
    |
 LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn ptx_ptr(f: extern "ptx-kernel" fn()) {
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:41:1
+  --> $DIR/unsupported.rs:40:1
    |
 LL | extern "ptx-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "aapcs" is not supported on this target
-  --> $DIR/unsupported.rs:52:17
+  --> $DIR/unsupported.rs:51:17
    |
 LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^
@@ -24,13 +24,13 @@ LL | fn aapcs_ptr(f: extern "aapcs" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:65:1
+  --> $DIR/unsupported.rs:64:1
    |
 LL | extern "aapcs" {}
    | ^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "msp430-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:74:18
+  --> $DIR/unsupported.rs:73:18
    |
 LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,13 +39,13 @@ LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:79:1
+  --> $DIR/unsupported.rs:78:1
    |
 LL | extern "msp430-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "avr-interrupt" is not supported on this target
-  --> $DIR/unsupported.rs:84:15
+  --> $DIR/unsupported.rs:83:15
    |
 LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,13 +54,13 @@ LL | fn avr_ptr(f: extern "avr-interrupt" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:89:1
+  --> $DIR/unsupported.rs:88:1
    |
 LL | extern "avr-interrupt" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "riscv-interrupt-m" is not supported on this target
-  --> $DIR/unsupported.rs:97:17
+  --> $DIR/unsupported.rs:96:17
    |
 LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,13 +69,13 @@ LL | fn riscv_ptr(f: extern "riscv-interrupt-m" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:108:1
+  --> $DIR/unsupported.rs:107:1
    |
 LL | extern "riscv-interrupt-m" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "thiscall" is not supported on this target
-  --> $DIR/unsupported.rs:142:20
+  --> $DIR/unsupported.rs:141:20
    |
 LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    |                    ^^^^^^^^^^^^^^^^^^^^^^
@@ -84,13 +84,13 @@ LL | fn thiscall_ptr(f: extern "thiscall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:155:1
+  --> $DIR/unsupported.rs:154:1
    |
 LL | extern "thiscall" {}
    | ^^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "stdcall" is not supported on this target
-  --> $DIR/unsupported.rs:168:19
+  --> $DIR/unsupported.rs:167:19
    |
 LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    |                   ^^^^^^^^^^^^^^^^^^^^^
@@ -99,13 +99,13 @@ LL | fn stdcall_ptr(f: extern "stdcall" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:181:1
+  --> $DIR/unsupported.rs:180:1
    |
 LL | extern "stdcall" {}
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: the calling convention "C-cmse-nonsecure-call" is not supported on this target
-  --> $DIR/unsupported.rs:188:21
+  --> $DIR/unsupported.rs:187:21
    |
 LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,7 +114,7 @@ LL | fn cmse_call_ptr(f: extern "C-cmse-nonsecure-call" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 warning: the calling convention "C-cmse-nonsecure-entry" is not supported on this target
-  --> $DIR/unsupported.rs:196:22
+  --> $DIR/unsupported.rs:195:22
    |
 LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,61 +123,61 @@ LL | fn cmse_entry_ptr(f: extern "C-cmse-nonsecure-entry" fn()) {
    = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:201:1
+  --> $DIR/unsupported.rs:200:1
    |
 LL | extern "C-cmse-nonsecure-entry" {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:34:1
+  --> $DIR/unsupported.rs:33:1
    |
 LL | extern "ptx-kernel" fn ptx() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:43:1
+  --> $DIR/unsupported.rs:42:1
    |
 LL | extern "gpu-kernel" fn gpu() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"aapcs"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:46:1
+  --> $DIR/unsupported.rs:45:1
    |
 LL | extern "aapcs" fn aapcs() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:72:1
+  --> $DIR/unsupported.rs:71:1
    |
 LL | extern "msp430-interrupt" fn msp430() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:82:1
+  --> $DIR/unsupported.rs:81:1
    |
 LL | extern "avr-interrupt" fn avr() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:92:1
+  --> $DIR/unsupported.rs:91:1
    |
 LL | extern "riscv-interrupt-m" fn riscv() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"thiscall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:136:1
+  --> $DIR/unsupported.rs:135:1
    |
 LL | extern "thiscall" fn thiscall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"stdcall"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:162:1
+  --> $DIR/unsupported.rs:161:1
    |
 LL | extern "stdcall" fn stdcall() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/unsupported.rs:194:1
+  --> $DIR/unsupported.rs:193:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn cmse_entry() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs b/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
index 707bcac78bf..22786043693 100644
--- a/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
+++ b/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 // Test that we do not ICE when the self type is `ty::err`, but rather
 // just propagate the error.
 
@@ -6,17 +7,8 @@
 #![feature(no_core)]
 #![no_core]
 
-#[lang="sized"]
-pub trait Sized {
-    // Empty.
-}
-
-#[lang = "add"]
-trait Add<RHS=Self> {
-    type Output;
-
-    fn add(self, _: RHS) -> Self::Output;
-}
+extern crate minicore;
+use minicore::*;
 
 fn ice<A>(a: A) {
     let r = loop {};
diff --git a/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr b/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr
index ebe56c8cd68..0bbb601a6d2 100644
--- a/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr
+++ b/tests/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr
@@ -1,14 +1,8 @@
 error[E0277]: the trait bound `(): Add<A>` is not satisfied
-  --> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:23:11
+  --> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:15:11
    |
 LL |     r = r + a;
    |           ^ the trait `Add<A>` is not implemented for `()`
-   |
-help: this trait has no implementations, consider adding one
-  --> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:15:1
-   |
-LL | trait Add<RHS=Self> {
-   | ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/borrowck/issue-92157.rs b/tests/ui/borrowck/issue-92157.rs
index a2b685cdf6e..72f216e301d 100644
--- a/tests/ui/borrowck/issue-92157.rs
+++ b/tests/ui/borrowck/issue-92157.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 #![feature(no_core)]
 #![feature(lang_items)]
 
@@ -13,28 +14,7 @@ fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
     40+2
 }
 
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-
-#[lang = "drop_in_place"]
-#[allow(unconditional_recursion)]
-pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
-    drop_in_place(to_drop)
-}
-
-#[lang = "add"]
-trait Add<RHS> {
-    type Output;
-    fn add(self, other: RHS) -> Self::Output;
-}
-
-impl Add<isize> for isize {
-    type Output = isize;
-    fn add(self, other: isize) -> isize {
-        self + other
-    }
-}
+extern crate minicore;
+use minicore::*;
 
 fn main() {}
diff --git a/tests/ui/borrowck/issue-92157.stderr b/tests/ui/borrowck/issue-92157.stderr
index 0ffedccd690..248d700ab4b 100644
--- a/tests/ui/borrowck/issue-92157.stderr
+++ b/tests/ui/borrowck/issue-92157.stderr
@@ -1,5 +1,5 @@
 error[E0308]: lang item `start` function has wrong type
-  --> $DIR/issue-92157.rs:11:1
+  --> $DIR/issue-92157.rs:12:1
    |
 LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
diff --git a/tests/ui/c-variadic/variadic-ffi-1.rs b/tests/ui/c-variadic/variadic-ffi-1.rs
index e41ab269211..9dcd55d13e3 100644
--- a/tests/ui/c-variadic/variadic-ffi-1.rs
+++ b/tests/ui/c-variadic/variadic-ffi-1.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 extern "stdcall" {
     fn printf(_: *const u8, ...);
diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr
index 39dfb2548a3..f99abed0a62 100644
--- a/tests/ui/c-variadic/variadic-ffi-1.stderr
+++ b/tests/ui/c-variadic/variadic-ffi-1.stderr
@@ -1,17 +1,17 @@
 error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi`
-  --> $DIR/variadic-ffi-1.rs:9:5
+  --> $DIR/variadic-ffi-1.rs:11:5
    |
 LL |     fn printf(_: *const u8, ...);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
 
 error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied
-  --> $DIR/variadic-ffi-1.rs:22:9
+  --> $DIR/variadic-ffi-1.rs:24:9
    |
 LL |         foo();
    |         ^^^-- two arguments of type `isize` and `u8` are missing
    |
 note: function defined here
-  --> $DIR/variadic-ffi-1.rs:15:8
+  --> $DIR/variadic-ffi-1.rs:17:8
    |
 LL |     fn foo(f: isize, x: u8, ...);
    |        ^^^ -         -
@@ -21,13 +21,13 @@ LL |         foo(/* isize */, /* u8 */);
    |             +++++++++++++++++++++
 
 error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
-  --> $DIR/variadic-ffi-1.rs:23:9
+  --> $DIR/variadic-ffi-1.rs:25:9
    |
 LL |         foo(1);
    |         ^^^--- argument #2 of type `u8` is missing
    |
 note: function defined here
-  --> $DIR/variadic-ffi-1.rs:15:8
+  --> $DIR/variadic-ffi-1.rs:17:8
    |
 LL |     fn foo(f: isize, x: u8, ...);
    |        ^^^           -
@@ -37,7 +37,7 @@ LL |         foo(1, /* u8 */);
    |              ++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/variadic-ffi-1.rs:25:56
+  --> $DIR/variadic-ffi-1.rs:27:56
    |
 LL |         let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
    |                -------------------------------------   ^^^ expected non-variadic fn, found variadic function
@@ -48,7 +48,7 @@ LL |         let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
                  found fn item `unsafe extern "C" fn(_, _, ...) {foo}`
 
 error[E0308]: mismatched types
-  --> $DIR/variadic-ffi-1.rs:26:54
+  --> $DIR/variadic-ffi-1.rs:28:54
    |
 LL |         let y: extern "C" fn(f: isize, x: u8, ...) = bar;
    |                -----------------------------------   ^^^ expected variadic fn, found non-variadic function
@@ -59,7 +59,7 @@ LL |         let y: extern "C" fn(f: isize, x: u8, ...) = bar;
                  found fn item `extern "C" fn(_, _) {bar}`
 
 error[E0617]: can't pass `f32` to variadic function
-  --> $DIR/variadic-ffi-1.rs:28:19
+  --> $DIR/variadic-ffi-1.rs:30:19
    |
 LL |         foo(1, 2, 3f32);
    |                   ^^^^
@@ -70,7 +70,7 @@ LL |         foo(1, 2, 3f32 as c_double);
    |                        +++++++++++
 
 error[E0617]: can't pass `bool` to variadic function
-  --> $DIR/variadic-ffi-1.rs:29:19
+  --> $DIR/variadic-ffi-1.rs:31:19
    |
 LL |         foo(1, 2, true);
    |                   ^^^^
@@ -81,7 +81,7 @@ LL |         foo(1, 2, true as c_int);
    |                        ++++++++
 
 error[E0617]: can't pass `i8` to variadic function
-  --> $DIR/variadic-ffi-1.rs:30:19
+  --> $DIR/variadic-ffi-1.rs:32:19
    |
 LL |         foo(1, 2, 1i8);
    |                   ^^^
@@ -92,7 +92,7 @@ LL |         foo(1, 2, 1i8 as c_int);
    |                       ++++++++
 
 error[E0617]: can't pass `u8` to variadic function
-  --> $DIR/variadic-ffi-1.rs:31:19
+  --> $DIR/variadic-ffi-1.rs:33:19
    |
 LL |         foo(1, 2, 1u8);
    |                   ^^^
@@ -103,7 +103,7 @@ LL |         foo(1, 2, 1u8 as c_uint);
    |                       +++++++++
 
 error[E0617]: can't pass `i16` to variadic function
-  --> $DIR/variadic-ffi-1.rs:32:19
+  --> $DIR/variadic-ffi-1.rs:34:19
    |
 LL |         foo(1, 2, 1i16);
    |                   ^^^^
@@ -114,7 +114,7 @@ LL |         foo(1, 2, 1i16 as c_int);
    |                        ++++++++
 
 error[E0617]: can't pass `u16` to variadic function
-  --> $DIR/variadic-ffi-1.rs:33:19
+  --> $DIR/variadic-ffi-1.rs:35:19
    |
 LL |         foo(1, 2, 1u16);
    |                   ^^^^
diff --git a/tests/ui/check-cfg/my-awesome-platform.json b/tests/ui/check-cfg/my-awesome-platform.json
index 5e9ab8f1a2d..03b08b727bd 100644
--- a/tests/ui/check-cfg/my-awesome-platform.json
+++ b/tests/ui/check-cfg/my-awesome-platform.json
@@ -1,6 +1,6 @@
 {
     "llvm-target": "x86_64-unknown-none-gnu",
-    "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
+    "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
     "arch": "x86_64",
     "target-endian": "little",
     "target-pointer-width": "64",
diff --git a/tests/ui/check-cfg/values-target-json.rs b/tests/ui/check-cfg/values-target-json.rs
index b52decdf6c0..d473f39c3d6 100644
--- a/tests/ui/check-cfg/values-target-json.rs
+++ b/tests/ui/check-cfg/values-target-json.rs
@@ -1,5 +1,6 @@
 // This test checks that we don't lint values defined by a custom target (target json)
 //
+//@ add-core-stubs
 //@ check-pass
 //@ no-auto-check-cfg
 //@ needs-llvm-components: x86
@@ -8,8 +9,8 @@
 #![feature(lang_items, no_core, auto_traits)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[cfg(target_os = "linux")]
 fn target_os_linux() {}
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/callback-as-argument.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/callback-as-argument.rs
index 37c8319d98d..b25a81b858b 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/callback-as-argument.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/callback-as-argument.rs
@@ -1,13 +1,12 @@
+//@ add-core-stubs
 //@ build-pass
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(abi_c_cmse_nonsecure_call, cmse_nonsecure_entry, no_core, lang_items, intrinsics)]
 #![no_core]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub extern "C-cmse-nonsecure-entry" fn test(
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs
index 31782b05105..18041b08061 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.rs
@@ -1,12 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(abi_c_cmse_nonsecure_call, no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 struct Wrapper<T>(T);
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr
index 0560f0eec1c..ab7c9cee4f0 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/generics.stderr
@@ -1,11 +1,11 @@
 error: function pointer types may not have generic parameters
-  --> $DIR/generics.rs:15:42
+  --> $DIR/generics.rs:14:42
    |
 LL |     f1: extern "C-cmse-nonsecure-call" fn<U: Copy>(U, u32, u32, u32) -> u64,
    |                                          ^^^^^^^^^
 
 error[E0412]: cannot find type `U` in this scope
-  --> $DIR/generics.rs:15:52
+  --> $DIR/generics.rs:14:52
    |
 LL | struct Test<T: Copy> {
    |             - similarly named type parameter `T` defined here
@@ -23,7 +23,7 @@ LL | struct Test<T: Copy, U> {
    |                    +++
 
 error[E0562]: `impl Trait` is not allowed in `fn` pointer parameters
-  --> $DIR/generics.rs:18:43
+  --> $DIR/generics.rs:17:43
    |
 LL |     f2: extern "C-cmse-nonsecure-call" fn(impl Copy, u32, u32, u32) -> u64,
    |                                           ^^^^^^^^^
@@ -31,19 +31,19 @@ LL |     f2: extern "C-cmse-nonsecure-call" fn(impl Copy, u32, u32, u32) -> u64,
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0798]: function pointers with the `"C-cmse-nonsecure-call"` ABI cannot contain generics in their type
-  --> $DIR/generics.rs:20:9
+  --> $DIR/generics.rs:19:9
    |
 LL |     f3: extern "C-cmse-nonsecure-call" fn(T, u32, u32, u32) -> u64,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0798]: function pointers with the `"C-cmse-nonsecure-call"` ABI cannot contain generics in their type
-  --> $DIR/generics.rs:21:9
+  --> $DIR/generics.rs:20:9
    |
 LL |     f4: extern "C-cmse-nonsecure-call" fn(Wrapper<T>, u32, u32, u32) -> u64,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/generics.rs:27:73
+  --> $DIR/generics.rs:26:73
    |
 LL | type WithTraitObject = extern "C-cmse-nonsecure-call" fn(&dyn Trait) -> &dyn Trait;
    |                                                                         ^^^^^^^^^^ this type doesn't fit in the available registers
@@ -52,7 +52,7 @@ LL | type WithTraitObject = extern "C-cmse-nonsecure-call" fn(&dyn Trait) -> &dy
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/generics.rs:31:62
+  --> $DIR/generics.rs:30:62
    |
 LL |     extern "C-cmse-nonsecure-call" fn(&'static dyn Trait) -> &'static dyn Trait;
    |                                                              ^^^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -61,7 +61,7 @@ LL |     extern "C-cmse-nonsecure-call" fn(&'static dyn Trait) -> &'static dyn T
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/generics.rs:38:62
+  --> $DIR/generics.rs:37:62
    |
 LL |     extern "C-cmse-nonsecure-call" fn(WrapperTransparent) -> WrapperTransparent;
    |                                                              ^^^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -70,7 +70,7 @@ LL |     extern "C-cmse-nonsecure-call" fn(WrapperTransparent) -> WrapperTranspa
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi`
-  --> $DIR/generics.rs:41:20
+  --> $DIR/generics.rs:40:20
    |
 LL | type WithVarArgs = extern "C-cmse-nonsecure-call" fn(u32, ...);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.rs
index 083a563bd7b..8328f9b6dd5 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.rs
@@ -1,12 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(abi_c_cmse_nonsecure_call, no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[repr(C, align(16))]
 #[allow(unused)]
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.stderr
index a5f5e1c3151..10a5e856107 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/params-via-stack.stderr
@@ -1,5 +1,5 @@
 error[E0798]: arguments for `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:17:63
+  --> $DIR/params-via-stack.rs:16:63
    |
 LL |     f1: extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32, x: u32, y: u32),
    |                                                               ^^^^^^^^^^^^^^ these arguments don't fit in the available registers
@@ -7,7 +7,7 @@ LL |     f1: extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32, x: u32, y: u3
    = note: functions with the `"C-cmse-nonsecure-call"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:18:63
+  --> $DIR/params-via-stack.rs:17:63
    |
 LL |     f2: extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u16, u16),
    |                                                               ^^^ this argument doesn't fit in the available registers
@@ -15,7 +15,7 @@ LL |     f2: extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u16, u16),
    = note: functions with the `"C-cmse-nonsecure-call"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:19:53
+  --> $DIR/params-via-stack.rs:18:53
    |
 LL |     f3: extern "C-cmse-nonsecure-call" fn(u32, u64, u32),
    |                                                     ^^^ this argument doesn't fit in the available registers
@@ -23,7 +23,7 @@ LL |     f3: extern "C-cmse-nonsecure-call" fn(u32, u64, u32),
    = note: functions with the `"C-cmse-nonsecure-call"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:20:58
+  --> $DIR/params-via-stack.rs:19:58
    |
 LL |     f4: extern "C-cmse-nonsecure-call" fn(AlignRelevant, u32),
    |                                                          ^^^ this argument doesn't fit in the available registers
@@ -31,7 +31,7 @@ LL |     f4: extern "C-cmse-nonsecure-call" fn(AlignRelevant, u32),
    = note: functions with the `"C-cmse-nonsecure-call"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:21:43
+  --> $DIR/params-via-stack.rs:20:43
    |
 LL |     f5: extern "C-cmse-nonsecure-call" fn([u32; 5]),
    |                                           ^^^^^^^^ this argument doesn't fit in the available registers
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.rs
index b052aabb499..890ec4b00f6 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 //@ add-core-stubs
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.stderr
index 89f7f159d6e..d2077352900 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/return-via-stack.stderr
@@ -1,5 +1,5 @@
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:35:50
+  --> $DIR/return-via-stack.rs:36:50
    |
 LL |     u128: extern "C-cmse-nonsecure-call" fn() -> u128,
    |                                                  ^^^^ this type doesn't fit in the available registers
@@ -8,7 +8,7 @@ LL |     u128: extern "C-cmse-nonsecure-call" fn() -> u128,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:36:50
+  --> $DIR/return-via-stack.rs:37:50
    |
 LL |     i128: extern "C-cmse-nonsecure-call" fn() -> i128,
    |                                                  ^^^^ this type doesn't fit in the available registers
@@ -17,7 +17,7 @@ LL |     i128: extern "C-cmse-nonsecure-call" fn() -> i128,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:25:48
+  --> $DIR/return-via-stack.rs:26:48
    |
 LL |     f1: extern "C-cmse-nonsecure-call" fn() -> ReprCU64,
    |                                                ^^^^^^^^ this type doesn't fit in the available registers
@@ -26,7 +26,7 @@ LL |     f1: extern "C-cmse-nonsecure-call" fn() -> ReprCU64,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:26:48
+  --> $DIR/return-via-stack.rs:27:48
    |
 LL |     f2: extern "C-cmse-nonsecure-call" fn() -> ReprCBytes,
    |                                                ^^^^^^^^^^ this type doesn't fit in the available registers
@@ -35,7 +35,7 @@ LL |     f2: extern "C-cmse-nonsecure-call" fn() -> ReprCBytes,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:27:48
+  --> $DIR/return-via-stack.rs:28:48
    |
 LL |     f3: extern "C-cmse-nonsecure-call" fn() -> U64Compound,
    |                                                ^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -44,7 +44,7 @@ LL |     f3: extern "C-cmse-nonsecure-call" fn() -> U64Compound,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:28:48
+  --> $DIR/return-via-stack.rs:29:48
    |
 LL |     f4: extern "C-cmse-nonsecure-call" fn() -> ReprCAlign16,
    |                                                ^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -53,7 +53,7 @@ LL |     f4: extern "C-cmse-nonsecure-call" fn() -> ReprCAlign16,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:29:48
+  --> $DIR/return-via-stack.rs:30:48
    |
 LL |     f5: extern "C-cmse-nonsecure-call" fn() -> [u8; 5],
    |                                                ^^^^^^^ this type doesn't fit in the available registers
@@ -62,7 +62,7 @@ LL |     f5: extern "C-cmse-nonsecure-call" fn() -> [u8; 5],
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:51:48
+  --> $DIR/return-via-stack.rs:52:48
    |
 LL |     f1: extern "C-cmse-nonsecure-call" fn() -> ReprRustUnionU64,
    |                                                ^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -71,7 +71,7 @@ LL |     f1: extern "C-cmse-nonsecure-call" fn() -> ReprRustUnionU64,
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-call"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:52:48
+  --> $DIR/return-via-stack.rs:53:48
    |
 LL |     f2: extern "C-cmse-nonsecure-call" fn() -> ReprCUnionU64,
    |                                                ^^^^^^^^^^^^^ this type doesn't fit in the available registers
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs
index 9fda55c2a48..7dfe6cf9672 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/via-registers.rs
@@ -1,13 +1,12 @@
+//@ add-core-stubs
 //@ build-pass
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(abi_c_cmse_nonsecure_call, no_core, lang_items, intrinsics)]
 #![no_core]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[repr(transparent)]
 pub struct ReprTransparentStruct<T> {
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs
index 3265cf4146d..5a2d2db19c5 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs
@@ -1,8 +1,10 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(abi_c_cmse_nonsecure_call, lang_items, no_core)]
 #![no_core]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 pub extern "C-cmse-nonsecure-call" fn test() {} //~ ERROR [E0781]
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.stderr
index 8d1b10eaeb5..f49fab043a4 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.stderr
@@ -1,5 +1,5 @@
 error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers
-  --> $DIR/wrong-abi-location-1.rs:8:1
+  --> $DIR/wrong-abi-location-1.rs:10:1
    |
 LL | pub extern "C-cmse-nonsecure-call" fn test() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs
index b47471c6ad7..e93b153949a 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(abi_c_cmse_nonsecure_call, lang_items, no_core)]
 #![no_core]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 extern "C-cmse-nonsecure-call" { //~ ERROR [E0781]
     fn test();
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.stderr
index 917098e21d8..bae8d20d81c 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.stderr
@@ -1,5 +1,5 @@
 error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers
-  --> $DIR/wrong-abi-location-2.rs:8:1
+  --> $DIR/wrong-abi-location-2.rs:10:1
    |
 LL | / extern "C-cmse-nonsecure-call" {
 LL | |     fn test();
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs
index a264bba6f3c..19b6179dde7 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs
@@ -1,12 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(cmse_nonsecure_entry, c_variadic, no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[repr(C)]
 struct Wrapper<T>(T);
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
index 9e67f881f75..c314671dc29 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
@@ -1,11 +1,11 @@
 error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
-  --> $DIR/generics.rs:74:55
+  --> $DIR/generics.rs:73:55
    |
 LL | extern "C-cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
    |                                                       ^^^^^^
 
 error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type
-  --> $DIR/generics.rs:31:1
+  --> $DIR/generics.rs:30:1
    |
 LL | / extern "C-cmse-nonsecure-entry" fn introduced_generic<U: Copy>(
 LL | |
@@ -17,19 +17,19 @@ LL | | ) -> u64 {
    | |________^
 
 error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type
-  --> $DIR/generics.rs:41:1
+  --> $DIR/generics.rs:40:1
    |
 LL | extern "C-cmse-nonsecure-entry" fn impl_trait(_: impl Copy, _: u32, _: u32, _: u32) -> u64 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type
-  --> $DIR/generics.rs:15:5
+  --> $DIR/generics.rs:14:5
    |
 LL |     extern "C-cmse-nonsecure-entry" fn ambient_generic(_: T, _: u32, _: u32, _: u32) -> u64 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type
-  --> $DIR/generics.rs:20:5
+  --> $DIR/generics.rs:19:5
    |
 LL | /     extern "C-cmse-nonsecure-entry" fn ambient_generic_nested(
 LL | |
@@ -41,7 +41,7 @@ LL | |     ) -> u64 {
    | |____________^
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/generics.rs:52:67
+  --> $DIR/generics.rs:51:67
    |
 LL | extern "C-cmse-nonsecure-entry" fn trait_object(x: &dyn Trait) -> &dyn Trait {
    |                                                                   ^^^^^^^^^^ this type doesn't fit in the available registers
@@ -50,7 +50,7 @@ LL | extern "C-cmse-nonsecure-entry" fn trait_object(x: &dyn Trait) -> &dyn Trai
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/generics.rs:59:6
+  --> $DIR/generics.rs:58:6
    |
 LL | ) -> &'static dyn Trait {
    |      ^^^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -59,7 +59,7 @@ LL | ) -> &'static dyn Trait {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/generics.rs:69:6
+  --> $DIR/generics.rs:68:6
    |
 LL | ) -> WrapperTransparent {
    |      ^^^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -68,7 +68,7 @@ LL | ) -> WrapperTransparent {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error: requires `va_list` lang_item
-  --> $DIR/generics.rs:74:55
+  --> $DIR/generics.rs:73:55
    |
 LL | extern "C-cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
    |                                                       ^^^^^^
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.rs
index 572d792d5a5..4c53f9422da 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.rs
@@ -1,12 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(cmse_nonsecure_entry, no_core, lang_items)]
 #![no_core]
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for u32 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[repr(C, align(16))]
 #[allow(unused)]
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.stderr
index b77e64c6bfb..24e9ddf32fe 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.stderr
@@ -1,5 +1,5 @@
 error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:16:78
+  --> $DIR/params-via-stack.rs:15:78
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f1(_: u32, _: u32, _: u32, _: u32, _: u32, _: u32) {}
    |                                                                              ^^^^^^^^^^^ these arguments don't fit in the available registers
@@ -7,7 +7,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f1(_: u32, _: u32, _: u32, _: u32, _
    = note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:18:78
+  --> $DIR/params-via-stack.rs:17:78
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f2(_: u32, _: u32, _: u32, _: u16, _: u16) {}
    |                                                                              ^^^ this argument doesn't fit in the available registers
@@ -15,7 +15,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f2(_: u32, _: u32, _: u32, _: u16, _
    = note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:20:62
+  --> $DIR/params-via-stack.rs:19:62
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f3(_: u32, _: u64, _: u32) {}
    |                                                              ^^^ this argument doesn't fit in the available registers
@@ -23,7 +23,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f3(_: u32, _: u64, _: u32) {}
    = note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:22:64
+  --> $DIR/params-via-stack.rs:21:64
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f4(_: AlignRelevant, _: u32) {}
    |                                                                ^^^ this argument doesn't fit in the available registers
@@ -31,7 +31,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f4(_: AlignRelevant, _: u32) {}
    = note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers
 
 error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/params-via-stack.rs:26:46
+  --> $DIR/params-via-stack.rs:25:46
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f5(_: [u32; 5]) {}
    |                                              ^^^^^^^^ this argument doesn't fit in the available registers
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.rs
index 23d55526e57..735eab10fa1 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 //@ add-core-stubs
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.stderr
index d37d9b5e8ff..9c885d95318 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/return-via-stack.stderr
@@ -1,5 +1,5 @@
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:24:48
+  --> $DIR/return-via-stack.rs:25:48
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f1() -> ReprCU64 {
    |                                                ^^^^^^^^ this type doesn't fit in the available registers
@@ -8,7 +8,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f1() -> ReprCU64 {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:29:48
+  --> $DIR/return-via-stack.rs:30:48
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f2() -> ReprCBytes {
    |                                                ^^^^^^^^^^ this type doesn't fit in the available registers
@@ -17,7 +17,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f2() -> ReprCBytes {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:34:48
+  --> $DIR/return-via-stack.rs:35:48
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f3() -> U64Compound {
    |                                                ^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -26,7 +26,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f3() -> U64Compound {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:39:48
+  --> $DIR/return-via-stack.rs:40:48
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f4() -> ReprCAlign16 {
    |                                                ^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -35,7 +35,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f4() -> ReprCAlign16 {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:46:48
+  --> $DIR/return-via-stack.rs:47:48
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn f5() -> [u8; 5] {
    |                                                ^^^^^^^ this type doesn't fit in the available registers
@@ -44,7 +44,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn f5() -> [u8; 5] {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:52:50
+  --> $DIR/return-via-stack.rs:53:50
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn u128() -> u128 {
    |                                                  ^^^^ this type doesn't fit in the available registers
@@ -53,7 +53,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn u128() -> u128 {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:58:50
+  --> $DIR/return-via-stack.rs:59:50
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn i128() -> i128 {
    |                                                  ^^^^ this type doesn't fit in the available registers
@@ -62,7 +62,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn i128() -> i128 {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:75:56
+  --> $DIR/return-via-stack.rs:76:56
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn union_rust() -> ReprRustUnionU64 {
    |                                                        ^^^^^^^^^^^^^^^^ this type doesn't fit in the available registers
@@ -71,7 +71,7 @@ LL | pub extern "C-cmse-nonsecure-entry" fn union_rust() -> ReprRustUnionU64 {
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
 error[E0798]: return value of `"C-cmse-nonsecure-entry"` function too large to pass via registers
-  --> $DIR/return-via-stack.rs:80:53
+  --> $DIR/return-via-stack.rs:81:53
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn union_c() -> ReprCUnionU64 {
    |                                                     ^^^^^^^^^^^^^ this type doesn't fit in the available registers
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr
index 26409279fbe..6a90dc8d635 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr
@@ -1,5 +1,5 @@
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/trustzone-only.rs:20:1
+  --> $DIR/trustzone-only.rs:17:1
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs
index a4ea7a1757d..6d84dab2166 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: x86 aarch64 thumb7
 //
 //@[x86] compile-flags: --target x86_64-unknown-linux-gnu
@@ -9,12 +10,8 @@
 #![feature(no_core, lang_items, rustc_attrs, cmse_nonsecure_entry)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-
-impl Copy for u32 {}
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr
index 26409279fbe..6a90dc8d635 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr
@@ -1,5 +1,5 @@
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/trustzone-only.rs:20:1
+  --> $DIR/trustzone-only.rs:17:1
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr
index 26409279fbe..6a90dc8d635 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr
@@ -1,5 +1,5 @@
 error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target
-  --> $DIR/trustzone-only.rs:20:1
+  --> $DIR/trustzone-only.rs:17:1
    |
 LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/via-registers.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/via-registers.rs
index 8978b35d356..912fc8b85eb 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/via-registers.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/via-registers.rs
@@ -1,15 +1,13 @@
+//@ add-core-stubs
 //@ build-pass
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
 #![feature(cmse_nonsecure_entry, no_core, lang_items)]
 #![no_core]
 #![crate_type = "lib"]
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for u32 {}
-impl Copy for u8 {}
+
+extern crate minicore;
+use minicore::*;
 
 #[repr(transparent)]
 pub struct ReprTransparentStruct<T> {
diff --git a/tests/ui/consts/const-eval/simd/insert_extract.rs b/tests/ui/consts/const-eval/simd/insert_extract.rs
index e5873ea26e8..fc97f9ec141 100644
--- a/tests/ui/consts/const-eval/simd/insert_extract.rs
+++ b/tests/ui/consts/const-eval/simd/insert_extract.rs
@@ -1,28 +1,19 @@
 //@ run-pass
 #![feature(repr_simd)]
-#![feature(intrinsics, rustc_attrs)]
+#![feature(intrinsics, core_intrinsics, rustc_attrs)]
 #![feature(staged_api)]
 #![stable(feature = "foo", since = "1.3.37")]
 #![allow(non_camel_case_types)]
 
-// repr(simd) now only supports array types
-#[repr(simd)] struct i8x1([i8; 1]);
-#[repr(simd)] struct u16x2([u16; 2]);
-#[repr(simd)] struct f32x4([f32; 4]);
-
-#[stable(feature = "foo", since = "1.3.37")]
-#[rustc_const_stable(feature = "foo", since = "1.3.37")]
-#[rustc_intrinsic]
-const unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T {
-    unimplemented!()
-}
+use std::intrinsics::simd::{simd_extract, simd_insert};
 
-#[stable(feature = "foo", since = "1.3.37")]
-#[rustc_const_stable(feature = "foo", since = "1.3.37")]
-#[rustc_intrinsic]
-const unsafe fn simd_extract<T, U>(_x: T, _idx: u32) -> U {
-    unimplemented!()
-}
+// repr(simd) now only supports array types
+#[repr(simd)]
+struct i8x1([i8; 1]);
+#[repr(simd)]
+struct u16x2([u16; 2]);
+#[repr(simd)]
+struct f32x4([f32; 4]);
 
 fn main() {
     {
diff --git a/tests/ui/deriving/deriving-with-helper.rs b/tests/ui/deriving/deriving-with-helper.rs
index c71d553c892..df98bb6beb9 100644
--- a/tests/ui/deriving/deriving-with-helper.rs
+++ b/tests/ui/deriving/deriving-with-helper.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ check-pass
 //@ compile-flags: --crate-type=lib
 
@@ -8,6 +9,9 @@
 
 #![no_core]
 
+extern crate minicore;
+use minicore::*;
+
 #[rustc_builtin_macro]
 macro derive() {}
 
@@ -26,9 +30,6 @@ mod default {
     }
 }
 
-#[lang = "sized"]
-trait Sized {}
-
 #[derive(Default)]
 enum S {
     #[default] // OK
diff --git a/tests/ui/error-codes/E0511.rs b/tests/ui/error-codes/E0511.rs
index 81656c71088..c7e59c5c6c9 100644
--- a/tests/ui/error-codes/E0511.rs
+++ b/tests/ui/error-codes/E0511.rs
@@ -1,11 +1,11 @@
 //@ build-fail
 
-#![feature(intrinsics)]
+#![feature(core_intrinsics)]
 
-extern "rust-intrinsic" {
-    fn simd_add<T>(a: T, b: T) -> T;
-}
+use std::intrinsics::simd::simd_add;
 
 fn main() {
-    unsafe { simd_add(0, 1); } //~ ERROR E0511
+    unsafe {
+        simd_add(0, 1) //~ ERROR E0511
+    };
 }
diff --git a/tests/ui/error-codes/E0511.stderr b/tests/ui/error-codes/E0511.stderr
index 59eb19d2ee5..45f5b8d238d 100644
--- a/tests/ui/error-codes/E0511.stderr
+++ b/tests/ui/error-codes/E0511.stderr
@@ -1,8 +1,8 @@
 error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/E0511.rs:10:14
+  --> $DIR/E0511.rs:9:9
    |
-LL |     unsafe { simd_add(0, 1); }
-   |              ^^^^^^^^^^^^^^
+LL |         simd_add(0, 1)
+   |         ^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs b/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
index ce3d3fc645d..6901a2ab9f1 100644
--- a/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
+++ b/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ needs-llvm-components: avr
 //@ compile-flags: --target=avr-none -C target-cpu=atmega328p --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 // Test that the AVR interrupt ABI cannot be used when avr_interrupt
 // feature gate is not used.
diff --git a/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.stderr b/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.stderr
index d9f3c3adc7f..768209eec63 100644
--- a/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi-avr-interrupt.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:11:8
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:13:8
    |
 LL | extern "avr-non-blocking-interrupt" fn fu() {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "avr-non-blocking-interrupt" fn fu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:13:8
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:15:8
    |
 LL | extern "avr-interrupt" fn f() {}
    |        ^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | extern "avr-interrupt" fn f() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:17:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:19:12
    |
 LL |     extern "avr-interrupt" fn m();
    |            ^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "avr-interrupt" fn m();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:19:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:21:12
    |
 LL |     extern "avr-non-blocking-interrupt" fn mu();
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "avr-non-blocking-interrupt" fn mu();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:22:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:24:12
    |
 LL |     extern "avr-interrupt" fn dm() {}
    |            ^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "avr-interrupt" fn dm() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:24:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:26:12
    |
 LL |     extern "avr-non-blocking-interrupt" fn dmu() {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL |     extern "avr-non-blocking-interrupt" fn dmu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:30:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:32:12
    |
 LL |     extern "avr-interrupt" fn m() {}
    |            ^^^^^^^^^^^^^^^
@@ -69,7 +69,7 @@ LL |     extern "avr-interrupt" fn m() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:32:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:34:12
    |
 LL |     extern "avr-non-blocking-interrupt" fn mu() {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -79,7 +79,7 @@ LL |     extern "avr-non-blocking-interrupt" fn mu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:37:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:39:12
    |
 LL |     extern "avr-interrupt" fn im() {}
    |            ^^^^^^^^^^^^^^^
@@ -89,7 +89,7 @@ LL |     extern "avr-interrupt" fn im() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:39:12
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:41:12
    |
 LL |     extern "avr-non-blocking-interrupt" fn imu() {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL |     extern "avr-non-blocking-interrupt" fn imu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:43:18
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:45:18
    |
 LL | type TA = extern "avr-interrupt" fn();
    |                  ^^^^^^^^^^^^^^^
@@ -109,7 +109,7 @@ LL | type TA = extern "avr-interrupt" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:45:19
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:47:19
    |
 LL | type TAU = extern "avr-non-blocking-interrupt" fn();
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -119,7 +119,7 @@ LL | type TAU = extern "avr-non-blocking-interrupt" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:48:8
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:50:8
    |
 LL | extern "avr-interrupt" {}
    |        ^^^^^^^^^^^^^^^
@@ -129,7 +129,7 @@ LL | extern "avr-interrupt" {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "avr-non-blocking-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-avr-interrupt.rs:50:8
+  --> $DIR/feature-gate-abi-avr-interrupt.rs:52:8
    |
 LL | extern "avr-non-blocking-interrupt" {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs b/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs
index bb69a638cee..60bf69f597c 100644
--- a/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs
+++ b/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ needs-llvm-components: msp430
 //@ compile-flags: --target=msp430-none-elf --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 extern "msp430-interrupt" fn f() {}
 //~^ ERROR "msp430-interrupt" ABI is experimental
diff --git a/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr b/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr
index 21ddbf7a86d..4a995b4efa6 100644
--- a/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:8:8
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:10:8
    |
 LL | extern "msp430-interrupt" fn f() {}
    |        ^^^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "msp430-interrupt" fn f() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:12:12
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:14:12
    |
 LL |     extern "msp430-interrupt" fn m();
    |            ^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     extern "msp430-interrupt" fn m();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:15:12
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:17:12
    |
 LL |     extern "msp430-interrupt" fn dm() {}
    |            ^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "msp430-interrupt" fn dm() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:21:12
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:23:12
    |
 LL |     extern "msp430-interrupt" fn m() {}
    |            ^^^^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "msp430-interrupt" fn m() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:26:12
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:28:12
    |
 LL |     extern "msp430-interrupt" fn im() {}
    |            ^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "msp430-interrupt" fn im() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:30:18
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:32:18
    |
 LL | type TA = extern "msp430-interrupt" fn();
    |                  ^^^^^^^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | type TA = extern "msp430-interrupt" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-msp430-interrupt.rs:33:8
+  --> $DIR/feature-gate-abi-msp430-interrupt.rs:35:8
    |
 LL | extern "msp430-interrupt" {}
    |        ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.rs b/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.rs
index 6f4989fbd9f..006d01c5589 100644
--- a/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.rs
+++ b/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ needs-llvm-components: riscv
 //@ compile-flags: --target=riscv32imc-unknown-none-elf --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang = "sized"]
-trait Sized {}
+
+extern crate minicore;
+use minicore::*;
 
 // Test that the riscv interrupt ABIs cannot be used when riscv_interrupt
 // feature gate is not used.
diff --git a/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.stderr b/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.stderr
index 3c9e99aa1b9..af956c35da6 100644
--- a/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "riscv-interrupt-m" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-riscv-interrupt.rs:11:8
+  --> $DIR/feature-gate-abi-riscv-interrupt.rs:13:8
    |
 LL | extern "riscv-interrupt-m" fn f() {}
    |        ^^^^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "riscv-interrupt-m" fn f() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "riscv-interrupt-s" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-riscv-interrupt.rs:13:8
+  --> $DIR/feature-gate-abi-riscv-interrupt.rs:15:8
    |
 LL | extern "riscv-interrupt-s" fn f_s() {}
    |        ^^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | extern "riscv-interrupt-s" fn f_s() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "riscv-interrupt-m" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-riscv-interrupt.rs:17:12
+  --> $DIR/feature-gate-abi-riscv-interrupt.rs:19:12
    |
 LL |     extern "riscv-interrupt-m" fn m();
    |            ^^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "riscv-interrupt-m" fn m();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "riscv-interrupt-m" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-riscv-interrupt.rs:23:12
+  --> $DIR/feature-gate-abi-riscv-interrupt.rs:25:12
    |
 LL |     extern "riscv-interrupt-m" fn m() {}
    |            ^^^^^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "riscv-interrupt-m" fn m() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "riscv-interrupt-m" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-riscv-interrupt.rs:28:12
+  --> $DIR/feature-gate-abi-riscv-interrupt.rs:30:12
    |
 LL |     extern "riscv-interrupt-m" fn im() {}
    |            ^^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "riscv-interrupt-m" fn im() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "riscv-interrupt-m" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-riscv-interrupt.rs:32:18
+  --> $DIR/feature-gate-abi-riscv-interrupt.rs:34:18
    |
 LL | type TA = extern "riscv-interrupt-m" fn();
    |                  ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.rs b/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.rs
index 93c59364f10..c4fdb5f427c 100644
--- a/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.rs
+++ b/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 extern "x86-interrupt" fn f7() {} //~ ERROR "x86-interrupt" ABI is experimental
 trait Tr {
diff --git a/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.stderr b/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.stderr
index 231cf207c86..67211d402c6 100644
--- a/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi-x86-interrupt.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:8:8
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:10:8
    |
 LL | extern "x86-interrupt" fn f7() {}
    |        ^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "x86-interrupt" fn f7() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:10:12
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:12:12
    |
 LL |     extern "x86-interrupt" fn m7();
    |            ^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     extern "x86-interrupt" fn m7();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:11:12
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:13:12
    |
 LL |     extern "x86-interrupt" fn dm7() {}
    |            ^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "x86-interrupt" fn dm7() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:18:12
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:20:12
    |
 LL |     extern "x86-interrupt" fn m7() {}
    |            ^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "x86-interrupt" fn m7() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:23:12
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:25:12
    |
 LL |     extern "x86-interrupt" fn im7() {}
    |            ^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "x86-interrupt" fn im7() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:26:18
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:28:18
    |
 LL | type A7 = extern "x86-interrupt" fn();
    |                  ^^^^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | type A7 = extern "x86-interrupt" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "x86-interrupt" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi-x86-interrupt.rs:28:8
+  --> $DIR/feature-gate-abi-x86-interrupt.rs:30:8
    |
 LL | extern "x86-interrupt" {}
    |        ^^^^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-abi.rs b/tests/ui/feature-gates/feature-gate-abi.rs
index 7ab05889c20..2af623734ee 100644
--- a/tests/ui/feature-gates/feature-gate-abi.rs
+++ b/tests/ui/feature-gates/feature-gate-abi.rs
@@ -1,14 +1,12 @@
 // gate-test-intrinsics
+//@ add-core-stubs
 //@ compile-flags: --crate-type=rlib
 
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang="sized"]
-trait Sized { }
-
-#[lang="tuple_trait"]
-trait Tuple { }
+extern crate minicore;
+use minicore::*;
 
 // Functions
 extern "rust-intrinsic" fn f1() {} //~ ERROR extern "rust-intrinsic" ABI is an implementation detail
diff --git a/tests/ui/feature-gates/feature-gate-abi.stderr b/tests/ui/feature-gates/feature-gate-abi.stderr
index 70ec64e5135..a974c0099cb 100644
--- a/tests/ui/feature-gates/feature-gate-abi.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:14:8
+  --> $DIR/feature-gate-abi.rs:12:8
    |
 LL | extern "rust-intrinsic" fn f1() {}
    |        ^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | extern "rust-intrinsic" fn f1() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:16:8
+  --> $DIR/feature-gate-abi.rs:14:8
    |
 LL | extern "rust-intrinsic" fn f2() {}
    |        ^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | extern "rust-intrinsic" fn f2() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:18:8
+  --> $DIR/feature-gate-abi.rs:16:8
    |
 LL | extern "rust-call" fn f4(_: ()) {}
    |        ^^^^^^^^^^^
@@ -27,7 +27,7 @@ LL | extern "rust-call" fn f4(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:22:12
+  --> $DIR/feature-gate-abi.rs:20:12
    |
 LL |     extern "rust-intrinsic" fn m1();
    |            ^^^^^^^^^^^^^^^^
@@ -36,7 +36,7 @@ LL |     extern "rust-intrinsic" fn m1();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:24:12
+  --> $DIR/feature-gate-abi.rs:22:12
    |
 LL |     extern "rust-intrinsic" fn m2();
    |            ^^^^^^^^^^^^^^^^
@@ -45,7 +45,7 @@ LL |     extern "rust-intrinsic" fn m2();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:26:12
+  --> $DIR/feature-gate-abi.rs:24:12
    |
 LL |     extern "rust-call" fn m4(_: ());
    |            ^^^^^^^^^^^
@@ -55,7 +55,7 @@ LL |     extern "rust-call" fn m4(_: ());
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:28:12
+  --> $DIR/feature-gate-abi.rs:26:12
    |
 LL |     extern "rust-call" fn dm4(_: ()) {}
    |            ^^^^^^^^^^^
@@ -65,7 +65,7 @@ LL |     extern "rust-call" fn dm4(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:35:12
+  --> $DIR/feature-gate-abi.rs:33:12
    |
 LL |     extern "rust-intrinsic" fn m1() {}
    |            ^^^^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL |     extern "rust-intrinsic" fn m1() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:37:12
+  --> $DIR/feature-gate-abi.rs:35:12
    |
 LL |     extern "rust-intrinsic" fn m2() {}
    |            ^^^^^^^^^^^^^^^^
@@ -83,7 +83,7 @@ LL |     extern "rust-intrinsic" fn m2() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:39:12
+  --> $DIR/feature-gate-abi.rs:37:12
    |
 LL |     extern "rust-call" fn m4(_: ()) {}
    |            ^^^^^^^^^^^
@@ -93,7 +93,7 @@ LL |     extern "rust-call" fn m4(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:44:12
+  --> $DIR/feature-gate-abi.rs:42:12
    |
 LL |     extern "rust-intrinsic" fn im1() {}
    |            ^^^^^^^^^^^^^^^^
@@ -102,7 +102,7 @@ LL |     extern "rust-intrinsic" fn im1() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:46:12
+  --> $DIR/feature-gate-abi.rs:44:12
    |
 LL |     extern "rust-intrinsic" fn im2() {}
    |            ^^^^^^^^^^^^^^^^
@@ -111,7 +111,7 @@ LL |     extern "rust-intrinsic" fn im2() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:48:12
+  --> $DIR/feature-gate-abi.rs:46:12
    |
 LL |     extern "rust-call" fn im4(_: ()) {}
    |            ^^^^^^^^^^^
@@ -121,7 +121,7 @@ LL |     extern "rust-call" fn im4(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:52:18
+  --> $DIR/feature-gate-abi.rs:50:18
    |
 LL | type A1 = extern "rust-intrinsic" fn();
    |                  ^^^^^^^^^^^^^^^^
@@ -130,7 +130,7 @@ LL | type A1 = extern "rust-intrinsic" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:53:18
+  --> $DIR/feature-gate-abi.rs:51:18
    |
 LL | type A2 = extern "rust-intrinsic" fn();
    |                  ^^^^^^^^^^^^^^^^
@@ -139,7 +139,7 @@ LL | type A2 = extern "rust-intrinsic" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:54:18
+  --> $DIR/feature-gate-abi.rs:52:18
    |
 LL | type A4 = extern "rust-call" fn(_: ());
    |                  ^^^^^^^^^^^
@@ -149,7 +149,7 @@ LL | type A4 = extern "rust-call" fn(_: ());
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:57:8
+  --> $DIR/feature-gate-abi.rs:55:8
    |
 LL | extern "rust-intrinsic" {}
    |        ^^^^^^^^^^^^^^^^
@@ -158,7 +158,7 @@ LL | extern "rust-intrinsic" {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-intrinsic" ABI is an implementation detail and perma-unstable
-  --> $DIR/feature-gate-abi.rs:58:8
+  --> $DIR/feature-gate-abi.rs:56:8
    |
 LL | extern "rust-intrinsic" {}
    |        ^^^^^^^^^^^^^^^^
@@ -167,7 +167,7 @@ LL | extern "rust-intrinsic" {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "rust-call" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi.rs:59:8
+  --> $DIR/feature-gate-abi.rs:57:8
    |
 LL | extern "rust-call" {}
    |        ^^^^^^^^^^^
@@ -177,49 +177,49 @@ LL | extern "rust-call" {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:22:32
+  --> $DIR/feature-gate-abi.rs:20:32
    |
 LL |     extern "rust-intrinsic" fn m1();
    |                                ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:24:32
+  --> $DIR/feature-gate-abi.rs:22:32
    |
 LL |     extern "rust-intrinsic" fn m2();
    |                                ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:14:33
+  --> $DIR/feature-gate-abi.rs:12:33
    |
 LL | extern "rust-intrinsic" fn f1() {}
    |                                 ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:16:33
+  --> $DIR/feature-gate-abi.rs:14:33
    |
 LL | extern "rust-intrinsic" fn f2() {}
    |                                 ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:35:37
+  --> $DIR/feature-gate-abi.rs:33:37
    |
 LL |     extern "rust-intrinsic" fn m1() {}
    |                                     ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:37:37
+  --> $DIR/feature-gate-abi.rs:35:37
    |
 LL |     extern "rust-intrinsic" fn m2() {}
    |                                     ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:44:38
+  --> $DIR/feature-gate-abi.rs:42:38
    |
 LL |     extern "rust-intrinsic" fn im1() {}
    |                                      ^^
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
-  --> $DIR/feature-gate-abi.rs:46:38
+  --> $DIR/feature-gate-abi.rs:44:38
    |
 LL |     extern "rust-intrinsic" fn im2() {}
    |                                      ^^
diff --git a/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs
index fb04906dafe..d9027b417b4 100644
--- a/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs
+++ b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs
@@ -1,13 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --crate-type=rlib
 
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang="sized"]
-trait Sized { }
-
-#[lang="tuple_trait"]
-trait Tuple { }
+extern crate minicore;
+use minicore::*;
 
 // Functions
 extern "gpu-kernel" fn f1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
diff --git a/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr
index b05c16e3d9e..d8dbd94696e 100644
--- a/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi_gpu_kernel.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:13:8
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:11:8
    |
 LL | extern "gpu-kernel" fn f1(_: ()) {}
    |        ^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "gpu-kernel" fn f1(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:18:12
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:16:12
    |
 LL |     extern "gpu-kernel" fn m1(_: ());
    |            ^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     extern "gpu-kernel" fn m1(_: ());
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:20:12
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:18:12
    |
 LL |     extern "gpu-kernel" fn dm1(_: ()) {}
    |            ^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "gpu-kernel" fn dm1(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:28:12
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:26:12
    |
 LL |     extern "gpu-kernel" fn m1(_: ()) {}
    |            ^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "gpu-kernel" fn m1(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:34:12
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
    |
 LL |     extern "gpu-kernel" fn im1(_: ()) {}
    |            ^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "gpu-kernel" fn im1(_: ()) {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:39:18
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:37:18
    |
 LL | type A1 = extern "gpu-kernel" fn(_: ());
    |                  ^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | type A1 = extern "gpu-kernel" fn(_: ());
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:44:8
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:42:8
    |
 LL | extern "gpu-kernel" {}
    |        ^^^^^^^^^^^^
@@ -69,7 +69,7 @@ LL | extern "gpu-kernel" {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 warning: the calling convention "gpu-kernel" is not supported on this target
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:39:11
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:37:11
    |
 LL | type A1 = extern "gpu-kernel" fn(_: ());
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -79,31 +79,31 @@ LL | type A1 = extern "gpu-kernel" fn(_: ());
    = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:44:1
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:42:1
    |
 LL | extern "gpu-kernel" {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:13:1
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:11:1
    |
 LL | extern "gpu-kernel" fn f1(_: ()) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:20:5
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:18:5
    |
 LL |     extern "gpu-kernel" fn dm1(_: ()) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:28:5
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:26:5
    |
 LL |     extern "gpu-kernel" fn m1(_: ()) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
-  --> $DIR/feature-gate-abi_gpu_kernel.rs:34:5
+  --> $DIR/feature-gate-abi_gpu_kernel.rs:32:5
    |
 LL |     extern "gpu-kernel" fn im1(_: ()) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-abi_ptx.rs b/tests/ui/feature-gates/feature-gate-abi_ptx.rs
index e742492303a..3cc2b786192 100644
--- a/tests/ui/feature-gates/feature-gate-abi_ptx.rs
+++ b/tests/ui/feature-gates/feature-gate-abi_ptx.rs
@@ -1,9 +1,11 @@
+//@ add-core-stubs
 //@ needs-llvm-components: nvptx
 //@ compile-flags: --target=nvptx64-nvidia-cuda --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 extern "ptx-kernel" fn fu() {} //~ ERROR extern "ptx-kernel" ABI is experimental
 
diff --git a/tests/ui/feature-gates/feature-gate-abi_ptx.stderr b/tests/ui/feature-gates/feature-gate-abi_ptx.stderr
index d128075919b..cbe9fd8d834 100644
--- a/tests/ui/feature-gates/feature-gate-abi_ptx.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi_ptx.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:8:8
+  --> $DIR/feature-gate-abi_ptx.rs:10:8
    |
 LL | extern "ptx-kernel" fn fu() {}
    |        ^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "ptx-kernel" fn fu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:11:12
+  --> $DIR/feature-gate-abi_ptx.rs:13:12
    |
 LL |     extern "ptx-kernel" fn mu();
    |            ^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     extern "ptx-kernel" fn mu();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:12:12
+  --> $DIR/feature-gate-abi_ptx.rs:14:12
    |
 LL |     extern "ptx-kernel" fn dmu() {}
    |            ^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "ptx-kernel" fn dmu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:17:12
+  --> $DIR/feature-gate-abi_ptx.rs:19:12
    |
 LL |     extern "ptx-kernel" fn mu() {}
    |            ^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "ptx-kernel" fn mu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:21:12
+  --> $DIR/feature-gate-abi_ptx.rs:23:12
    |
 LL |     extern "ptx-kernel" fn imu() {}
    |            ^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "ptx-kernel" fn imu() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:24:19
+  --> $DIR/feature-gate-abi_ptx.rs:26:19
    |
 LL | type TAU = extern "ptx-kernel" fn();
    |                   ^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | type TAU = extern "ptx-kernel" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "ptx-kernel" ABI is experimental and subject to change
-  --> $DIR/feature-gate-abi_ptx.rs:26:8
+  --> $DIR/feature-gate-abi_ptx.rs:28:8
    |
 LL | extern "ptx-kernel" {}
    |        ^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_arch.rs b/tests/ui/feature-gates/feature-gate-asm_experimental_arch.rs
index a52fbbe4075..a3b41e07195 100644
--- a/tests/ui/feature-gates/feature-gate-asm_experimental_arch.rs
+++ b/tests/ui/feature-gates/feature-gate-asm_experimental_arch.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target mips-unknown-linux-gnu
 //@ needs-llvm-components: mips
 
@@ -5,15 +6,8 @@
 #![crate_type = "rlib"]
 #![no_core]
 
-#[rustc_builtin_macro]
-macro_rules! asm {
-    () => {};
-}
-
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 unsafe fn main() {
     asm!("");
diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_arch.stderr b/tests/ui/feature-gates/feature-gate-asm_experimental_arch.stderr
index d930429779c..e59a10c11c3 100644
--- a/tests/ui/feature-gates/feature-gate-asm_experimental_arch.stderr
+++ b/tests/ui/feature-gates/feature-gate-asm_experimental_arch.stderr
@@ -1,5 +1,5 @@
 error[E0658]: inline assembly is not stable yet on this architecture
-  --> $DIR/feature-gate-asm_experimental_arch.rs:19:5
+  --> $DIR/feature-gate-asm_experimental_arch.rs:13:5
    |
 LL |     asm!("");
    |     ^^^^^^^^
diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs
index 7aec7455b2e..6c53c2213a5 100644
--- a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs
+++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ needs-asm-support
 //@ compile-flags: --target s390x-unknown-linux-gnu
 //@ needs-llvm-components: systemz
@@ -6,15 +7,8 @@
 #![crate_type = "rlib"]
 #![no_core]
 
-#[rustc_builtin_macro]
-macro_rules! asm {
-    () => {};
-}
-
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
+extern crate minicore;
+use minicore::*;
 
 unsafe fn main() {
     asm!("", in("v0") 0);
diff --git a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr
index 0791ce4543c..6f2ea0ddaec 100644
--- a/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr
+++ b/tests/ui/feature-gates/feature-gate-asm_experimental_reg.stderr
@@ -1,5 +1,5 @@
 error[E0658]: register class `vreg` can only be used as a clobber in stable
-  --> $DIR/feature-gate-asm_experimental_reg.rs:20:14
+  --> $DIR/feature-gate-asm_experimental_reg.rs:14:14
    |
 LL |     asm!("", in("v0") 0);
    |              ^^^^^^^^^^
@@ -9,7 +9,7 @@ LL |     asm!("", in("v0") 0);
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: type `i32` cannot be used with this register class in stable
-  --> $DIR/feature-gate-asm_experimental_reg.rs:20:23
+  --> $DIR/feature-gate-asm_experimental_reg.rs:14:23
    |
 LL |     asm!("", in("v0") 0);
    |                       ^
diff --git a/tests/ui/feature-gates/feature-gate-vectorcall.rs b/tests/ui/feature-gates/feature-gate-vectorcall.rs
index aafa6a2ed62..b29fd08473a 100644
--- a/tests/ui/feature-gates/feature-gate-vectorcall.rs
+++ b/tests/ui/feature-gates/feature-gate-vectorcall.rs
@@ -1,10 +1,12 @@
 // gate-test-abi_vectorcall
+//@ add-core-stubs
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
 #![no_core]
 #![feature(no_core, lang_items)]
-#[lang="sized"]
-trait Sized { }
+
+extern crate minicore;
+use minicore::*;
 
 // Test that the "vectorcall" ABI is feature-gated, and cannot be used when
 // the `vectorcall` feature gate is not used.
diff --git a/tests/ui/feature-gates/feature-gate-vectorcall.stderr b/tests/ui/feature-gates/feature-gate-vectorcall.stderr
index 8f3f47a3d48..81dd10f5fe5 100644
--- a/tests/ui/feature-gates/feature-gate-vectorcall.stderr
+++ b/tests/ui/feature-gates/feature-gate-vectorcall.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:12:8
+  --> $DIR/feature-gate-vectorcall.rs:14:8
    |
 LL | extern "vectorcall" fn f() {}
    |        ^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | extern "vectorcall" fn f() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:15:12
+  --> $DIR/feature-gate-vectorcall.rs:17:12
    |
 LL |     extern "vectorcall" fn m();
    |            ^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     extern "vectorcall" fn m();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:17:12
+  --> $DIR/feature-gate-vectorcall.rs:19:12
    |
 LL |     extern "vectorcall" fn dm() {}
    |            ^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL |     extern "vectorcall" fn dm() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:22:12
+  --> $DIR/feature-gate-vectorcall.rs:24:12
    |
 LL |     extern "vectorcall" fn m() {}
    |            ^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     extern "vectorcall" fn m() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:26:12
+  --> $DIR/feature-gate-vectorcall.rs:28:12
    |
 LL |     extern "vectorcall" fn im() {}
    |            ^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     extern "vectorcall" fn im() {}
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:29:18
+  --> $DIR/feature-gate-vectorcall.rs:31:18
    |
 LL | type TA = extern "vectorcall" fn();
    |                  ^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | type TA = extern "vectorcall" fn();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the extern "vectorcall" ABI is experimental and subject to change
-  --> $DIR/feature-gate-vectorcall.rs:31:8
+  --> $DIR/feature-gate-vectorcall.rs:33:8
    |
 LL | extern "vectorcall" {}
    |        ^^^^^^^^^^^^
diff --git a/tests/ui/force-inlining/asm.rs b/tests/ui/force-inlining/asm.rs
index 85014ffa515..2b5f87c59d3 100644
--- a/tests/ui/force-inlining/asm.rs
+++ b/tests/ui/force-inlining/asm.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ build-fail
 //@ compile-flags: --crate-type=lib --target thumbv4t-none-eabi
 //@ needs-llvm-components: arm
@@ -9,17 +10,8 @@
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy {}
-#[lang = "freeze"]
-pub unsafe trait Freeze {}
-
-#[lang = "start"]
-fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize {
-    0
-}
+extern crate minicore;
+use minicore::*;
 
 #[rustc_builtin_macro]
 #[macro_export]
diff --git a/tests/ui/force-inlining/asm.stderr b/tests/ui/force-inlining/asm.stderr
index ef04688965b..1744c0215bb 100644
--- a/tests/ui/force-inlining/asm.stderr
+++ b/tests/ui/force-inlining/asm.stderr
@@ -1,5 +1,5 @@
 error: `instruction_set_a32` could not be inlined into `t32` but is required to be inlined
-  --> $DIR/asm.rs:53:5
+  --> $DIR/asm.rs:45:5
    |
 LL |     instruction_set_a32();
    |     ^^^^^^^^^^^^^^^^^^^^^ ...`instruction_set_a32` called here
@@ -7,7 +7,7 @@ LL |     instruction_set_a32();
    = note: could not be inlined due to: incompatible instruction set
 
 error: `inline_always_and_using_inline_asm` could not be inlined into `t32` but is required to be inlined
-  --> $DIR/asm.rs:57:5
+  --> $DIR/asm.rs:49:5
    |
 LL |     inline_always_and_using_inline_asm();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...`inline_always_and_using_inline_asm` called here
@@ -15,7 +15,7 @@ LL |     inline_always_and_using_inline_asm();
    = note: could not be inlined due to: cannot move inline-asm across instruction sets
 
 error: `instruction_set_a32` could not be inlined into `default` but is required to be inlined
-  --> $DIR/asm.rs:62:5
+  --> $DIR/asm.rs:54:5
    |
 LL |     instruction_set_a32();
    |     ^^^^^^^^^^^^^^^^^^^^^ ...`instruction_set_a32` called here
@@ -23,7 +23,7 @@ LL |     instruction_set_a32();
    = note: could not be inlined due to: incompatible instruction set
 
 error: `instruction_set_t32` could not be inlined into `default` but is required to be inlined
-  --> $DIR/asm.rs:64:5
+  --> $DIR/asm.rs:56:5
    |
 LL |     instruction_set_t32();
    |     ^^^^^^^^^^^^^^^^^^^^^ ...`instruction_set_t32` called here
diff --git a/tests/ui/inline-const/collect-scopes-in-pat.rs b/tests/ui/inline-const/collect-scopes-in-pat.rs
index 024fde53741..16baf920f58 100644
--- a/tests/ui/inline-const/collect-scopes-in-pat.rs
+++ b/tests/ui/inline-const/collect-scopes-in-pat.rs
@@ -1,4 +1,4 @@
-// @compile-flags: -Zlint-mir
+//@ compile-flags: -Zlint-mir
 //@ check-pass
 
 #![feature(inline_const_pat)]
diff --git a/tests/ui/intrinsics/bad-intrinsic-monomorphization.rs b/tests/ui/intrinsics/bad-intrinsic-monomorphization.rs
index 254ac24f0b9..d68cbf26ef1 100644
--- a/tests/ui/intrinsics/bad-intrinsic-monomorphization.rs
+++ b/tests/ui/intrinsics/bad-intrinsic-monomorphization.rs
@@ -7,10 +7,6 @@
 // Bad monomorphizations could previously cause LLVM asserts even though the
 // error was caught in the compiler.
 
-extern "rust-intrinsic" {
-    fn simd_add<T>(x: T, y: T) -> T;
-}
-
 use std::intrinsics;
 
 #[derive(Copy, Clone)]
@@ -27,6 +23,6 @@ pub unsafe fn test_fadd_fast(a: Foo, b: Foo) -> Foo {
 }
 
 pub unsafe fn test_simd_add(a: Foo, b: Foo) -> Foo {
-    simd_add(a, b)
+    intrinsics::simd::simd_add(a, b)
     //~^ ERROR `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
 }
diff --git a/tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr b/tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr
index c070f018181..f49d95e9cfc 100644
--- a/tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr
+++ b/tests/ui/intrinsics/bad-intrinsic-monomorphization.stderr
@@ -1,20 +1,20 @@
 error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo`
-  --> $DIR/bad-intrinsic-monomorphization.rs:20:5
+  --> $DIR/bad-intrinsic-monomorphization.rs:16:5
    |
 LL |     intrinsics::cttz(v)
    |     ^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic float type, found `Foo`
-  --> $DIR/bad-intrinsic-monomorphization.rs:25:5
+  --> $DIR/bad-intrinsic-monomorphization.rs:21:5
    |
 LL |     intrinsics::fadd_fast(a, b)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
-  --> $DIR/bad-intrinsic-monomorphization.rs:30:5
+  --> $DIR/bad-intrinsic-monomorphization.rs:26:5
    |
-LL |     simd_add(a, b)
-   |     ^^^^^^^^^^^^^^
+LL |     intrinsics::simd::simd_add(a, b)
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/layout/hexagon-enum.rs b/tests/ui/layout/hexagon-enum.rs
index 5fa12e479e7..02833eb41fa 100644
--- a/tests/ui/layout/hexagon-enum.rs
+++ b/tests/ui/layout/hexagon-enum.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target hexagon-unknown-linux-musl
 //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED"
 //@ needs-llvm-components: hexagon
@@ -9,8 +10,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang="sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[rustc_layout(debug)]
 #[repr(C)]
diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr
index 90c06ba1f83..b802b400b18 100644
--- a/tests/ui/layout/hexagon-enum.stderr
+++ b/tests/ui/layout/hexagon-enum.stderr
@@ -71,7 +71,7 @@ error: layout_of(A) = Layout {
            unadjusted_abi_align: Align(1 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/hexagon-enum.rs:17:1
+  --> $DIR/hexagon-enum.rs:18:1
    |
 LL | enum A { Apple }
    | ^^^^^^
@@ -149,7 +149,7 @@ error: layout_of(B) = Layout {
            unadjusted_abi_align: Align(1 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/hexagon-enum.rs:21:1
+  --> $DIR/hexagon-enum.rs:22:1
    |
 LL | enum B { Banana = 255, }
    | ^^^^^^
@@ -227,7 +227,7 @@ error: layout_of(C) = Layout {
            unadjusted_abi_align: Align(2 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/hexagon-enum.rs:25:1
+  --> $DIR/hexagon-enum.rs:26:1
    |
 LL | enum C { Chaenomeles = 256, }
    | ^^^^^^
@@ -305,7 +305,7 @@ error: layout_of(P) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/hexagon-enum.rs:29:1
+  --> $DIR/hexagon-enum.rs:30:1
    |
 LL | enum P { Peach = 0x1000_0000isize, }
    | ^^^^^^
@@ -383,7 +383,7 @@ error: layout_of(T) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/hexagon-enum.rs:35:1
+  --> $DIR/hexagon-enum.rs:36:1
    |
 LL | enum T { Tangerine = TANGERINE as isize }
    | ^^^^^^
diff --git a/tests/ui/layout/thumb-enum.rs b/tests/ui/layout/thumb-enum.rs
index 2381d9d0292..1c4fab812f9 100644
--- a/tests/ui/layout/thumb-enum.rs
+++ b/tests/ui/layout/thumb-enum.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabihf
 //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED"
 //@ needs-llvm-components: arm
@@ -9,8 +10,8 @@
 #![crate_type = "lib"]
 #![no_core]
 
-#[lang="sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[rustc_layout(debug)]
 #[repr(C)]
diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr
index 0c343318564..07153fee027 100644
--- a/tests/ui/layout/thumb-enum.stderr
+++ b/tests/ui/layout/thumb-enum.stderr
@@ -71,7 +71,7 @@ error: layout_of(A) = Layout {
            unadjusted_abi_align: Align(1 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/thumb-enum.rs:17:1
+  --> $DIR/thumb-enum.rs:18:1
    |
 LL | enum A { Apple }
    | ^^^^^^
@@ -149,7 +149,7 @@ error: layout_of(B) = Layout {
            unadjusted_abi_align: Align(1 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/thumb-enum.rs:21:1
+  --> $DIR/thumb-enum.rs:22:1
    |
 LL | enum B { Banana = 255, }
    | ^^^^^^
@@ -227,7 +227,7 @@ error: layout_of(C) = Layout {
            unadjusted_abi_align: Align(2 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/thumb-enum.rs:25:1
+  --> $DIR/thumb-enum.rs:26:1
    |
 LL | enum C { Chaenomeles = 256, }
    | ^^^^^^
@@ -305,7 +305,7 @@ error: layout_of(P) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/thumb-enum.rs:29:1
+  --> $DIR/thumb-enum.rs:30:1
    |
 LL | enum P { Peach = 0x1000_0000isize, }
    | ^^^^^^
@@ -383,7 +383,7 @@ error: layout_of(T) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/thumb-enum.rs:35:1
+  --> $DIR/thumb-enum.rs:36:1
    |
 LL | enum T { Tangerine = TANGERINE as isize }
    | ^^^^^^
diff --git a/tests/ui/layout/too-big-with-padding.rs b/tests/ui/layout/too-big-with-padding.rs
index 8423ad2e1d6..0f03bd10fb6 100644
--- a/tests/ui/layout/too-big-with-padding.rs
+++ b/tests/ui/layout/too-big-with-padding.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ build-fail
 //@ compile-flags: --target i686-unknown-linux-gnu --crate-type lib
 //@ needs-llvm-components: x86
@@ -6,13 +7,11 @@
 #![no_std]
 #![no_core]
 
+extern crate minicore;
+use minicore::*;
+
 // 0x7fffffff is fine, but after rounding up it becomes too big
 #[repr(C, align(2))]
 pub struct Example([u8; 0x7fffffff]);
 
 pub fn lib(_x: Example) {} //~ERROR: too big for the target architecture
-
-#[lang = "sized"]
-pub trait Sized {}
-#[lang = "copy"]
-pub trait Copy: Sized {}
diff --git a/tests/ui/layout/too-big-with-padding.stderr b/tests/ui/layout/too-big-with-padding.stderr
index fc3b4db049a..761ac7514ee 100644
--- a/tests/ui/layout/too-big-with-padding.stderr
+++ b/tests/ui/layout/too-big-with-padding.stderr
@@ -1,5 +1,5 @@
 error: values of the type `Example` are too big for the target architecture
-  --> $DIR/too-big-with-padding.rs:13:1
+  --> $DIR/too-big-with-padding.rs:17:1
    |
 LL | pub fn lib(_x: Example) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/mir/checks_without_panic_impl.rs b/tests/ui/mir/checks_without_panic_impl.rs
index 0dba5784daa..11ab50a5f9a 100644
--- a/tests/ui/mir/checks_without_panic_impl.rs
+++ b/tests/ui/mir/checks_without_panic_impl.rs
@@ -2,6 +2,7 @@
 // does not prevent crates without a panic_impl from compiling.
 // See rust-lang/rust#109996
 
+//@ add-core-stubs
 //@ build-pass
 //@ compile-flags: -Cdebug-assertions=yes
 
@@ -11,7 +12,7 @@
 #![feature(no_core)]
 #![no_core]
 
-#[lang = "sized"]
-trait Foo {}
+extern crate minicore;
+use minicore::*;
 
 pub unsafe fn foo(x: *const i32) -> &'static i32 { unsafe { &*x } }
diff --git a/tests/ui/process/win-command-child-path.rs b/tests/ui/process/win-command-child-path.rs
new file mode 100644
index 00000000000..7ec2679749f
--- /dev/null
+++ b/tests/ui/process/win-command-child-path.rs
@@ -0,0 +1,72 @@
+//@ run-pass
+//@ only-windows
+//@ needs-subprocess
+//@ no-prefer-dynamic
+
+// Test Windows std::process::Command search path semantics when setting PATH on the child process.
+// NOTE: The exact semantics here are (possibly) subject to change.
+
+use std::process::Command;
+use std::{env, fs, path};
+
+fn main() {
+    if env::args().skip(1).any(|s| s == "--child") {
+        child();
+    } else if env::args().skip(1).any(|s| s == "--parent") {
+        parent();
+    } else {
+        setup();
+    }
+}
+
+// Set up the directories so that there are three app dirs:
+// app: Where the parent app is run from
+// parent: In the parent's PATH env var
+// child: In the child's PATH env var
+fn setup() {
+    let exe = env::current_exe().unwrap();
+
+    fs::create_dir_all("app").unwrap();
+    fs::copy(&exe, "app/myapp.exe").unwrap();
+    fs::create_dir_all("parent").unwrap();
+    fs::copy(&exe, "parent/myapp.exe").unwrap();
+    fs::create_dir_all("child").unwrap();
+    fs::copy(&exe, "child/myapp.exe").unwrap();
+
+    let parent_path = path::absolute("parent").unwrap();
+    let status =
+        Command::new("./app/myapp.exe").env("PATH", parent_path).arg("--parent").status().unwrap();
+    // print the status in case of abnormal exit
+    dbg!(status);
+    assert!(status.success());
+}
+
+// The child simply prints the name of its parent directory.
+fn child() {
+    let exe = env::current_exe().unwrap();
+    let parent = exe.parent().unwrap().file_name().unwrap();
+    println!("{}", parent.display());
+}
+
+fn parent() {
+    let exe = env::current_exe().unwrap();
+    let name = exe.file_name().unwrap();
+
+    // By default, the application dir will be search first for the exe
+    let output = Command::new(&name).arg("--child").output().unwrap();
+    assert_eq!(output.stdout, b"app\n");
+
+    // Setting an environment variable should not change the above.
+    let output = Command::new(&name).arg("--child").env("a", "b").output().unwrap();
+    assert_eq!(output.stdout, b"app\n");
+
+    // Setting a child path means that path will be searched first.
+    let child_path = path::absolute("child").unwrap();
+    let output = Command::new(&name).arg("--child").env("PATH", child_path).output().unwrap();
+    assert_eq!(output.stdout, b"child\n");
+
+    // Setting a child path that does not contain the exe (currently) means
+    // we fallback to searching the app dir.
+    let output = Command::new(&name).arg("--child").env("PATH", "").output().unwrap();
+    assert_eq!(output.stdout, b"app\n");
+}
diff --git a/tests/ui/repr/16-bit-repr-c-enum.rs b/tests/ui/repr/16-bit-repr-c-enum.rs
index 8c2d2fafce0..d4d5a086dcc 100644
--- a/tests/ui/repr/16-bit-repr-c-enum.rs
+++ b/tests/ui/repr/16-bit-repr-c-enum.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ build-pass
 //@ revisions: avr msp430
 //
@@ -11,6 +12,9 @@
 #![stable(feature = "intrinsics_for_test", since = "3.3.3")]
 #![allow(dead_code)]
 
+extern crate minicore;
+use minicore::*;
+
 // Test that the repr(C) attribute doesn't break compilation
 // Previous bad assumption was that 32-bit enum default width is fine on msp430, avr
 // But the width of the C int on these platforms is 16 bits, and C enums <= C int range
@@ -26,11 +30,6 @@ enum Foo {
 #[rustc_intrinsic]
 const fn size_of<T>() -> usize;
 
-#[lang="sized"]
-trait Sized {}
-#[lang="copy"]
-trait Copy {}
-
 const EXPECTED: usize = 2;
 const ACTUAL: usize = size_of::<Foo>();
 // Validate that the size is indeed 16 bits, to match this C static_assert:
diff --git a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr
index 204db30786e..42fcaee2d4a 100644
--- a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr
+++ b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr
@@ -81,7 +81,7 @@ error: layout_of(Univariant) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:39:1
+  --> $DIR/repr-c-dead-variants.rs:43:1
    |
 LL | enum Univariant {
    | ^^^^^^^^^^^^^^^
@@ -219,7 +219,7 @@ error: layout_of(TwoVariants) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:46:1
+  --> $DIR/repr-c-dead-variants.rs:50:1
    |
 LL | enum TwoVariants {
    | ^^^^^^^^^^^^^^^^
@@ -327,7 +327,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
            unadjusted_abi_align: Align(8 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:58:1
+  --> $DIR/repr-c-dead-variants.rs:62:1
    |
 LL | enum DeadBranchHasOtherField {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr
index 1fab00bf50c..bb2c6e70dc7 100644
--- a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr
+++ b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr
@@ -81,7 +81,7 @@ error: layout_of(Univariant) = Layout {
            unadjusted_abi_align: Align(1 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:39:1
+  --> $DIR/repr-c-dead-variants.rs:43:1
    |
 LL | enum Univariant {
    | ^^^^^^^^^^^^^^^
@@ -219,7 +219,7 @@ error: layout_of(TwoVariants) = Layout {
            unadjusted_abi_align: Align(1 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:46:1
+  --> $DIR/repr-c-dead-variants.rs:50:1
    |
 LL | enum TwoVariants {
    | ^^^^^^^^^^^^^^^^
@@ -327,7 +327,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
            unadjusted_abi_align: Align(8 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:58:1
+  --> $DIR/repr-c-dead-variants.rs:62:1
    |
 LL | enum DeadBranchHasOtherField {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr
index 204db30786e..42fcaee2d4a 100644
--- a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr
+++ b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr
@@ -81,7 +81,7 @@ error: layout_of(Univariant) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:39:1
+  --> $DIR/repr-c-dead-variants.rs:43:1
    |
 LL | enum Univariant {
    | ^^^^^^^^^^^^^^^
@@ -219,7 +219,7 @@ error: layout_of(TwoVariants) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:46:1
+  --> $DIR/repr-c-dead-variants.rs:50:1
    |
 LL | enum TwoVariants {
    | ^^^^^^^^^^^^^^^^
@@ -327,7 +327,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
            unadjusted_abi_align: Align(8 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:58:1
+  --> $DIR/repr-c-dead-variants.rs:62:1
    |
 LL | enum DeadBranchHasOtherField {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/repr/repr-c-dead-variants.rs b/tests/ui/repr/repr-c-dead-variants.rs
index 99f20982a99..7f274308562 100644
--- a/tests/ui/repr/repr-c-dead-variants.rs
+++ b/tests/ui/repr/repr-c-dead-variants.rs
@@ -4,8 +4,12 @@
 #![no_std]
 #![no_core]
 
+extern crate minicore;
+use minicore::*;
+
 // See also: repr-c-int-dead-variants.rs
 
+//@ add-core-stubs
 //@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"
 //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED"
 
@@ -59,6 +63,3 @@ enum DeadBranchHasOtherField { //~ ERROR layout_of
     Variant1(Void, Align8U64),
     Variant2(u8),
 }
-
-#[lang = "sized"]
-trait Sized {}
diff --git a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr
index 204db30786e..42fcaee2d4a 100644
--- a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr
+++ b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr
@@ -81,7 +81,7 @@ error: layout_of(Univariant) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:39:1
+  --> $DIR/repr-c-dead-variants.rs:43:1
    |
 LL | enum Univariant {
    | ^^^^^^^^^^^^^^^
@@ -219,7 +219,7 @@ error: layout_of(TwoVariants) = Layout {
            unadjusted_abi_align: Align(4 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:46:1
+  --> $DIR/repr-c-dead-variants.rs:50:1
    |
 LL | enum TwoVariants {
    | ^^^^^^^^^^^^^^^^
@@ -327,7 +327,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
            unadjusted_abi_align: Align(8 bytes),
            randomization_seed: $SEED,
        }
-  --> $DIR/repr-c-dead-variants.rs:58:1
+  --> $DIR/repr-c-dead-variants.rs:62:1
    |
 LL | enum DeadBranchHasOtherField {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/repr/repr_align_greater_usize.msp430.stderr b/tests/ui/repr/repr_align_greater_usize.msp430.stderr
index 7c85249c009..db25cb1b5f2 100644
--- a/tests/ui/repr/repr_align_greater_usize.msp430.stderr
+++ b/tests/ui/repr/repr_align_greater_usize.msp430.stderr
@@ -1,5 +1,5 @@
 error[E0589]: alignment must not be greater than `isize::MAX` bytes
-  --> $DIR/repr_align_greater_usize.rs:21:8
+  --> $DIR/repr_align_greater_usize.rs:22:8
    |
 LL | #[repr(align(32768))]
    |        ^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | #[repr(align(32768))]
    = note: `isize::MAX` is 32767 for the current target
 
 error[E0589]: alignment must not be greater than `isize::MAX` bytes
-  --> $DIR/repr_align_greater_usize.rs:24:8
+  --> $DIR/repr_align_greater_usize.rs:25:8
    |
 LL | #[repr(align(65536))]
    |        ^^^^^^^^^^^^
diff --git a/tests/ui/repr/repr_align_greater_usize.rs b/tests/ui/repr/repr_align_greater_usize.rs
index b47320b6d9b..7499e242d59 100644
--- a/tests/ui/repr/repr_align_greater_usize.rs
+++ b/tests/ui/repr/repr_align_greater_usize.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: msp430 aarch32
 //@[msp430] needs-llvm-components: msp430
 //@[msp430] compile-flags: --target=msp430-none-elf
@@ -12,8 +13,8 @@
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 #[repr(align(16384))]
 struct Kitten;
diff --git a/tests/ui/sanitizer/cfg-kasan.rs b/tests/ui/sanitizer/cfg-kasan.rs
index 491eaf3acc1..ba0abf60570 100644
--- a/tests/ui/sanitizer/cfg-kasan.rs
+++ b/tests/ui/sanitizer/cfg-kasan.rs
@@ -1,6 +1,7 @@
 // Verifies that when compiling with -Zsanitizer=kernel-address,
 // the `#[cfg(sanitize = "address")]` attribute is configured.
 
+//@ add-core-stubs
 //@ check-pass
 //@ compile-flags: -Zsanitizer=kernel-address
 //@ revisions: aarch64 riscv64imac riscv64gc x86_64
@@ -17,8 +18,8 @@
 #![feature(cfg_sanitize, no_core, lang_items)]
 #![no_core]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 const _: fn() -> () = main;
 
diff --git a/tests/ui/sanitizer/cfg.rs b/tests/ui/sanitizer/cfg.rs
index 7b8f285e41a..a43813c0446 100644
--- a/tests/ui/sanitizer/cfg.rs
+++ b/tests/ui/sanitizer/cfg.rs
@@ -1,6 +1,7 @@
 // Verifies that when compiling with -Zsanitizer=option,
 // the `#[cfg(sanitize = "option")]` attribute is configured.
 
+//@ add-core-stubs
 //@ check-pass
 //@ revisions: address cfi kcfi leak memory thread
 //@compile-flags: -Ctarget-feature=-crt-static
@@ -23,10 +24,8 @@
 #![crate_type="lib"]
 #![no_core]
 
-#[lang="sized"]
-trait Sized { }
-#[lang="copy"]
-trait Copy { }
+extern crate minicore;
+use minicore::*;
 
 #[cfg(all(sanitize = "address", address))]
 fn main() {}
diff --git a/tests/ui/simd/array-trait.rs b/tests/ui/simd/array-trait.rs
index 32cbf01428c..26218856771 100644
--- a/tests/ui/simd/array-trait.rs
+++ b/tests/ui/simd/array-trait.rs
@@ -1,11 +1,11 @@
 // Figuring out the size of a vector type that depends on traits doesn't ICE
 
 #![allow(dead_code)]
-
-
-#![feature(repr_simd, intrinsics, generic_const_exprs)]
+#![feature(repr_simd, core_intrinsics, generic_const_exprs)]
 #![allow(non_camel_case_types, incomplete_features)]
 
+use std::intrinsics::simd::{simd_extract, simd_insert};
+
 pub trait Simd {
     type Lane: Clone + Copy;
     const SIZE: usize;
@@ -24,13 +24,6 @@ pub struct T<S: Simd>([S::Lane; S::SIZE]);
 //~| ERROR SIMD vector element type should be a primitive scalar
 //~| ERROR unconstrained generic constant
 
-#[rustc_intrinsic]
-unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
-
-
 pub fn main() {
     let mut t = T::<i32x4>([0; 4]);
     unsafe {
diff --git a/tests/ui/simd/array-type.rs b/tests/ui/simd/array-type.rs
index d1de7004416..468e0b2f9b5 100644
--- a/tests/ui/simd/array-type.rs
+++ b/tests/ui/simd/array-type.rs
@@ -1,8 +1,8 @@
 //@ run-pass
 #![allow(dead_code)]
+#![feature(repr_simd, core_intrinsics)]
 
-
-#![feature(repr_simd, intrinsics)]
+use std::intrinsics::simd::{simd_extract, simd_insert};
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -12,13 +12,6 @@ struct S([i32; 4]);
 #[derive(Copy, Clone)]
 struct T<const N: usize>([i32; N]);
 
-#[rustc_intrinsic]
-unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
-
-
 pub fn main() {
     let mut s = S([0; 4]);
 
diff --git a/tests/ui/simd/generics.rs b/tests/ui/simd/generics.rs
index 453ed86c14a..1ae08fef7cd 100644
--- a/tests/ui/simd/generics.rs
+++ b/tests/ui/simd/generics.rs
@@ -1,7 +1,8 @@
 //@ run-pass
 #![allow(non_camel_case_types)]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
+use std::intrinsics::simd::simd_add;
 use std::ops;
 
 #[repr(simd)]
@@ -20,11 +21,7 @@ struct B<T>([T; 4]);
 #[derive(Copy, Clone)]
 struct C<T, const N: usize>([T; N]);
 
-
-#[rustc_intrinsic]
-unsafe fn simd_add<T>(x: T, y: T) -> T;
-
-fn add<T: ops::Add<Output=T>>(lhs: T, rhs: T) -> T {
+fn add<T: ops::Add<Output = T>>(lhs: T, rhs: T) -> T {
     lhs + rhs
 }
 
@@ -60,7 +57,6 @@ impl ops::Add for C<f32, 4> {
     }
 }
 
-
 pub fn main() {
     let x = [1.0f32, 2.0f32, 3.0f32, 4.0f32];
     let y = [2.0f32, 4.0f32, 6.0f32, 8.0f32];
diff --git a/tests/ui/simd/intrinsic/float-math-pass.rs b/tests/ui/simd/intrinsic/float-math-pass.rs
index 91059f353fd..4c28568a739 100644
--- a/tests/ui/simd/intrinsic/float-math-pass.rs
+++ b/tests/ui/simd/intrinsic/float-math-pass.rs
@@ -8,58 +8,14 @@
 
 // Test that the simd floating-point math intrinsics produce correct results.
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, intrinsics, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct f32x4(pub [f32; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_fsqrt<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_fabs<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_fsin<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_fcos<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_fexp<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_fexp2<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_fma<T>(x: T, y: T, z: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_relaxed_fma<T>(x: T, y: T, z: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_flog<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_flog10<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_flog2<T>(x: T) -> T;
-
-// rounding functions
-#[rustc_intrinsic]
-unsafe fn simd_ceil<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_floor<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_round<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_trunc<T>(x: T) -> T;
+use std::intrinsics::simd::*;
 
 macro_rules! assert_approx_eq_f32 {
     ($a:expr, $b:expr) => {{
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
index 0fcff8584c8..fdf06b7882e 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
@@ -1,7 +1,10 @@
 //@ build-fail
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
+
+use std::intrinsics::simd::*;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct i32x4(pub [i32; 4]);
@@ -14,55 +17,6 @@ pub struct u32x4(pub [u32; 4]);
 #[derive(Copy, Clone)]
 pub struct f32x4(pub [f32; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_add<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_sub<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_mul<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_div<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_rem<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_shl<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_shr<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_and<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_or<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_xor<T>(x: T, y: T) -> T;
-
-
-#[rustc_intrinsic]
-unsafe fn simd_neg<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_bswap<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_bitreverse<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_ctlz<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_ctpop<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_cttz<T>(x: T) -> T;
-
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
     let y = u32x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
index e67de2fe903..76db6d5328f 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
@@ -1,143 +1,143 @@
 error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:110:9
+  --> $DIR/generic-arithmetic-2.rs:64:9
    |
 LL |         simd_add(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_sub` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:112:9
+  --> $DIR/generic-arithmetic-2.rs:66:9
    |
 LL |         simd_sub(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_mul` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:114:9
+  --> $DIR/generic-arithmetic-2.rs:68:9
    |
 LL |         simd_mul(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_div` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:116:9
+  --> $DIR/generic-arithmetic-2.rs:70:9
    |
 LL |         simd_div(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:118:9
+  --> $DIR/generic-arithmetic-2.rs:72:9
    |
 LL |         simd_shl(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:120:9
+  --> $DIR/generic-arithmetic-2.rs:74:9
    |
 LL |         simd_shr(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:122:9
+  --> $DIR/generic-arithmetic-2.rs:76:9
    |
 LL |         simd_and(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:124:9
+  --> $DIR/generic-arithmetic-2.rs:78:9
    |
 LL |         simd_or(0, 0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:126:9
+  --> $DIR/generic-arithmetic-2.rs:80:9
    |
 LL |         simd_xor(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_neg` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:129:9
+  --> $DIR/generic-arithmetic-2.rs:83:9
    |
 LL |         simd_neg(0);
    |         ^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:131:9
+  --> $DIR/generic-arithmetic-2.rs:85:9
    |
 LL |         simd_bswap(0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:133:9
+  --> $DIR/generic-arithmetic-2.rs:87:9
    |
 LL |         simd_bitreverse(0);
    |         ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:135:9
+  --> $DIR/generic-arithmetic-2.rs:89:9
    |
 LL |         simd_ctlz(0);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:137:9
+  --> $DIR/generic-arithmetic-2.rs:91:9
    |
 LL |         simd_cttz(0);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:140:9
+  --> $DIR/generic-arithmetic-2.rs:94:9
    |
 LL |         simd_shl(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:142:9
+  --> $DIR/generic-arithmetic-2.rs:96:9
    |
 LL |         simd_shr(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:144:9
+  --> $DIR/generic-arithmetic-2.rs:98:9
    |
 LL |         simd_and(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:146:9
+  --> $DIR/generic-arithmetic-2.rs:100:9
    |
 LL |         simd_or(z, z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:148:9
+  --> $DIR/generic-arithmetic-2.rs:102:9
    |
 LL |         simd_xor(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:150:9
+  --> $DIR/generic-arithmetic-2.rs:104:9
    |
 LL |         simd_bswap(z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:152:9
+  --> $DIR/generic-arithmetic-2.rs:106:9
    |
 LL |         simd_bitreverse(z);
    |         ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:154:9
+  --> $DIR/generic-arithmetic-2.rs:108:9
    |
 LL |         simd_ctlz(z);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctpop` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:156:9
+  --> $DIR/generic-arithmetic-2.rs:110:9
    |
 LL |         simd_ctpop(z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:158:9
+  --> $DIR/generic-arithmetic-2.rs:112:9
    |
 LL |         simd_cttz(z);
    |         ^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
index 29d82255d4e..3f0325d690b 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
@@ -1,6 +1,6 @@
 //@ run-pass
 #![allow(non_camel_case_types)]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -22,53 +22,7 @@ macro_rules! all_eq {
     }};
 }
 
-#[rustc_intrinsic]
-unsafe fn simd_add<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_sub<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_mul<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_div<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_rem<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_shl<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_shr<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_and<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_or<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_xor<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_neg<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_bswap<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_bitreverse<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_ctlz<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_ctpop<T>(x: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_cttz<T>(x: T) -> T;
+use std::intrinsics::simd::*;
 
 fn main() {
     let x1 = i32x4([1, 2, 3, 4]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs
index 85464402d6a..ca170f2d850 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.rs
@@ -1,7 +1,10 @@
 //@ build-fail
 //@ ignore-emscripten
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
+
+use std::intrinsics::simd::{simd_saturating_add, simd_saturating_sub};
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct i32x4(pub [i32; 4]);
@@ -14,13 +17,6 @@ pub struct x4<T>(pub [T; 4]);
 #[derive(Copy, Clone)]
 pub struct f32x4(pub [f32; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_saturating_add<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_saturating_sub<T>(x: T, y: T) -> T;
-
-
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
     let y = x4([0_usize, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr
index cf275db7e43..f7874582340 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-2.stderr
@@ -1,11 +1,11 @@
 error[E0511]: invalid monomorphization of `simd_saturating_add` intrinsic: expected element type `f32` of vector type `f32x4` to be a signed or unsigned integer type
-  --> $DIR/generic-arithmetic-saturating-2.rs:35:9
+  --> $DIR/generic-arithmetic-saturating-2.rs:31:9
    |
 LL |         simd_saturating_add(z, z);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_saturating_sub` intrinsic: expected element type `f32` of vector type `f32x4` to be a signed or unsigned integer type
-  --> $DIR/generic-arithmetic-saturating-2.rs:37:9
+  --> $DIR/generic-arithmetic-saturating-2.rs:33:9
    |
 LL |         simd_saturating_sub(z, z);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs
index 5fe65257d15..4d12a312331 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs
@@ -2,7 +2,9 @@
 //@ ignore-emscripten
 
 #![allow(non_camel_case_types)]
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
+
+use std::intrinsics::simd::{simd_saturating_add, simd_saturating_sub};
 
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
@@ -12,13 +14,6 @@ struct u32x4(pub [u32; 4]);
 #[derive(Copy, Clone)]
 struct I32<const N: usize>([i32; N]);
 
-#[rustc_intrinsic]
-unsafe fn simd_saturating_add<T>(x: T, y: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_saturating_sub<T>(x: T, y: T) -> T;
-
-
 fn main() {
     // unsigned
     {
diff --git a/tests/ui/simd/intrinsic/generic-as.rs b/tests/ui/simd/intrinsic/generic-as.rs
index 124ca56bc88..da53211cbc7 100644
--- a/tests/ui/simd/intrinsic/generic-as.rs
+++ b/tests/ui/simd/intrinsic/generic-as.rs
@@ -1,10 +1,8 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-
-#[rustc_intrinsic]
-unsafe fn simd_as<T, U>(x: T) -> U;
+use std::intrinsics::simd::simd_as;
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/intrinsic/generic-bitmask-pass.rs b/tests/ui/simd/intrinsic/generic-bitmask-pass.rs
index 08526991fbe..cb3221e21d5 100644
--- a/tests/ui/simd/intrinsic/generic-bitmask-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-bitmask-pass.rs
@@ -1,13 +1,12 @@
 //@ run-pass
 #![allow(non_camel_case_types)]
-
 //@ ignore-emscripten
 //@ ignore-endian-big behavior of simd_bitmask is endian-specific
 
 // Test that the simd_bitmask intrinsic produces correct results.
+#![feature(repr_simd, core_intrinsics)]
 
-#![feature(repr_simd, intrinsics)]
-#[allow(non_camel_case_types)]
+use std::intrinsics::simd::simd_bitmask;
 
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
@@ -21,9 +20,6 @@ struct u8x4(pub [u8; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct Tx4<T>(pub [T; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_bitmask<T, U>(x: T) -> U;
-
 fn main() {
     let z = u32x4([0, 0, 0, 0]);
     let ez = 0_u8;
@@ -56,6 +52,5 @@ fn main() {
 
         let r: u8 = simd_bitmask(msize);
         assert_eq!(r, e);
-
     }
 }
diff --git a/tests/ui/simd/intrinsic/generic-bitmask.rs b/tests/ui/simd/intrinsic/generic-bitmask.rs
index 49589d22bbf..9f5e806337e 100644
--- a/tests/ui/simd/intrinsic/generic-bitmask.rs
+++ b/tests/ui/simd/intrinsic/generic-bitmask.rs
@@ -3,9 +3,11 @@
 // Test that the simd_bitmask intrinsic produces ok-ish error
 // messages when misused.
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_bitmask;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct u32x2([u32; 2]);
@@ -30,9 +32,6 @@ struct u8x32([u8; 32]);
 #[derive(Copy, Clone)]
 struct u8x64([u8; 64]);
 
-#[rustc_intrinsic]
-unsafe fn simd_bitmask<T, U>(x: T) -> U;
-
 fn main() {
     let m2 = u32x2([0; 2]);
     let m4 = u32x4([0; 4]);
@@ -63,6 +62,5 @@ fn main() {
 
         let _: u128 = simd_bitmask(m64);
         //~^ ERROR invalid monomorphization of `simd_bitmask` intrinsic
-
-   }
+    }
 }
diff --git a/tests/ui/simd/intrinsic/generic-bitmask.stderr b/tests/ui/simd/intrinsic/generic-bitmask.stderr
index c217bb2d8f1..3c4878f39cc 100644
--- a/tests/ui/simd/intrinsic/generic-bitmask.stderr
+++ b/tests/ui/simd/intrinsic/generic-bitmask.stderr
@@ -1,29 +1,29 @@
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u16`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-bitmask.rs:52:22
+  --> $DIR/generic-bitmask.rs:51:22
    |
 LL |         let _: u16 = simd_bitmask(m2);
    |                      ^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u16`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-bitmask.rs:55:22
+  --> $DIR/generic-bitmask.rs:54:22
    |
 LL |         let _: u16 = simd_bitmask(m8);
    |                      ^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u32`, expected `u16` or `[u8; 2]`
-  --> $DIR/generic-bitmask.rs:58:22
+  --> $DIR/generic-bitmask.rs:57:22
    |
 LL |         let _: u32 = simd_bitmask(m16);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u64`, expected `u32` or `[u8; 4]`
-  --> $DIR/generic-bitmask.rs:61:22
+  --> $DIR/generic-bitmask.rs:60:22
    |
 LL |         let _: u64 = simd_bitmask(m32);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitmask` intrinsic: cannot return `u128`, expected `u64` or `[u8; 8]`
-  --> $DIR/generic-bitmask.rs:64:23
+  --> $DIR/generic-bitmask.rs:63:23
    |
 LL |         let _: u128 = simd_bitmask(m64);
    |                       ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-bswap-byte.rs b/tests/ui/simd/intrinsic/generic-bswap-byte.rs
index 4521573636c..903a07656a7 100644
--- a/tests/ui/simd/intrinsic/generic-bswap-byte.rs
+++ b/tests/ui/simd/intrinsic/generic-bswap-byte.rs
@@ -1,7 +1,9 @@
 //@ run-pass
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_bswap;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 struct i8x4([i8; 4]);
@@ -10,9 +12,6 @@ struct i8x4([i8; 4]);
 #[derive(Copy, Clone)]
 struct u8x4([u8; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_bswap<T>(x: T) -> T;
-
 fn main() {
     unsafe {
         assert_eq!(simd_bswap(i8x4([0, 1, 2, 3])).0, [0, 1, 2, 3]);
diff --git a/tests/ui/simd/intrinsic/generic-cast-pass.rs b/tests/ui/simd/intrinsic/generic-cast-pass.rs
index aab7347d1de..7a4663bcad2 100644
--- a/tests/ui/simd/intrinsic/generic-cast-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-cast-pass.rs
@@ -1,9 +1,8 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-#[rustc_intrinsic]
-unsafe fn simd_cast<T, U>(x: T) -> U;
+use std::intrinsics::simd::simd_cast;
 
 use std::cmp::{max, min};
 
diff --git a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs
index 9f28898654f..ea34e9ffeb8 100644
--- a/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs
+++ b/tests/ui/simd/intrinsic/generic-cast-pointer-width.rs
@@ -1,8 +1,7 @@
 //@ run-pass
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-#[rustc_intrinsic]
-unsafe fn simd_cast<T, U>(x: T) -> U;
+use std::intrinsics::simd::simd_cast;
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/intrinsic/generic-cast.rs b/tests/ui/simd/intrinsic/generic-cast.rs
index 7f398804eb4..4b13a93f323 100644
--- a/tests/ui/simd/intrinsic/generic-cast.rs
+++ b/tests/ui/simd/intrinsic/generic-cast.rs
@@ -1,6 +1,8 @@
 //@ build-fail
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
+
+use std::intrinsics::simd::simd_cast;
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -20,10 +22,6 @@ struct f32x4([f32; 4]);
 #[allow(non_camel_case_types)]
 struct f32x8([f32; 8]);
 
-
-#[rustc_intrinsic]
-unsafe fn simd_cast<T, U>(x: T) -> U;
-
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
 
@@ -35,6 +33,6 @@ fn main() {
         simd_cast::<i32x4, i32>(x);
         //~^ ERROR expected SIMD return type, found non-SIMD `i32`
         simd_cast::<_, i32x8>(x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i32x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i32x8` with length 8
     }
 }
diff --git a/tests/ui/simd/intrinsic/generic-cast.stderr b/tests/ui/simd/intrinsic/generic-cast.stderr
index 1b6ac03f8c9..192aa13216b 100644
--- a/tests/ui/simd/intrinsic/generic-cast.stderr
+++ b/tests/ui/simd/intrinsic/generic-cast.stderr
@@ -1,23 +1,23 @@
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-cast.rs:31:9
+  --> $DIR/generic-cast.rs:29:9
    |
 LL |         simd_cast::<i32, i32>(0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-cast.rs:33:9
+  --> $DIR/generic-cast.rs:31:9
    |
 LL |         simd_cast::<i32, i32x4>(0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-cast.rs:35:9
+  --> $DIR/generic-cast.rs:33:9
    |
 LL |         simd_cast::<i32x4, i32>(x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i32x8` with length 8
-  --> $DIR/generic-cast.rs:37:9
+  --> $DIR/generic-cast.rs:35:9
    |
 LL |         simd_cast::<_, i32x8>(x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-comparison-pass.rs b/tests/ui/simd/intrinsic/generic-comparison-pass.rs
index d0ec2503602..2ee164cdfd8 100644
--- a/tests/ui/simd/intrinsic/generic-comparison-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-comparison-pass.rs
@@ -1,8 +1,10 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics, concat_idents)]
+#![feature(repr_simd, core_intrinsics, concat_idents)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_eq, simd_ge, simd_gt, simd_le, simd_lt, simd_ne};
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 struct i32x4([i32; 4]);
@@ -13,24 +15,6 @@ struct u32x4(pub [u32; 4]);
 #[derive(Copy, Clone)]
 struct f32x4(pub [f32; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_eq<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_ne<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_lt<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_le<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_gt<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_ge<T, U>(x: T, y: T) -> U;
-
 macro_rules! cmp {
     ($method: ident($lhs: expr, $rhs: expr)) => {{
         let lhs = $lhs;
diff --git a/tests/ui/simd/intrinsic/generic-comparison.rs b/tests/ui/simd/intrinsic/generic-comparison.rs
index e5adb49f6a3..ebd1f629be4 100644
--- a/tests/ui/simd/intrinsic/generic-comparison.rs
+++ b/tests/ui/simd/intrinsic/generic-comparison.rs
@@ -1,6 +1,6 @@
 //@ build-fail
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -11,24 +11,7 @@ struct i32x4([i32; 4]);
 #[allow(non_camel_case_types)]
 struct i16x8([i16; 8]);
 
-
-#[rustc_intrinsic]
-unsafe fn simd_eq<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_ne<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_lt<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_le<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_gt<T, U>(x: T, y: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_ge<T, U>(x: T, y: T) -> U;
+use std::intrinsics::simd::{simd_eq, simd_ge, simd_gt, simd_le, simd_lt, simd_ne};
 
 fn main() {
     let x = i32x4([0, 0, 0, 0]);
@@ -61,16 +44,16 @@ fn main() {
         //~^ ERROR expected SIMD return type, found non-SIMD `i32`
 
         simd_eq::<_, i16x8>(x, x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
         simd_ne::<_, i16x8>(x, x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
         simd_lt::<_, i16x8>(x, x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
         simd_le::<_, i16x8>(x, x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
         simd_gt::<_, i16x8>(x, x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
         simd_ge::<_, i16x8>(x, x);
-//~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
+        //~^ ERROR return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
     }
 }
diff --git a/tests/ui/simd/intrinsic/generic-comparison.stderr b/tests/ui/simd/intrinsic/generic-comparison.stderr
index cc66d2ce40a..a6e91bf6a36 100644
--- a/tests/ui/simd/intrinsic/generic-comparison.stderr
+++ b/tests/ui/simd/intrinsic/generic-comparison.stderr
@@ -1,107 +1,107 @@
 error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:37:9
+  --> $DIR/generic-comparison.rs:20:9
    |
 LL |         simd_eq::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:39:9
+  --> $DIR/generic-comparison.rs:22:9
    |
 LL |         simd_ne::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:41:9
+  --> $DIR/generic-comparison.rs:24:9
    |
 LL |         simd_lt::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:43:9
+  --> $DIR/generic-comparison.rs:26:9
    |
 LL |         simd_le::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:45:9
+  --> $DIR/generic-comparison.rs:28:9
    |
 LL |         simd_gt::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:47:9
+  --> $DIR/generic-comparison.rs:30:9
    |
 LL |         simd_ge::<i32, i32>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:50:9
+  --> $DIR/generic-comparison.rs:33:9
    |
 LL |         simd_eq::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:52:9
+  --> $DIR/generic-comparison.rs:35:9
    |
 LL |         simd_ne::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:54:9
+  --> $DIR/generic-comparison.rs:37:9
    |
 LL |         simd_lt::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:56:9
+  --> $DIR/generic-comparison.rs:39:9
    |
 LL |         simd_le::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:58:9
+  --> $DIR/generic-comparison.rs:41:9
    |
 LL |         simd_gt::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected SIMD return type, found non-SIMD `i32`
-  --> $DIR/generic-comparison.rs:60:9
+  --> $DIR/generic-comparison.rs:43:9
    |
 LL |         simd_ge::<_, i32>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:63:9
+  --> $DIR/generic-comparison.rs:46:9
    |
 LL |         simd_eq::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:65:9
+  --> $DIR/generic-comparison.rs:48:9
    |
 LL |         simd_ne::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:67:9
+  --> $DIR/generic-comparison.rs:50:9
    |
 LL |         simd_lt::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:69:9
+  --> $DIR/generic-comparison.rs:52:9
    |
 LL |         simd_le::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:71:9
+  --> $DIR/generic-comparison.rs:54:9
    |
 LL |         simd_gt::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8
-  --> $DIR/generic-comparison.rs:73:9
+  --> $DIR/generic-comparison.rs:56:9
    |
 LL |         simd_ge::<_, i16x8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-elements-pass.rs b/tests/ui/simd/intrinsic/generic-elements-pass.rs
index b8d872c5cb7..4dc2e4d5a80 100644
--- a/tests/ui/simd/intrinsic/generic-elements-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-elements-pass.rs
@@ -1,6 +1,8 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
+
+use std::intrinsics::simd::{simd_extract, simd_insert, simd_shuffle};
 
 #[repr(simd)]
 #[derive(Copy, Clone, Debug, PartialEq)]
@@ -15,15 +17,6 @@ struct i32x4([i32; 4]);
 #[allow(non_camel_case_types)]
 struct i32x8([i32; 8]);
 
-#[rustc_intrinsic]
-unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
-
-#[rustc_intrinsic]
-unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-
 #[repr(simd)]
 struct SimdShuffleIdx<const LEN: usize>([u32; LEN]);
 
diff --git a/tests/ui/simd/intrinsic/generic-elements.rs b/tests/ui/simd/intrinsic/generic-elements.rs
index 54cf35df8c7..905299a9289 100644
--- a/tests/ui/simd/intrinsic/generic-elements.rs
+++ b/tests/ui/simd/intrinsic/generic-elements.rs
@@ -1,8 +1,20 @@
 //@ build-fail
 
-#![feature(repr_simd, intrinsics, rustc_attrs, adt_const_params, unsized_const_params)]
+#![feature(
+    repr_simd,
+    intrinsics,
+    core_intrinsics,
+    rustc_attrs,
+    adt_const_params,
+    unsized_const_params
+)]
 #![allow(incomplete_features)]
 
+use std::intrinsics::simd::{simd_extract, simd_insert, simd_shuffle};
+
+#[rustc_intrinsic]
+unsafe fn simd_shuffle_const_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 #[allow(non_camel_case_types)]
@@ -29,21 +41,6 @@ struct f32x4([f32; 4]);
 #[allow(non_camel_case_types)]
 struct f32x8([f32; 8]);
 
-
-#[rustc_intrinsic]
-unsafe fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_extract<T, E>(x: T, idx: u32) -> E;
-
-
-#[rustc_intrinsic]
-unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_shuffle_const_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
-
-
 #[repr(simd)]
 struct SimdShuffleIdx<const LEN: usize>([u32; LEN]);
 
diff --git a/tests/ui/simd/intrinsic/generic-elements.stderr b/tests/ui/simd/intrinsic/generic-elements.stderr
index 1b3e8d59213..3779aa86cee 100644
--- a/tests/ui/simd/intrinsic/generic-elements.stderr
+++ b/tests/ui/simd/intrinsic/generic-elements.stderr
@@ -1,125 +1,125 @@
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:54:9
+  --> $DIR/generic-elements.rs:51:9
    |
 LL |         simd_insert(0, 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected inserted type `i32` (element of input `i32x4`), found `f64`
-  --> $DIR/generic-elements.rs:56:9
+  --> $DIR/generic-elements.rs:53:9
    |
 LL |         simd_insert(x, 0, 1.0);
    |         ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_extract` intrinsic: expected return type `i32` (element of input `i32x4`), found `f32`
-  --> $DIR/generic-elements.rs:58:9
+  --> $DIR/generic-elements.rs:55:9
    |
 LL |         simd_extract::<_, f32>(x, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:62:9
+  --> $DIR/generic-elements.rs:59:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:65:9
+  --> $DIR/generic-elements.rs:62:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:68:9
+  --> $DIR/generic-elements.rs:65:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
-  --> $DIR/generic-elements.rs:71:9
+  --> $DIR/generic-elements.rs:68:9
    |
 LL |         simd_shuffle::<_, _, f32x2>(x, x, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
-  --> $DIR/generic-elements.rs:73:9
+  --> $DIR/generic-elements.rs:70:9
    |
 LL |         simd_shuffle::<_, _, f32x4>(x, x, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
-  --> $DIR/generic-elements.rs:75:9
+  --> $DIR/generic-elements.rs:72:9
    |
 LL |         simd_shuffle::<_, _, f32x8>(x, x, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 2, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:78:9
+  --> $DIR/generic-elements.rs:75:9
    |
 LL |         simd_shuffle::<_, _, i32x8>(x, x, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 4, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:80:9
+  --> $DIR/generic-elements.rs:77:9
    |
 LL |         simd_shuffle::<_, _, i32x8>(x, x, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 8, found `i32x2` with length 2
-  --> $DIR/generic-elements.rs:82:9
+  --> $DIR/generic-elements.rs:79:9
    |
 LL |         simd_shuffle::<_, _, i32x2>(x, x, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:86:9
+  --> $DIR/generic-elements.rs:83:9
    |
 LL |         simd_shuffle_const_generic::<i32, i32, I2>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:89:9
+  --> $DIR/generic-elements.rs:86:9
    |
 LL |         simd_shuffle_const_generic::<i32, i32, I4>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:92:9
+  --> $DIR/generic-elements.rs:89:9
    |
 LL |         simd_shuffle_const_generic::<i32, i32, I8>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
-  --> $DIR/generic-elements.rs:95:9
+  --> $DIR/generic-elements.rs:92:9
    |
 LL |         simd_shuffle_const_generic::<_, f32x2, I2>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
-  --> $DIR/generic-elements.rs:97:9
+  --> $DIR/generic-elements.rs:94:9
    |
 LL |         simd_shuffle_const_generic::<_, f32x4, I4>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
-  --> $DIR/generic-elements.rs:99:9
+  --> $DIR/generic-elements.rs:96:9
    |
 LL |         simd_shuffle_const_generic::<_, f32x8, I8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return type of length 2, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:102:9
+  --> $DIR/generic-elements.rs:99:9
    |
 LL |         simd_shuffle_const_generic::<_, i32x8, I2>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return type of length 4, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:104:9
+  --> $DIR/generic-elements.rs:101:9
    |
 LL |         simd_shuffle_const_generic::<_, i32x8, I4>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return type of length 8, found `i32x2` with length 2
-  --> $DIR/generic-elements.rs:106:9
+  --> $DIR/generic-elements.rs:103:9
    |
 LL |         simd_shuffle_const_generic::<_, i32x2, I8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-gather-pass.rs b/tests/ui/simd/intrinsic/generic-gather-pass.rs
index 0b2cf47e989..b98d4d6575b 100644
--- a/tests/ui/simd/intrinsic/generic-gather-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-gather-pass.rs
@@ -3,19 +3,15 @@
 
 // Test that the simd_{gather,scatter} intrinsics produce the correct results.
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_gather, simd_scatter};
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct x4<T>(pub [T; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_scatter<T, U, V>(x: T, y: U, z: V) -> ();
-
 fn main() {
     let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.];
 
@@ -26,12 +22,8 @@ fn main() {
     // reading from *const
     unsafe {
         let pointer = x.as_ptr();
-        let pointers =  x4([
-            pointer.offset(0),
-            pointer.offset(2),
-            pointer.offset(4),
-            pointer.offset(6)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]);
 
         let r_strided = simd_gather(default, pointers, mask);
 
@@ -41,12 +33,8 @@ fn main() {
     // reading from *mut
     unsafe {
         let pointer = x.as_mut_ptr();
-        let pointers = x4([
-            pointer.offset(0),
-            pointer.offset(2),
-            pointer.offset(4),
-            pointer.offset(6)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]);
 
         let r_strided = simd_gather(default, pointers, mask);
 
@@ -56,12 +44,8 @@ fn main() {
     // writing to *mut
     unsafe {
         let pointer = x.as_mut_ptr();
-        let pointers = x4([
-            pointer.offset(0),
-            pointer.offset(2),
-            pointer.offset(4),
-            pointer.offset(6)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]);
 
         let values = x4([42_f32, 43_f32, 44_f32, 45_f32]);
         simd_scatter(values, pointers, mask);
@@ -78,7 +62,7 @@ fn main() {
         &x[4] as *const f32,
         &x[5] as *const f32,
         &x[6] as *const f32,
-        &x[7] as *const f32
+        &x[7] as *const f32,
     ];
 
     let default = x4([y[0], y[0], y[0], y[0]]);
@@ -87,12 +71,8 @@ fn main() {
     // reading from *const
     unsafe {
         let pointer = y.as_ptr();
-        let pointers = x4([
-            pointer.offset(0),
-            pointer.offset(2),
-            pointer.offset(4),
-            pointer.offset(6)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]);
 
         let r_strided = simd_gather(default, pointers, mask);
 
@@ -102,12 +82,8 @@ fn main() {
     // reading from *mut
     unsafe {
         let pointer = y.as_mut_ptr();
-        let pointers = x4([
-            pointer.offset(0),
-            pointer.offset(2),
-            pointer.offset(4),
-            pointer.offset(6)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]);
 
         let r_strided = simd_gather(default, pointers, mask);
 
@@ -117,12 +93,8 @@ fn main() {
     // writing to *mut
     unsafe {
         let pointer = y.as_mut_ptr();
-        let pointers = x4([
-            pointer.offset(0),
-            pointer.offset(2),
-            pointer.offset(4),
-            pointer.offset(6)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(2), pointer.offset(4), pointer.offset(6)]);
 
         let values = x4([y[7], y[6], y[5], y[1]]);
         simd_scatter(values, pointers, mask);
@@ -135,7 +107,7 @@ fn main() {
             &x[4] as *const f32,
             &x[5] as *const f32,
             &x[1] as *const f32,
-            &x[7] as *const f32
+            &x[7] as *const f32,
         ];
         assert_eq!(y, s);
     }
diff --git a/tests/ui/simd/intrinsic/generic-reduction-pass.rs b/tests/ui/simd/intrinsic/generic-reduction-pass.rs
index 8408d0f203b..2d5d75447b6 100644
--- a/tests/ui/simd/intrinsic/generic-reduction-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-reduction-pass.rs
@@ -1,12 +1,11 @@
 //@ run-pass
 #![allow(non_camel_case_types)]
-
 //@ ignore-emscripten
 
 // Test that the simd_reduce_{op} intrinsics produce the correct results.
+#![feature(repr_simd, core_intrinsics)]
 
-#![feature(repr_simd, intrinsics)]
-#[allow(non_camel_case_types)]
+use std::intrinsics::simd::*;
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -24,39 +23,6 @@ struct f32x4(pub [f32; 4]);
 #[derive(Copy, Clone)]
 struct b8x4(pub [i8; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_reduce_add_unordered<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_mul_unordered<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_add_ordered<T, U>(x: T, acc: U) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_mul_ordered<T, U>(x: T, acc: U) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_min<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_max<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_and<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_or<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_xor<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_all<T>(x: T) -> bool;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_any<T>(x: T) -> bool;
-
 fn main() {
     unsafe {
         let x = i32x4([1, -2, 3, 4]);
diff --git a/tests/ui/simd/intrinsic/generic-reduction.rs b/tests/ui/simd/intrinsic/generic-reduction.rs
index ead13250643..49a33ac35e7 100644
--- a/tests/ui/simd/intrinsic/generic-reduction.rs
+++ b/tests/ui/simd/intrinsic/generic-reduction.rs
@@ -4,9 +4,11 @@
 // Test that the simd_reduce_{op} intrinsics produce ok-ish error
 // messages when misused.
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::*;
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct f32x4(pub [f32; 4]);
@@ -15,27 +17,6 @@ pub struct f32x4(pub [f32; 4]);
 #[derive(Copy, Clone)]
 pub struct u32x4(pub [u32; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_reduce_add_ordered<T, U>(x: T, y: U) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_mul_ordered<T, U>(x: T, y: U) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_and<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_or<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_xor<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_all<T>(x: T) -> bool;
-
-#[rustc_intrinsic]
-unsafe fn simd_reduce_any<T>(x: T) -> bool;
-
 fn main() {
     let x = u32x4([0, 0, 0, 0]);
     let z = f32x4([0.0, 0.0, 0.0, 0.0]);
diff --git a/tests/ui/simd/intrinsic/generic-reduction.stderr b/tests/ui/simd/intrinsic/generic-reduction.stderr
index 302b9ae1d77..eaa7b8d48eb 100644
--- a/tests/ui/simd/intrinsic/generic-reduction.stderr
+++ b/tests/ui/simd/intrinsic/generic-reduction.stderr
@@ -1,59 +1,59 @@
 error[E0511]: invalid monomorphization of `simd_reduce_add_ordered` intrinsic: expected return type `f32` (element of input `f32x4`), found `i32`
-  --> $DIR/generic-reduction.rs:44:9
+  --> $DIR/generic-reduction.rs:25:9
    |
 LL |         simd_reduce_add_ordered(z, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_mul_ordered` intrinsic: expected return type `f32` (element of input `f32x4`), found `i32`
-  --> $DIR/generic-reduction.rs:46:9
+  --> $DIR/generic-reduction.rs:27:9
    |
 LL |         simd_reduce_mul_ordered(z, 1);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_and` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32`
-  --> $DIR/generic-reduction.rs:49:22
+  --> $DIR/generic-reduction.rs:30:22
    |
 LL |         let _: f32 = simd_reduce_and(x);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_or` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32`
-  --> $DIR/generic-reduction.rs:51:22
+  --> $DIR/generic-reduction.rs:32:22
    |
 LL |         let _: f32 = simd_reduce_or(x);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_xor` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32`
-  --> $DIR/generic-reduction.rs:53:22
+  --> $DIR/generic-reduction.rs:34:22
    |
 LL |         let _: f32 = simd_reduce_xor(x);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_and` intrinsic: unsupported simd_reduce_and from `f32x4` with element `f32` to `f32`
-  --> $DIR/generic-reduction.rs:56:22
+  --> $DIR/generic-reduction.rs:37:22
    |
 LL |         let _: f32 = simd_reduce_and(z);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_or` intrinsic: unsupported simd_reduce_or from `f32x4` with element `f32` to `f32`
-  --> $DIR/generic-reduction.rs:58:22
+  --> $DIR/generic-reduction.rs:39:22
    |
 LL |         let _: f32 = simd_reduce_or(z);
    |                      ^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_xor` intrinsic: unsupported simd_reduce_xor from `f32x4` with element `f32` to `f32`
-  --> $DIR/generic-reduction.rs:60:22
+  --> $DIR/generic-reduction.rs:41:22
    |
 LL |         let _: f32 = simd_reduce_xor(z);
    |                      ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_all` intrinsic: unsupported simd_reduce_all from `f32x4` with element `f32` to `bool`
-  --> $DIR/generic-reduction.rs:63:23
+  --> $DIR/generic-reduction.rs:44:23
    |
 LL |         let _: bool = simd_reduce_all(z);
    |                       ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_reduce_any` intrinsic: unsupported simd_reduce_any from `f32x4` with element `f32` to `bool`
-  --> $DIR/generic-reduction.rs:65:23
+  --> $DIR/generic-reduction.rs:46:23
    |
 LL |         let _: bool = simd_reduce_any(z);
    |                       ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-select-pass.rs b/tests/ui/simd/intrinsic/generic-select-pass.rs
index 6b1b6cb79db..0e5f7c4902f 100644
--- a/tests/ui/simd/intrinsic/generic-select-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-select-pass.rs
@@ -1,13 +1,12 @@
 //@ run-pass
 #![allow(non_camel_case_types)]
-
 //@ ignore-emscripten
 //@ ignore-endian-big behavior of simd_select_bitmask is endian-specific
 
 // Test that the simd_select intrinsics produces correct results.
+#![feature(repr_simd, core_intrinsics)]
 
-#![feature(repr_simd, intrinsics)]
-#[allow(non_camel_case_types)]
+use std::intrinsics::simd::{simd_select, simd_select_bitmask};
 
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
@@ -29,13 +28,6 @@ struct f32x4(pub [f32; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct b8x4(pub [i8; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_select<T, U>(x: T, a: U, b: U) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
-
-
 fn main() {
     let m0 = b8x4([!0, !0, !0, !0]);
     let m1 = b8x4([0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-select.rs b/tests/ui/simd/intrinsic/generic-select.rs
index 340fe3f3592..917ad3ca604 100644
--- a/tests/ui/simd/intrinsic/generic-select.rs
+++ b/tests/ui/simd/intrinsic/generic-select.rs
@@ -3,9 +3,11 @@
 // Test that the simd_select intrinsic produces ok-ish error
 // messages when misused.
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_select, simd_select_bitmask};
+
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct f32x4(pub [f32; 4]);
@@ -22,14 +24,6 @@ struct b8x4(pub [i8; 4]);
 #[derive(Copy, Clone, PartialEq)]
 struct b8x8(pub [i8; 8]);
 
-
-#[rustc_intrinsic]
-unsafe fn simd_select<T, U>(x: T, a: U, b: U) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U;
-
-
 fn main() {
     let m4 = b8x4([0, 0, 0, 0]);
     let m8 = b8x8([0, 0, 0, 0, 0, 0, 0, 0]);
diff --git a/tests/ui/simd/intrinsic/generic-select.stderr b/tests/ui/simd/intrinsic/generic-select.stderr
index a97fc91f951..c46584d117c 100644
--- a/tests/ui/simd/intrinsic/generic-select.stderr
+++ b/tests/ui/simd/intrinsic/generic-select.stderr
@@ -1,47 +1,47 @@
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: mismatched lengths: mask length `8` != other vector length `4`
-  --> $DIR/generic-select.rs:42:9
+  --> $DIR/generic-select.rs:36:9
    |
 LL |         simd_select(m8, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `u32`, expected `i_`
-  --> $DIR/generic-select.rs:45:9
+  --> $DIR/generic-select.rs:39:9
    |
 LL |         simd_select(x, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `f32`, expected `i_`
-  --> $DIR/generic-select.rs:48:9
+  --> $DIR/generic-select.rs:42:9
    |
 LL |         simd_select(z, z, z);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select` intrinsic: expected SIMD argument type, found non-SIMD `u32`
-  --> $DIR/generic-select.rs:51:9
+  --> $DIR/generic-select.rs:45:9
    |
 LL |         simd_select(m4, 0u32, 1u32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: invalid bitmask `u16`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-select.rs:54:9
+  --> $DIR/generic-select.rs:48:9
    |
 LL |         simd_select_bitmask(0u16, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: expected SIMD argument type, found non-SIMD `u32`
-  --> $DIR/generic-select.rs:57:9
+  --> $DIR/generic-select.rs:51:9
    |
 LL |         simd_select_bitmask(0u8, 1u32, 2u32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: invalid bitmask `f32`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-select.rs:60:9
+  --> $DIR/generic-select.rs:54:9
    |
 LL |         simd_select_bitmask(0.0f32, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: invalid bitmask `&str`, expected `u8` or `[u8; 1]`
-  --> $DIR/generic-select.rs:63:9
+  --> $DIR/generic-select.rs:57:9
    |
 LL |         simd_select_bitmask("x", x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-shuffle.rs b/tests/ui/simd/intrinsic/generic-shuffle.rs
index 1223b8ebe19..7cfd764f5d5 100644
--- a/tests/ui/simd/intrinsic/generic-shuffle.rs
+++ b/tests/ui/simd/intrinsic/generic-shuffle.rs
@@ -3,16 +3,14 @@
 // Test that the simd_shuffle intrinsic produces ok-ish error
 // messages when misused.
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
+
+use std::intrinsics::simd::simd_shuffle;
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
 pub struct Simd<T, const N: usize>([T; N]);
 
-#[rustc_intrinsic]
-unsafe fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
-
-
 fn main() {
     const I: Simd<u32, 2> = Simd([0; 2]);
     const I2: Simd<f32, 2> = Simd([0.; 2]);
diff --git a/tests/ui/simd/intrinsic/generic-shuffle.stderr b/tests/ui/simd/intrinsic/generic-shuffle.stderr
index 7e6d51a5f65..e8cd528b702 100644
--- a/tests/ui/simd/intrinsic/generic-shuffle.stderr
+++ b/tests/ui/simd/intrinsic/generic-shuffle.stderr
@@ -1,23 +1,23 @@
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: simd_shuffle index must be a SIMD vector of `u32`, got `[u32; 2]`
-  --> $DIR/generic-shuffle.rs:24:31
+  --> $DIR/generic-shuffle.rs:22:31
    |
 LL |         let _: Simd<u32, 2> = simd_shuffle(v, v, const { [0u32; 2] });
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 2, found `Simd<u32, 4>` with length 4
-  --> $DIR/generic-shuffle.rs:27:31
+  --> $DIR/generic-shuffle.rs:25:31
    |
 LL |         let _: Simd<u32, 4> = simd_shuffle(v, v, I);
    |                               ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `u32` (element of input `Simd<u32, 4>`), found `Simd<f32, 2>` with element type `f32`
-  --> $DIR/generic-shuffle.rs:30:31
+  --> $DIR/generic-shuffle.rs:28:31
    |
 LL |         let _: Simd<f32, 2> = simd_shuffle(v, v, I);
    |                               ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: simd_shuffle index must be a SIMD vector of `u32`, got `Simd<f32, 2>`
-  --> $DIR/generic-shuffle.rs:33:31
+  --> $DIR/generic-shuffle.rs:31:31
    |
 LL |         let _: Simd<u32, 2> = simd_shuffle(v, v, I2);
    |                               ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs b/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs
index b324ac40749..49a26ff5734 100644
--- a/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs
+++ b/tests/ui/simd/intrinsic/inlining-issue67557-ice.rs
@@ -3,10 +3,9 @@
 //
 //@ run-pass
 //@ compile-flags: -Zmir-opt-level=4
-#![feature(intrinsics, repr_simd)]
+#![feature(core_intrinsics, repr_simd)]
 
-#[rustc_intrinsic]
-unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
+use std::intrinsics::simd::simd_shuffle;
 
 #[repr(simd)]
 #[derive(Debug, PartialEq)]
diff --git a/tests/ui/simd/intrinsic/inlining-issue67557.rs b/tests/ui/simd/intrinsic/inlining-issue67557.rs
index 319bb15c015..13e7266b2a5 100644
--- a/tests/ui/simd/intrinsic/inlining-issue67557.rs
+++ b/tests/ui/simd/intrinsic/inlining-issue67557.rs
@@ -3,10 +3,9 @@
 //
 //@ run-pass
 //@ compile-flags: -Zmir-opt-level=4
-#![feature(intrinsics, repr_simd)]
+#![feature(core_intrinsics, repr_simd)]
 
-#[rustc_intrinsic]
-unsafe fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
+use std::intrinsics::simd::simd_shuffle;
 
 #[repr(simd)]
 #[derive(Debug, PartialEq)]
@@ -36,7 +35,6 @@ fn assert_10_13(x: Simd2) {
     assert_eq!(x, Simd2([10, 13]));
 }
 
-
 #[inline(always)]
 unsafe fn inline_me() -> Simd2 {
     const IDX: SimdShuffleIdx<2> = SimdShuffleIdx([0, 3]);
diff --git a/tests/ui/simd/intrinsic/issue-85855.rs b/tests/ui/simd/intrinsic/issue-85855.rs
index daeea793d1b..cbaa8f046be 100644
--- a/tests/ui/simd/intrinsic/issue-85855.rs
+++ b/tests/ui/simd/intrinsic/issue-85855.rs
@@ -3,8 +3,7 @@
 // that no ICE occurs in these cases.
 
 #![feature(intrinsics)]
-#![crate_type="lib"]
-
+#![crate_type = "lib"]
 
 #[rustc_intrinsic]
 unsafe fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
diff --git a/tests/ui/simd/intrinsic/issue-85855.stderr b/tests/ui/simd/intrinsic/issue-85855.stderr
index b91a606ba68..af61c6fcdc1 100644
--- a/tests/ui/simd/intrinsic/issue-85855.stderr
+++ b/tests/ui/simd/intrinsic/issue-85855.stderr
@@ -1,17 +1,17 @@
 error[E0094]: intrinsic has wrong number of lifetime parameters: found 1, expected 0
-  --> $DIR/issue-85855.rs:10:30
+  --> $DIR/issue-85855.rs:9:30
    |
 LL | unsafe fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
    |                              ^^^^^^^^^^^ expected 0 lifetime parameters
 
 error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1
-  --> $DIR/issue-85855.rs:17:19
+  --> $DIR/issue-85855.rs:16:19
    |
 LL | unsafe fn simd_sub<T, U>(x: T, y: U);
    |                   ^^^^^^ expected 1 type parameter
 
 error[E0094]: intrinsic has wrong number of const parameters: found 1, expected 0
-  --> $DIR/issue-85855.rs:21:19
+  --> $DIR/issue-85855.rs:20:19
    |
 LL | unsafe fn simd_mul<T, const N: usize>(x: T, y: T);
    |                   ^^^^^^^^^^^^^^^^^^^ expected 0 const parameters
diff --git a/tests/ui/simd/intrinsic/ptr-cast.rs b/tests/ui/simd/intrinsic/ptr-cast.rs
index 559b8ba1b5c..3a73c0273e1 100644
--- a/tests/ui/simd/intrinsic/ptr-cast.rs
+++ b/tests/ui/simd/intrinsic/ptr-cast.rs
@@ -1,16 +1,8 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-
-#[rustc_intrinsic]
-unsafe fn simd_cast_ptr<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_expose_provenance<T, U>(x: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_with_exposed_provenance<T, U>(x: T) -> U;
+use std::intrinsics::simd::{simd_cast_ptr, simd_expose_provenance, simd_with_exposed_provenance};
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/simd/issue-105439.rs b/tests/ui/simd/issue-105439.rs
index 108bb282df2..0a44f36fb2e 100644
--- a/tests/ui/simd/issue-105439.rs
+++ b/tests/ui/simd/issue-105439.rs
@@ -1,17 +1,13 @@
 //@ run-pass
 //@ compile-flags: -O -Zverify-llvm-ir
 
-#![feature(repr_simd)]
-#![feature(intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 #[allow(non_camel_case_types)]
 #[derive(Clone, Copy)]
 #[repr(simd)]
 struct i32x4([i32; 4]);
 
-#[rustc_intrinsic]
-pub(crate) unsafe fn simd_add<T>(x: T, y: T) -> T;
-
 #[inline(always)]
 fn to_array(a: i32x4) -> [i32; 4] {
     a.0
@@ -19,6 +15,6 @@ fn to_array(a: i32x4) -> [i32; 4] {
 
 fn main() {
     let a = i32x4([1, 2, 3, 4]);
-    let b = unsafe { simd_add(a, a) };
+    let b = unsafe { std::intrinsics::simd::simd_add(a, a) };
     assert_eq!(to_array(b), [2, 4, 6, 8]);
 }
diff --git a/tests/ui/simd/issue-39720.rs b/tests/ui/simd/issue-39720.rs
index c3c4750d6de..db441e55167 100644
--- a/tests/ui/simd/issue-39720.rs
+++ b/tests/ui/simd/issue-39720.rs
@@ -1,6 +1,6 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
 #[repr(simd)]
 #[derive(Copy, Clone, Debug)]
@@ -10,11 +10,8 @@ pub struct Char3(pub [i8; 3]);
 #[derive(Copy, Clone, Debug)]
 pub struct Short3(pub [i16; 3]);
 
-#[rustc_intrinsic]
-unsafe fn simd_cast<T, U>(x: T) -> U;
-
 fn main() {
-    let cast: Short3 = unsafe { simd_cast(Char3([10, -3, -9])) };
+    let cast: Short3 = unsafe { std::intrinsics::simd::simd_cast(Char3([10, -3, -9])) };
 
     println!("{:?}", cast);
 }
diff --git a/tests/ui/simd/issue-85915-simd-ptrs.rs b/tests/ui/simd/issue-85915-simd-ptrs.rs
index 2e7baf48ee3..4e2379d0525 100644
--- a/tests/ui/simd/issue-85915-simd-ptrs.rs
+++ b/tests/ui/simd/issue-85915-simd-ptrs.rs
@@ -3,9 +3,11 @@
 
 // Short form of the generic gather/scatter tests,
 // verifying simd([*const T; N]) and simd([*mut T; N]) pass typeck and work.
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::{simd_gather, simd_scatter};
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct cptrx4<T>([*const T; 4]);
@@ -22,13 +24,6 @@ struct f32x4([f32; 4]);
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct i32x4([i32; 4]);
 
-
-#[rustc_intrinsic]
-unsafe fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_scatter<T, U, V>(x: T, y: U, z: V) -> ();
-
 fn main() {
     let mut x = [0_f32, 1., 2., 3., 4., 5., 6., 7.];
 
@@ -39,11 +34,11 @@ fn main() {
     // reading from *const
     unsafe {
         let pointer = &x as *const f32;
-        let pointers =  cptrx4([
+        let pointers = cptrx4([
             pointer.offset(0) as *const f32,
             pointer.offset(2),
             pointer.offset(4),
-            pointer.offset(6)
+            pointer.offset(6),
         ]);
 
         let r_strided = simd_gather(default, pointers, mask);
@@ -58,7 +53,7 @@ fn main() {
             pointer.offset(0) as *mut f32,
             pointer.offset(2),
             pointer.offset(4),
-            pointer.offset(6)
+            pointer.offset(6),
         ]);
 
         let values = f32x4([42_f32, 43_f32, 44_f32, 45_f32]);
diff --git a/tests/ui/simd/issue-89193.rs b/tests/ui/simd/issue-89193.rs
index 4b4fb9d9169..a6c3017572a 100644
--- a/tests/ui/simd/issue-89193.rs
+++ b/tests/ui/simd/issue-89193.rs
@@ -3,16 +3,15 @@
 // Test that simd gather instructions on slice of usize don't cause crash
 // See issue #89183 - https://github.com/rust-lang/rust/issues/89193
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_gather;
+
 #[repr(simd)]
 #[derive(Copy, Clone, PartialEq, Debug)]
 struct x4<T>(pub [T; 4]);
 
-#[rustc_intrinsic]
-unsafe fn simd_gather<T, U, V>(x: T, y: U, z: V) -> T;
-
 fn main() {
     let x: [usize; 4] = [10, 11, 12, 13];
     let default = x4([0_usize, 1, 2, 3]);
@@ -22,12 +21,8 @@ fn main() {
 
     unsafe {
         let pointer = x.as_ptr();
-        let pointers =  x4([
-            pointer.offset(0),
-            pointer.offset(1),
-            pointer.offset(2),
-            pointer.offset(3)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(1), pointer.offset(2), pointer.offset(3)]);
         let result = simd_gather(default, pointers, mask);
         assert_eq!(result, expected);
     }
@@ -39,12 +34,8 @@ fn main() {
 
     unsafe {
         let pointer = x.as_ptr();
-        let pointers =  x4([
-            pointer.offset(0),
-            pointer.offset(1),
-            pointer.offset(2),
-            pointer.offset(3)
-        ]);
+        let pointers =
+            x4([pointer.offset(0), pointer.offset(1), pointer.offset(2), pointer.offset(3)]);
         let result = simd_gather(default, pointers, mask);
         assert_eq!(result, expected);
     }
diff --git a/tests/ui/simd/masked-load-store-build-fail.rs b/tests/ui/simd/masked-load-store-build-fail.rs
index b8742184eb0..ad2de556103 100644
--- a/tests/ui/simd/masked-load-store-build-fail.rs
+++ b/tests/ui/simd/masked-load-store-build-fail.rs
@@ -1,12 +1,7 @@
 //@ build-fail
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-
-#[rustc_intrinsic]
-unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
+use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
@@ -17,60 +12,28 @@ fn main() {
         let mut arr = [4u8, 5, 6, 7];
         let default = Simd::<u8, 4>([9; 4]);
 
-        simd_masked_load(
-            Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]),
-            arr.as_ptr(),
-            default
-        );
-        //~^^^^^ ERROR expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
+        simd_masked_load(Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]), arr.as_ptr(), default);
+        //~^ ERROR expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
 
-        simd_masked_load(
-            Simd::<i8, 4>([-1, 0, -1, -1]),
-            arr.as_ptr() as *const i8,
-            default
-        );
-        //~^^^^^ ERROR expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
+        simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr() as *const i8, default);
+        //~^ ERROR expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
 
-        simd_masked_load(
-            Simd::<i8, 4>([-1, 0, -1, -1]),
-            arr.as_ptr(),
-            Simd::<u32, 4>([9; 4])
-        );
-        //~^^^^^ ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
+        simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u32, 4>([9; 4]));
+        //~^ ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
 
-        simd_masked_load(
-            Simd::<u8, 4>([1, 0, 1, 1]),
-            arr.as_ptr(),
-            default
-        );
-        //~^^^^^ ERROR expected element type `u8` of third argument `Simd<u8, 4>` to be a signed integer type
+        simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
+        //~^ ERROR expected element type `u8` of third argument `Simd<u8, 4>` to be a signed integer type
 
-        simd_masked_store(
-            Simd([-1i8; 4]),
-            arr.as_ptr(),
-            Simd([5u32; 4])
-        );
-        //~^^^^^ ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
+        simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u32; 4]));
+        //~^ ERROR expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
 
-        simd_masked_store(
-            Simd([-1i8; 4]),
-            arr.as_ptr(),
-            Simd([5u8; 4])
-        );
-        //~^^^^^ ERROR expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
+        simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u8; 4]));
+        //~^ ERROR expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
 
-        simd_masked_store(
-            Simd([-1i8; 4]),
-            arr.as_mut_ptr(),
-            Simd([5u8; 2])
-        );
-        //~^^^^^ ERROR expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
+        simd_masked_store(Simd([-1i8; 4]), arr.as_mut_ptr(), Simd([5u8; 2]));
+        //~^ ERROR expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
 
-        simd_masked_store(
-            Simd([1u32; 4]),
-            arr.as_mut_ptr(),
-            Simd([5u8; 4])
-        );
-        //~^^^^^ ERROR expected element type `u8` of third argument `Simd<u32, 4>` to be a signed integer type
+        simd_masked_store(Simd([1u32; 4]), arr.as_mut_ptr(), Simd([5u8; 4]));
+        //~^ ERROR expected element type `u8` of third argument `Simd<u32, 4>` to be a signed integer type
     }
 }
diff --git a/tests/ui/simd/masked-load-store-build-fail.stderr b/tests/ui/simd/masked-load-store-build-fail.stderr
index 8a8d8eb99e2..d57e0aa539f 100644
--- a/tests/ui/simd/masked-load-store-build-fail.stderr
+++ b/tests/ui/simd/masked-load-store-build-fail.stderr
@@ -1,82 +1,50 @@
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
-  --> $DIR/masked-load-store-build-fail.rs:20:9
+  --> $DIR/masked-load-store-build-fail.rs:15:9
    |
-LL | /         simd_masked_load(
-LL | |             Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]),
-LL | |             arr.as_ptr(),
-LL | |             default
-LL | |         );
-   | |_________^
+LL |         simd_masked_load(Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]), arr.as_ptr(), default);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
-  --> $DIR/masked-load-store-build-fail.rs:27:9
+  --> $DIR/masked-load-store-build-fail.rs:18:9
    |
-LL | /         simd_masked_load(
-LL | |             Simd::<i8, 4>([-1, 0, -1, -1]),
-LL | |             arr.as_ptr() as *const i8,
-LL | |             default
-LL | |         );
-   | |_________^
+LL |         simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr() as *const i8, default);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
-  --> $DIR/masked-load-store-build-fail.rs:34:9
+  --> $DIR/masked-load-store-build-fail.rs:21:9
    |
-LL | /         simd_masked_load(
-LL | |             Simd::<i8, 4>([-1, 0, -1, -1]),
-LL | |             arr.as_ptr(),
-LL | |             Simd::<u32, 4>([9; 4])
-LL | |         );
-   | |_________^
+LL |         simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u32, 4>([9; 4]));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of third argument `Simd<u8, 4>` to be a signed integer type
-  --> $DIR/masked-load-store-build-fail.rs:41:9
+  --> $DIR/masked-load-store-build-fail.rs:24:9
    |
-LL | /         simd_masked_load(
-LL | |             Simd::<u8, 4>([1, 0, 1, 1]),
-LL | |             arr.as_ptr(),
-LL | |             default
-LL | |         );
-   | |_________^
+LL |         simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
-  --> $DIR/masked-load-store-build-fail.rs:48:9
+  --> $DIR/masked-load-store-build-fail.rs:27:9
    |
-LL | /         simd_masked_store(
-LL | |             Simd([-1i8; 4]),
-LL | |             arr.as_ptr(),
-LL | |             Simd([5u32; 4])
-LL | |         );
-   | |_________^
+LL |         simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u32; 4]));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
-  --> $DIR/masked-load-store-build-fail.rs:55:9
+  --> $DIR/masked-load-store-build-fail.rs:30:9
    |
-LL | /         simd_masked_store(
-LL | |             Simd([-1i8; 4]),
-LL | |             arr.as_ptr(),
-LL | |             Simd([5u8; 4])
-LL | |         );
-   | |_________^
+LL |         simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u8; 4]));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
-  --> $DIR/masked-load-store-build-fail.rs:62:9
+  --> $DIR/masked-load-store-build-fail.rs:33:9
    |
-LL | /         simd_masked_store(
-LL | |             Simd([-1i8; 4]),
-LL | |             arr.as_mut_ptr(),
-LL | |             Simd([5u8; 2])
-LL | |         );
-   | |_________^
+LL |         simd_masked_store(Simd([-1i8; 4]), arr.as_mut_ptr(), Simd([5u8; 2]));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of third argument `Simd<u32, 4>` to be a signed integer type
-  --> $DIR/masked-load-store-build-fail.rs:69:9
+  --> $DIR/masked-load-store-build-fail.rs:36:9
    |
-LL | /         simd_masked_store(
-LL | |             Simd([1u32; 4]),
-LL | |             arr.as_mut_ptr(),
-LL | |             Simd([5u8; 4])
-LL | |         );
-   | |_________^
+LL |         simd_masked_store(Simd([1u32; 4]), arr.as_mut_ptr(), Simd([5u8; 4]));
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 8 previous errors
 
diff --git a/tests/ui/simd/masked-load-store-check-fail.rs b/tests/ui/simd/masked-load-store-check-fail.rs
index 0f36bf6443f..3ed47cd9ed4 100644
--- a/tests/ui/simd/masked-load-store-check-fail.rs
+++ b/tests/ui/simd/masked-load-store-check-fail.rs
@@ -1,11 +1,7 @@
 //@ check-fail
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-#[rustc_intrinsic]
-unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
+use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
@@ -16,18 +12,11 @@ fn main() {
         let mut arr = [4u8, 5, 6, 7];
         let default = Simd::<u8, 4>([9; 4]);
 
-        let _x: Simd<u8, 2> = simd_masked_load(
-            Simd::<i8, 4>([-1, 0, -1, -1]),
-            arr.as_ptr(),
-            Simd::<u8, 4>([9; 4])
-        );
-        //~^^ ERROR mismatched types
+        let _x: Simd<u8, 2> =
+            simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u8, 4>([9; 4]));
+        //~^ ERROR mismatched types
 
-        let _x: Simd<u32, 4> = simd_masked_load(
-            Simd::<u8, 4>([1, 0, 1, 1]),
-            arr.as_ptr(),
-            default
-        );
-        //~^^ ERROR mismatched types
+        let _x: Simd<u32, 4> = simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
+        //~^ ERROR mismatched types
     }
 }
diff --git a/tests/ui/simd/masked-load-store-check-fail.stderr b/tests/ui/simd/masked-load-store-check-fail.stderr
index fa65798fc94..1c9f9d246df 100644
--- a/tests/ui/simd/masked-load-store-check-fail.stderr
+++ b/tests/ui/simd/masked-load-store-check-fail.stderr
@@ -1,58 +1,38 @@
 error[E0308]: mismatched types
-  --> $DIR/masked-load-store-check-fail.rs:22:13
+  --> $DIR/masked-load-store-check-fail.rs:16:76
    |
-LL |         let _x: Simd<u8, 2> = simd_masked_load(
-   |                               ---------------- arguments to this function are incorrect
-...
-LL |             Simd::<u8, 4>([9; 4])
-   |             ^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4`
+LL |             simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u8, 4>([9; 4]));
+   |             ---------------- arguments to this function are incorrect      ^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4`
    |
    = note: expected struct `Simd<_, 2>`
               found struct `Simd<_, 4>`
 help: the return type of this call is `Simd<u8, 4>` due to the type of the argument passed
-  --> $DIR/masked-load-store-check-fail.rs:19:31
+  --> $DIR/masked-load-store-check-fail.rs:16:13
    |
-LL |           let _x: Simd<u8, 2> = simd_masked_load(
-   |  _______________________________^
-LL | |             Simd::<i8, 4>([-1, 0, -1, -1]),
-LL | |             arr.as_ptr(),
-LL | |             Simd::<u8, 4>([9; 4])
-   | |             --------------------- this argument influences the return type of `simd_masked_load`
-LL | |         );
-   | |_________^
+LL |             simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u8, 4>([9; 4]));
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------^
+   |                                                                            |
+   |                                                                            this argument influences the return type of `simd_masked_load`
 note: function defined here
-  --> $DIR/masked-load-store-check-fail.rs:5:11
-   |
-LL | unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-   |           ^^^^^^^^^^^^^^^^                               ---------
+  --> $SRC_DIR/core/src/intrinsics/simd.rs:LL:COL
 
 error[E0308]: mismatched types
-  --> $DIR/masked-load-store-check-fail.rs:29:13
+  --> $DIR/masked-load-store-check-fail.rs:19:92
    |
-LL |         let _x: Simd<u32, 4> = simd_masked_load(
-   |                                ---------------- arguments to this function are incorrect
-...
-LL |             default
-   |             ^^^^^^^ expected `Simd<u32, 4>`, found `Simd<u8, 4>`
+LL |         let _x: Simd<u32, 4> = simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
+   |                                ---------------- arguments to this function are incorrect   ^^^^^^^ expected `Simd<u32, 4>`, found `Simd<u8, 4>`
    |
    = note: expected struct `Simd<u32, _>`
               found struct `Simd<u8, _>`
 help: the return type of this call is `Simd<u8, 4>` due to the type of the argument passed
-  --> $DIR/masked-load-store-check-fail.rs:26:32
+  --> $DIR/masked-load-store-check-fail.rs:19:32
    |
-LL |           let _x: Simd<u32, 4> = simd_masked_load(
-   |  ________________________________^
-LL | |             Simd::<u8, 4>([1, 0, 1, 1]),
-LL | |             arr.as_ptr(),
-LL | |             default
-   | |             ------- this argument influences the return type of `simd_masked_load`
-LL | |         );
-   | |_________^
+LL |         let _x: Simd<u32, 4> = simd_masked_load(Simd::<u8, 4>([1, 0, 1, 1]), arr.as_ptr(), default);
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^
+   |                                                                                            |
+   |                                                                                            this argument influences the return type of `simd_masked_load`
 note: function defined here
-  --> $DIR/masked-load-store-check-fail.rs:5:11
-   |
-LL | unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-   |           ^^^^^^^^^^^^^^^^                               ---------
+  --> $SRC_DIR/core/src/intrinsics/simd.rs:LL:COL
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/simd/masked-load-store.rs b/tests/ui/simd/masked-load-store.rs
index 4b4195f51f1..69ea76581ee 100644
--- a/tests/ui/simd/masked-load-store.rs
+++ b/tests/ui/simd/masked-load-store.rs
@@ -1,11 +1,7 @@
 //@ run-pass
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 
-#[rustc_intrinsic]
-unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
-
-#[rustc_intrinsic]
-unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T) -> ();
+use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
@@ -16,11 +12,8 @@ fn main() {
         let a = Simd::<u8, 4>([0, 1, 2, 3]);
         let b_src = [4u8, 5, 6, 7];
         let b_default = Simd::<u8, 4>([9; 4]);
-        let b: Simd::<u8, 4> = simd_masked_load(
-            Simd::<i8, 4>([-1, 0, -1, -1]),
-            b_src.as_ptr(),
-            b_default
-        );
+        let b: Simd<u8, 4> =
+            simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), b_src.as_ptr(), b_default);
 
         assert_eq!(&b.0, &[4, 9, 6, 7]);
 
diff --git a/tests/ui/simd/monomorphize-shuffle-index.generic.stderr b/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
index 8d4bf1e0533..b0742bc5ef8 100644
--- a/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
+++ b/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
@@ -1,5 +1,5 @@
 error: overly complex generic constant
-  --> $DIR/monomorphize-shuffle-index.rs:32:51
+  --> $DIR/monomorphize-shuffle-index.rs:36:51
    |
 LL |         return simd_shuffle_const_generic::<_, _, { &Self::I.0 }>(a, b);
    |                                                   ^^----------^^
diff --git a/tests/ui/simd/monomorphize-shuffle-index.rs b/tests/ui/simd/monomorphize-shuffle-index.rs
index 026193e6af6..3a074dfd432 100644
--- a/tests/ui/simd/monomorphize-shuffle-index.rs
+++ b/tests/ui/simd/monomorphize-shuffle-index.rs
@@ -1,19 +1,23 @@
+//@ revisions: old generic generic_with_fn
 //@[old]run-pass
 //@[generic_with_fn]run-pass
-//@ revisions: old generic generic_with_fn
-#![feature(repr_simd, intrinsics, adt_const_params, unsized_const_params, generic_const_exprs)]
+#![feature(
+    repr_simd,
+    core_intrinsics,
+    intrinsics,
+    adt_const_params,
+    unsized_const_params,
+    generic_const_exprs
+)]
 #![allow(incomplete_features)]
 
-
-#[rustc_intrinsic]
 #[cfg(old)]
-unsafe fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
+use std::intrinsics::simd::simd_shuffle;
 
-#[rustc_intrinsic]
 #[cfg(any(generic, generic_with_fn))]
+#[rustc_intrinsic]
 unsafe fn simd_shuffle_const_generic<T, U, const I: &'static [u32]>(a: T, b: T) -> U;
 
-
 #[derive(Copy, Clone)]
 #[repr(simd)]
 struct Simd<T, const N: usize>([T; N]);
diff --git a/tests/ui/simd/repr_packed.rs b/tests/ui/simd/repr_packed.rs
index a666892226e..cc54477ae71 100644
--- a/tests/ui/simd/repr_packed.rs
+++ b/tests/ui/simd/repr_packed.rs
@@ -1,8 +1,10 @@
 //@ run-pass
 
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
 
+use std::intrinsics::simd::simd_add;
+
 #[repr(simd, packed)]
 struct Simd<T, const N: usize>([T; N]);
 
@@ -22,9 +24,6 @@ fn check_ty<T>() {
     check_size_align::<T, 15>();
 }
 
-#[rustc_intrinsic]
-unsafe fn simd_add<T>(a: T, b: T) -> T;
-
 fn main() {
     check_ty::<u8>();
     check_ty::<i16>();
diff --git a/tests/ui/simd/shuffle.rs b/tests/ui/simd/shuffle.rs
index 2cae5a1e7de..cd270edcf00 100644
--- a/tests/ui/simd/shuffle.rs
+++ b/tests/ui/simd/shuffle.rs
@@ -2,14 +2,13 @@
 //@ revisions: opt noopt
 //@[noopt] compile-flags: -Copt-level=0
 //@[opt] compile-flags: -O
-#![feature(repr_simd, intrinsics)]
+#![feature(repr_simd, core_intrinsics)]
 #![allow(incomplete_features)]
 #![feature(adt_const_params)]
 
 use std::marker::ConstParamTy;
 
-#[rustc_intrinsic]
-unsafe fn simd_shuffle<T, I, U>(a: T, b: T, i: I) -> U;
+use std::intrinsics::simd::simd_shuffle;
 
 #[derive(Copy, Clone, ConstParamTy, PartialEq, Eq)]
 #[repr(simd)]
diff --git a/tests/ui/simd/simd-bitmask-notpow2.rs b/tests/ui/simd/simd-bitmask-notpow2.rs
index d7572ef4a2a..4935097065e 100644
--- a/tests/ui/simd/simd-bitmask-notpow2.rs
+++ b/tests/ui/simd/simd-bitmask-notpow2.rs
@@ -2,14 +2,9 @@
 // FIXME: broken codegen on big-endian (https://github.com/rust-lang/rust/issues/127205)
 // This should be merged into `simd-bitmask` once that's fixed.
 //@ ignore-endian-big
-#![feature(repr_simd, intrinsics)]
-
-#[rustc_intrinsic]
-unsafe fn simd_bitmask<T, U>(v: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_select_bitmask<T, U>(m: T, a: U, b: U) -> U;
+#![feature(repr_simd, core_intrinsics)]
 
+use std::intrinsics::simd::{simd_bitmask, simd_select_bitmask};
 
 fn main() {
     // Non-power-of-2 multi-byte mask.
diff --git a/tests/ui/simd/simd-bitmask.rs b/tests/ui/simd/simd-bitmask.rs
index 4275ab0f40c..6fcceeaa24b 100644
--- a/tests/ui/simd/simd-bitmask.rs
+++ b/tests/ui/simd/simd-bitmask.rs
@@ -1,12 +1,7 @@
 //@run-pass
-#![feature(repr_simd, intrinsics)]
-
-#[rustc_intrinsic]
-unsafe fn simd_bitmask<T, U>(v: T) -> U;
-
-#[rustc_intrinsic]
-unsafe fn simd_select_bitmask<T, U>(m: T, a: U, b: U) -> U;
+#![feature(repr_simd, core_intrinsics)]
 
+use std::intrinsics::simd::{simd_bitmask, simd_select_bitmask};
 
 #[derive(Copy, Clone)]
 #[repr(simd)]
diff --git a/tests/ui/static/static_sized_requirement.rs b/tests/ui/static/static_sized_requirement.rs
index 80f93dea054..25e1359607c 100644
--- a/tests/ui/static/static_sized_requirement.rs
+++ b/tests/ui/static/static_sized_requirement.rs
@@ -1,11 +1,12 @@
-//@ build-pass (FIXME(62277): could be check-pass?)
+//@ add-core-stubs
+//@ check-pass
 
 #![feature(no_core, lang_items)]
 #![no_core]
 #![crate_type = "lib"]
 
-#[lang = "sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 extern "C" {
     pub static A: u32;
diff --git a/tests/ui/target-feature/no-llvm-leaks.rs b/tests/ui/target-feature/no-llvm-leaks.rs
index d4f70fe7069..50544b97a96 100644
--- a/tests/ui/target-feature/no-llvm-leaks.rs
+++ b/tests/ui/target-feature/no-llvm-leaks.rs
@@ -1,3 +1,4 @@
+//@ add-core-stubs
 //@ revisions: aarch64 x86-64
 //@ [aarch64] compile-flags: -Ctarget-feature=+neon,+fp16,+fhm --target=aarch64-unknown-linux-gnu
 //@ [aarch64] needs-llvm-components: aarch64
@@ -9,12 +10,8 @@
 #![feature(intrinsics, rustc_attrs, no_core, lang_items, staged_api)]
 #![stable(feature = "test", since = "1.0.0")]
 
-// Supporting minimal rust core code
-#[lang = "sized"]
-trait Sized {}
-#[lang = "copy"]
-trait Copy {}
-impl Copy for bool {}
+extern crate minicore;
+use minicore::*;
 
 #[stable(feature = "test", since = "1.0.0")]
 #[rustc_const_stable(feature = "test", since = "1.0.0")]
diff --git a/tests/ui/target-feature/tied-features.rs b/tests/ui/target-feature/tied-features.rs
index c6cdf21a3e3..9aa5291e68c 100644
--- a/tests/ui/target-feature/tied-features.rs
+++ b/tests/ui/target-feature/tied-features.rs
@@ -1,10 +1,11 @@
+//@ add-core-stubs
 //@ compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
 //@ needs-llvm-components: aarch64
 #![feature(no_core, lang_items)]
 #![no_core]
 
-#[lang="sized"]
-trait Sized {}
+extern crate minicore;
+use minicore::*;
 
 pub fn main() {
     #[target_feature(enable = "pacg")]
diff --git a/tests/ui/target-feature/tied-features.stderr b/tests/ui/target-feature/tied-features.stderr
index 8d677735e84..49df4f109ba 100644
--- a/tests/ui/target-feature/tied-features.stderr
+++ b/tests/ui/target-feature/tied-features.stderr
@@ -1,5 +1,5 @@
 error: the target features paca, pacg must all be either enabled or disabled together
-  --> $DIR/tied-features.rs:10:5
+  --> $DIR/tied-features.rs:11:5
    |
 LL |     #[target_feature(enable = "pacg")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL |     #[target_feature(enable = "pacg")]
    = help: add the missing features in a `target_feature` attribute
 
 error: the target features paca, pacg must all be either enabled or disabled together
-  --> $DIR/tied-features.rs:22:1
+  --> $DIR/tied-features.rs:23:1
    |
 LL | #[target_feature(enable = "paca")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL | #[target_feature(enable = "paca")]
    = help: add the missing features in a `target_feature` attribute
 
 error: the target features paca, pacg must all be either enabled or disabled together
-  --> $DIR/tied-features.rs:35:1
+  --> $DIR/tied-features.rs:36:1
    |
 LL | #[target_feature(enable = "paca")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/unsafe-binders/binder-sized-crit.rs b/tests/ui/unsafe-binders/binder-sized-crit.rs
new file mode 100644
index 00000000000..37677c0ef69
--- /dev/null
+++ b/tests/ui/unsafe-binders/binder-sized-crit.rs
@@ -0,0 +1,18 @@
+//@ check-pass
+
+#![feature(unsafe_binders)]
+//~^ WARN the feature `unsafe_binders` is incomplete
+
+use std::unsafe_binder::wrap_binder;
+
+struct A {
+    b: unsafe<> (),
+}
+
+fn main() {
+    unsafe {
+        let _ = A {
+            b: wrap_binder!(()),
+        };
+    }
+}
diff --git a/tests/ui/unsafe-binders/binder-sized-crit.stderr b/tests/ui/unsafe-binders/binder-sized-crit.stderr
new file mode 100644
index 00000000000..3ba6cf2ef8c
--- /dev/null
+++ b/tests/ui/unsafe-binders/binder-sized-crit.stderr
@@ -0,0 +1,11 @@
+warning: the feature `unsafe_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/binder-sized-crit.rs:3:12
+   |
+LL | #![feature(unsafe_binders)]
+   |            ^^^^^^^^^^^^^^
+   |
+   = note: see issue #130516 <https://github.com/rust-lang/rust/issues/130516> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+