about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/codegen/vec-iter.rs17
-rw-r--r--tests/codegen/vecdeque-drain.rs69
-rw-r--r--tests/coverage/closure_unit_return.cov-map34
-rw-r--r--tests/coverage/closure_unit_return.coverage30
-rw-r--r--tests/coverage/closure_unit_return.rs29
-rw-r--r--tests/coverage/coverage_attr_closure.cov-map8
-rw-r--r--tests/coverage/coverage_attr_closure.coverage8
-rw-r--r--tests/coverage/inline-dead.cov-map6
-rw-r--r--tests/coverage/macro_name_span.cov-map4
-rw-r--r--tests/coverage/macro_name_span.coverage2
-rw-r--r--tests/coverage/no_spans.cov-map8
-rw-r--r--tests/coverage/no_spans.coverage2
-rw-r--r--tests/coverage/no_spans_if_not.cov-map12
-rw-r--r--tests/coverage/no_spans_if_not.coverage8
-rw-r--r--tests/coverage/unicode.cov-map8
-rw-r--r--tests/coverage/unicode.coverage3
-rw-r--r--tests/debuginfo/mutex.rs2
-rw-r--r--tests/debuginfo/rwlock-read.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/enum.rs2
-rw-r--r--tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir8
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir78
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir78
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir104
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir104
-rw-r--r--tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs4
-rw-r--r--tests/rustdoc-gui/mobile-crate-name.goml22
-rw-r--r--tests/rustdoc-gui/type-declation-overflow.goml4
-rw-r--r--tests/rustdoc/bounds.rs (renamed from tests/rustdoc/bounds-in-multiple-parts.rs)12
-rw-r--r--tests/rustdoc/const-generics/generic_const_exprs.rs2
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs6
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs5
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-1.rs15
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-2.rs16
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-3.rs16
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.rs13
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.stderr8
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr9
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs14
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr50
-rw-r--r--tests/ui-fulldeps/stable-mir/compilation-result.rs2
-rw-r--r--tests/ui/abi/statics/static-mut-foreign.rs4
-rw-r--r--tests/ui/abi/statics/static-mut-foreign.stderr22
-rw-r--r--tests/ui/anon-params/anon-params-edition-hygiene.rs4
-rw-r--r--tests/ui/anon-params/anon-params-edition-hygiene.stderr23
-rw-r--r--tests/ui/asm/bad-arch.stderr2
-rw-r--r--tests/ui/associated-consts/defaults-cyclic-fail.stderr2
-rw-r--r--tests/ui/associated-consts/defaults-not-assumed-fail.stderr8
-rw-r--r--tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs4
-rw-r--r--tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr16
-rw-r--r--tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr14
-rw-r--r--tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs4
-rw-r--r--tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr16
-rw-r--r--tests/ui/async-await/async-fn/auxiliary/block-on.rs20
-rw-r--r--tests/ui/async-await/async-fn/simple.rs7
-rw-r--r--tests/ui/async-await/for-await-passthrough.rs2
-rw-r--r--tests/ui/async-await/issue-72442.stderr5
-rw-r--r--tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs2
-rw-r--r--tests/ui/auto-traits/issue-117789.rs2
-rw-r--r--tests/ui/auto-traits/issue-117789.stderr4
-rw-r--r--tests/ui/auto-traits/issue-83857-ub.rs1
-rw-r--r--tests/ui/auto-traits/issue-83857-ub.stderr12
-rw-r--r--tests/ui/auto-traits/suspicious-impls-lint.rs50
-rw-r--r--tests/ui/auto-traits/suspicious-impls-lint.stderr82
-rw-r--r--tests/ui/auto-traits/suspicious-negative-impls-lint.rs21
-rw-r--r--tests/ui/auto-traits/suspicious-negative-impls-lint.stderr52
-rw-r--r--tests/ui/borrowck/borrowck-access-permissions.rs2
-rw-r--r--tests/ui/borrowck/borrowck-access-permissions.stderr12
-rw-r--r--tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs2
-rw-r--r--tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr12
-rw-r--r--tests/ui/borrowck/issue-20801.rs2
-rw-r--r--tests/ui/borrowck/issue-20801.stderr12
-rw-r--r--tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs6
-rw-r--r--tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr32
-rw-r--r--tests/ui/check-cfg/cargo-feature.rs2
-rw-r--r--tests/ui/check-cfg/diagnotics.rs4
-rw-r--r--tests/ui/check-static-values-constraints.stderr22
-rw-r--r--tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs2
-rw-r--r--tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr18
-rw-r--r--tests/ui/coherence/coherence-fn-implied-bounds.rs2
-rw-r--r--tests/ui/coherence/coherence-fn-implied-bounds.stderr2
-rw-r--r--tests/ui/coherence/coherence-free-vs-bound-region.rs2
-rw-r--r--tests/ui/coherence/coherence-free-vs-bound-region.stderr2
-rw-r--r--tests/ui/coherence/coherence-orphan.rs12
-rw-r--r--tests/ui/coherence/coherence-orphan.stderr25
-rw-r--r--tests/ui/coherence/coherence-overlap-negative-impls.rs13
-rw-r--r--tests/ui/coherence/coherence-subtyping.rs4
-rw-r--r--tests/ui/coherence/coherence-subtyping.stderr2
-rw-r--r--tests/ui/coherence/coherence-wasm-bindgen.rs2
-rw-r--r--tests/ui/coherence/coherence-wasm-bindgen.stderr2
-rw-r--r--tests/ui/coherence/coherent-due-to-fulfill.rs20
-rw-r--r--tests/ui/coherence/const-errs-dont-conflict-103369.rs14
-rw-r--r--tests/ui/coherence/const-errs-dont-conflict-103369.stderr39
-rw-r--r--tests/ui/coherence/incoherent-even-though-we-fulfill.rs22
-rw-r--r--tests/ui/coherence/incoherent-even-though-we-fulfill.stderr14
-rw-r--r--tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr2
-rw-r--r--tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs2
-rw-r--r--tests/ui/coherence/occurs-check/associated-type.next.stderr8
-rw-r--r--tests/ui/coherence/occurs-check/associated-type.old.stderr8
-rw-r--r--tests/ui/const-generics/invariant.rs10
-rw-r--r--tests/ui/const-generics/invariant.stderr4
-rw-r--r--tests/ui/const-generics/issues/issue-100313.rs1
-rw-r--r--tests/ui/const-generics/issues/issue-100313.stderr13
-rw-r--r--tests/ui/consts/const-array-oob.rs3
-rw-r--r--tests/ui/consts/const-array-oob.stderr10
-rw-r--r--tests/ui/consts/const-err2.noopt.stderr48
-rw-r--r--tests/ui/consts/const-err2.opt.stderr48
-rw-r--r--tests/ui/consts/const-err2.opt_with_overflow_checks.stderr48
-rw-r--r--tests/ui/consts/const-err2.rs39
-rw-r--r--tests/ui/consts/const-eval/const-eval-query-stack.stderr3
-rw-r--r--tests/ui/consts/const-eval/const_fn_ptr.stderr10
-rw-r--r--tests/ui/consts/const-eval/generic-slice.stderr28
-rw-r--r--tests/ui/consts/const-eval/issue-44578.stderr8
-rw-r--r--tests/ui/consts/const-eval/issue-50814.rs1
-rw-r--r--tests/ui/consts/const-eval/issue-50814.stderr22
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.rs2
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr32
-rw-r--r--tests/ui/consts/const-mut-refs/issue-76510.rs1
-rw-r--r--tests/ui/consts/const-mut-refs/issue-76510.stderr12
-rw-r--r--tests/ui/consts/const-ref-to-static-linux-vtable.rs43
-rw-r--r--tests/ui/consts/const_cmp_type_id.stderr12
-rw-r--r--tests/ui/consts/const_let_assign2.rs2
-rw-r--r--tests/ui/consts/const_let_assign2.stderr12
-rw-r--r--tests/ui/consts/const_let_assign3.stderr16
-rw-r--r--tests/ui/consts/const_refs_to_static_fail_invalid.rs6
-rw-r--r--tests/ui/consts/const_refs_to_static_fail_invalid.stderr26
-rw-r--r--tests/ui/consts/fn_trait_refs.stderr36
-rw-r--r--tests/ui/consts/issue-16538.stderr18
-rw-r--r--tests/ui/consts/issue-17718-const-bad-values.rs3
-rw-r--r--tests/ui/consts/issue-17718-const-bad-values.stderr12
-rw-r--r--tests/ui/consts/issue-66693.rs4
-rw-r--r--tests/ui/consts/issue-66693.stderr19
-rw-r--r--tests/ui/consts/miri_unleashed/box.stderr2
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs2
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr36
-rw-r--r--tests/ui/consts/miri_unleashed/extern-static.rs2
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references.rs15
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references.stderr48
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr64
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr64
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references_err.rs13
-rw-r--r--tests/ui/consts/mut-ptr-to-static.rs40
-rw-r--r--tests/ui/consts/overflowing-consts.noopt.stderr1023
-rw-r--r--tests/ui/consts/overflowing-consts.opt.stderr1023
-rw-r--r--tests/ui/consts/overflowing-consts.opt_with_overflow_checks.stderr1023
-rw-r--r--tests/ui/consts/overflowing-consts.rs288
-rw-r--r--tests/ui/consts/promote-not.stderr40
-rw-r--r--tests/ui/consts/promoted_const_call2.stderr12
-rw-r--r--tests/ui/consts/promotion.rs3
-rw-r--r--tests/ui/consts/qualif-indirect-mutation-fail.stderr51
-rw-r--r--tests/ui/consts/recursive-zst-static.default.stderr12
-rw-r--r--tests/ui/consts/recursive-zst-static.unleash.stderr12
-rw-r--r--tests/ui/consts/static-promoted-to-mutable-static.rs21
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref.rs2
-rw-r--r--tests/ui/consts/static_mut_containing_mut_ref2.rs2
-rw-r--r--tests/ui/coroutine/async_gen_fn_iter.rs1
-rw-r--r--tests/ui/crate-loading/missing-std.rs2
-rw-r--r--tests/ui/did_you_mean/bad-assoc-ty.stderr9
-rw-r--r--tests/ui/drop/issue-23338-ensure-param-drop-order.rs2
-rw-r--r--tests/ui/drop/issue-23338-ensure-param-drop-order.stderr12
-rw-r--r--tests/ui/drop/repeat-drop-2.stderr18
-rw-r--r--tests/ui/editions/edition-keywords-2018-2018-parsing.rs4
-rw-r--r--tests/ui/editions/edition-keywords-2018-2018-parsing.stderr6
-rw-r--r--tests/ui/error-codes/E0017.rs14
-rw-r--r--tests/ui/error-codes/E0017.stderr61
-rw-r--r--tests/ui/error-codes/E0093.stderr2
-rw-r--r--tests/ui/error-codes/E0388.rs10
-rw-r--r--tests/ui/error-codes/E0388.stderr26
-rw-r--r--tests/ui/error-codes/E0396.stderr32
-rw-r--r--tests/ui/error-should-say-copy-not-pod.stderr5
-rw-r--r--tests/ui/extern-flag/empty-extern-arg.stderr9
-rw-r--r--tests/ui/extern/issue-28324.rs1
-rw-r--r--tests/ui/extern/issue-28324.stderr11
-rw-r--r--tests/ui/feature-gates/feature-gate-abi.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-intrinsics.stderr4
-rw-r--r--tests/ui/fmt/format-args-capture-first-literal-is-macro.rs2
-rw-r--r--tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr8
-rw-r--r--tests/ui/fmt/ifmt-unimpl.stderr2
-rw-r--r--tests/ui/generic-associated-types/issue-79636-1.rs1
-rw-r--r--tests/ui/generic-associated-types/issue-79636-1.stderr17
-rw-r--r--tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs2
-rw-r--r--tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr13
-rw-r--r--tests/ui/impl-trait/rpit/early_bound.rs1
-rw-r--r--tests/ui/impl-trait/rpit/early_bound.stderr14
-rw-r--r--tests/ui/impl-trait/where-allowed.rs1
-rw-r--r--tests/ui/impl-trait/where-allowed.stderr86
-rw-r--r--tests/ui/inference/issue-80409.no-compat.stderr12
-rw-r--r--tests/ui/inference/issue-80409.rs1
-rw-r--r--tests/ui/intrinsics-always-extern.stderr2
-rw-r--r--tests/ui/intrinsics/safe-intrinsic-mismatch.rs8
-rw-r--r--tests/ui/intrinsics/safe-intrinsic-mismatch.stderr21
-rw-r--r--tests/ui/issues/issue-106755.rs2
-rw-r--r--tests/ui/issues/issue-106755.stderr18
-rw-r--r--tests/ui/issues/issue-17252.rs1
-rw-r--r--tests/ui/issues/issue-17252.stderr21
-rw-r--r--tests/ui/issues/issue-23302-enum-infinite-recursion/issue-23302-3.stderr10
-rw-r--r--tests/ui/issues/issue-23611-enum-swap-in-drop.rs2
-rw-r--r--tests/ui/issues/issue-23611-enum-swap-in-drop.stderr12
-rw-r--r--tests/ui/issues/issue-30123.stderr5
-rw-r--r--tests/ui/issues/issue-54410.rs2
-rw-r--r--tests/ui/issues/issue-54410.stderr12
-rw-r--r--tests/ui/issues/issue-76191.rs1
-rw-r--r--tests/ui/issues/issue-76191.stderr17
-rw-r--r--tests/ui/lazy-type-alias/constrained-late-bound-regions.rs15
-rw-r--r--tests/ui/lazy-type-alias/constrained-params-in-impl.rs27
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-conflicting.rs10
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-conflicting.stderr11
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-not-nominal.rs12
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-not-nominal.stderr11
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-overflow.classic.stderr43
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr38
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls-overflow.rs20
-rw-r--r--tests/ui/lazy-type-alias/inherent-impls.rs18
-rw-r--r--tests/ui/lazy-type-alias/unconstrained-late-bound-regions.rs23
-rw-r--r--tests/ui/lazy-type-alias/unconstrained-late-bound-regions.stderr22
-rw-r--r--tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.rs8
-rw-r--r--tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr9
-rw-r--r--tests/ui/lazy-type-alias/unconstrained-params-in-impl.rs12
-rw-r--r--tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr9
-rw-r--r--tests/ui/lint/issue-117949.noopt.stderr54
-rw-r--r--tests/ui/lint/issue-117949.opt.stderr54
-rw-r--r--tests/ui/lint/issue-117949.opt_with_overflow_checks.stderr54
-rw-r--r--tests/ui/lint/issue-117949.rs20
-rw-r--r--tests/ui/lint/lint-exceeding-bitshifts.noopt.stderr152
-rw-r--r--tests/ui/lint/lint-exceeding-bitshifts.opt.stderr152
-rw-r--r--tests/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr152
-rw-r--r--tests/ui/lint/lint-exceeding-bitshifts.rs79
-rw-r--r--tests/ui/lint/lint-overflowing-ops.noopt.stderr1030
-rw-r--r--tests/ui/lint/lint-overflowing-ops.opt.stderr1030
-rw-r--r--tests/ui/lint/lint-overflowing-ops.opt_with_overflow_checks.stderr1030
-rw-r--r--tests/ui/lint/lint-overflowing-ops.rs294
-rw-r--r--tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs20
-rw-r--r--tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.stderr27
-rw-r--r--tests/ui/lint/unused/lint-unused-imports.rs2
-rw-r--r--tests/ui/lint/unused/lint-unused-imports.stderr26
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs19
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr44
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs11
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr26
-rw-r--r--tests/ui/lint/wide_pointer_comparisons.rs4
-rw-r--r--tests/ui/lint/wide_pointer_comparisons.stderr14
-rw-r--r--tests/ui/liveness/liveness-consts.stderr12
-rw-r--r--tests/ui/macros/invalid-fragment-specifier.rs10
-rw-r--r--tests/ui/macros/invalid-fragment-specifier.stderr18
-rw-r--r--tests/ui/macros/issue-118786.rs4
-rw-r--r--tests/ui/macros/issue-118786.stderr10
-rw-r--r--tests/ui/macros/macro-invalid-fragment-spec.rs8
-rw-r--r--tests/ui/macros/macro-invalid-fragment-spec.stderr10
-rw-r--r--tests/ui/methods/method-on-ambiguous-numeric-type.stderr4
-rw-r--r--tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs2
-rw-r--r--tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr12
-rw-r--r--tests/ui/numbers-arithmetic/promoted_overflow_opt.rs8
-rw-r--r--tests/ui/parser/issues/issue-44406.stderr2
-rw-r--r--tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr5
-rw-r--r--tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs4
-rw-r--r--tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr6
-rw-r--r--tests/ui/precondition-checks/out-of-bounds-get-unchecked.rs2
-rw-r--r--tests/ui/proc-macro/capture-macro-rules-invoke.stdout2
-rw-r--r--tests/ui/proc-macro/custom-attr-panic.rs8
-rw-r--r--tests/ui/proc-macro/custom-attr-panic.stderr10
-rw-r--r--tests/ui/reify-intrinsic.rs5
-rw-r--r--tests/ui/reify-intrinsic.stderr11
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr22
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr55
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr89
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr16
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed16
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs12
-rw-r--r--tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr33
-rw-r--r--tests/ui/rust-2018/remove-extern-crate.fixed1
-rw-r--r--tests/ui/rust-2018/remove-extern-crate.rs1
-rw-r--r--tests/ui/rust-2018/remove-extern-crate.stderr6
-rw-r--r--tests/ui/rust-2024/prelude2024.rs9
-rw-r--r--tests/ui/span/macro-span-replacement.rs4
-rw-r--r--tests/ui/span/macro-span-replacement.stderr7
-rw-r--r--tests/ui/static/reference-of-mut-static-safe.e2021.stderr26
-rw-r--r--tests/ui/static/reference-of-mut-static-safe.e2024.stderr15
-rw-r--r--tests/ui/static/reference-of-mut-static-unsafe-fn.rs15
-rw-r--r--tests/ui/static/reference-of-mut-static-unsafe-fn.stderr70
-rw-r--r--tests/ui/static/reference-of-mut-static.e2021.stderr64
-rw-r--r--tests/ui/static/reference-of-mut-static.e2024.stderr48
-rw-r--r--tests/ui/static/reference-of-mut-static.rs26
-rw-r--r--tests/ui/static/reference-to-mut-static-safe.e2021.stderr26
-rw-r--r--tests/ui/static/reference-to-mut-static-safe.e2024.stderr15
-rw-r--r--tests/ui/static/reference-to-mut-static-safe.rs (renamed from tests/ui/static/reference-of-mut-static-safe.rs)4
-rw-r--r--tests/ui/static/reference-to-mut-static-unsafe-fn.rs26
-rw-r--r--tests/ui/static/reference-to-mut-static-unsafe-fn.stderr75
-rw-r--r--tests/ui/static/reference-to-mut-static.e2021.stderr91
-rw-r--r--tests/ui/static/reference-to-mut-static.e2024.stderr75
-rw-r--r--tests/ui/static/reference-to-mut-static.rs50
-rw-r--r--tests/ui/static/safe-extern-statics-mut.rs4
-rw-r--r--tests/ui/static/safe-extern-statics-mut.stderr22
-rw-r--r--tests/ui/static/static-drop-scope.stderr32
-rw-r--r--tests/ui/statics/issue-14227.rs1
-rw-r--r--tests/ui/statics/issue-14227.stderr11
-rw-r--r--tests/ui/statics/issue-15261.rs2
-rw-r--r--tests/ui/statics/issue-15261.stderr12
-rw-r--r--tests/ui/statics/static-mut-xc.rs4
-rw-r--r--tests/ui/statics/static-mut-xc.stderr22
-rw-r--r--tests/ui/statics/static-recursive.rs2
-rw-r--r--tests/ui/statics/static-recursive.stderr12
-rw-r--r--tests/ui/statics/uninhabited-static.rs2
-rw-r--r--tests/ui/statics/uninhabited-static.stderr31
-rw-r--r--tests/ui/suggestions/issue-84973-blacklist.stderr5
-rw-r--r--tests/ui/thread-local/thread-local-static.rs2
-rw-r--r--tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs11
-rw-r--r--tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr27
-rw-r--r--tests/ui/traits/issue-77982.stderr1
-rw-r--r--tests/ui/traits/next-solver/coherence-fulfill-overflow.rs15
-rw-r--r--tests/ui/traits/next-solver/coherence-fulfill-overflow.stderr11
-rw-r--r--tests/ui/traits/next-solver/generalize/occurs-check-nested-alias.next.stderr4
-rw-r--r--tests/ui/treat-err-as-bug/err.stderr2
-rw-r--r--tests/ui/try-trait/bad-interconversion.stderr1
-rw-r--r--tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr10
-rw-r--r--tests/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr4
-rw-r--r--tests/ui/typeck/cyclic_type_ice.rs7
-rw-r--r--tests/ui/typeck/cyclic_type_ice.stderr31
-rw-r--r--tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.rs4
-rw-r--r--tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.stderr26
-rw-r--r--tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.rs13
-rw-r--r--tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr16
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item.stderr12
-rw-r--r--tests/ui/ufcs/bad-builder.rs6
-rw-r--r--tests/ui/ufcs/bad-builder.stderr20
-rw-r--r--tests/ui/union/unnamed-fields/auxiliary/dep.rs18
-rw-r--r--tests/ui/union/unnamed-fields/restrict_type_hir.rs44
-rw-r--r--tests/ui/union/unnamed-fields/restrict_type_hir.stderr62
-rw-r--r--tests/ui/wf/issue-110157.rs3
-rw-r--r--tests/ui/wf/issue-110157.stderr25
330 files changed, 9977 insertions, 2616 deletions
diff --git a/tests/codegen/vec-iter.rs b/tests/codegen/vec-iter.rs
index 0282791e9d1..4e206858751 100644
--- a/tests/codegen/vec-iter.rs
+++ b/tests/codegen/vec-iter.rs
@@ -32,9 +32,9 @@ pub fn vec_iter_is_empty_nonnull(it: &vec::IntoIter<u8>) -> bool {
     it.is_empty()
 }
 
-// CHECK-LABEL: @vec_iter_next
+// CHECK-LABEL: @vec_iter_next_nonnull
 #[no_mangle]
-pub fn vec_iter_next(it: &mut vec::IntoIter<u8>) -> Option<u8> {
+pub fn vec_iter_next_nonnull(it: &mut vec::IntoIter<u8>) -> Option<u8> {
     // CHECK: load ptr
     // CHECK-SAME: !nonnull
     // CHECK-SAME: !noundef
@@ -44,3 +44,16 @@ pub fn vec_iter_next(it: &mut vec::IntoIter<u8>) -> Option<u8> {
     // CHECK: ret
     it.next()
 }
+
+// CHECK-LABEL: @vec_iter_next_back_nonnull
+#[no_mangle]
+pub fn vec_iter_next_back_nonnull(it: &mut vec::IntoIter<u8>) -> Option<u8> {
+    // CHECK: load ptr
+    // CHECK-SAME: !nonnull
+    // CHECK-SAME: !noundef
+    // CHECK: load ptr
+    // CHECK-SAME: !nonnull
+    // CHECK-SAME: !noundef
+    // CHECK: ret
+    it.next_back()
+}
diff --git a/tests/codegen/vecdeque-drain.rs b/tests/codegen/vecdeque-drain.rs
new file mode 100644
index 00000000000..f8263c69572
--- /dev/null
+++ b/tests/codegen/vecdeque-drain.rs
@@ -0,0 +1,69 @@
+// Check that draining at the front or back doesn't copy memory.
+
+// compile-flags: -O
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+use std::collections::VecDeque;
+
+// CHECK-LABEL: @clear
+// CHECK-NOT: call
+// CHECK-NOT: br
+// CHECK: getelementptr inbounds
+// CHECK-NEXT: {{call void @llvm.memset|store}}
+// CHECK-NEXT: ret void
+#[no_mangle]
+pub fn clear(v: &mut VecDeque<i32>) {
+    v.drain(..);
+}
+
+// CHECK-LABEL: @truncate
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK-NOT: br
+// CHECK: ret void
+#[no_mangle]
+pub fn truncate(v: &mut VecDeque<i32>, n: usize) {
+    if n < v.len() {
+        v.drain(n..);
+    }
+}
+
+// CHECK-LABEL: @advance
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK: br
+// CHECK-NOT: call
+// CHECK-NOT: br
+// CHECK: ret void
+#[no_mangle]
+pub fn advance(v: &mut VecDeque<i32>, n: usize) {
+    if n < v.len() {
+        v.drain(..n);
+    } else {
+        v.clear();
+    }
+}
+
+// CHECK-LABEL: @remove
+// CHECK: call
+// CHECK: ret void
+#[no_mangle]
+pub fn remove(v: &mut VecDeque<i32>, a: usize, b: usize) {
+    v.drain(a..b);
+}
diff --git a/tests/coverage/closure_unit_return.cov-map b/tests/coverage/closure_unit_return.cov-map
new file mode 100644
index 00000000000..c97b4a44dd6
--- /dev/null
+++ b/tests/coverage/closure_unit_return.cov-map
@@ -0,0 +1,34 @@
+Function name: closure_unit_return::explicit_unit
+Raw bytes (14): 0x[01, 01, 00, 02, 01, 07, 01, 01, 10, 01, 05, 05, 02, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 0
+Number of file 0 mappings: 2
+- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 16)
+- Code(Counter(0)) at (prev + 5, 5) to (start + 2, 2)
+
+Function name: closure_unit_return::explicit_unit::{closure#0} (unused)
+Raw bytes (9): 0x[01, 01, 00, 01, 00, 08, 16, 02, 06]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 0
+Number of file 0 mappings: 1
+- Code(Zero) at (prev + 8, 22) to (start + 2, 6)
+
+Function name: closure_unit_return::implicit_unit
+Raw bytes (14): 0x[01, 01, 00, 02, 01, 10, 01, 01, 10, 01, 05, 05, 02, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 0
+Number of file 0 mappings: 2
+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 16)
+- Code(Counter(0)) at (prev + 5, 5) to (start + 2, 2)
+
+Function name: closure_unit_return::implicit_unit::{closure#0} (unused)
+Raw bytes (9): 0x[01, 01, 00, 01, 00, 11, 16, 02, 06]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 0
+Number of file 0 mappings: 1
+- Code(Zero) at (prev + 17, 22) to (start + 2, 6)
+
diff --git a/tests/coverage/closure_unit_return.coverage b/tests/coverage/closure_unit_return.coverage
new file mode 100644
index 00000000000..1056baa385c
--- /dev/null
+++ b/tests/coverage/closure_unit_return.coverage
@@ -0,0 +1,30 @@
+   LL|       |#![feature(coverage_attribute)]
+   LL|       |// edition: 2021
+   LL|       |
+   LL|       |// Regression test for an inconsistency between functions that return the value
+   LL|       |// of their trailing expression, and functions that implicitly return `()`.
+   LL|       |
+   LL|      1|fn explicit_unit() {
+   LL|      1|    let closure = || {
+   LL|      0|        ();
+   LL|      0|    };
+   LL|       |
+   LL|      1|    drop(closure);
+   LL|      1|    () // explicit return of trailing value
+   LL|      1|}
+   LL|       |
+   LL|      1|fn implicit_unit() {
+   LL|      1|    let closure = || {
+   LL|      0|        ();
+   LL|      0|    };
+   LL|       |
+   LL|      1|    drop(closure);
+   LL|      1|    // implicit return of `()`
+   LL|      1|}
+   LL|       |
+   LL|       |#[coverage(off)]
+   LL|       |fn main() {
+   LL|       |    explicit_unit();
+   LL|       |    implicit_unit();
+   LL|       |}
+
diff --git a/tests/coverage/closure_unit_return.rs b/tests/coverage/closure_unit_return.rs
new file mode 100644
index 00000000000..d2b4ab8bd9f
--- /dev/null
+++ b/tests/coverage/closure_unit_return.rs
@@ -0,0 +1,29 @@
+#![feature(coverage_attribute)]
+// edition: 2021
+
+// Regression test for an inconsistency between functions that return the value
+// of their trailing expression, and functions that implicitly return `()`.
+
+fn explicit_unit() {
+    let closure = || {
+        ();
+    };
+
+    drop(closure);
+    () // explicit return of trailing value
+}
+
+fn implicit_unit() {
+    let closure = || {
+        ();
+    };
+
+    drop(closure);
+    // implicit return of `()`
+}
+
+#[coverage(off)]
+fn main() {
+    explicit_unit();
+    implicit_unit();
+}
diff --git a/tests/coverage/coverage_attr_closure.cov-map b/tests/coverage/coverage_attr_closure.cov-map
index 2208b28fd41..5d2c6b00b40 100644
--- a/tests/coverage/coverage_attr_closure.cov-map
+++ b/tests/coverage/coverage_attr_closure.cov-map
@@ -15,14 +15,14 @@ Number of file 0 mappings: 1
 - Code(Zero) at (prev + 29, 19) to (start + 2, 6)
 
 Function name: coverage_attr_closure::contains_closures_on
-Raw bytes (19): 0x[01, 01, 00, 03, 01, 0f, 01, 02, 05, 01, 04, 06, 02, 05, 01, 04, 06, 01, 02]
+Raw bytes (19): 0x[01, 01, 00, 03, 01, 0f, 01, 01, 1a, 01, 05, 09, 00, 1b, 01, 04, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 0
 Number of file 0 mappings: 3
-- Code(Counter(0)) at (prev + 15, 1) to (start + 2, 5)
-- Code(Counter(0)) at (prev + 4, 6) to (start + 2, 5)
-- Code(Counter(0)) at (prev + 4, 6) to (start + 1, 2)
+- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 26)
+- Code(Counter(0)) at (prev + 5, 9) to (start + 0, 27)
+- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2)
 
 Function name: coverage_attr_closure::contains_closures_on::{closure#0} (unused)
 Raw bytes (9): 0x[01, 01, 00, 01, 00, 11, 13, 02, 06]
diff --git a/tests/coverage/coverage_attr_closure.coverage b/tests/coverage/coverage_attr_closure.coverage
index 32c75b40d83..3474ad65063 100644
--- a/tests/coverage/coverage_attr_closure.coverage
+++ b/tests/coverage/coverage_attr_closure.coverage
@@ -14,13 +14,13 @@
    LL|       |#[coverage(on)]
    LL|      1|fn contains_closures_on() {
    LL|      1|    let _local_closure_on = #[coverage(on)]
-   LL|      1|    |input: &str| {
+   LL|      0|    |input: &str| {
    LL|      0|        println!("{input}");
-   LL|      1|    };
+   LL|      0|    };
    LL|      1|    let _local_closure_off = #[coverage(off)]
-   LL|      1|    |input: &str| {
+   LL|       |    |input: &str| {
    LL|       |        println!("{input}");
-   LL|      1|    };
+   LL|       |    };
    LL|      1|}
    LL|       |
    LL|       |#[coverage(off)]
diff --git a/tests/coverage/inline-dead.cov-map b/tests/coverage/inline-dead.cov-map
index c669b7245ea..f77781ca028 100644
--- a/tests/coverage/inline-dead.cov-map
+++ b/tests/coverage/inline-dead.cov-map
@@ -22,13 +22,13 @@ Number of file 0 mappings: 4
     = (Zero + (c0 - Zero))
 
 Function name: inline_dead::main
-Raw bytes (14): 0x[01, 01, 00, 02, 01, 04, 01, 03, 0d, 01, 05, 06, 02, 02]
+Raw bytes (14): 0x[01, 01, 00, 02, 01, 04, 01, 03, 0a, 01, 06, 05, 01, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 0
 Number of file 0 mappings: 2
-- Code(Counter(0)) at (prev + 4, 1) to (start + 3, 13)
-- Code(Counter(0)) at (prev + 5, 6) to (start + 2, 2)
+- Code(Counter(0)) at (prev + 4, 1) to (start + 3, 10)
+- Code(Counter(0)) at (prev + 6, 5) to (start + 1, 2)
 
 Function name: inline_dead::main::{closure#0}
 Raw bytes (23): 0x[01, 01, 02, 00, 06, 01, 00, 03, 01, 07, 17, 01, 16, 00, 01, 17, 00, 18, 03, 01, 05, 00, 06]
diff --git a/tests/coverage/macro_name_span.cov-map b/tests/coverage/macro_name_span.cov-map
index a18e5f14861..f3ee44d2a5a 100644
--- a/tests/coverage/macro_name_span.cov-map
+++ b/tests/coverage/macro_name_span.cov-map
@@ -1,10 +1,10 @@
 Function name: macro_name_span::affected_function
-Raw bytes (9): 0x[01, 01, 00, 01, 01, 16, 1c, 02, 06]
+Raw bytes (9): 0x[01, 01, 00, 01, 01, 16, 1c, 01, 40]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 0
 Number of file 0 mappings: 1
-- Code(Counter(0)) at (prev + 22, 28) to (start + 2, 6)
+- Code(Counter(0)) at (prev + 22, 28) to (start + 1, 64)
 
 Function name: macro_name_span::main
 Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 01, 02, 02]
diff --git a/tests/coverage/macro_name_span.coverage b/tests/coverage/macro_name_span.coverage
index 28c88b1defa..0e12ce4a27c 100644
--- a/tests/coverage/macro_name_span.coverage
+++ b/tests/coverage/macro_name_span.coverage
@@ -21,6 +21,6 @@
    LL|       |macro_name_span_helper::macro_that_defines_a_function! {
    LL|      1|    fn affected_function() {
    LL|      1|        macro_with_an_unreasonably_and_egregiously_long_name!();
-   LL|      1|    }
+   LL|       |    }
    LL|       |}
 
diff --git a/tests/coverage/no_spans.cov-map b/tests/coverage/no_spans.cov-map
index 9915fc52e6d..30171c3f319 100644
--- a/tests/coverage/no_spans.cov-map
+++ b/tests/coverage/no_spans.cov-map
@@ -1,3 +1,11 @@
+Function name: no_spans::affected_function
+Raw bytes (9): 0x[01, 01, 00, 01, 01, 1a, 1c, 00, 1d]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 0
+Number of file 0 mappings: 1
+- Code(Counter(0)) at (prev + 26, 28) to (start + 0, 29)
+
 Function name: no_spans::affected_function::{closure#0}
 Raw bytes (9): 0x[01, 01, 00, 01, 01, 1b, 0c, 00, 0e]
 Number of files: 1
diff --git a/tests/coverage/no_spans.coverage b/tests/coverage/no_spans.coverage
index e55177698a2..b117c32ffd0 100644
--- a/tests/coverage/no_spans.coverage
+++ b/tests/coverage/no_spans.coverage
@@ -23,7 +23,7 @@
    LL|       |}
    LL|       |
    LL|       |macro_that_defines_a_function! {
-   LL|       |    fn affected_function() {
+   LL|      1|    fn affected_function() {
    LL|      1|        || ()
    LL|       |    }
    LL|       |}
diff --git a/tests/coverage/no_spans_if_not.cov-map b/tests/coverage/no_spans_if_not.cov-map
index 5277267ec1b..bc3e14eddd5 100644
--- a/tests/coverage/no_spans_if_not.cov-map
+++ b/tests/coverage/no_spans_if_not.cov-map
@@ -1,3 +1,15 @@
+Function name: no_spans_if_not::affected_function
+Raw bytes (21): 0x[01, 01, 01, 01, 00, 03, 01, 16, 1c, 01, 12, 02, 02, 0d, 00, 0f, 00, 02, 0d, 00, 0f]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 1
+- expression 0 operands: lhs = Counter(0), rhs = Zero
+Number of file 0 mappings: 3
+- Code(Counter(0)) at (prev + 22, 28) to (start + 1, 18)
+- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 15)
+    = (c0 - Zero)
+- Code(Zero) at (prev + 2, 13) to (start + 0, 15)
+
 Function name: no_spans_if_not::main
 Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 01, 02, 02]
 Number of files: 1
diff --git a/tests/coverage/no_spans_if_not.coverage b/tests/coverage/no_spans_if_not.coverage
index 1b6bbc75a04..d235568db65 100644
--- a/tests/coverage/no_spans_if_not.coverage
+++ b/tests/coverage/no_spans_if_not.coverage
@@ -19,11 +19,11 @@
    LL|       |}
    LL|       |
    LL|       |macro_that_defines_a_function! {
-   LL|       |    fn affected_function() {
-   LL|       |        if !false {
-   LL|       |            ()
+   LL|      1|    fn affected_function() {
+   LL|      1|        if !false {
+   LL|      1|            ()
    LL|       |        } else {
-   LL|       |            ()
+   LL|      0|            ()
    LL|       |        }
    LL|       |    }
    LL|       |}
diff --git a/tests/coverage/unicode.cov-map b/tests/coverage/unicode.cov-map
index cd40194a083..aedfb2071c1 100644
--- a/tests/coverage/unicode.cov-map
+++ b/tests/coverage/unicode.cov-map
@@ -27,14 +27,6 @@ Number of file 0 mappings: 9
 - Code(Expression(5, Add)) at (prev + 2, 5) to (start + 1, 2)
     = (c4 + ((((c0 + c1) - c1) - c2) + c3))
 
-Function name: unicode::サビ
-Raw bytes (9): 0x[01, 01, 00, 01, 01, 1e, 14, 00, 18]
-Number of files: 1
-- file 0 => global file 1
-Number of expressions: 0
-Number of file 0 mappings: 1
-- Code(Counter(0)) at (prev + 30, 20) to (start + 0, 24)
-
 Function name: unicode::他 (unused)
 Raw bytes (9): 0x[01, 01, 00, 01, 00, 1e, 19, 00, 25]
 Number of files: 1
diff --git a/tests/coverage/unicode.coverage b/tests/coverage/unicode.coverage
index b284a557d57..af586111ba3 100644
--- a/tests/coverage/unicode.coverage
+++ b/tests/coverage/unicode.coverage
@@ -29,8 +29,7 @@
    LL|       |
    LL|       |macro_rules! macro_that_defines_a_function {
    LL|       |    (fn $名:ident () $体:tt) => {
-   LL|      1|        fn $名 () $体 fn 他 () {}
-                                      ^0
+   LL|      0|        fn $名 () $体 fn 他 () {}
    LL|       |    }
    LL|       |}
    LL|       |
diff --git a/tests/debuginfo/mutex.rs b/tests/debuginfo/mutex.rs
index 7a58c5c2224..ab9fb8b7e81 100644
--- a/tests/debuginfo/mutex.rs
+++ b/tests/debuginfo/mutex.rs
@@ -10,7 +10,7 @@
 //
 // cdb-command:dx m,d
 // cdb-check:m,d              [Type: std::sync::mutex::Mutex<i32>]
-// cdb-check:    [...] inner            [Type: std::sys::pal::windows::locks::mutex::Mutex]
+// cdb-check:    [...] inner            [Type: std::sys::locks::mutex::windows::Mutex]
 // cdb-check:    [...] poison           [Type: std::sync::poison::Flag]
 // cdb-check:    [...] data             : 0 [Type: core::cell::UnsafeCell<i32>]
 
diff --git a/tests/debuginfo/rwlock-read.rs b/tests/debuginfo/rwlock-read.rs
index 4ed1ebd0b37..7e9838871ba 100644
--- a/tests/debuginfo/rwlock-read.rs
+++ b/tests/debuginfo/rwlock-read.rs
@@ -16,7 +16,7 @@
 // cdb-command:dx r
 // cdb-check:r                [Type: std::sync::rwlock::RwLockReadGuard<i32>]
 // cdb-check:    [...] data             : NonNull([...]: 0) [Type: core::ptr::non_null::NonNull<i32>]
-// cdb-check:    [...] inner_lock       : [...] [Type: std::sys::pal::windows::locks::rwlock::RwLock *]
+// cdb-check:    [...] inner_lock       : [...] [Type: std::sys::locks::rwlock::windows::RwLock *]
 
 #[allow(unused_variables)]
 
diff --git a/tests/mir-opt/dataflow-const-prop/enum.rs b/tests/mir-opt/dataflow-const-prop/enum.rs
index 78410e49d2a..34792cb9f01 100644
--- a/tests/mir-opt/dataflow-const-prop/enum.rs
+++ b/tests/mir-opt/dataflow-const-prop/enum.rs
@@ -62,7 +62,7 @@ fn statics() {
 
     static RC: &E = &E::V2(4);
 
-    // CHECK: [[t:_.*]] = const {alloc2: &&E};
+    // CHECK: [[t:_.*]] = const {alloc5: &&E};
     // CHECK: [[e2]] = (*[[t]]);
     let e2 = RC;
 
diff --git a/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
index 596dcef85fd..ea5cd55b560 100644
--- a/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
@@ -19,7 +19,8 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
 
     bb0: {
         PlaceMention(_1);
-        switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1];
+        _2 = discriminant((_1.2: std::option::Option<i32>));
+        switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
     }
 
     bb1: {
@@ -28,12 +29,11 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
     }
 
     bb2: {
-        _2 = discriminant((_1.2: std::option::Option<i32>));
-        switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb1];
+        switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb3, 8: bb3, otherwise: bb1];
     }
 
     bb3: {
-        switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1];
+        switchInt((_1.0: u32)) -> [1: bb4, 4: bb4, otherwise: bb1];
     }
 
     bb4: {
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
index bc7617bb6dd..153505b1bbb 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
@@ -7,89 +7,13 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
     scope 1 (inlined core::slice::<impl [u32]>::get_mut::<usize>) {
         debug self => _1;
         debug index => _2;
-        scope 2 (inlined <usize as SliceIndex<[u32]>>::get_mut) {
-            debug self => _2;
-            debug slice => _1;
-            let mut _3: usize;
-            let mut _4: bool;
-            let mut _5: *mut [u32];
-            let mut _7: *mut u32;
-            let mut _8: &mut u32;
-            scope 3 {
-                scope 4 (inlined <usize as SliceIndex<[u32]>>::get_unchecked_mut) {
-                    debug self => _2;
-                    debug slice => _5;
-                    let mut _6: *mut u32;
-                    let mut _9: *mut [u32];
-                    let mut _10: &[&str];
-                    scope 5 {
-                        scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
-                            debug self => _5;
-                        }
-                        scope 11 (inlined std::ptr::mut_ptr::<impl *mut u32>::add) {
-                            debug self => _6;
-                            debug count => _2;
-                            scope 12 {
-                            }
-                        }
-                    }
-                    scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
-                        debug self => _9;
-                        let mut _11: *const [u32];
-                        scope 7 (inlined std::ptr::metadata::<[u32]>) {
-                            debug ptr => _11;
-                            scope 8 {
-                            }
-                        }
-                    }
-                    scope 9 (inlined Arguments::<'_>::new_const) {
-                        debug pieces => _10;
-                    }
-                }
-            }
-        }
     }
 
     bb0: {
-        StorageLive(_7);
-        StorageLive(_4);
-        StorageLive(_3);
-        _3 = Len((*_1));
-        _4 = Lt(_2, move _3);
-        switchInt(move _4) -> [0: bb1, otherwise: bb2];
+        _0 = <usize as SliceIndex<[u32]>>::get_mut(move _2, move _1) -> [return: bb1, unwind unreachable];
     }
 
     bb1: {
-        StorageDead(_3);
-        _0 = const Option::<&mut u32>::None;
-        goto -> bb3;
-    }
-
-    bb2: {
-        StorageDead(_3);
-        StorageLive(_8);
-        StorageLive(_5);
-        _5 = &raw mut (*_1);
-        StorageLive(_9);
-        StorageLive(_10);
-        StorageLive(_11);
-        StorageLive(_6);
-        _6 = _5 as *mut u32 (PtrToPtr);
-        _7 = Offset(_6, _2);
-        StorageDead(_6);
-        StorageDead(_11);
-        StorageDead(_10);
-        StorageDead(_9);
-        StorageDead(_5);
-        _8 = &mut (*_7);
-        _0 = Option::<&mut u32>::Some(move _8);
-        StorageDead(_8);
-        goto -> bb3;
-    }
-
-    bb3: {
-        StorageDead(_4);
-        StorageDead(_7);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
index bc7617bb6dd..d37ee783117 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
@@ -7,89 +7,13 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
     scope 1 (inlined core::slice::<impl [u32]>::get_mut::<usize>) {
         debug self => _1;
         debug index => _2;
-        scope 2 (inlined <usize as SliceIndex<[u32]>>::get_mut) {
-            debug self => _2;
-            debug slice => _1;
-            let mut _3: usize;
-            let mut _4: bool;
-            let mut _5: *mut [u32];
-            let mut _7: *mut u32;
-            let mut _8: &mut u32;
-            scope 3 {
-                scope 4 (inlined <usize as SliceIndex<[u32]>>::get_unchecked_mut) {
-                    debug self => _2;
-                    debug slice => _5;
-                    let mut _6: *mut u32;
-                    let mut _9: *mut [u32];
-                    let mut _10: &[&str];
-                    scope 5 {
-                        scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
-                            debug self => _5;
-                        }
-                        scope 11 (inlined std::ptr::mut_ptr::<impl *mut u32>::add) {
-                            debug self => _6;
-                            debug count => _2;
-                            scope 12 {
-                            }
-                        }
-                    }
-                    scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
-                        debug self => _9;
-                        let mut _11: *const [u32];
-                        scope 7 (inlined std::ptr::metadata::<[u32]>) {
-                            debug ptr => _11;
-                            scope 8 {
-                            }
-                        }
-                    }
-                    scope 9 (inlined Arguments::<'_>::new_const) {
-                        debug pieces => _10;
-                    }
-                }
-            }
-        }
     }
 
     bb0: {
-        StorageLive(_7);
-        StorageLive(_4);
-        StorageLive(_3);
-        _3 = Len((*_1));
-        _4 = Lt(_2, move _3);
-        switchInt(move _4) -> [0: bb1, otherwise: bb2];
+        _0 = <usize as SliceIndex<[u32]>>::get_mut(move _2, move _1) -> [return: bb1, unwind continue];
     }
 
     bb1: {
-        StorageDead(_3);
-        _0 = const Option::<&mut u32>::None;
-        goto -> bb3;
-    }
-
-    bb2: {
-        StorageDead(_3);
-        StorageLive(_8);
-        StorageLive(_5);
-        _5 = &raw mut (*_1);
-        StorageLive(_9);
-        StorageLive(_10);
-        StorageLive(_11);
-        StorageLive(_6);
-        _6 = _5 as *mut u32 (PtrToPtr);
-        _7 = Offset(_6, _2);
-        StorageDead(_6);
-        StorageDead(_11);
-        StorageDead(_10);
-        StorageDead(_9);
-        StorageDead(_5);
-        _8 = &mut (*_7);
-        _0 = Option::<&mut u32>::Some(move _8);
-        StorageDead(_8);
-        goto -> bb3;
-    }
-
-    bb3: {
-        StorageDead(_4);
-        StorageDead(_7);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
index 2fdc21d636f..bcc540ae6fc 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
@@ -4,106 +4,24 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
     debug slice => _1;
     debug index => _2;
     let mut _0: &mut [u32];
-    let mut _3: usize;
-    let mut _4: usize;
     scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) {
         debug self => _1;
-        debug ((index: std::ops::Range<usize>).0: usize) => _3;
-        debug ((index: std::ops::Range<usize>).1: usize) => _4;
-        let mut _5: *mut [u32];
-        let mut _13: *mut [u32];
+        debug index => _2;
+        let mut _3: *mut [u32];
+        let mut _4: *mut [u32];
         scope 2 {
-            scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) {
-                debug ((self: std::ops::Range<usize>).0: usize) => _3;
-                debug ((self: std::ops::Range<usize>).1: usize) => _4;
-                debug slice => _5;
-                let mut _7: *mut u32;
-                let mut _8: *mut u32;
-                let mut _14: *mut [u32];
-                let mut _15: &[&str];
-                scope 4 {
-                    let _6: usize;
-                    scope 5 {
-                        debug new_len => _6;
-                        scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
-                            debug self => _5;
-                        }
-                        scope 11 (inlined std::ptr::mut_ptr::<impl *mut u32>::add) {
-                            debug self => _7;
-                            debug count => _3;
-                            scope 12 {
-                            }
-                        }
-                        scope 13 (inlined slice_from_raw_parts_mut::<u32>) {
-                            debug data => _8;
-                            debug len => _6;
-                            let mut _9: *mut ();
-                            scope 14 (inlined std::ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
-                                debug self => _8;
-                            }
-                            scope 15 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
-                                debug data_pointer => _9;
-                                debug metadata => _6;
-                                let mut _10: *const ();
-                                let mut _11: std::ptr::metadata::PtrComponents<[u32]>;
-                                let mut _12: std::ptr::metadata::PtrRepr<[u32]>;
-                                scope 16 {
-                                }
-                            }
-                        }
-                    }
-                }
-                scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
-                    debug self => _14;
-                    let mut _16: *const [u32];
-                    scope 7 (inlined std::ptr::metadata::<[u32]>) {
-                        debug ptr => _16;
-                        scope 8 {
-                        }
-                    }
-                }
-                scope 9 (inlined Arguments::<'_>::new_const) {
-                    debug pieces => _15;
-                }
-            }
         }
     }
 
     bb0: {
-        _3 = move (_2.0: usize);
-        _4 = move (_2.1: usize);
-        StorageLive(_5);
-        _5 = &raw mut (*_1);
-        StorageLive(_14);
-        StorageLive(_15);
-        StorageLive(_6);
-        StorageLive(_16);
-        _6 = SubUnchecked(_4, _3);
-        StorageLive(_8);
-        StorageLive(_7);
-        _7 = _5 as *mut u32 (PtrToPtr);
-        _8 = Offset(_7, _3);
-        StorageDead(_7);
-        StorageLive(_9);
-        _9 = _8 as *mut () (PtrToPtr);
-        StorageLive(_12);
-        StorageLive(_11);
-        StorageLive(_10);
-        _10 = _8 as *const () (PtrToPtr);
-        _11 = std::ptr::metadata::PtrComponents::<[u32]> { data_pointer: move _10, metadata: _6 };
-        StorageDead(_10);
-        _12 = std::ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _11 };
-        StorageDead(_11);
-        _13 = (_12.1: *mut [u32]);
-        StorageDead(_12);
-        StorageDead(_9);
-        StorageDead(_8);
-        StorageDead(_16);
-        StorageDead(_6);
-        StorageDead(_15);
-        StorageDead(_14);
-        StorageDead(_5);
-        _0 = &mut (*_13);
+        StorageLive(_3);
+        _3 = &raw mut (*_1);
+        _4 = <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut(move _2, move _3) -> [return: bb1, unwind unreachable];
+    }
+
+    bb1: {
+        StorageDead(_3);
+        _0 = &mut (*_4);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
index 2fdc21d636f..1fe7da7d2fd 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
@@ -4,106 +4,24 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
     debug slice => _1;
     debug index => _2;
     let mut _0: &mut [u32];
-    let mut _3: usize;
-    let mut _4: usize;
     scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) {
         debug self => _1;
-        debug ((index: std::ops::Range<usize>).0: usize) => _3;
-        debug ((index: std::ops::Range<usize>).1: usize) => _4;
-        let mut _5: *mut [u32];
-        let mut _13: *mut [u32];
+        debug index => _2;
+        let mut _3: *mut [u32];
+        let mut _4: *mut [u32];
         scope 2 {
-            scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) {
-                debug ((self: std::ops::Range<usize>).0: usize) => _3;
-                debug ((self: std::ops::Range<usize>).1: usize) => _4;
-                debug slice => _5;
-                let mut _7: *mut u32;
-                let mut _8: *mut u32;
-                let mut _14: *mut [u32];
-                let mut _15: &[&str];
-                scope 4 {
-                    let _6: usize;
-                    scope 5 {
-                        debug new_len => _6;
-                        scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
-                            debug self => _5;
-                        }
-                        scope 11 (inlined std::ptr::mut_ptr::<impl *mut u32>::add) {
-                            debug self => _7;
-                            debug count => _3;
-                            scope 12 {
-                            }
-                        }
-                        scope 13 (inlined slice_from_raw_parts_mut::<u32>) {
-                            debug data => _8;
-                            debug len => _6;
-                            let mut _9: *mut ();
-                            scope 14 (inlined std::ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
-                                debug self => _8;
-                            }
-                            scope 15 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
-                                debug data_pointer => _9;
-                                debug metadata => _6;
-                                let mut _10: *const ();
-                                let mut _11: std::ptr::metadata::PtrComponents<[u32]>;
-                                let mut _12: std::ptr::metadata::PtrRepr<[u32]>;
-                                scope 16 {
-                                }
-                            }
-                        }
-                    }
-                }
-                scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
-                    debug self => _14;
-                    let mut _16: *const [u32];
-                    scope 7 (inlined std::ptr::metadata::<[u32]>) {
-                        debug ptr => _16;
-                        scope 8 {
-                        }
-                    }
-                }
-                scope 9 (inlined Arguments::<'_>::new_const) {
-                    debug pieces => _15;
-                }
-            }
         }
     }
 
     bb0: {
-        _3 = move (_2.0: usize);
-        _4 = move (_2.1: usize);
-        StorageLive(_5);
-        _5 = &raw mut (*_1);
-        StorageLive(_14);
-        StorageLive(_15);
-        StorageLive(_6);
-        StorageLive(_16);
-        _6 = SubUnchecked(_4, _3);
-        StorageLive(_8);
-        StorageLive(_7);
-        _7 = _5 as *mut u32 (PtrToPtr);
-        _8 = Offset(_7, _3);
-        StorageDead(_7);
-        StorageLive(_9);
-        _9 = _8 as *mut () (PtrToPtr);
-        StorageLive(_12);
-        StorageLive(_11);
-        StorageLive(_10);
-        _10 = _8 as *const () (PtrToPtr);
-        _11 = std::ptr::metadata::PtrComponents::<[u32]> { data_pointer: move _10, metadata: _6 };
-        StorageDead(_10);
-        _12 = std::ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _11 };
-        StorageDead(_11);
-        _13 = (_12.1: *mut [u32]);
-        StorageDead(_12);
-        StorageDead(_9);
-        StorageDead(_8);
-        StorageDead(_16);
-        StorageDead(_6);
-        StorageDead(_15);
-        StorageDead(_14);
-        StorageDead(_5);
-        _0 = &mut (*_13);
+        StorageLive(_3);
+        _3 = &raw mut (*_1);
+        _4 = <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut(move _2, move _3) -> [return: bb1, unwind continue];
+    }
+
+    bb1: {
+        StorageDead(_3);
+        _0 = &mut (*_4);
         return;
     }
 }
diff --git a/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs b/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
index 9e0a7ba63d0..28a1e27cccc 100644
--- a/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
+++ b/tests/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
@@ -49,11 +49,11 @@ impl CodegenBackend for TheBackend {
         ongoing_codegen: Box<dyn Any>,
         _sess: &Session,
         _outputs: &OutputFilenames,
-    ) -> Result<(CodegenResults, FxIndexMap<WorkProductId, WorkProduct>), ErrorGuaranteed> {
+    ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) {
         let codegen_results = ongoing_codegen
             .downcast::<CodegenResults>()
             .expect("in join_codegen: ongoing_codegen is not a CodegenResults");
-        Ok((*codegen_results, FxIndexMap::default()))
+        (*codegen_results, FxIndexMap::default())
     }
 
     fn link(
diff --git a/tests/rustdoc-gui/mobile-crate-name.goml b/tests/rustdoc-gui/mobile-crate-name.goml
new file mode 100644
index 00000000000..a0c96eec8a5
--- /dev/null
+++ b/tests/rustdoc-gui/mobile-crate-name.goml
@@ -0,0 +1,22 @@
+// Checks that if the crate name is too long on mobile, it will not grow and overflow its parent
+// (thanks to text overflow ellipsis).
+
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+// First we change the title to make it big.
+set-window-size: (350, 800)
+// We ensure that the "format" of the title is the same as the one we'll use.
+assert-text: (".mobile-topbar .location a", "test_docs")
+// We store the height we know is correct.
+store-property: (".mobile-topbar .location", {"offsetHeight": height})
+// We change the crate name to something longer.
+set-text: (".mobile-topbar .location a", "cargo_packager_resource_resolver")
+// And we check that the size remained the same.
+assert-property: (".mobile-topbar .location", {"offsetHeight": |height|})
+
+// Now we check if it works for the non-crate pages as well.
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+// We store the height we know is correct.
+store-property: (".mobile-topbar .location", {"offsetHeight": height})
+set-text: (".mobile-topbar .location a", "Something_incredibly_long_because")
+// And we check that the size remained the same.
+assert-property: (".mobile-topbar .location", {"offsetHeight": |height|})
diff --git a/tests/rustdoc-gui/type-declation-overflow.goml b/tests/rustdoc-gui/type-declation-overflow.goml
index 5780f5c88f8..a97cc98897a 100644
--- a/tests/rustdoc-gui/type-declation-overflow.goml
+++ b/tests/rustdoc-gui/type-declation-overflow.goml
@@ -39,8 +39,8 @@ assert-property: ("pre.item-decl", {"scrollWidth": "950"})
 set-window-size: (600, 600)
 go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
 // It shouldn't have an overflow in the topbar either.
-store-property: (".mobile-topbar h2", {"scrollWidth": scrollWidth})
-assert-property: (".mobile-topbar h2", {"clientWidth": |scrollWidth|})
+store-property: (".mobile-topbar", {"scrollWidth": scrollWidth})
+assert-property: (".mobile-topbar", {"clientWidth": |scrollWidth|})
 assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"})
 
 // Check wrapping for top main-heading h1 and out-of-band.
diff --git a/tests/rustdoc/bounds-in-multiple-parts.rs b/tests/rustdoc/bounds.rs
index 279e3c14888..da09e3f2a52 100644
--- a/tests/rustdoc/bounds-in-multiple-parts.rs
+++ b/tests/rustdoc/bounds.rs
@@ -18,3 +18,15 @@ pub trait T2 {
     fn f<T: Eq>()
         where Self: Eq, Self: Eq2, T: Eq2;
 }
+
+// Checking that we support empty bounds (we used to crash on empty outlives-bounds).
+// Note that we don't want to hide them since they have a semantic effect.
+// For outlives-bounds, they force the lifetime param to be early-bound instead of late-bound.
+// For trait bounds, it can affect well-formedness (see `ClauseKind::WellFormed`).
+// @has 'foo/fn.empty.html'
+// @has - '//pre[@class="rust item-decl"]' "empty<'a, T>()where T:, 'a:,"
+pub fn empty<'a, T>()
+    where
+        T:,
+        'a:,
+{}
diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc/const-generics/generic_const_exprs.rs
index e23b3006da6..2d2d31d7231 100644
--- a/tests/rustdoc/const-generics/generic_const_exprs.rs
+++ b/tests/rustdoc/const-generics/generic_const_exprs.rs
@@ -3,5 +3,5 @@
 #![allow(incomplete_features)]
 // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647
 // @has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \
-//      'pub struct Ice<const N: usize>;'
+//      'pub struct Ice<const N: usize> where [(); { _ }]:;'
 pub struct Ice<const N: usize> where [(); N + 1]:;
diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs b/tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs
new file mode 100644
index 00000000000..4ae9f79a532
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/issue-76736-1.rs
@@ -0,0 +1,6 @@
+#![feature(staged_api)]
+#![unstable(feature = "rustc_private", issue = "none")]
+
+pub trait MaybeResult<T> {}
+
+impl<T> MaybeResult<T> for T {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs b/tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs
new file mode 100644
index 00000000000..b5fbac97082
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/issue-76736-2.rs
@@ -0,0 +1,5 @@
+#![feature(rustc_private)]
+
+extern crate issue_76736_1;
+
+pub struct Bar;
diff --git a/tests/rustdoc/inline_cross/issue-76736-1.rs b/tests/rustdoc/inline_cross/issue-76736-1.rs
new file mode 100644
index 00000000000..25feae2c8d6
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-76736-1.rs
@@ -0,0 +1,15 @@
+// aux-build:issue-76736-1.rs
+// aux-build:issue-76736-2.rs
+
+#![crate_name = "foo"]
+
+extern crate issue_76736_1;
+extern crate issue_76736_2;
+
+// @has foo/struct.Foo.html
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub struct Foo;
+
+// @has foo/struct.Bar.html
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub use issue_76736_2::Bar;
diff --git a/tests/rustdoc/inline_cross/issue-76736-2.rs b/tests/rustdoc/inline_cross/issue-76736-2.rs
new file mode 100644
index 00000000000..e43c825d6e1
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-76736-2.rs
@@ -0,0 +1,16 @@
+// aux-build:issue-76736-1.rs
+// aux-build:issue-76736-2.rs
+
+#![crate_name = "foo"]
+#![feature(rustc_private)]
+
+extern crate issue_76736_1;
+extern crate issue_76736_2;
+
+// @has foo/struct.Foo.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub struct Foo;
+
+// @has foo/struct.Bar.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub use issue_76736_2::Bar;
diff --git a/tests/rustdoc/inline_cross/issue-76736-3.rs b/tests/rustdoc/inline_cross/issue-76736-3.rs
new file mode 100644
index 00000000000..9542f3f3557
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-76736-3.rs
@@ -0,0 +1,16 @@
+// compile-flags: -Zforce-unstable-if-unmarked
+// aux-build:issue-76736-1.rs
+// aux-build:issue-76736-2.rs
+
+#![crate_name = "foo"]
+
+extern crate issue_76736_1;
+extern crate issue_76736_2;
+
+// @has foo/struct.Foo.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub struct Foo;
+
+// @has foo/struct.Bar.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub use issue_76736_2::Bar;
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.rs b/tests/ui-fulldeps/internal-lints/diagnostics.rs
index 5a2099865d6..dcf948d2a88 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics.rs
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.rs
@@ -55,8 +55,11 @@ impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for TranslatableInIntoDiagn
 pub struct UntranslatableInAddToDiagnostic;
 
 impl AddToDiagnostic for UntranslatableInAddToDiagnostic {
-    fn add_to_diagnostic_with<F: SubdiagnosticMessageOp>(self, diag: &mut Diagnostic, _: F)
-    {
+    fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
+        self,
+        diag: &mut DiagnosticBuilder<'_, G>,
+        f: F,
+    ) {
         diag.note("untranslatable diagnostic");
         //~^ ERROR diagnostics should be created using translatable messages
     }
@@ -65,7 +68,11 @@ impl AddToDiagnostic for UntranslatableInAddToDiagnostic {
 pub struct TranslatableInAddToDiagnostic;
 
 impl AddToDiagnostic for TranslatableInAddToDiagnostic {
-    fn add_to_diagnostic_with<F: SubdiagnosticMessageOp>(self, diag: &mut Diagnostic, _: F) {
+    fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
+        self,
+        diag: &mut DiagnosticBuilder<'_, G>,
+        f: F,
+    ) {
         diag.note(crate::fluent_generated::no_crate_note);
     }
 }
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.stderr b/tests/ui-fulldeps/internal-lints/diagnostics.stderr
index 108b7c8ea9c..a69a71bf50e 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics.stderr
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.stderr
@@ -11,13 +11,13 @@ LL | #![deny(rustc::untranslatable_diagnostic)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostics should be created using translatable messages
-  --> $DIR/diagnostics.rs:60:14
+  --> $DIR/diagnostics.rs:63:14
    |
 LL |         diag.note("untranslatable diagnostic");
    |              ^^^^
 
 error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
-  --> $DIR/diagnostics.rs:74:21
+  --> $DIR/diagnostics.rs:81:21
    |
 LL |     let _diag = dcx.struct_err(crate::fluent_generated::no_crate_example);
    |                     ^^^^^^^^^^
@@ -29,13 +29,13 @@ LL | #![deny(rustc::diagnostic_outside_of_impl)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
-  --> $DIR/diagnostics.rs:77:21
+  --> $DIR/diagnostics.rs:84:21
    |
 LL |     let _diag = dcx.struct_err("untranslatable diagnostic");
    |                     ^^^^^^^^^^
 
 error: diagnostics should be created using translatable messages
-  --> $DIR/diagnostics.rs:77:21
+  --> $DIR/diagnostics.rs:84:21
    |
 LL |     let _diag = dcx.struct_err("untranslatable diagnostic");
    |                     ^^^^^^^^^^
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
index f07b69326b0..0d61e15b0f1 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.stderr
@@ -8,9 +8,9 @@ LL |     arg: NotIntoDiagnosticArg,
    |          ^^^^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
    |
    = help: normalized in stderr
-note: required by a bound in `DiagnosticBuilder::<'a, G>::arg`
-  --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
-   = note: this error originates in the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
+note: required by a bound in `rustc_errors::diagnostic::<impl DiagnosticBuilder<'a, G>>::arg`
+  --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
+   = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
   --> $DIR/diagnostic-derive-doc-comment-field.rs:46:10
@@ -22,8 +22,9 @@ LL |     arg: NotIntoDiagnosticArg,
    |          ^^^^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `NotIntoDiagnosticArg`
    |
    = help: normalized in stderr
-note: required by a bound in `Diagnostic::arg`
+note: required by a bound in `rustc_errors::diagnostic::<impl DiagnosticBuilder<'a, G>>::arg`
   --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
+   = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index d3cfd28082d..856f32fafa0 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -1,8 +1,8 @@
 // check-fail
 // Tests error conditions for specifying diagnostics using #[derive(Diagnostic)]
-
 // normalize-stderr-test "the following other types implement trait `IntoDiagnosticArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
-// normalize-stderr-test "diagnostic_builder\.rs:[0-9]+:[0-9]+" -> "diagnostic_builder.rs:LL:CC"
+// normalize-stderr-test "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"
+
 // The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
 // changing the output of this test. Since Diagnostic is strictly internal to the compiler
 // the test is just ignored on stable and beta:
@@ -701,7 +701,7 @@ struct RawIdentDiagnosticArg {
 #[diag(no_crate_example)]
 struct SubdiagnosticBad {
     #[subdiagnostic(bad)]
-    //~^ ERROR `eager` is the only supported nested attribute for `subdiagnostic`
+    //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
     note: Note,
 }
 
@@ -717,7 +717,7 @@ struct SubdiagnosticBadStr {
 #[diag(no_crate_example)]
 struct SubdiagnosticBadTwice {
     #[subdiagnostic(bad, bad)]
-    //~^ ERROR `eager` is the only supported nested attribute for `subdiagnostic`
+    //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
     note: Note,
 }
 
@@ -725,7 +725,7 @@ struct SubdiagnosticBadTwice {
 #[diag(no_crate_example)]
 struct SubdiagnosticBadLitStr {
     #[subdiagnostic("bad")]
-    //~^ ERROR `eager` is the only supported nested attribute for `subdiagnostic`
+    //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
     note: Note,
 }
 
@@ -739,8 +739,9 @@ struct SubdiagnosticEagerLint {
 
 #[derive(Diagnostic)]
 #[diag(no_crate_example)]
-struct SubdiagnosticEagerCorrect {
+struct SubdiagnosticEagerFormerlyCorrect {
     #[subdiagnostic(eager)]
+    //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
     note: Note,
 }
 
@@ -761,6 +762,7 @@ pub(crate) struct SubdiagnosticWithSuggestion {
 #[diag(no_crate_example)]
 struct SubdiagnosticEagerSuggestion {
     #[subdiagnostic(eager)]
+    //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
     sub: SubdiagnosticWithSuggestion,
 }
 
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 2032b8a972a..ddbb3c6df26 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -468,11 +468,11 @@ LL | #[label]
    |
    = help: `#[label]` and `#[suggestion]` can only be applied to fields
 
-error: `eager` is the only supported nested attribute for `subdiagnostic`
-  --> $DIR/diagnostic-derive.rs:703:7
+error: `#[subdiagnostic(...)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:703:5
    |
 LL |     #[subdiagnostic(bad)]
-   |       ^^^^^^^^^^^^^
+   |     ^
 
 error: `#[subdiagnostic = ...]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:711:5
@@ -480,40 +480,50 @@ error: `#[subdiagnostic = ...]` is not a valid attribute
 LL |     #[subdiagnostic = "bad"]
    |     ^
 
-error: `eager` is the only supported nested attribute for `subdiagnostic`
-  --> $DIR/diagnostic-derive.rs:719:7
+error: `#[subdiagnostic(...)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:719:5
    |
 LL |     #[subdiagnostic(bad, bad)]
-   |       ^^^^^^^^^^^^^
+   |     ^
 
-error: `eager` is the only supported nested attribute for `subdiagnostic`
-  --> $DIR/diagnostic-derive.rs:727:7
+error: `#[subdiagnostic(...)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:727:5
    |
 LL |     #[subdiagnostic("bad")]
-   |       ^^^^^^^^^^^^^
+   |     ^
 
 error: `#[subdiagnostic(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:735:5
    |
 LL |     #[subdiagnostic(eager)]
    |     ^
+
+error: `#[subdiagnostic(...)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:743:5
    |
-   = help: eager subdiagnostics are not supported on lints
+LL |     #[subdiagnostic(eager)]
+   |     ^
+
+error: `#[subdiagnostic(...)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:764:5
+   |
+LL |     #[subdiagnostic(eager)]
+   |     ^
 
 error: expected at least one string literal for `code(...)`
-  --> $DIR/diagnostic-derive.rs:793:23
+  --> $DIR/diagnostic-derive.rs:795:23
    |
 LL |     #[suggestion(code())]
    |                       ^
 
 error: `code(...)` must contain only string literals
-  --> $DIR/diagnostic-derive.rs:801:23
+  --> $DIR/diagnostic-derive.rs:803:23
    |
 LL |     #[suggestion(code(foo))]
    |                       ^^^
 
 error: `#[suggestion(...)]` is not a valid attribute
-  --> $DIR/diagnostic-derive.rs:825:5
+  --> $DIR/diagnostic-derive.rs:827:5
    |
 LL |     #[suggestion(no_crate_suggestion, code = "")]
    |     ^
@@ -529,13 +539,13 @@ LL | #[diag = "E0123"]
    |        ^ maybe a missing crate `core`?
 
 error[E0433]: failed to resolve: maybe a missing crate `core`?
-  --> $DIR/diagnostic-derive.rs:801:23
+  --> $DIR/diagnostic-derive.rs:803:23
    |
 LL |     #[suggestion(code(foo))]
    |                       ^^^ maybe a missing crate `core`?
 
 error[E0433]: failed to resolve: maybe a missing crate `core`?
-  --> $DIR/diagnostic-derive.rs:810:25
+  --> $DIR/diagnostic-derive.rs:812:25
    |
 LL |     #[suggestion(code = 3)]
    |                         ^ maybe a missing crate `core`?
@@ -601,7 +611,7 @@ LL | #[diag(nonsense, code = E0123)]
    |        ^^^^^^^^ not found in `crate::fluent_generated`
 
 error[E0425]: cannot find value `__code_34` in this scope
-  --> $DIR/diagnostic-derive.rs:807:10
+  --> $DIR/diagnostic-derive.rs:809:10
    |
 LL | #[derive(Diagnostic)]
    |          ^^^^^^^^^^ not found in this scope
@@ -618,11 +628,11 @@ LL |     other: Hello,
    |            ^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
    |
    = help: normalized in stderr
-note: required by a bound in `DiagnosticBuilder::<'a, G>::arg`
-  --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
-   = note: this error originates in the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
+note: required by a bound in `rustc_errors::diagnostic::<impl DiagnosticBuilder<'a, G>>::arg`
+  --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
+   = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 84 previous errors
+error: aborting due to 86 previous errors
 
 Some errors have detailed explanations: E0277, E0425, E0433.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui-fulldeps/stable-mir/compilation-result.rs b/tests/ui-fulldeps/stable-mir/compilation-result.rs
index e6dd9fa132d..cd61d599eb4 100644
--- a/tests/ui-fulldeps/stable-mir/compilation-result.rs
+++ b/tests/ui-fulldeps/stable-mir/compilation-result.rs
@@ -55,7 +55,7 @@ fn test_skipped(mut args: Vec<String>) {
 fn test_failed(mut args: Vec<String>) {
     args.push("--cfg=broken".to_string());
     let result = run!(args, || unreachable!() as ControlFlow<()>);
-    assert_eq!(result, Err(stable_mir::CompilerError::CompilationFailed));
+    assert_eq!(result, Err(stable_mir::CompilerError::Failed));
 }
 
 /// Test that we are able to pass a closure and set the return according to the captured value.
diff --git a/tests/ui/abi/statics/static-mut-foreign.rs b/tests/ui/abi/statics/static-mut-foreign.rs
index fdd775da578..f32ce8cf085 100644
--- a/tests/ui/abi/statics/static-mut-foreign.rs
+++ b/tests/ui/abi/statics/static-mut-foreign.rs
@@ -33,9 +33,9 @@ unsafe fn run() {
     rust_dbg_static_mut = -3;
     assert_eq!(rust_dbg_static_mut, -3);
     static_bound(&rust_dbg_static_mut);
-    //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
     static_bound_set(&mut rust_dbg_static_mut);
-    //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
 }
 
 pub fn main() {
diff --git a/tests/ui/abi/statics/static-mut-foreign.stderr b/tests/ui/abi/statics/static-mut-foreign.stderr
index 144ac056f87..f393088ff9f 100644
--- a/tests/ui/abi/statics/static-mut-foreign.stderr
+++ b/tests/ui/abi/statics/static-mut-foreign.stderr
@@ -1,28 +1,28 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/static-mut-foreign.rs:35:18
    |
 LL |     static_bound(&rust_dbg_static_mut);
-   |                  ^^^^^^^^^^^^^^^^^^^^ shared reference of mutable static
+   |                  ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     static_bound(addr_of!(rust_dbg_static_mut));
    |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/static-mut-foreign.rs:37:22
    |
 LL |     static_bound_set(&mut rust_dbg_static_mut);
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |     static_bound_set(addr_of_mut!(rust_dbg_static_mut));
    |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/anon-params/anon-params-edition-hygiene.rs b/tests/ui/anon-params/anon-params-edition-hygiene.rs
index 607412f44c4..56e7336a7a5 100644
--- a/tests/ui/anon-params/anon-params-edition-hygiene.rs
+++ b/tests/ui/anon-params/anon-params-edition-hygiene.rs
@@ -1,3 +1,4 @@
+//@ check-pass
 //@ edition:2018
 //@ aux-build:anon-params-edition-hygiene.rs
 
@@ -8,7 +9,6 @@
 extern crate anon_params_edition_hygiene;
 
 generate_trait_2015_ident!(u8);
-// FIXME: Edition hygiene doesn't work correctly with `tt`s in this case.
-generate_trait_2015_tt!(u8); //~ ERROR expected one of `:`, `@`, or `|`, found `)`
+generate_trait_2015_tt!(u8);
 
 fn main() {}
diff --git a/tests/ui/anon-params/anon-params-edition-hygiene.stderr b/tests/ui/anon-params/anon-params-edition-hygiene.stderr
deleted file mode 100644
index 373d7c6aebb..00000000000
--- a/tests/ui/anon-params/anon-params-edition-hygiene.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: expected one of `:`, `@`, or `|`, found `)`
-  --> $DIR/anon-params-edition-hygiene.rs:12:1
-   |
-LL | generate_trait_2015_tt!(u8);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of `:`, `@`, or `|`
-   |
-   = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-   = note: this error originates in the macro `generate_trait_2015_tt` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: if this is a `self` type, give it a parameter name
-   |
-LL | generate_trait_2015_tt!(self: u8);
-   |                         +++++
-help: if this is a parameter name, give it a type
-   |
-LL | generate_trait_2015_tt!(u8: TypeName);
-   |                           ++++++++++
-help: if this is a type, explicitly ignore the parameter name
-   |
-LL | generate_trait_2015_tt!(_: u8);
-   |                         ++
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/asm/bad-arch.stderr b/tests/ui/asm/bad-arch.stderr
index 23aad9908ef..c6f726600eb 100644
--- a/tests/ui/asm/bad-arch.stderr
+++ b/tests/ui/asm/bad-arch.stderr
@@ -9,8 +9,6 @@ error[E0472]: inline assembly is unsupported on this target
    |
 LL | global_asm!("");
    | ^^^^^^^^^^^^^^^
-   |
-   = note: this error originates in the macro `global_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/associated-consts/defaults-cyclic-fail.stderr b/tests/ui/associated-consts/defaults-cyclic-fail.stderr
index 9cee03041fe..31974d95561 100644
--- a/tests/ui/associated-consts/defaults-cyclic-fail.stderr
+++ b/tests/ui/associated-consts/defaults-cyclic-fail.stderr
@@ -20,7 +20,7 @@ note: ...which requires const-evaluating + checking `Tr::B`...
 LL |     const B: u8 = Self::A;
    |                   ^^^^^^^
    = note: ...which again requires simplifying constant for the type system `Tr::A`, completing the cycle
-note: cycle used when const-evaluating + checking `main::promoted[1]`
+note: cycle used when optimizing promoted MIR for `main`
   --> $DIR/defaults-cyclic-fail.rs:16:16
    |
 LL |     assert_eq!(<() as Tr>::A, 0);
diff --git a/tests/ui/associated-consts/defaults-not-assumed-fail.stderr b/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
index 091a50f9463..4b53603cfe8 100644
--- a/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
+++ b/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
@@ -11,6 +11,14 @@ LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
    |                ^^^^^^^^^^^^^
 
 note: erroneous constant encountered
+  --> $DIR/defaults-not-assumed-fail.rs:33:16
+   |
+LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
+   |                ^^^^^^^^^^^^^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+note: erroneous constant encountered
   --> $DIR/defaults-not-assumed-fail.rs:33:5
    |
 LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs
index 0315938a7ed..be8162c86b9 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs
@@ -4,12 +4,12 @@ trait Foo {
     const BAR: u32;
 }
 
-const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; //~ ERROR E0391
 
 struct GlobalImplRef;
 
 impl GlobalImplRef {
-    const BAR: u32 = IMPL_REF_BAR; //~ ERROR E0391
+    const BAR: u32 = IMPL_REF_BAR;
 }
 
 fn main() {}
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
index 88b17be601c..bf37f537a49 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
@@ -1,14 +1,9 @@
-error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`
-  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:22
-   |
-LL |     const BAR: u32 = IMPL_REF_BAR;
-   |                      ^^^^^^^^^^^^
-   |
-note: ...which requires simplifying constant for the type system `IMPL_REF_BAR`...
+error[E0391]: cycle detected when simplifying constant for the type system `IMPL_REF_BAR`
   --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
    |
 LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
    | ^^^^^^^^^^^^^^^^^^^^^^^
+   |
 note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
   --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:27
    |
@@ -29,7 +24,12 @@ note: ...which requires caching mir of `<impl at $DIR/issue-24949-assoc-const-st
    |
 LL |     const BAR: u32 = IMPL_REF_BAR;
    |     ^^^^^^^^^^^^^^
-   = note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`, completing the cycle
+note: ...which requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:22
+   |
+LL |     const BAR: u32 = IMPL_REF_BAR;
+   |                      ^^^^^^^^^^^^
+   = note: ...which again requires simplifying constant for the type system `IMPL_REF_BAR`, completing the cycle
    = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
index fd1b4f2f964..d0ada37b99e 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
@@ -1,9 +1,14 @@
-error[E0391]: cycle detected when elaborating drops for `FooDefault::BAR`
+error[E0391]: cycle detected when caching mir of `FooDefault::BAR` for CTFE
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+   |
+LL |     const BAR: u32 = DEFAULT_REF_BAR;
+   |     ^^^^^^^^^^^^^^
+   |
+note: ...which requires elaborating drops for `FooDefault::BAR`...
   --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:22
    |
 LL |     const BAR: u32 = DEFAULT_REF_BAR;
    |                      ^^^^^^^^^^^^^^^
-   |
 note: ...which requires simplifying constant for the type system `DEFAULT_REF_BAR`...
   --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
    |
@@ -24,13 +29,12 @@ note: ...which requires const-evaluating + checking `FooDefault::BAR`...
    |
 LL |     const BAR: u32 = DEFAULT_REF_BAR;
    |     ^^^^^^^^^^^^^^
-note: ...which requires caching mir of `FooDefault::BAR` for CTFE...
+   = note: ...which again requires caching mir of `FooDefault::BAR` for CTFE, completing the cycle
+note: cycle used when const-evaluating + checking `FooDefault::BAR`
   --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
    |
 LL |     const BAR: u32 = DEFAULT_REF_BAR;
    |     ^^^^^^^^^^^^^^
-   = note: ...which again requires elaborating drops for `FooDefault::BAR`, completing the cycle
-   = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs
index 68b653ff3c5..62af8534340 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs
@@ -4,12 +4,12 @@ trait Foo {
     const BAR: u32;
 }
 
-const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR; //~ ERROR E0391
 
 struct GlobalTraitRef;
 
 impl Foo for GlobalTraitRef {
-    const BAR: u32 = TRAIT_REF_BAR; //~ ERROR E0391
+    const BAR: u32 = TRAIT_REF_BAR;
 }
 
 fn main() {}
diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
index 303400f928e..317af7975aa 100644
--- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
+++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
@@ -1,14 +1,9 @@
-error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`
-  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22
-   |
-LL |     const BAR: u32 = TRAIT_REF_BAR;
-   |                      ^^^^^^^^^^^^^
-   |
-note: ...which requires simplifying constant for the type system `TRAIT_REF_BAR`...
+error[E0391]: cycle detected when simplifying constant for the type system `TRAIT_REF_BAR`
   --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
    |
 LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
    | ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
 note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
   --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:28
    |
@@ -29,7 +24,12 @@ note: ...which requires caching mir of `<impl at $DIR/issue-24949-assoc-const-st
    |
 LL |     const BAR: u32 = TRAIT_REF_BAR;
    |     ^^^^^^^^^^^^^^
-   = note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`, completing the cycle
+note: ...which requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22
+   |
+LL |     const BAR: u32 = TRAIT_REF_BAR;
+   |                      ^^^^^^^^^^^^^
+   = note: ...which again requires simplifying constant for the type system `TRAIT_REF_BAR`, completing the cycle
    = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
diff --git a/tests/ui/async-await/async-fn/auxiliary/block-on.rs b/tests/ui/async-await/async-fn/auxiliary/block-on.rs
new file mode 100644
index 00000000000..dcb710fc97c
--- /dev/null
+++ b/tests/ui/async-await/async-fn/auxiliary/block-on.rs
@@ -0,0 +1,20 @@
+//@ edition: 2021
+
+#![feature(async_closure, noop_waker)]
+
+use std::future::Future;
+use std::pin::pin;
+use std::task::*;
+
+pub fn block_on<T>(fut: impl Future<Output = T>) -> T {
+    let mut fut = pin!(fut);
+    // Poll loop, just to test the future...
+    let ctx = &mut Context::from_waker(Waker::noop());
+
+    loop {
+        match unsafe { fut.as_mut().poll(ctx) } {
+            Poll::Pending => {}
+            Poll::Ready(t) => break t,
+        }
+    }
+}
diff --git a/tests/ui/async-await/async-fn/simple.rs b/tests/ui/async-await/async-fn/simple.rs
index e2a183a8c0b..21972ba5aef 100644
--- a/tests/ui/async-await/async-fn/simple.rs
+++ b/tests/ui/async-await/async-fn/simple.rs
@@ -1,8 +1,11 @@
+//@ aux-build:block-on.rs
 //@ edition: 2021
 //@ build-pass
 
 #![feature(async_fn_traits)]
 
+extern crate block_on;
+
 use std::ops::AsyncFn;
 
 async fn foo() {}
@@ -12,5 +15,7 @@ async fn call_asyncly(f: impl AsyncFn(i32) -> i32) -> i32 {
 }
 
 fn main() {
-    let fut = call_asyncly(|x| async move { x + 1 });
+    block_on::block_on(async {
+        call_asyncly(|x| async move { x + 1 }).await;
+    });
 }
diff --git a/tests/ui/async-await/for-await-passthrough.rs b/tests/ui/async-await/for-await-passthrough.rs
index 3769ef60b01..e09e843332e 100644
--- a/tests/ui/async-await/for-await-passthrough.rs
+++ b/tests/ui/async-await/for-await-passthrough.rs
@@ -4,8 +4,6 @@
 #![feature(async_iterator, async_iter_from_iter, const_waker, async_for_loop, noop_waker,
            gen_blocks)]
 
-use std::future::Future;
-
 async gen fn async_iter() -> i32 {
     let iter = core::async_iter::from_iter(0..3);
     for await i in iter {
diff --git a/tests/ui/async-await/issue-72442.stderr b/tests/ui/async-await/issue-72442.stderr
index 313f6079c7c..e68f7a29990 100644
--- a/tests/ui/async-await/issue-72442.stderr
+++ b/tests/ui/async-await/issue-72442.stderr
@@ -8,6 +8,11 @@ LL |             let mut f = File::open(path.to_str())?;
    |
 note: required by a bound in `File::open`
   --> $SRC_DIR/std/src/fs.rs:LL:COL
+help: consider removing this method call, as the receiver has type `&Path` and `&Path: AsRef<Path>` trivially holds
+   |
+LL -             let mut f = File::open(path.to_str())?;
+LL +             let mut f = File::open(path)?;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs
index e5a3d54c5d0..e1fae0f0e93 100644
--- a/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs
+++ b/tests/ui/async-await/suggest-switching-edition-on-await-cargo.rs
@@ -1,4 +1,4 @@
-//@ rustc-env:CARGO=/usr/bin/cargo
+//@ rustc-env:CARGO_CRATE_NAME=foo
 
 use std::pin::Pin;
 use std::future::Future;
diff --git a/tests/ui/auto-traits/issue-117789.rs b/tests/ui/auto-traits/issue-117789.rs
index 0c30931a1b5..63f796771db 100644
--- a/tests/ui/auto-traits/issue-117789.rs
+++ b/tests/ui/auto-traits/issue-117789.rs
@@ -1,5 +1,3 @@
-#![deny(suspicious_auto_trait_impls)]
-
 auto trait Trait<P> {} //~ ERROR auto traits cannot have generic parameters
 //~^ ERROR auto traits are experimental and possibly buggy
 impl<P> Trait<P> for () {}
diff --git a/tests/ui/auto-traits/issue-117789.stderr b/tests/ui/auto-traits/issue-117789.stderr
index 1f8880b1ef4..99efb213417 100644
--- a/tests/ui/auto-traits/issue-117789.stderr
+++ b/tests/ui/auto-traits/issue-117789.stderr
@@ -1,5 +1,5 @@
 error[E0567]: auto traits cannot have generic parameters
-  --> $DIR/issue-117789.rs:3:17
+  --> $DIR/issue-117789.rs:1:17
    |
 LL | auto trait Trait<P> {}
    |            -----^^^ help: remove the parameters
@@ -7,7 +7,7 @@ LL | auto trait Trait<P> {}
    |            auto trait cannot have generic parameters
 
 error[E0658]: auto traits are experimental and possibly buggy
-  --> $DIR/issue-117789.rs:3:1
+  --> $DIR/issue-117789.rs:1:1
    |
 LL | auto trait Trait<P> {}
    | ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/auto-traits/issue-83857-ub.rs b/tests/ui/auto-traits/issue-83857-ub.rs
index f9b47d2b0c6..20abfdd851a 100644
--- a/tests/ui/auto-traits/issue-83857-ub.rs
+++ b/tests/ui/auto-traits/issue-83857-ub.rs
@@ -1,4 +1,3 @@
-#![allow(suspicious_auto_trait_impls)]
 // Tests that we don't incorrectly allow overlap between a builtin auto trait
 // impl and a user written one. See #83857 for more details
 
diff --git a/tests/ui/auto-traits/issue-83857-ub.stderr b/tests/ui/auto-traits/issue-83857-ub.stderr
index 6372bdfe762..20bfe7e36ca 100644
--- a/tests/ui/auto-traits/issue-83857-ub.stderr
+++ b/tests/ui/auto-traits/issue-83857-ub.stderr
@@ -1,12 +1,12 @@
 error[E0277]: `Foo<T, U>` cannot be sent between threads safely
-  --> $DIR/issue-83857-ub.rs:22:38
+  --> $DIR/issue-83857-ub.rs:21:38
    |
 LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo<T, U>` cannot be sent between threads safely
    |
    = help: the trait `Send` is not implemented for `Foo<T, U>`, which is required by `Foo<T, U>: WithAssoc`
 note: required for `Foo<T, U>` to implement `WithAssoc`
-  --> $DIR/issue-83857-ub.rs:15:15
+  --> $DIR/issue-83857-ub.rs:14:15
    |
 LL | impl<T: Send> WithAssoc for T {
    |         ----  ^^^^^^^^^     ^
@@ -18,7 +18,7 @@ LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i
    |                                                                                +++++++++++++++++++++
 
 error[E0277]: `Foo<T, U>` cannot be sent between threads safely
-  --> $DIR/issue-83857-ub.rs:22:80
+  --> $DIR/issue-83857-ub.rs:21:80
    |
 LL |   fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
    |  ________________________________________________________________________________^
@@ -31,7 +31,7 @@ LL | | }
    |
    = help: the trait `Send` is not implemented for `Foo<T, U>`, which is required by `Foo<T, U>: WithAssoc`
 note: required for `Foo<T, U>` to implement `WithAssoc`
-  --> $DIR/issue-83857-ub.rs:15:15
+  --> $DIR/issue-83857-ub.rs:14:15
    |
 LL | impl<T: Send> WithAssoc for T {
    |         ----  ^^^^^^^^^     ^
@@ -43,7 +43,7 @@ LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i
    |                                                                                +++++++++++++++++++++
 
 error[E0277]: `Foo<T, U>` cannot be sent between threads safely
-  --> $DIR/issue-83857-ub.rs:25:11
+  --> $DIR/issue-83857-ub.rs:24:11
    |
 LL |     f(foo(v));
    |       --- ^ `Foo<T, U>` cannot be sent between threads safely
@@ -52,7 +52,7 @@ LL |     f(foo(v));
    |
    = help: the trait `Send` is not implemented for `Foo<T, U>`
 note: required by a bound in `foo`
-  --> $DIR/issue-83857-ub.rs:29:11
+  --> $DIR/issue-83857-ub.rs:28:11
    |
 LL | fn foo<T: Send>(x: T) -> <T as WithAssoc>::Output {
    |           ^^^^ required by this bound in `foo`
diff --git a/tests/ui/auto-traits/suspicious-impls-lint.rs b/tests/ui/auto-traits/suspicious-impls-lint.rs
deleted file mode 100644
index 7712e84f4a2..00000000000
--- a/tests/ui/auto-traits/suspicious-impls-lint.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-#![deny(suspicious_auto_trait_impls)]
-
-use std::marker::PhantomData;
-
-struct MayImplementSendOk<T>(T);
-unsafe impl<T: Send> Send for MayImplementSendOk<T> {} // ok
-
-struct MayImplementSendErr<T>(T);
-unsafe impl<T: Send> Send for MayImplementSendErr<&T> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-struct ContainsNonSendDirect<T>(*const T);
-unsafe impl<T: Send> Send for ContainsNonSendDirect<&T> {} // ok
-
-struct ContainsPtr<T>(*const T);
-struct ContainsIndirectNonSend<T>(ContainsPtr<T>);
-unsafe impl<T: Send> Send for ContainsIndirectNonSend<&T> {} // ok
-
-struct ContainsVec<T>(Vec<T>);
-unsafe impl Send for ContainsVec<i32> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-struct TwoParams<T, U>(T, U);
-unsafe impl<T: Send, U: Send> Send for TwoParams<T, U> {} // ok
-
-struct TwoParamsFlipped<T, U>(T, U);
-unsafe impl<T: Send, U: Send> Send for TwoParamsFlipped<U, T> {} // ok
-
-struct TwoParamsSame<T, U>(T, U);
-unsafe impl<T: Send> Send for TwoParamsSame<T, T> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-pub struct WithPhantomDataNonSend<T, U>(PhantomData<*const T>, U);
-unsafe impl<T> Send for WithPhantomDataNonSend<T, i8> {} // ok
-
-pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
-unsafe impl<T> Send for WithPhantomDataSend<*const T, i8> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-pub struct WithLifetime<'a, T>(&'a (), T);
-unsafe impl<T> Send for WithLifetime<'static, T> {} // ok
-unsafe impl<T> Sync for WithLifetime<'static, Vec<T>> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-fn main() {}
diff --git a/tests/ui/auto-traits/suspicious-impls-lint.stderr b/tests/ui/auto-traits/suspicious-impls-lint.stderr
deleted file mode 100644
index 9cd4e79f851..00000000000
--- a/tests/ui/auto-traits/suspicious-impls-lint.stderr
+++ /dev/null
@@ -1,82 +0,0 @@
-error: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/suspicious-impls-lint.rs:9:1
-   |
-LL | unsafe impl<T: Send> Send for MayImplementSendErr<&T> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `&T` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-impls-lint.rs:8:1
-   |
-LL | struct MayImplementSendErr<T>(T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: the lint level is defined here
-  --> $DIR/suspicious-impls-lint.rs:1:9
-   |
-LL | #![deny(suspicious_auto_trait_impls)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/suspicious-impls-lint.rs:21:1
-   |
-LL | unsafe impl Send for ContainsVec<i32> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `i32` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-impls-lint.rs:20:1
-   |
-LL | struct ContainsVec<T>(Vec<T>);
-   | ^^^^^^^^^^^^^^^^^^^^^
-
-error: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/suspicious-impls-lint.rs:32:1
-   |
-LL | unsafe impl<T: Send> Send for TwoParamsSame<T, T> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `T` is mentioned multiple times
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-impls-lint.rs:31:1
-   |
-LL | struct TwoParamsSame<T, U>(T, U);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/suspicious-impls-lint.rs:40:1
-   |
-LL | unsafe impl<T> Send for WithPhantomDataSend<*const T, i8> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `*const T` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-impls-lint.rs:39:1
-   |
-LL | pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: cross-crate traits with a default impl, like `Sync`, should not be specialized
-  --> $DIR/suspicious-impls-lint.rs:46:1
-   |
-LL | unsafe impl<T> Sync for WithLifetime<'static, Vec<T>> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `Vec<T>` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-impls-lint.rs:44:1
-   |
-LL | pub struct WithLifetime<'a, T>(&'a (), T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 5 previous errors
-
diff --git a/tests/ui/auto-traits/suspicious-negative-impls-lint.rs b/tests/ui/auto-traits/suspicious-negative-impls-lint.rs
deleted file mode 100644
index 34842e5944b..00000000000
--- a/tests/ui/auto-traits/suspicious-negative-impls-lint.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![feature(negative_impls)]
-#![deny(suspicious_auto_trait_impls)]
-
-use std::marker::PhantomData;
-
-struct ContainsVec<T>(Vec<T>);
-impl !Send for ContainsVec<u32> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
-impl<T> !Send for WithPhantomDataSend<*const T, u8> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-pub struct WithLifetime<'a, T>(&'a (), T);
-impl<T> !Sync for WithLifetime<'static, Option<T>> {}
-//~^ ERROR
-//~| WARNING this will change its meaning
-
-fn main() {}
diff --git a/tests/ui/auto-traits/suspicious-negative-impls-lint.stderr b/tests/ui/auto-traits/suspicious-negative-impls-lint.stderr
deleted file mode 100644
index ee03ea12557..00000000000
--- a/tests/ui/auto-traits/suspicious-negative-impls-lint.stderr
+++ /dev/null
@@ -1,52 +0,0 @@
-error: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/suspicious-negative-impls-lint.rs:7:1
-   |
-LL | impl !Send for ContainsVec<u32> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `u32` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-negative-impls-lint.rs:6:1
-   |
-LL | struct ContainsVec<T>(Vec<T>);
-   | ^^^^^^^^^^^^^^^^^^^^^
-note: the lint level is defined here
-  --> $DIR/suspicious-negative-impls-lint.rs:2:9
-   |
-LL | #![deny(suspicious_auto_trait_impls)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/suspicious-negative-impls-lint.rs:12:1
-   |
-LL | impl<T> !Send for WithPhantomDataSend<*const T, u8> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `*const T` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-negative-impls-lint.rs:11:1
-   |
-LL | pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: cross-crate traits with a default impl, like `Sync`, should not be specialized
-  --> $DIR/suspicious-negative-impls-lint.rs:17:1
-   |
-LL | impl<T> !Sync for WithLifetime<'static, Option<T>> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `Option<T>` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/suspicious-negative-impls-lint.rs:16:1
-   |
-LL | pub struct WithLifetime<'a, T>(&'a (), T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
diff --git a/tests/ui/borrowck/borrowck-access-permissions.rs b/tests/ui/borrowck/borrowck-access-permissions.rs
index 1638644103b..be11286a523 100644
--- a/tests/ui/borrowck/borrowck-access-permissions.rs
+++ b/tests/ui/borrowck/borrowck-access-permissions.rs
@@ -16,7 +16,7 @@ fn main() {
         let _y1 = &mut static_x; //~ ERROR [E0596]
         unsafe {
             let _y2 = &mut static_x_mut;
-            //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+            //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         }
     }
 
diff --git a/tests/ui/borrowck/borrowck-access-permissions.stderr b/tests/ui/borrowck/borrowck-access-permissions.stderr
index 93d92295dd9..11e2b63bd6c 100644
--- a/tests/ui/borrowck/borrowck-access-permissions.stderr
+++ b/tests/ui/borrowck/borrowck-access-permissions.stderr
@@ -1,14 +1,14 @@
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/borrowck-access-permissions.rs:18:23
    |
 LL |             let _y2 = &mut static_x_mut;
-   |                       ^^^^^^^^^^^^^^^^^ mutable reference of mutable static
+   |                       ^^^^^^^^^^^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |             let _y2 = addr_of_mut!(static_x_mut);
    |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs
index a89cad20f97..b09c96ada8a 100644
--- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs
+++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.rs
@@ -17,7 +17,7 @@ impl Foo {
 fn main() {
     unsafe {
         let sfoo: *mut Foo = &mut SFOO;
-        //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+        //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         let x = (*sfoo).x();
         (*sfoo).x[1] += 1;
         *x += 1;
diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr
index 7a3824f79a4..354d70eb1ad 100644
--- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr
+++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr
@@ -1,14 +1,14 @@
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/borrowck-unsafe-static-mutable-borrows.rs:19:30
    |
 LL |         let sfoo: *mut Foo = &mut SFOO;
-   |                              ^^^^^^^^^ mutable reference of mutable static
+   |                              ^^^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |         let sfoo: *mut Foo = addr_of_mut!(SFOO);
    |                              ~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/borrowck/issue-20801.rs b/tests/ui/borrowck/issue-20801.rs
index ec83af5d5df..7e3d3703dc7 100644
--- a/tests/ui/borrowck/issue-20801.rs
+++ b/tests/ui/borrowck/issue-20801.rs
@@ -12,7 +12,7 @@ fn imm_ref() -> &'static T {
 
 fn mut_ref() -> &'static mut T {
     unsafe { &mut GLOBAL_MUT_T }
-    //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
 }
 
 fn mut_ptr() -> *mut T {
diff --git a/tests/ui/borrowck/issue-20801.stderr b/tests/ui/borrowck/issue-20801.stderr
index b2bee2d8803..97294afd3df 100644
--- a/tests/ui/borrowck/issue-20801.stderr
+++ b/tests/ui/borrowck/issue-20801.stderr
@@ -1,14 +1,14 @@
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/issue-20801.rs:14:14
    |
 LL |     unsafe { &mut GLOBAL_MUT_T }
-   |              ^^^^^^^^^^^^^^^^^ mutable reference of mutable static
+   |              ^^^^^^^^^^^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |     unsafe { addr_of_mut!(GLOBAL_MUT_T) }
    |              ~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
index 9b172b41319..c3909d05963 100644
--- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
+++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs
@@ -10,7 +10,7 @@ mod borrowck_closures_unique {
         //~^ ERROR is not declared as mutable
         unsafe {
             c1(&mut Y);
-            //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+            //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         }
     }
 }
@@ -25,7 +25,7 @@ mod borrowck_closures_unique_grandparent {
         };
         unsafe {
             c1(&mut Z);
-            //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+            //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
         }
     }
 }
@@ -62,7 +62,7 @@ fn main() {
     static mut X: isize = 2;
     unsafe {
         borrowck_closures_unique::e(&mut X);
-        //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+        //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
     }
 
     mutability_errors::capture_assign_whole((1000,));
diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
index e4e4947fce1..098a2964e9f 100644
--- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
+++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr
@@ -1,42 +1,42 @@
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:12:16
    |
 LL |             c1(&mut Y);
-   |                ^^^^^^ mutable reference of mutable static
+   |                ^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |             c1(addr_of_mut!(Y));
    |                ~~~~~~~~~~~~~~~
 
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:27:16
    |
 LL |             c1(&mut Z);
-   |                ^^^^^^ mutable reference of mutable static
+   |                ^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |             c1(addr_of_mut!(Z));
    |                ~~~~~~~~~~~~~~~
 
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:64:37
    |
 LL |         borrowck_closures_unique::e(&mut X);
-   |                                     ^^^^^^ mutable reference of mutable static
+   |                                     ^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |         borrowck_closures_unique::e(addr_of_mut!(X));
    |                                     ~~~~~~~~~~~~~~~
diff --git a/tests/ui/check-cfg/cargo-feature.rs b/tests/ui/check-cfg/cargo-feature.rs
index a91068ca05a..ba451921d79 100644
--- a/tests/ui/check-cfg/cargo-feature.rs
+++ b/tests/ui/check-cfg/cargo-feature.rs
@@ -4,7 +4,7 @@
 //
 //@ check-pass
 //@ revisions: some none
-//@ rustc-env:CARGO=/usr/bin/cargo
+//@ rustc-env:CARGO_CRATE_NAME=foo
 //@ compile-flags: -Z unstable-options
 //@ [none]compile-flags: --check-cfg=cfg(feature,values())
 //@ [some]compile-flags: --check-cfg=cfg(feature,values("bitcode"))
diff --git a/tests/ui/check-cfg/diagnotics.rs b/tests/ui/check-cfg/diagnotics.rs
index 54138d15890..134bfcf8ef4 100644
--- a/tests/ui/check-cfg/diagnotics.rs
+++ b/tests/ui/check-cfg/diagnotics.rs
@@ -1,7 +1,7 @@
 //@ check-pass
 //@ revisions: cargo rustc
-//@ [rustc]unset-rustc-env:CARGO
-//@ [cargo]rustc-env:CARGO=/usr/bin/cargo
+//@ [rustc]unset-rustc-env:CARGO_CRATE_NAME
+//@ [cargo]rustc-env:CARGO_CRATE_NAME=foo
 //@ compile-flags: --check-cfg=cfg(feature,values("foo")) --check-cfg=cfg(no_values) -Z unstable-options
 
 #[cfg(featur)]
diff --git a/tests/ui/check-static-values-constraints.stderr b/tests/ui/check-static-values-constraints.stderr
index 064eb4b8a5c..e7532de5647 100644
--- a/tests/ui/check-static-values-constraints.stderr
+++ b/tests/ui/check-static-values-constraints.stderr
@@ -129,17 +129,6 @@ LL | static STATIC19: Vec<isize> = vec![3];
    = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0507]: cannot move out of static item `x`
-  --> $DIR/check-static-values-constraints.rs:119:9
-   |
-LL |         x
-   |         ^ move occurs because `x` has type `Vec<isize>`, which does not implement the `Copy` trait
-   |
-help: consider borrowing here
-   |
-LL |         &x
-   |         +
-
 error[E0010]: allocations are not allowed in statics
   --> $DIR/check-static-values-constraints.rs:117:32
    |
@@ -158,6 +147,17 @@ LL |         static x: Vec<isize> = vec![3];
    = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
+error[E0507]: cannot move out of static item `x`
+  --> $DIR/check-static-values-constraints.rs:119:9
+   |
+LL |         x
+   |         ^ move occurs because `x` has type `Vec<isize>`, which does not implement the `Copy` trait
+   |
+help: consider borrowing here
+   |
+LL |         &x
+   |         +
+
 error: aborting due to 17 previous errors
 
 Some errors have detailed explanations: E0010, E0015, E0493, E0507.
diff --git a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs
index 76a57936e69..24b87892753 100644
--- a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs
+++ b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs
@@ -13,7 +13,5 @@ impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and nega
 unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
 
 impl !Send for TestType<i32> {}
-//~^ WARNING
-//~| WARNING this will change its meaning
 
 fn main() {}
diff --git a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
index 020199da991..2463f38a922 100644
--- a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
+++ b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
@@ -16,23 +16,7 @@ LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
 LL | unsafe impl<T: 'static> Send for TestType<T> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
 
-warning: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/coherence-conflicting-negative-trait-impl.rs:15:1
-   |
-LL | impl !Send for TestType<i32> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `i32` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/coherence-conflicting-negative-trait-impl.rs:7:1
-   |
-LL | struct TestType<T>(::std::marker::PhantomData<T>);
-   | ^^^^^^^^^^^^^^^^^^
-   = note: `#[warn(suspicious_auto_trait_impls)]` on by default
-
-error: aborting due to 2 previous errors; 1 warning emitted
+error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0119, E0751.
 For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/coherence/coherence-fn-implied-bounds.rs b/tests/ui/coherence/coherence-fn-implied-bounds.rs
index 4539af9a32e..0ae54284102 100644
--- a/tests/ui/coherence/coherence-fn-implied-bounds.rs
+++ b/tests/ui/coherence/coherence-fn-implied-bounds.rs
@@ -20,7 +20,7 @@ impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
 
 impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
     //~^ ERROR conflicting implementations
-    //~| WARNING this was previously accepted by the compiler
+    //~| WARN the behavior may change in a future release
 }
 
 fn main() {}
diff --git a/tests/ui/coherence/coherence-fn-implied-bounds.stderr b/tests/ui/coherence/coherence-fn-implied-bounds.stderr
index b0dea746709..ece3288989d 100644
--- a/tests/ui/coherence/coherence-fn-implied-bounds.stderr
+++ b/tests/ui/coherence/coherence-fn-implied-bounds.stderr
@@ -7,7 +7,7 @@ LL |
 LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
    |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: the behavior may change in a future release
    = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
 note: the lint level is defined here
diff --git a/tests/ui/coherence/coherence-free-vs-bound-region.rs b/tests/ui/coherence/coherence-free-vs-bound-region.rs
index 2f5c49d293d..89d0005fb79 100644
--- a/tests/ui/coherence/coherence-free-vs-bound-region.rs
+++ b/tests/ui/coherence/coherence-free-vs-bound-region.rs
@@ -15,7 +15,7 @@ impl<'a> TheTrait for fn(&'a u8) {}
 
 impl TheTrait for fn(&u8) {
     //~^ ERROR conflicting implementations of trait
-    //~| WARNING this was previously accepted by the compiler
+    //~| WARN the behavior may change in a future release
 }
 
 fn main() {}
diff --git a/tests/ui/coherence/coherence-free-vs-bound-region.stderr b/tests/ui/coherence/coherence-free-vs-bound-region.stderr
index c97b32e429d..e45cf5ad3a4 100644
--- a/tests/ui/coherence/coherence-free-vs-bound-region.stderr
+++ b/tests/ui/coherence/coherence-free-vs-bound-region.stderr
@@ -7,7 +7,7 @@ LL |
 LL | impl TheTrait for fn(&u8) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)`
    |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: the behavior may change in a future release
    = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
 note: the lint level is defined here
diff --git a/tests/ui/coherence/coherence-orphan.rs b/tests/ui/coherence/coherence-orphan.rs
index c06705133c8..9c96958f21a 100644
--- a/tests/ui/coherence/coherence-orphan.rs
+++ b/tests/ui/coherence/coherence-orphan.rs
@@ -7,18 +7,16 @@ use lib::TheTrait;
 
 struct TheType;
 
-impl TheTrait<usize> for isize { }
+impl TheTrait<usize> for isize {}
 //~^ ERROR E0117
 //~| ERROR not all trait items implemented
 
-impl TheTrait<TheType> for isize { }
+impl TheTrait<TheType> for isize {}
 //~^ ERROR not all trait items implemented
 
-impl TheTrait<isize> for TheType { }
+impl TheTrait<isize> for TheType {}
 //~^ ERROR not all trait items implemented
 
-impl !Send for Vec<isize> { } //~ ERROR E0117
-//~^ WARNING
-//~| WARNING this will change its meaning
+impl !Send for Vec<isize> {} //~ ERROR E0117
 
-fn main() { }
+fn main() {}
diff --git a/tests/ui/coherence/coherence-orphan.stderr b/tests/ui/coherence/coherence-orphan.stderr
index 78fad837647..b1bb75bfe51 100644
--- a/tests/ui/coherence/coherence-orphan.stderr
+++ b/tests/ui/coherence/coherence-orphan.stderr
@@ -1,7 +1,7 @@
 error[E0117]: only traits defined in the current crate can be implemented for primitive types
   --> $DIR/coherence-orphan.rs:10:1
    |
-LL | impl TheTrait<usize> for isize { }
+LL | impl TheTrait<usize> for isize {}
    | ^^^^^---------------^^^^^-----
    | |    |                   |
    | |    |                   `isize` is not defined in the current crate
@@ -13,7 +13,7 @@ LL | impl TheTrait<usize> for isize { }
 error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
   --> $DIR/coherence-orphan.rs:20:1
    |
-LL | impl !Send for Vec<isize> { }
+LL | impl !Send for Vec<isize> {}
    | ^^^^^^^^^^^^^^^----------
    | |              |
    | |              `Vec` is not defined in the current crate
@@ -21,23 +21,10 @@ LL | impl !Send for Vec<isize> { }
    |
    = note: define and implement a trait or new type instead
 
-warning: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/coherence-orphan.rs:20:1
-   |
-LL | impl !Send for Vec<isize> { }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `isize` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-   = note: `#[warn(suspicious_auto_trait_impls)]` on by default
-
 error[E0046]: not all trait items implemented, missing: `the_fn`
   --> $DIR/coherence-orphan.rs:10:1
    |
-LL | impl TheTrait<usize> for isize { }
+LL | impl TheTrait<usize> for isize {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `the_fn` in implementation
    |
    = help: implement the missing item: `fn the_fn(&self) { todo!() }`
@@ -45,7 +32,7 @@ LL | impl TheTrait<usize> for isize { }
 error[E0046]: not all trait items implemented, missing: `the_fn`
   --> $DIR/coherence-orphan.rs:14:1
    |
-LL | impl TheTrait<TheType> for isize { }
+LL | impl TheTrait<TheType> for isize {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `the_fn` in implementation
    |
    = help: implement the missing item: `fn the_fn(&self) { todo!() }`
@@ -53,12 +40,12 @@ LL | impl TheTrait<TheType> for isize { }
 error[E0046]: not all trait items implemented, missing: `the_fn`
   --> $DIR/coherence-orphan.rs:17:1
    |
-LL | impl TheTrait<isize> for TheType { }
+LL | impl TheTrait<isize> for TheType {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `the_fn` in implementation
    |
    = help: implement the missing item: `fn the_fn(&self) { todo!() }`
 
-error: aborting due to 5 previous errors; 1 warning emitted
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0046, E0117.
 For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/coherence/coherence-overlap-negative-impls.rs b/tests/ui/coherence/coherence-overlap-negative-impls.rs
index 9a85d8c5a63..ffcd56817e5 100644
--- a/tests/ui/coherence/coherence-overlap-negative-impls.rs
+++ b/tests/ui/coherence/coherence-overlap-negative-impls.rs
@@ -15,16 +15,20 @@ struct Test;
 
 trait Fold<F> {}
 
-impl<T, F> Fold<F> for Cons<T> // 0
+impl<T, F> Fold<F> for Cons<T>
+// 0
 where
     T: Fold<Nil>,
-{}
+{
+}
 
-impl<T, F> Fold<F> for Cons<T> // 1
+impl<T, F> Fold<F> for Cons<T>
+// 1
 where
     T: Fold<F>,
     private::Is<T>: private::NotNil,
-{}
+{
+}
 
 impl<F> Fold<F> for Test {} // 2
 
@@ -34,7 +38,6 @@ mod private {
     pub struct Is<T>(T);
     pub auto trait NotNil {}
 
-    #[allow(suspicious_auto_trait_impls)]
     impl !NotNil for Is<Nil> {}
 }
 
diff --git a/tests/ui/coherence/coherence-subtyping.rs b/tests/ui/coherence/coherence-subtyping.rs
index da0cc2d0265..4365ad5c884 100644
--- a/tests/ui/coherence/coherence-subtyping.rs
+++ b/tests/ui/coherence/coherence-subtyping.rs
@@ -13,8 +13,8 @@ trait TheTrait {
 impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
 
 impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
-    //~^ WARNING conflicting implementation
-    //~^^ WARNING this was previously accepted by the compiler but is being phased out
+    //~^ WARN conflicting implementation
+    //~| WARN the behavior may change in a future release
 }
 
 fn main() {}
diff --git a/tests/ui/coherence/coherence-subtyping.stderr b/tests/ui/coherence/coherence-subtyping.stderr
index 9d90019a50f..42f256ace78 100644
--- a/tests/ui/coherence/coherence-subtyping.stderr
+++ b/tests/ui/coherence/coherence-subtyping.stderr
@@ -7,7 +7,7 @@ LL |
 LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
    |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: the behavior may change in a future release
    = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
    = note: `#[warn(coherence_leak_check)]` on by default
diff --git a/tests/ui/coherence/coherence-wasm-bindgen.rs b/tests/ui/coherence/coherence-wasm-bindgen.rs
index ee09a72449b..57daaa134d4 100644
--- a/tests/ui/coherence/coherence-wasm-bindgen.rs
+++ b/tests/ui/coherence/coherence-wasm-bindgen.rs
@@ -31,7 +31,7 @@ where
     R: ReturnWasmAbi,
 {
     //~^^^^^ ERROR conflicting implementation
-    //~| WARNING this was previously accepted
+    //~| WARN the behavior may change in a future release
 }
 
 fn main() {}
diff --git a/tests/ui/coherence/coherence-wasm-bindgen.stderr b/tests/ui/coherence/coherence-wasm-bindgen.stderr
index b3c3dac612d..939f1fce9a4 100644
--- a/tests/ui/coherence/coherence-wasm-bindgen.stderr
+++ b/tests/ui/coherence/coherence-wasm-bindgen.stderr
@@ -13,7 +13,7 @@ LL | |     A: RefFromWasmAbi,
 LL | |     R: ReturnWasmAbi,
    | |_____________________^ conflicting implementation for `&dyn Fn(&_) -> _`
    |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: the behavior may change in a future release
    = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
    = note: downstream crates may implement trait `FromWasmAbi` for type `&_`
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
diff --git a/tests/ui/coherence/coherent-due-to-fulfill.rs b/tests/ui/coherence/coherent-due-to-fulfill.rs
new file mode 100644
index 00000000000..084f9be0a8c
--- /dev/null
+++ b/tests/ui/coherence/coherent-due-to-fulfill.rs
@@ -0,0 +1,20 @@
+//@ compile-flags: -Znext-solver=coherence
+//@ check-pass
+
+trait Mirror {
+    type Assoc;
+}
+impl<T> Mirror for T {
+    type Assoc = T;
+}
+
+trait Foo {}
+trait Bar {}
+
+// self type starts out as `?0` but is constrained to `()`
+// due to the where clause below. Because `(): Bar` does not
+// hold in intercrate mode, we can prove the impls disjoint.
+impl<T> Foo for T where (): Mirror<Assoc = T> {}
+impl<T> Foo for T where T: Bar {}
+
+fn main() {}
diff --git a/tests/ui/coherence/const-errs-dont-conflict-103369.rs b/tests/ui/coherence/const-errs-dont-conflict-103369.rs
new file mode 100644
index 00000000000..c7d46a8000d
--- /dev/null
+++ b/tests/ui/coherence/const-errs-dont-conflict-103369.rs
@@ -0,0 +1,14 @@
+// #103369: don't complain about conflicting implementations with [const error]
+
+pub trait ConstGenericTrait<const N: u32> {}
+
+impl ConstGenericTrait<{my_fn(1)}> for () {}
+
+impl ConstGenericTrait<{my_fn(2)}> for () {}
+
+const fn my_fn(v: u32) -> u32 {
+    panic!("Some error occurred"); //~ ERROR E0080
+    //~| ERROR E0080
+}
+
+fn main() {}
diff --git a/tests/ui/coherence/const-errs-dont-conflict-103369.stderr b/tests/ui/coherence/const-errs-dont-conflict-103369.stderr
new file mode 100644
index 00000000000..22066d6b6bd
--- /dev/null
+++ b/tests/ui/coherence/const-errs-dont-conflict-103369.stderr
@@ -0,0 +1,39 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-errs-dont-conflict-103369.rs:10:5
+   |
+LL |     panic!("Some error occurred");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
+   |
+note: inside `my_fn`
+  --> $DIR/const-errs-dont-conflict-103369.rs:10:5
+   |
+LL |     panic!("Some error occurred");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside `<() as ConstGenericTrait<{my_fn(1)}>>::{constant#0}`
+  --> $DIR/const-errs-dont-conflict-103369.rs:5:25
+   |
+LL | impl ConstGenericTrait<{my_fn(1)}> for () {}
+   |                         ^^^^^^^^
+   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-errs-dont-conflict-103369.rs:10:5
+   |
+LL |     panic!("Some error occurred");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
+   |
+note: inside `my_fn`
+  --> $DIR/const-errs-dont-conflict-103369.rs:10:5
+   |
+LL |     panic!("Some error occurred");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside `<() as ConstGenericTrait<{my_fn(2)}>>::{constant#0}`
+  --> $DIR/const-errs-dont-conflict-103369.rs:7:25
+   |
+LL | impl ConstGenericTrait<{my_fn(2)}> for () {}
+   |                         ^^^^^^^^
+   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/coherence/incoherent-even-though-we-fulfill.rs b/tests/ui/coherence/incoherent-even-though-we-fulfill.rs
new file mode 100644
index 00000000000..b3c9cf328c2
--- /dev/null
+++ b/tests/ui/coherence/incoherent-even-though-we-fulfill.rs
@@ -0,0 +1,22 @@
+//@ compile-flags: -Znext-solver=coherence
+
+trait Mirror {
+    type Assoc;
+}
+impl<T> Mirror for T {
+    type Assoc = T;
+}
+
+trait Foo {}
+
+// Even though using fulfillment in coherence allows us to figure out that
+// `?T = ()`, we still treat it as incoherent because `(): Iterator` may be
+// added upstream.
+impl<T> Foo for T where (): Mirror<Assoc = T> {}
+//~^ NOTE first implementation here
+impl<T> Foo for T where T: Iterator {}
+//~^ ERROR conflicting implementations of trait `Foo` for type `()`
+//~| NOTE conflicting implementation for `()`
+//~| NOTE upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions
+
+fn main() {}
diff --git a/tests/ui/coherence/incoherent-even-though-we-fulfill.stderr b/tests/ui/coherence/incoherent-even-though-we-fulfill.stderr
new file mode 100644
index 00000000000..b16465d2011
--- /dev/null
+++ b/tests/ui/coherence/incoherent-even-though-we-fulfill.stderr
@@ -0,0 +1,14 @@
+error[E0119]: conflicting implementations of trait `Foo` for type `()`
+  --> $DIR/incoherent-even-though-we-fulfill.rs:17:1
+   |
+LL | impl<T> Foo for T where (): Mirror<Assoc = T> {}
+   | --------------------------------------------- first implementation here
+LL |
+LL | impl<T> Foo for T where T: Iterator {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+   |
+   = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr
index 5368db29338..832c56a4554 100644
--- a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr
+++ b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr
@@ -6,7 +6,7 @@ LL | impl<T: ?Sized + Marker> FnMarker for fn(T) {}
 LL | impl<T: ?Sized> FnMarker for fn(&T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&_)`
    |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: the behavior may change in a future release
    = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
 note: the lint level is defined here
diff --git a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs
index 7967002e021..e487dcc3c0e 100644
--- a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs
+++ b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs
@@ -20,6 +20,6 @@ trait FnMarker {}
 impl<T: ?Sized + Marker> FnMarker for fn(T) {}
 impl<T: ?Sized> FnMarker for fn(&T) {}
 //[explicit]~^ ERROR conflicting implementations of trait `FnMarker` for type `fn(&_)`
-//[explicit]~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+//[explicit]~| WARN the behavior may change in a future release
 
 fn main() {}
diff --git a/tests/ui/coherence/occurs-check/associated-type.next.stderr b/tests/ui/coherence/occurs-check/associated-type.next.stderr
index 65be4a9c884..e405f389f5e 100644
--- a/tests/ui/coherence/occurs-check/associated-type.next.stderr
+++ b/tests/ui/coherence/occurs-check/associated-type.next.stderr
@@ -1,11 +1,11 @@
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())`
   --> $DIR/associated-type.rs:31:1
    |
diff --git a/tests/ui/coherence/occurs-check/associated-type.old.stderr b/tests/ui/coherence/occurs-check/associated-type.old.stderr
index 8e852ec796e..4a67a777f10 100644
--- a/tests/ui/coherence/occurs-check/associated-type.old.stderr
+++ b/tests/ui/coherence/occurs-check/associated-type.old.stderr
@@ -1,11 +1,11 @@
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
-WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
+WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) })
 error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)`
   --> $DIR/associated-type.rs:31:1
    |
diff --git a/tests/ui/const-generics/invariant.rs b/tests/ui/const-generics/invariant.rs
index 39d658be67d..ee4ad4e7c4e 100644
--- a/tests/ui/const-generics/invariant.rs
+++ b/tests/ui/const-generics/invariant.rs
@@ -12,18 +12,16 @@ impl SadBee for for<'a> fn(&'a ()) {
     const ASSOC: usize = 0;
 }
 impl SadBee for fn(&'static ()) {
-    //~^ WARNING conflicting implementations of trait
-    //~| WARNING this was previously accepted
+    //~^ WARN conflicting implementations of trait
+    //~| WARN the behavior may change in a future release
     const ASSOC: usize = 100;
 }
 
 struct Foo<T: SadBee>([u8; <T as SadBee>::ASSOC], PhantomData<T>)
 where
-    [(); <T as SadBee>::ASSOC]: ;
+    [(); <T as SadBee>::ASSOC]:;
 
-fn covariant(
-    v: &'static Foo<for<'a> fn(&'a ())>
-) -> &'static Foo<fn(&'static ())> {
+fn covariant(v: &'static Foo<for<'a> fn(&'a ())>) -> &'static Foo<fn(&'static ())> {
     v
     //~^ ERROR mismatched types
 }
diff --git a/tests/ui/const-generics/invariant.stderr b/tests/ui/const-generics/invariant.stderr
index f631e131146..b4e46e55268 100644
--- a/tests/ui/const-generics/invariant.stderr
+++ b/tests/ui/const-generics/invariant.stderr
@@ -7,13 +7,13 @@ LL | impl SadBee for for<'a> fn(&'a ()) {
 LL | impl SadBee for fn(&'static ()) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())`
    |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: the behavior may change in a future release
    = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
    = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
    = note: `#[warn(coherence_leak_check)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/invariant.rs:27:5
+  --> $DIR/invariant.rs:25:5
    |
 LL |     v
    |     ^ one type is more general than the other
diff --git a/tests/ui/const-generics/issues/issue-100313.rs b/tests/ui/const-generics/issues/issue-100313.rs
index 9af9b5ca458..4e9d3626aa8 100644
--- a/tests/ui/const-generics/issues/issue-100313.rs
+++ b/tests/ui/const-generics/issues/issue-100313.rs
@@ -9,7 +9,6 @@ impl <const B: &'static bool> T<B> {
         unsafe {
             *(B as *const bool as *mut bool) = false;
             //~^ ERROR evaluation of constant value failed [E0080]
-            //~| ERROR assigning to `&T` is undefined behavior
         }
     }
 }
diff --git a/tests/ui/const-generics/issues/issue-100313.stderr b/tests/ui/const-generics/issues/issue-100313.stderr
index 5832dbe1777..a422764fe2c 100644
--- a/tests/ui/const-generics/issues/issue-100313.stderr
+++ b/tests/ui/const-generics/issues/issue-100313.stderr
@@ -1,12 +1,3 @@
-error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
-  --> $DIR/issue-100313.rs:10:13
-   |
-LL |             *(B as *const bool as *mut bool) = false;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
-   = note: `#[deny(invalid_reference_casting)]` on by default
-
 error[E0080]: evaluation of constant value failed
   --> $DIR/issue-100313.rs:10:13
    |
@@ -19,11 +10,11 @@ note: inside `T::<&true>::set_false`
 LL |             *(B as *const bool as *mut bool) = false;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: inside `_`
-  --> $DIR/issue-100313.rs:19:5
+  --> $DIR/issue-100313.rs:18:5
    |
 LL |     x.set_false();
    |     ^^^^^^^^^^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-array-oob.rs b/tests/ui/consts/const-array-oob.rs
index c747ab50c16..cf3db077e36 100644
--- a/tests/ui/consts/const-array-oob.rs
+++ b/tests/ui/consts/const-array-oob.rs
@@ -1,5 +1,6 @@
 const FOO: [usize; 3] = [1, 2, 3];
-const BAR: usize = FOO[5]; // no error, because the error below occurs before regular const eval
+const BAR: usize = FOO[5];
+//~^ ERROR: evaluation of constant value failed
 
 const BLUB: [u32; FOO[4]] = [5, 6];
 //~^ ERROR evaluation of constant value failed [E0080]
diff --git a/tests/ui/consts/const-array-oob.stderr b/tests/ui/consts/const-array-oob.stderr
index d481d772894..be31f183b9a 100644
--- a/tests/ui/consts/const-array-oob.stderr
+++ b/tests/ui/consts/const-array-oob.stderr
@@ -1,9 +1,15 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-array-oob.rs:4:19
+  --> $DIR/const-array-oob.rs:5:19
    |
 LL | const BLUB: [u32; FOO[4]] = [5, 6];
    |                   ^^^^^^ index out of bounds: the length is 3 but the index is 4
 
-error: aborting due to 1 previous error
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const-array-oob.rs:2:20
+   |
+LL | const BAR: usize = FOO[5];
+   |                    ^^^^^^ index out of bounds: the length is 3 but the index is 5
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-err2.noopt.stderr b/tests/ui/consts/const-err2.noopt.stderr
deleted file mode 100644
index 8b1688c4a89..00000000000
--- a/tests/ui/consts/const-err2.noopt.stderr
+++ /dev/null
@@ -1,48 +0,0 @@
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:19:13
-   |
-LL |     let a = -i8::MIN;
-   |             ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
-   |
-   = note: `#[deny(arithmetic_overflow)]` on by default
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:21:18
-   |
-LL |     let a_i128 = -i128::MIN;
-   |                  ^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:23:13
-   |
-LL |     let b = 200u8 + 200u8 + 200u8;
-   |             ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:25:18
-   |
-LL |     let b_i128 = i128::MIN - i128::MAX;
-   |                  ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:27:13
-   |
-LL |     let c = 200u8 * 4;
-   |             ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:29:13
-   |
-LL |     let d = 42u8 - (42u8 + 1);
-   |             ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
-
-error: this operation will panic at runtime
-  --> $DIR/const-err2.rs:31:14
-   |
-LL |     let _e = [5u8][1];
-   |              ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
-   |
-   = note: `#[deny(unconditional_panic)]` on by default
-
-error: aborting due to 7 previous errors
-
diff --git a/tests/ui/consts/const-err2.opt.stderr b/tests/ui/consts/const-err2.opt.stderr
deleted file mode 100644
index 8b1688c4a89..00000000000
--- a/tests/ui/consts/const-err2.opt.stderr
+++ /dev/null
@@ -1,48 +0,0 @@
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:19:13
-   |
-LL |     let a = -i8::MIN;
-   |             ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
-   |
-   = note: `#[deny(arithmetic_overflow)]` on by default
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:21:18
-   |
-LL |     let a_i128 = -i128::MIN;
-   |                  ^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:23:13
-   |
-LL |     let b = 200u8 + 200u8 + 200u8;
-   |             ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:25:18
-   |
-LL |     let b_i128 = i128::MIN - i128::MAX;
-   |                  ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:27:13
-   |
-LL |     let c = 200u8 * 4;
-   |             ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:29:13
-   |
-LL |     let d = 42u8 - (42u8 + 1);
-   |             ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
-
-error: this operation will panic at runtime
-  --> $DIR/const-err2.rs:31:14
-   |
-LL |     let _e = [5u8][1];
-   |              ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
-   |
-   = note: `#[deny(unconditional_panic)]` on by default
-
-error: aborting due to 7 previous errors
-
diff --git a/tests/ui/consts/const-err2.opt_with_overflow_checks.stderr b/tests/ui/consts/const-err2.opt_with_overflow_checks.stderr
deleted file mode 100644
index 8b1688c4a89..00000000000
--- a/tests/ui/consts/const-err2.opt_with_overflow_checks.stderr
+++ /dev/null
@@ -1,48 +0,0 @@
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:19:13
-   |
-LL |     let a = -i8::MIN;
-   |             ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
-   |
-   = note: `#[deny(arithmetic_overflow)]` on by default
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:21:18
-   |
-LL |     let a_i128 = -i128::MIN;
-   |                  ^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:23:13
-   |
-LL |     let b = 200u8 + 200u8 + 200u8;
-   |             ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:25:18
-   |
-LL |     let b_i128 = i128::MIN - i128::MAX;
-   |                  ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:27:13
-   |
-LL |     let c = 200u8 * 4;
-   |             ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
-
-error: this arithmetic operation will overflow
-  --> $DIR/const-err2.rs:29:13
-   |
-LL |     let d = 42u8 - (42u8 + 1);
-   |             ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
-
-error: this operation will panic at runtime
-  --> $DIR/const-err2.rs:31:14
-   |
-LL |     let _e = [5u8][1];
-   |              ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
-   |
-   = note: `#[deny(unconditional_panic)]` on by default
-
-error: aborting due to 7 previous errors
-
diff --git a/tests/ui/consts/const-err2.rs b/tests/ui/consts/const-err2.rs
deleted file mode 100644
index 67c85d35401..00000000000
--- a/tests/ui/consts/const-err2.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// needed because negating int::MIN will behave differently between
-// optimized compilation and unoptimized compilation and thus would
-// lead to different lints being emitted
-
-//@ revisions: noopt opt opt_with_overflow_checks
-//@[noopt]compile-flags: -C opt-level=0
-//@[opt]compile-flags: -O
-//@[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
-
-//@ build-fail
-
-#![feature(rustc_attrs)]
-
-fn black_box<T>(_: T) {
-    unimplemented!()
-}
-
-fn main() {
-    let a = -i8::MIN;
-    //~^ ERROR arithmetic operation will overflow
-    let a_i128 = -i128::MIN;
-    //~^ ERROR arithmetic operation will overflow
-    let b = 200u8 + 200u8 + 200u8;
-    //~^ ERROR arithmetic operation will overflow
-    let b_i128 = i128::MIN - i128::MAX;
-    //~^ ERROR arithmetic operation will overflow
-    let c = 200u8 * 4;
-    //~^ ERROR arithmetic operation will overflow
-    let d = 42u8 - (42u8 + 1);
-    //~^ ERROR arithmetic operation will overflow
-    let _e = [5u8][1];
-    //~^ ERROR operation will panic
-    black_box(a);
-    black_box(a_i128);
-    black_box(b);
-    black_box(b_i128);
-    black_box(c);
-    black_box(d);
-}
diff --git a/tests/ui/consts/const-eval/const-eval-query-stack.stderr b/tests/ui/consts/const-eval/const-eval-query-stack.stderr
index 2fcb3d41dd9..96fd9ed5f04 100644
--- a/tests/ui/consts/const-eval/const-eval-query-stack.stderr
+++ b/tests/ui/consts/const-eval/const-eval-query-stack.stderr
@@ -7,6 +7,5 @@ LL | const X: i32 = 1 / 0;
 query stack during panic:
 #0 [eval_to_allocation_raw] const-evaluating + checking `X`
 #1 [eval_to_const_value_raw] simplifying constant for the type system `X`
-#2 [lint_mod] linting top-level module
-#3 [analysis] running analysis passes on this crate
+#2 [analysis] running analysis passes on this crate
 end of query stack
diff --git a/tests/ui/consts/const-eval/const_fn_ptr.stderr b/tests/ui/consts/const-eval/const_fn_ptr.stderr
index ca1585f8837..682a5a23afc 100644
--- a/tests/ui/consts/const-eval/const_fn_ptr.stderr
+++ b/tests/ui/consts/const-eval/const_fn_ptr.stderr
@@ -1,11 +1,6 @@
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/const_fn_ptr.rs:11:5
-   |
-LL |     X(x)
-   |     ^^^^
-help: skipping check that does not even have a feature gate
   --> $DIR/const_fn_ptr.rs:15:5
    |
 LL |     X_CONST(x)
@@ -15,6 +10,11 @@ help: skipping check that does not even have a feature gate
    |
 LL |     x(y)
    |     ^^^^
+help: skipping check that does not even have a feature gate
+  --> $DIR/const_fn_ptr.rs:11:5
+   |
+LL |     X(x)
+   |     ^^^^
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/consts/const-eval/generic-slice.stderr b/tests/ui/consts/const-eval/generic-slice.stderr
index ff1dc29ccfd..8559f6d1a44 100644
--- a/tests/ui/consts/const-eval/generic-slice.stderr
+++ b/tests/ui/consts/const-eval/generic-slice.stderr
@@ -1,4 +1,18 @@
 error[E0597]: `x` does not live long enough
+  --> $DIR/generic-slice.rs:27:5
+   |
+LL |     let x: &[_] = &[];
+   |         - binding `x` declared here
+LL |     &x
+   |     ^^
+   |     |
+   |     borrowed value does not live long enough
+   |     using this value as a static requires that `x` is borrowed for `'static`
+LL |
+LL | };
+   | - `x` dropped here while still borrowed
+
+error[E0597]: `x` does not live long enough
   --> $DIR/generic-slice.rs:15:9
    |
 LL | impl<'a, T: 'static> Generic<'a, T> {
@@ -15,20 +29,6 @@ LL |
 LL |     };
    |     - `x` dropped here while still borrowed
 
-error[E0597]: `x` does not live long enough
-  --> $DIR/generic-slice.rs:27:5
-   |
-LL |     let x: &[_] = &[];
-   |         - binding `x` declared here
-LL |     &x
-   |     ^^
-   |     |
-   |     borrowed value does not live long enough
-   |     using this value as a static requires that `x` is borrowed for `'static`
-LL |
-LL | };
-   | - `x` dropped here while still borrowed
-
 error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0597`.
diff --git a/tests/ui/consts/const-eval/issue-44578.stderr b/tests/ui/consts/const-eval/issue-44578.stderr
index 6aabe53011c..7d5cf86d396 100644
--- a/tests/ui/consts/const-eval/issue-44578.stderr
+++ b/tests/ui/consts/const-eval/issue-44578.stderr
@@ -16,6 +16,14 @@ note: erroneous constant encountered
 LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+note: erroneous constant encountered
+  --> $DIR/issue-44578.rs:25:20
+   |
+LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
    = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: erroneous constant encountered
diff --git a/tests/ui/consts/const-eval/issue-50814.rs b/tests/ui/consts/const-eval/issue-50814.rs
index ca26f51f111..27b5b39ad73 100644
--- a/tests/ui/consts/const-eval/issue-50814.rs
+++ b/tests/ui/consts/const-eval/issue-50814.rs
@@ -14,6 +14,7 @@ struct Sum<A, B>(A, B);
 impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A, B> {
     const MAX: u8 = A::MAX + B::MAX;
     //~^ ERROR evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
+    //~| ERROR evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
 }
 
 fn foo<T>(_: T) -> &'static u8 {
diff --git a/tests/ui/consts/const-eval/issue-50814.stderr b/tests/ui/consts/const-eval/issue-50814.stderr
index 65c49956f18..8d018161401 100644
--- a/tests/ui/consts/const-eval/issue-50814.stderr
+++ b/tests/ui/consts/const-eval/issue-50814.stderr
@@ -5,17 +5,33 @@ LL |     const MAX: u8 = A::MAX + B::MAX;
    |                     ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814.rs:20:6
+  --> $DIR/issue-50814.rs:21:6
    |
 LL |     &Sum::<U8, U8>::MAX
    |      ^^^^^^^^^^^^^^^^^^
 
+error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
+  --> $DIR/issue-50814.rs:15:21
+   |
+LL |     const MAX: u8 = A::MAX + B::MAX;
+   |                     ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+note: erroneous constant encountered
+  --> $DIR/issue-50814.rs:21:6
+   |
+LL |     &Sum::<U8, U8>::MAX
+   |      ^^^^^^^^^^^^^^^^^^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
 note: the above error was encountered while instantiating `fn foo::<i32>`
-  --> $DIR/issue-50814.rs:25:5
+  --> $DIR/issue-50814.rs:26:5
    |
 LL |     foo(0);
    |     ^^^^^^
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs b/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
index 5fc0674c576..261dea6182d 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -1,7 +1,6 @@
 const fn foo() -> ! {
     unsafe { std::mem::transmute(()) }
     //~^ ERROR evaluation of constant value failed
-    //~| WARN the type `!` does not permit zero-initialization [invalid_value]
 }
 
 // Type defined in a submodule, so that it is not "visibly"
@@ -18,7 +17,6 @@ const FOO: [empty::Empty; 3] = [foo(); 3];
 
 const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
 //~^ ERROR evaluation of constant value failed
-//~| WARN the type `empty::Empty` does not permit zero-initialization
 
 fn main() {
     FOO;
diff --git a/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr b/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr
index 4c50ab5319e..d9f1780f7b9 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr
@@ -1,12 +1,3 @@
-warning: the type `!` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:2:14
-   |
-LL |     unsafe { std::mem::transmute(()) }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
-   |
-   = note: the `!` type has no valid value
-   = note: `#[warn(invalid_value)]` on by default
-
 error[E0080]: evaluation of constant value failed
   --> $DIR/validate_uninhabited_zsts.rs:2:14
    |
@@ -19,34 +10,17 @@ note: inside `foo`
 LL |     unsafe { std::mem::transmute(()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^
 note: inside `FOO`
-  --> $DIR/validate_uninhabited_zsts.rs:17:33
+  --> $DIR/validate_uninhabited_zsts.rs:16:33
    |
 LL | const FOO: [empty::Empty; 3] = [foo(); 3];
    |                                 ^^^^^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/validate_uninhabited_zsts.rs:19:42
+  --> $DIR/validate_uninhabited_zsts.rs:18:42
    |
 LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type `Void`
 
-warning: the type `empty::Empty` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:19:42
-   |
-LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
-   |
-note: in this struct field
-  --> $DIR/validate_uninhabited_zsts.rs:14:22
-   |
-LL |     pub struct Empty(Void);
-   |                      ^^^^
-note: enums with no inhabited variants have no valid value
-  --> $DIR/validate_uninhabited_zsts.rs:11:5
-   |
-LL |     enum Void {}
-   |     ^^^^^^^^^
-
-error: aborting due to 2 previous errors; 2 warnings emitted
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-mut-refs/issue-76510.rs b/tests/ui/consts/const-mut-refs/issue-76510.rs
index b6a73abb09c..685e3a129c2 100644
--- a/tests/ui/consts/const-mut-refs/issue-76510.rs
+++ b/tests/ui/consts/const-mut-refs/issue-76510.rs
@@ -3,7 +3,6 @@ use std::mem::{transmute, ManuallyDrop};
 const S: &'static mut str = &mut " hello ";
 //~^ ERROR: mutable references are not allowed in the final value of constants
 //~| ERROR: mutation through a reference is not allowed in constants
-//~| ERROR: cannot borrow data in a `&` reference as mutable
 
 const fn trigger() -> [(); unsafe {
         let s = transmute::<(*const u8, usize), &ManuallyDrop<str>>((S.as_ptr(), 3));
diff --git a/tests/ui/consts/const-mut-refs/issue-76510.stderr b/tests/ui/consts/const-mut-refs/issue-76510.stderr
index 8a1b19baff7..ab4487026cf 100644
--- a/tests/ui/consts/const-mut-refs/issue-76510.stderr
+++ b/tests/ui/consts/const-mut-refs/issue-76510.stderr
@@ -14,13 +14,7 @@ LL | const S: &'static mut str = &mut " hello ";
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/issue-76510.rs:3:29
-   |
-LL | const S: &'static mut str = &mut " hello ";
-   |                             ^^^^^^^^^^^^^^ cannot borrow as mutable
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0596, E0658, E0764.
-For more information about an error, try `rustc --explain E0596`.
+Some errors have detailed explanations: E0658, E0764.
+For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/const-ref-to-static-linux-vtable.rs b/tests/ui/consts/const-ref-to-static-linux-vtable.rs
new file mode 100644
index 00000000000..9325746c1e7
--- /dev/null
+++ b/tests/ui/consts/const-ref-to-static-linux-vtable.rs
@@ -0,0 +1,43 @@
+//@check-pass
+//! This is the reduced version of the "Linux kernel vtable" use-case.
+#![feature(const_mut_refs, const_refs_to_static)]
+use std::ptr::addr_of_mut;
+
+#[repr(C)]
+struct ThisModule(i32);
+
+trait Module {
+    const THIS_MODULE_PTR: *mut ThisModule;
+}
+
+struct MyModule;
+
+// Generated by a macro.
+extern "C" {
+    static mut THIS_MODULE: ThisModule;
+}
+
+// Generated by a macro.
+impl Module for MyModule {
+    const THIS_MODULE_PTR: *mut ThisModule = unsafe { addr_of_mut!(THIS_MODULE) };
+}
+
+struct Vtable {
+    module: *mut ThisModule,
+    foo_fn: fn(*mut ()) -> i32,
+}
+
+trait Foo {
+    type Mod: Module;
+
+    fn foo(&mut self) -> i32;
+}
+
+fn generate_vtable<T: Foo>() -> &'static Vtable {
+    &Vtable {
+        module: T::Mod::THIS_MODULE_PTR,
+        foo_fn: |ptr| unsafe { &mut *ptr.cast::<T>() }.foo(),
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/consts/const_cmp_type_id.stderr b/tests/ui/consts/const_cmp_type_id.stderr
index 84be0b67307..98f5b3a5e90 100644
--- a/tests/ui/consts/const_cmp_type_id.stderr
+++ b/tests/ui/consts/const_cmp_type_id.stderr
@@ -4,6 +4,12 @@ error[E0131]: `main` function is not allowed to have generic parameters
 LL | const fn main() {
    |              ^ `main` cannot have generic parameters
 
+error[E0080]: evaluation of constant value failed
+  --> $DIR/const_cmp_type_id.rs:10:22
+   |
+LL |     const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `<TypeId as PartialOrd>::lt`
+
 error[E0308]: mismatched types
   --> $DIR/const_cmp_type_id.rs:8:13
    |
@@ -22,7 +28,7 @@ LL |     assert!(TypeId::of::<()>() != TypeId::of::<u8>());
    = note: expected constant `host`
               found constant `true`
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0131, E0308.
-For more information about an error, try `rustc --explain E0131`.
+Some errors have detailed explanations: E0080, E0131, E0308.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const_let_assign2.rs b/tests/ui/consts/const_let_assign2.rs
index f239507d245..e8ebba7b208 100644
--- a/tests/ui/consts/const_let_assign2.rs
+++ b/tests/ui/consts/const_let_assign2.rs
@@ -16,7 +16,7 @@ static mut BB: AA = AA::new();
 
 fn main() {
     let ptr = unsafe { &mut BB };
-    //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
     for a in ptr.data.iter() {
         println!("{}", a);
     }
diff --git a/tests/ui/consts/const_let_assign2.stderr b/tests/ui/consts/const_let_assign2.stderr
index 2764153a8a5..5ae8fd353dd 100644
--- a/tests/ui/consts/const_let_assign2.stderr
+++ b/tests/ui/consts/const_let_assign2.stderr
@@ -1,14 +1,14 @@
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/const_let_assign2.rs:18:24
    |
 LL |     let ptr = unsafe { &mut BB };
-   |                        ^^^^^^^ mutable reference of mutable static
+   |                        ^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |     let ptr = unsafe { addr_of_mut!(BB) };
    |                        ~~~~~~~~~~~~~~~~
diff --git a/tests/ui/consts/const_let_assign3.stderr b/tests/ui/consts/const_let_assign3.stderr
index 40c11acee5c..ae890131715 100644
--- a/tests/ui/consts/const_let_assign3.stderr
+++ b/tests/ui/consts/const_let_assign3.stderr
@@ -1,18 +1,18 @@
-error[E0658]: mutable references are not allowed in constant functions
-  --> $DIR/const_let_assign3.rs:6:18
+error[E0658]: mutable references are not allowed in constants
+  --> $DIR/const_let_assign3.rs:14:5
    |
-LL |     const fn foo(&mut self, x: u32) {
-   |                  ^^^^^^^^^
+LL |     s.foo(3);
+   |     ^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: mutable references are not allowed in constants
-  --> $DIR/const_let_assign3.rs:14:5
+error[E0658]: mutable references are not allowed in constant functions
+  --> $DIR/const_let_assign3.rs:6:18
    |
-LL |     s.foo(3);
-   |     ^
+LL |     const fn foo(&mut self, x: u32) {
+   |                  ^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.rs b/tests/ui/consts/const_refs_to_static_fail_invalid.rs
index 363a6da0901..be1574af588 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.rs
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.rs
@@ -1,7 +1,7 @@
 //@ normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
 #![feature(const_refs_to_static)]
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 
 fn invalid() {
     static S: i8 = 10;
@@ -43,8 +43,8 @@ fn mutable() {
     // This *must not build*, the constant we are matching against
     // could change its value!
     match &42 {
-        C => {}, //~ERROR: could not evaluate constant pattern
-        _ => {},
+        C => {} //~ERROR: could not evaluate constant pattern
+        _ => {}
     }
 }
 
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
index 082f8532444..d5bb4847746 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
@@ -9,12 +9,6 @@ LL |     const C: &bool = unsafe { std::mem::transmute(&S) };
                HEX_DUMP
            }
 
-error: could not evaluate constant pattern
-  --> $DIR/const_refs_to_static_fail_invalid.rs:15:9
-   |
-LL |         C => {}
-   |         ^
-
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/const_refs_to_static_fail_invalid.rs:25:5
    |
@@ -26,12 +20,6 @@ LL |     const C: &i8 = unsafe { &S };
                HEX_DUMP
            }
 
-error: could not evaluate constant pattern
-  --> $DIR/const_refs_to_static_fail_invalid.rs:31:9
-   |
-LL |         C => {}
-   |         ^
-
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/const_refs_to_static_fail_invalid.rs:39:5
    |
@@ -44,9 +32,21 @@ LL |     const C: &i32 = unsafe { &S_MUT };
            }
 
 error: could not evaluate constant pattern
+  --> $DIR/const_refs_to_static_fail_invalid.rs:15:9
+   |
+LL |         C => {}
+   |         ^
+
+error: could not evaluate constant pattern
+  --> $DIR/const_refs_to_static_fail_invalid.rs:31:9
+   |
+LL |         C => {}
+   |         ^
+
+error: could not evaluate constant pattern
   --> $DIR/const_refs_to_static_fail_invalid.rs:46:9
    |
-LL |         C => {},
+LL |         C => {}
    |         ^
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr
index afe89461f03..527579d99ea 100644
--- a/tests/ui/consts/fn_trait_refs.stderr
+++ b/tests/ui/consts/fn_trait_refs.stderr
@@ -74,6 +74,24 @@ LL |     T: ~const FnMut<()> + ~const Destruct,
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
+error[E0015]: cannot call non-const operator in constants
+  --> $DIR/fn_trait_refs.rs:72:17
+   |
+LL |         assert!(test_one == (1, 1, 1));
+   |                 ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+   = help: add `#![feature(effects)]` to the crate attributes to enable
+
+error[E0015]: cannot call non-const operator in constants
+  --> $DIR/fn_trait_refs.rs:75:17
+   |
+LL |         assert!(test_two == (2, 2));
+   |                 ^^^^^^^^^^^^^^^^^^
+   |
+   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+   = help: add `#![feature(effects)]` to the crate attributes to enable
+
 error[E0015]: cannot call non-const closure in constant functions
   --> $DIR/fn_trait_refs.rs:17:5
    |
@@ -149,24 +167,6 @@ LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output)
 LL | }
    | - value is dropped here
 
-error[E0015]: cannot call non-const operator in constants
-  --> $DIR/fn_trait_refs.rs:72:17
-   |
-LL |         assert!(test_one == (1, 1, 1));
-   |                 ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
-   = help: add `#![feature(effects)]` to the crate attributes to enable
-
-error[E0015]: cannot call non-const operator in constants
-  --> $DIR/fn_trait_refs.rs:75:17
-   |
-LL |         assert!(test_two == (2, 2));
-   |                 ^^^^^^^^^^^^^^^^^^
-   |
-   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
-   = help: add `#![feature(effects)]` to the crate attributes to enable
-
 error: aborting due to 20 previous errors
 
 Some errors have detailed explanations: E0015, E0493, E0635.
diff --git a/tests/ui/consts/issue-16538.stderr b/tests/ui/consts/issue-16538.stderr
index 834ffa8d3a0..3981b4ada49 100644
--- a/tests/ui/consts/issue-16538.stderr
+++ b/tests/ui/consts/issue-16538.stderr
@@ -1,3 +1,12 @@
+error[E0015]: cannot call non-const fn `Y::foo` in statics
+  --> $DIR/issue-16538.rs:11:23
+   |
+LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+
 error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
   --> $DIR/issue-16538.rs:11:22
    |
@@ -14,15 +23,6 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
    |
    = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
 
-error[E0015]: cannot call non-const fn `Y::foo` in statics
-  --> $DIR/issue-16538.rs:11:23
-   |
-LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
-   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
-
 error: aborting due to 3 previous errors
 
 Some errors have detailed explanations: E0015, E0133.
diff --git a/tests/ui/consts/issue-17718-const-bad-values.rs b/tests/ui/consts/issue-17718-const-bad-values.rs
index 0299bfef1b4..33347d8df62 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.rs
+++ b/tests/ui/consts/issue-17718-const-bad-values.rs
@@ -1,4 +1,4 @@
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 
 const C1: &'static mut [usize] = &mut [];
 //~^ ERROR: mutable references are not allowed
@@ -6,5 +6,6 @@ const C1: &'static mut [usize] = &mut [];
 static mut S: usize = 3;
 const C2: &'static mut usize = unsafe { &mut S };
 //~^ ERROR: referencing statics in constants
+//~| ERROR: mutable references are not allowed
 
 fn main() {}
diff --git a/tests/ui/consts/issue-17718-const-bad-values.stderr b/tests/ui/consts/issue-17718-const-bad-values.stderr
index 57fcb1c7e9a..e755e5601a8 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.stderr
+++ b/tests/ui/consts/issue-17718-const-bad-values.stderr
@@ -16,7 +16,17 @@ LL | const C2: &'static mut usize = unsafe { &mut S };
    = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
    = help: to fix this, the value can be extracted to a `const` and then used.
 
-error: aborting due to 2 previous errors
+error[E0658]: mutable references are not allowed in constants
+  --> $DIR/issue-17718-const-bad-values.rs:7:41
+   |
+LL | const C2: &'static mut usize = unsafe { &mut S };
+   |                                         ^^^^^^
+   |
+   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+error: aborting due to 3 previous errors
 
 Some errors have detailed explanations: E0658, E0764.
 For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/issue-66693.rs b/tests/ui/consts/issue-66693.rs
index df45d01ec02..416bd8ec72a 100644
--- a/tests/ui/consts/issue-66693.rs
+++ b/tests/ui/consts/issue-66693.rs
@@ -12,9 +12,11 @@ const fn _foo() {
     //~^ ERROR: argument to `panic!()` in a const context must have type `&str`
 }
 
-// ensure that conforming panics don't cause an error
+// ensure that conforming panics don't cause an error beyond the failure to const eval
 const _: () = panic!();
+//~^ ERROR: evaluation of constant value failed
 static _BAR: () = panic!("panic in static");
+//~^ ERROR could not evaluate static initializer
 
 const fn _bar() {
     panic!("panic in const fn");
diff --git a/tests/ui/consts/issue-66693.stderr b/tests/ui/consts/issue-66693.stderr
index f4898fd9732..a435ace4773 100644
--- a/tests/ui/consts/issue-66693.stderr
+++ b/tests/ui/consts/issue-66693.stderr
@@ -14,6 +14,22 @@ LL | static _FOO: () = panic!(true);
    |
    = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
 
+error[E0080]: evaluation of constant value failed
+  --> $DIR/issue-66693.rs:16:15
+   |
+LL | const _: () = panic!();
+   |               ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/issue-66693.rs:16:15
+   |
+   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: could not evaluate static initializer
+  --> $DIR/issue-66693.rs:18:19
+   |
+LL | static _BAR: () = panic!("panic in static");
+   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'panic in static', $DIR/issue-66693.rs:18:19
+   |
+   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
 error: argument to `panic!()` in a const context must have type `&str`
   --> $DIR/issue-66693.rs:11:5
    |
@@ -22,5 +38,6 @@ LL |     panic!(&1);
    |
    = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 3 previous errors
+error: aborting due to 5 previous errors
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/box.stderr b/tests/ui/consts/miri_unleashed/box.stderr
index 5229f1e50cd..a0518c99cda 100644
--- a/tests/ui/consts/miri_unleashed/box.stderr
+++ b/tests/ui/consts/miri_unleashed/box.stderr
@@ -16,7 +16,7 @@ help: skipping check for `const_mut_refs` feature
    |
 LL |     &mut *(Box::new(0))
    |     ^^^^^^^^^^^^^^^^^^^
-help: skipping check that does not even have a feature gate
+help: skipping check for `const_mut_refs` feature
   --> $DIR/box.rs:8:5
    |
 LL |     &mut *(Box::new(0))
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
index 6ec44aab2c1..5e7845e4e82 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
@@ -3,7 +3,7 @@
 //@ normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
 #![feature(exclusive_range_pattern, half_open_range_patterns_in_slices)]
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 
 extern crate static_cross_crate;
 
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
index 7b22fa4399f..7a7b7bc57da 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
@@ -9,12 +9,6 @@ LL | const SLICE_MUT: &[u8; 1] = {
                HEX_DUMP
            }
 
-error: could not evaluate constant pattern
-  --> $DIR/const_refers_to_static_cross_crate.rs:40:9
-   |
-LL |         SLICE_MUT => true,
-   |         ^^^^^^^^^
-
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/const_refers_to_static_cross_crate.rs:17:1
    |
@@ -26,12 +20,6 @@ LL | const U8_MUT: &u8 = {
                HEX_DUMP
            }
 
-error: could not evaluate constant pattern
-  --> $DIR/const_refers_to_static_cross_crate.rs:48:9
-   |
-LL |         U8_MUT => true,
-   |         ^^^^^^
-
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/const_refers_to_static_cross_crate.rs:23:1
    |
@@ -43,12 +31,6 @@ LL | const U8_MUT2: &u8 = {
                HEX_DUMP
            }
 
-error: could not evaluate constant pattern
-  --> $DIR/const_refers_to_static_cross_crate.rs:58:9
-   |
-LL |         U8_MUT2 => true,
-   |         ^^^^^^^
-
 error[E0080]: evaluation of constant value failed
   --> $DIR/const_refers_to_static_cross_crate.rs:29:15
    |
@@ -56,6 +38,24 @@ LL |         match static_cross_crate::OPT_ZERO {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses mutable global memory
 
 error: could not evaluate constant pattern
+  --> $DIR/const_refers_to_static_cross_crate.rs:40:9
+   |
+LL |         SLICE_MUT => true,
+   |         ^^^^^^^^^
+
+error: could not evaluate constant pattern
+  --> $DIR/const_refers_to_static_cross_crate.rs:48:9
+   |
+LL |         U8_MUT => true,
+   |         ^^^^^^
+
+error: could not evaluate constant pattern
+  --> $DIR/const_refers_to_static_cross_crate.rs:58:9
+   |
+LL |         U8_MUT2 => true,
+   |         ^^^^^^^
+
+error: could not evaluate constant pattern
   --> $DIR/const_refers_to_static_cross_crate.rs:65:9
    |
 LL |         U8_MUT3 => true,
diff --git a/tests/ui/consts/miri_unleashed/extern-static.rs b/tests/ui/consts/miri_unleashed/extern-static.rs
index 1a523cc8e31..c9d9397518e 100644
--- a/tests/ui/consts/miri_unleashed/extern-static.rs
+++ b/tests/ui/consts/miri_unleashed/extern-static.rs
@@ -1,6 +1,6 @@
 //@ compile-flags: -Zunleash-the-miri-inside-of-you
 #![feature(thread_local)]
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 
 extern "C" {
     static mut DATA: u8;
diff --git a/tests/ui/consts/miri_unleashed/mutable_references.rs b/tests/ui/consts/miri_unleashed/mutable_references.rs
index a361c504b5e..ce7df4b1620 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references.rs
+++ b/tests/ui/consts/miri_unleashed/mutable_references.rs
@@ -4,29 +4,26 @@ use std::cell::UnsafeCell;
 
 // a test demonstrating what things we could allow with a smarter const qualification
 
-// this is fine because is not possible to mutate through an immutable reference.
 static FOO: &&mut u32 = &&mut 42;
+//~^ ERROR encountered mutable pointer in final value of static
 
-// this is fine because accessing an immutable static `BAR` is equivalent to accessing `*&BAR`
-// which puts the mutable reference behind an immutable one.
 static BAR: &mut () = &mut ();
+//~^ ERROR encountered mutable pointer in final value of static
 
 struct Foo<T>(T);
 
-// this is fine for the same reason as `BAR`.
 static BOO: &mut Foo<()> = &mut Foo(());
+//~^ ERROR encountered mutable pointer in final value of static
 
-// interior mutability is fine
 struct Meh {
     x: &'static UnsafeCell<i32>,
 }
 unsafe impl Sync for Meh {}
-static MEH: Meh = Meh {
-    x: &UnsafeCell::new(42),
-};
+static MEH: Meh = Meh { x: &UnsafeCell::new(42) };
+//~^ ERROR encountered mutable pointer in final value of static
 
-// this is fine for the same reason as `BAR`.
 static OH_YES: &mut i32 = &mut 42;
+//~^ ERROR encountered mutable pointer in final value of static
 
 fn main() {
     unsafe {
diff --git a/tests/ui/consts/miri_unleashed/mutable_references.stderr b/tests/ui/consts/miri_unleashed/mutable_references.stderr
index 39298842a33..532d7408e68 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references.stderr
+++ b/tests/ui/consts/miri_unleashed/mutable_references.stderr
@@ -1,5 +1,35 @@
+error: encountered mutable pointer in final value of static
+  --> $DIR/mutable_references.rs:7:1
+   |
+LL | static FOO: &&mut u32 = &&mut 42;
+   | ^^^^^^^^^^^^^^^^^^^^^
+
+error: encountered mutable pointer in final value of static
+  --> $DIR/mutable_references.rs:10:1
+   |
+LL | static BAR: &mut () = &mut ();
+   | ^^^^^^^^^^^^^^^^^^^
+
+error: encountered mutable pointer in final value of static
+  --> $DIR/mutable_references.rs:15:1
+   |
+LL | static BOO: &mut Foo<()> = &mut Foo(());
+   | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: encountered mutable pointer in final value of static
+  --> $DIR/mutable_references.rs:22:1
+   |
+LL | static MEH: Meh = Meh { x: &UnsafeCell::new(42) };
+   | ^^^^^^^^^^^^^^^
+
+error: encountered mutable pointer in final value of static
+  --> $DIR/mutable_references.rs:25:1
+   |
+LL | static OH_YES: &mut i32 = &mut 42;
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0594]: cannot assign to `*OH_YES`, as `OH_YES` is an immutable static item
-  --> $DIR/mutable_references.rs:35:5
+  --> $DIR/mutable_references.rs:32:5
    |
 LL |     *OH_YES = 99;
    |     ^^^^^^^^^^^^ cannot assign
@@ -7,31 +37,31 @@ LL |     *OH_YES = 99;
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:8:26
+  --> $DIR/mutable_references.rs:7:26
    |
 LL | static FOO: &&mut u32 = &&mut 42;
    |                          ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:12:23
+  --> $DIR/mutable_references.rs:10:23
    |
 LL | static BAR: &mut () = &mut ();
    |                       ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:17:28
+  --> $DIR/mutable_references.rs:15:28
    |
 LL | static BOO: &mut Foo<()> = &mut Foo(());
    |                            ^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:25:8
+  --> $DIR/mutable_references.rs:22:28
    |
-LL |     x: &UnsafeCell::new(42),
-   |        ^^^^^^^^^^^^^^^^^^^^
+LL | static MEH: Meh = Meh { x: &UnsafeCell::new(42) };
+   |                            ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:29:27
+  --> $DIR/mutable_references.rs:25:27
    |
 LL | static OH_YES: &mut i32 = &mut 42;
    |                           ^^^^^^^
 
-error: aborting due to 1 previous error; 1 warning emitted
+error: aborting due to 6 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0594`.
diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
index 401cf46710a..ea7573bf217 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
+++ b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
@@ -5,13 +5,13 @@ LL | const MUH: Meh = Meh {
    | ^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:27:1
+  --> $DIR/mutable_references_err.rs:28:1
    |
 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references_err.rs:32:1
+  --> $DIR/mutable_references_err.rs:33:1
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static`
@@ -22,13 +22,13 @@ LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
            }
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:35:1
+  --> $DIR/mutable_references_err.rs:36:1
    |
 LL | const BLUNT: &mut i32 = &mut 42;
    | ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references_err.rs:40:1
+  --> $DIR/mutable_references_err.rs:41:1
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -39,7 +39,7 @@ LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references_err.rs:47:1
+  --> $DIR/mutable_references_err.rs:48:1
    |
 LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -50,49 +50,49 @@ LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
            }
 
 note: erroneous constant encountered
-  --> $DIR/mutable_references_err.rs:49:34
+  --> $DIR/mutable_references_err.rs:50:34
    |
 LL | const READS_FROM_MUTABLE: i32 = *POINTS_TO_MUTABLE1;
    |                                  ^^^^^^^^^^^^^^^^^^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/mutable_references_err.rs:51:43
+  --> $DIR/mutable_references_err.rs:52:43
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
    |                                           ^^^^^^^^^^^^^ constant accesses mutable global memory
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:55:1
+  --> $DIR/mutable_references_err.rs:56:1
    |
 LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:57:1
+  --> $DIR/mutable_references_err.rs:58:1
    |
 LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:59:1
+  --> $DIR/mutable_references_err.rs:60:1
    |
 LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:69:1
+  --> $DIR/mutable_references_err.rs:72:1
    |
 LL | const RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:71:1
+  --> $DIR/mutable_references_err.rs:74:1
    |
-LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
+LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:73:1
+  --> $DIR/mutable_references_err.rs:76:1
    |
 LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,77 +100,77 @@ LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:18:8
+  --> $DIR/mutable_references_err.rs:19:8
    |
 LL |     x: &UnsafeCell::new(42),
    |        ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:27:27
+  --> $DIR/mutable_references_err.rs:28:27
    |
 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:32:40
+  --> $DIR/mutable_references_err.rs:33:40
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    |                                        ^^^
-help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:32:35
+help: skipping check for `const_mut_refs` feature
+  --> $DIR/mutable_references_err.rs:33:35
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    |                                   ^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:35:25
+  --> $DIR/mutable_references_err.rs:36:25
    |
 LL | const BLUNT: &mut i32 = &mut 42;
    |                         ^^^^^^^
 help: skipping check for `const_mut_refs` feature
-  --> $DIR/mutable_references_err.rs:40:49
+  --> $DIR/mutable_references_err.rs:41:49
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_mut_refs` feature
-  --> $DIR/mutable_references_err.rs:40:49
+  --> $DIR/mutable_references_err.rs:41:49
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:47:44
+  --> $DIR/mutable_references_err.rs:48:44
    |
 LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
    |                                            ^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:51:45
+  --> $DIR/mutable_references_err.rs:52:45
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
    |                                             ^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:55:45
+  --> $DIR/mutable_references_err.rs:56:45
    |
 LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
    |                                             ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:57:46
+  --> $DIR/mutable_references_err.rs:58:46
    |
 LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
    |                                              ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:59:47
+  --> $DIR/mutable_references_err.rs:60:47
    |
 LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    |                                               ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:69:51
+  --> $DIR/mutable_references_err.rs:72:51
    |
 LL | const RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
    |                                                   ^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:71:50
+  --> $DIR/mutable_references_err.rs:74:49
    |
-LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
-   |                                                  ^^^^^^^
+LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
+   |                                                 ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:73:51
+  --> $DIR/mutable_references_err.rs:76:51
    |
 LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                   ^^^^^^
diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
index 0eb01f5b773..2b5e8643f3b 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
+++ b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
@@ -5,13 +5,13 @@ LL | const MUH: Meh = Meh {
    | ^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:27:1
+  --> $DIR/mutable_references_err.rs:28:1
    |
 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references_err.rs:32:1
+  --> $DIR/mutable_references_err.rs:33:1
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static`
@@ -22,13 +22,13 @@ LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
            }
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:35:1
+  --> $DIR/mutable_references_err.rs:36:1
    |
 LL | const BLUNT: &mut i32 = &mut 42;
    | ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references_err.rs:40:1
+  --> $DIR/mutable_references_err.rs:41:1
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -39,7 +39,7 @@ LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references_err.rs:47:1
+  --> $DIR/mutable_references_err.rs:48:1
    |
 LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -50,49 +50,49 @@ LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
            }
 
 note: erroneous constant encountered
-  --> $DIR/mutable_references_err.rs:49:34
+  --> $DIR/mutable_references_err.rs:50:34
    |
 LL | const READS_FROM_MUTABLE: i32 = *POINTS_TO_MUTABLE1;
    |                                  ^^^^^^^^^^^^^^^^^^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/mutable_references_err.rs:51:43
+  --> $DIR/mutable_references_err.rs:52:43
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
    |                                           ^^^^^^^^^^^^^ constant accesses mutable global memory
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:55:1
+  --> $DIR/mutable_references_err.rs:56:1
    |
 LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:57:1
+  --> $DIR/mutable_references_err.rs:58:1
    |
 LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:59:1
+  --> $DIR/mutable_references_err.rs:60:1
    |
 LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:69:1
+  --> $DIR/mutable_references_err.rs:72:1
    |
 LL | const RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:71:1
+  --> $DIR/mutable_references_err.rs:74:1
    |
-LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
+LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references_err.rs:73:1
+  --> $DIR/mutable_references_err.rs:76:1
    |
 LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,77 +100,77 @@ LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:18:8
+  --> $DIR/mutable_references_err.rs:19:8
    |
 LL |     x: &UnsafeCell::new(42),
    |        ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:27:27
+  --> $DIR/mutable_references_err.rs:28:27
    |
 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:32:40
+  --> $DIR/mutable_references_err.rs:33:40
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    |                                        ^^^
-help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:32:35
+help: skipping check for `const_mut_refs` feature
+  --> $DIR/mutable_references_err.rs:33:35
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    |                                   ^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:35:25
+  --> $DIR/mutable_references_err.rs:36:25
    |
 LL | const BLUNT: &mut i32 = &mut 42;
    |                         ^^^^^^^
 help: skipping check for `const_mut_refs` feature
-  --> $DIR/mutable_references_err.rs:40:49
+  --> $DIR/mutable_references_err.rs:41:49
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_mut_refs` feature
-  --> $DIR/mutable_references_err.rs:40:49
+  --> $DIR/mutable_references_err.rs:41:49
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:47:44
+  --> $DIR/mutable_references_err.rs:48:44
    |
 LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
    |                                            ^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:51:45
+  --> $DIR/mutable_references_err.rs:52:45
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
    |                                             ^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:55:45
+  --> $DIR/mutable_references_err.rs:56:45
    |
 LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
    |                                             ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:57:46
+  --> $DIR/mutable_references_err.rs:58:46
    |
 LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
    |                                              ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:59:47
+  --> $DIR/mutable_references_err.rs:60:47
    |
 LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    |                                               ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:69:51
+  --> $DIR/mutable_references_err.rs:72:51
    |
 LL | const RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
    |                                                   ^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:71:50
+  --> $DIR/mutable_references_err.rs:74:49
    |
-LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
-   |                                                  ^^^^^^^
+LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
+   |                                                 ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references_err.rs:73:51
+  --> $DIR/mutable_references_err.rs:76:51
    |
 LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                   ^^^^^^
diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.rs b/tests/ui/consts/miri_unleashed/mutable_references_err.rs
index 2075adad6f7..feb2c825380 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references_err.rs
+++ b/tests/ui/consts/miri_unleashed/mutable_references_err.rs
@@ -1,9 +1,9 @@
 //@ stderr-per-bitwidth
 //@ compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(invalid_reference_casting, static_mut_ref)]
+#![allow(invalid_reference_casting, static_mut_refs)]
 
-use std::sync::atomic::*;
 use std::cell::UnsafeCell;
+use std::sync::atomic::*;
 
 // this test ensures that our mutability story is sound
 
@@ -14,7 +14,8 @@ unsafe impl Sync for Meh {}
 
 // the following will never be ok! no interior mut behind consts, because
 // all allocs interned here will be marked immutable.
-const MUH: Meh = Meh { //~ ERROR: mutable pointer in final value
+const MUH: Meh = Meh {
+    //~^ ERROR encountered mutable pointer in final value of constant
     x: &UnsafeCell::new(42),
 };
 
@@ -59,7 +60,9 @@ const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
 const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
 //~^ ERROR: mutable pointer in final value
 
-struct SyncPtr<T> { x : *const T }
+struct SyncPtr<T> {
+    x: *const T,
+}
 unsafe impl<T> Sync for SyncPtr<T> {}
 
 // These pass the lifetime checks because of the "tail expression" / "outer scope" rule.
@@ -68,7 +71,7 @@ unsafe impl<T> Sync for SyncPtr<T> {}
 // (Also see `static-no-inner-mut` for similar tests on `static`.)
 const RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
 //~^ ERROR mutable pointer in final value
-const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
+const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
 //~^ ERROR mutable pointer in final value
 const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
 //~^ ERROR mutable pointer in final value
diff --git a/tests/ui/consts/mut-ptr-to-static.rs b/tests/ui/consts/mut-ptr-to-static.rs
new file mode 100644
index 00000000000..d8a788bb37d
--- /dev/null
+++ b/tests/ui/consts/mut-ptr-to-static.rs
@@ -0,0 +1,40 @@
+//@run-pass
+#![feature(const_mut_refs)]
+#![feature(sync_unsafe_cell)]
+
+use std::cell::SyncUnsafeCell;
+use std::ptr;
+
+#[repr(C)]
+struct SyncPtr {
+    foo: *mut u32,
+}
+unsafe impl Sync for SyncPtr {}
+
+static mut STATIC: u32 = 42;
+
+static INTERIOR_MUTABLE_STATIC: SyncUnsafeCell<u32> = SyncUnsafeCell::new(42);
+
+// A static that mutably points to STATIC.
+static PTR: SyncPtr = SyncPtr {
+    foo: unsafe { ptr::addr_of_mut!(STATIC) },
+};
+static INTERIOR_MUTABLE_PTR: SyncPtr = SyncPtr {
+    foo: ptr::addr_of!(INTERIOR_MUTABLE_STATIC) as *mut u32,
+};
+
+fn main() {
+    let ptr = PTR.foo;
+    unsafe {
+        assert_eq!(*ptr, 42);
+        *ptr = 0;
+        assert_eq!(*PTR.foo, 0);
+    }
+
+    let ptr = INTERIOR_MUTABLE_PTR.foo;
+    unsafe {
+        assert_eq!(*ptr, 42);
+        *ptr = 0;
+        assert_eq!(*INTERIOR_MUTABLE_PTR.foo, 0);
+    }
+}
diff --git a/tests/ui/consts/overflowing-consts.noopt.stderr b/tests/ui/consts/overflowing-consts.noopt.stderr
new file mode 100644
index 00000000000..81f22944adb
--- /dev/null
+++ b/tests/ui/consts/overflowing-consts.noopt.stderr
@@ -0,0 +1,1023 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:19:22
+   |
+LL | const _NI8_SHL: i8 = 1i8 << 8;
+   |                      ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:20:26
+   |
+LL | const _NI8_SHL_P: &i8 = &(1i8 << 8);
+   |                          ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:22:24
+   |
+LL | const _NI16_SHL: i16 = 1i16 << 16;
+   |                        ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:23:28
+   |
+LL | const _NI16_SHL_P: &i16 = &(1i16 << 16);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:25:24
+   |
+LL | const _NI32_SHL: i32 = 1i32 << 32;
+   |                        ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:26:28
+   |
+LL | const _NI32_SHL_P: &i32 = &(1i32 << 32);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:28:24
+   |
+LL | const _NI64_SHL: i64 = 1i64 << 64;
+   |                        ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:29:28
+   |
+LL | const _NI64_SHL_P: &i64 = &(1i64 << 64);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:31:26
+   |
+LL | const _NI128_SHL: i128 = 1i128 << 128;
+   |                          ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:32:30
+   |
+LL | const _NI128_SHL_P: &i128 = &(1i128 << 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:34:22
+   |
+LL | const _NU8_SHL: u8 = 1u8 << 8;
+   |                      ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:35:26
+   |
+LL | const _NU8_SHL_P: &u8 = &(1u8 << 8);
+   |                          ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:37:24
+   |
+LL | const _NU16_SHL: u16 = 1u16 << 16;
+   |                        ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:38:28
+   |
+LL | const _NU16_SHL_P: &u16 = &(1u16 << 16);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:40:24
+   |
+LL | const _NU32_SHL: u32 = 1u32 << 32;
+   |                        ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:41:28
+   |
+LL | const _NU32_SHL_P: &u32 = &(1u32 << 32);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:43:24
+   |
+LL | const _NU64_SHL: u64 = 1u64 << 64;
+   |                        ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:44:28
+   |
+LL | const _NU64_SHL_P: &u64 = &(1u64 << 64);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:46:26
+   |
+LL | const _NU128_SHL: u128 = 1u128 << 128;
+   |                          ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:47:30
+   |
+LL | const _NU128_SHL_P: &u128 = &(1u128 << 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:49:28
+   |
+LL | const _NISIZE_SHL: isize = 1isize << BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:50:32
+   |
+LL | const _NISIZE_SHL_P: &isize = &(1isize << BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:52:28
+   |
+LL | const _NUSIZE_SHL: usize = 1usize << BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:53:32
+   |
+LL | const _NUSIZE_SHL_P: &usize = &(1usize << BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:57:22
+   |
+LL | const _NI8_SHR: i8 = 1i8 >> 8;
+   |                      ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:58:26
+   |
+LL | const _NI8_SHR_P: &i8 = &(1i8 >> 8);
+   |                          ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:60:24
+   |
+LL | const _NI16_SHR: i16 = 1i16 >> 16;
+   |                        ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:61:28
+   |
+LL | const _NI16_SHR_P: &i16 = &(1i16 >> 16);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:63:24
+   |
+LL | const _NI32_SHR: i32 = 1i32 >> 32;
+   |                        ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:64:28
+   |
+LL | const _NI32_SHR_P: &i32 = &(1i32 >> 32);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:66:24
+   |
+LL | const _NI64_SHR: i64 = 1i64 >> 64;
+   |                        ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:67:28
+   |
+LL | const _NI64_SHR_P: &i64 = &(1i64 >> 64);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:69:26
+   |
+LL | const _NI128_SHR: i128 = 1i128 >> 128;
+   |                          ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:70:30
+   |
+LL | const _NI128_SHR_P: &i128 = &(1i128 >> 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:72:22
+   |
+LL | const _NU8_SHR: u8 = 1u8 >> 8;
+   |                      ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:73:26
+   |
+LL | const _NU8_SHR_P: &u8 = &(1u8 >> 8);
+   |                          ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:75:24
+   |
+LL | const _NU16_SHR: u16 = 1u16 >> 16;
+   |                        ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:76:28
+   |
+LL | const _NU16_SHR_P: &u16 = &(1u16 >> 16);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:78:24
+   |
+LL | const _NU32_SHR: u32 = 1u32 >> 32;
+   |                        ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:79:28
+   |
+LL | const _NU32_SHR_P: &u32 = &(1u32 >> 32);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:81:24
+   |
+LL | const _NU64_SHR: u64 = 1u64 >> 64;
+   |                        ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:82:28
+   |
+LL | const _NU64_SHR_P: &u64 = &(1u64 >> 64);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:84:26
+   |
+LL | const _NU128_SHR: u128 = 1u128 >> 128;
+   |                          ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:85:30
+   |
+LL | const _NU128_SHR_P: &u128 = &(1u128 >> 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:87:28
+   |
+LL | const _NISIZE_SHR: isize = 1isize >> BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:88:32
+   |
+LL | const _NISIZE_SHR_P: &isize = &(1isize >> BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:90:28
+   |
+LL | const _NUSIZE_SHR: usize = 1usize >> BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:91:32
+   |
+LL | const _NUSIZE_SHR_P: &usize = &(1usize >> BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:95:22
+   |
+LL | const _NI8_ADD: i8 = 1i8 + i8::MAX;
+   |                      ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:96:26
+   |
+LL | const _NI8_ADD_P: &i8 = &(1i8 + i8::MAX);
+   |                          ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:98:24
+   |
+LL | const _NI16_ADD: i16 = 1i16 + i16::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:99:28
+   |
+LL | const _NI16_ADD_P: &i16 = &(1i16 + i16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:101:24
+   |
+LL | const _NI32_ADD: i32 = 1i32 + i32::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:102:28
+   |
+LL | const _NI32_ADD_P: &i32 = &(1i32 + i32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:104:24
+   |
+LL | const _NI64_ADD: i64 = 1i64 + i64::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:105:28
+   |
+LL | const _NI64_ADD_P: &i64 = &(1i64 + i64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:107:26
+   |
+LL | const _NI128_ADD: i128 = 1i128 + i128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:108:30
+   |
+LL | const _NI128_ADD_P: &i128 = &(1i128 + i128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:110:22
+   |
+LL | const _NU8_ADD: u8 = 1u8 + u8::MAX;
+   |                      ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:111:26
+   |
+LL | const _NU8_ADD_P: &u8 = &(1u8 + u8::MAX);
+   |                          ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:113:24
+   |
+LL | const _NU16_ADD: u16 = 1u16 + u16::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:114:28
+   |
+LL | const _NU16_ADD_P: &u16 = &(1u16 + u16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:116:24
+   |
+LL | const _NU32_ADD: u32 = 1u32 + u32::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:117:28
+   |
+LL | const _NU32_ADD_P: &u32 = &(1u32 + u32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:119:24
+   |
+LL | const _NU64_ADD: u64 = 1u64 + u64::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:120:28
+   |
+LL | const _NU64_ADD_P: &u64 = &(1u64 + u64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:122:26
+   |
+LL | const _NU128_ADD: u128 = 1u128 + u128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:123:30
+   |
+LL | const _NU128_ADD_P: &u128 = &(1u128 + u128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:125:28
+   |
+LL | const _NISIZE_ADD: isize = 1isize + isize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:126:32
+   |
+LL | const _NISIZE_ADD_P: &isize = &(1isize + isize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:128:28
+   |
+LL | const _NUSIZE_ADD: usize = 1usize + usize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:129:32
+   |
+LL | const _NUSIZE_ADD_P: &usize = &(1usize + usize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:133:22
+   |
+LL | const _NI8_SUB: i8 = -5i8 - i8::MAX;
+   |                      ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:134:26
+   |
+LL | const _NI8_SUB_P: &i8 = &(-5i8 - i8::MAX);
+   |                          ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:136:24
+   |
+LL | const _NI16_SUB: i16 = -5i16 - i16::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:137:28
+   |
+LL | const _NI16_SUB_P: &i16 = &(-5i16 - i16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:139:24
+   |
+LL | const _NI32_SUB: i32 = -5i32 - i32::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:140:28
+   |
+LL | const _NI32_SUB_P: &i32 = &(-5i32 - i32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:142:24
+   |
+LL | const _NI64_SUB: i64 = -5i64 - i64::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:143:28
+   |
+LL | const _NI64_SUB_P: &i64 = &(-5i64 - i64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:145:26
+   |
+LL | const _NI128_SUB: i128 = -5i128 - i128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:146:30
+   |
+LL | const _NI128_SUB_P: &i128 = &(-5i128 - i128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:148:22
+   |
+LL | const _NU8_SUB: u8 = 1u8 - 5;
+   |                      ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:149:26
+   |
+LL | const _NU8_SUB_P: &u8 = &(1u8 - 5);
+   |                          ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:151:24
+   |
+LL | const _NU16_SUB: u16 = 1u16 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:152:28
+   |
+LL | const _NU16_SUB_P: &u16 = &(1u16 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:154:24
+   |
+LL | const _NU32_SUB: u32 = 1u32 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:155:28
+   |
+LL | const _NU32_SUB_P: &u32 = &(1u32 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:157:24
+   |
+LL | const _NU64_SUB: u64 = 1u64 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:158:28
+   |
+LL | const _NU64_SUB_P: &u64 = &(1u64 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:160:26
+   |
+LL | const _NU128_SUB: u128 = 1u128 - 5;
+   |                          ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:161:30
+   |
+LL | const _NU128_SUB_P: &u128 = &(1u128 - 5);
+   |                              ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:163:28
+   |
+LL | const _NISIZE_SUB: isize = -5isize - isize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:164:32
+   |
+LL | const _NISIZE_SUB_P: &isize = &(-5isize - isize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:166:28
+   |
+LL | const _NUSIZE_SUB: usize = 1usize - 5 ;
+   |                            ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:167:32
+   |
+LL | const _NUSIZE_SUB_P: &usize = &(1usize - 5 );
+   |                                ^^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:171:22
+   |
+LL | const _NI8_MUL: i8 = i8::MAX * 5;
+   |                      ^^^^^^^^^^^ attempt to compute `i8::MAX * 5_i8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:172:26
+   |
+LL | const _NI8_MUL_P: &i8 = &(i8::MAX * 5);
+   |                          ^^^^^^^^^^^^^ attempt to compute `i8::MAX * 5_i8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:174:24
+   |
+LL | const _NI16_MUL: i16 = i16::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:175:28
+   |
+LL | const _NI16_MUL_P: &i16 = &(i16::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:177:24
+   |
+LL | const _NI32_MUL: i32 = i32::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:178:28
+   |
+LL | const _NI32_MUL_P: &i32 = &(i32::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:180:24
+   |
+LL | const _NI64_MUL: i64 = i64::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:181:28
+   |
+LL | const _NI64_MUL_P: &i64 = &(i64::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:183:26
+   |
+LL | const _NI128_MUL: i128 = i128::MAX * 5;
+   |                          ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:184:30
+   |
+LL | const _NI128_MUL_P: &i128 = &(i128::MAX * 5);
+   |                              ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:186:22
+   |
+LL | const _NU8_MUL: u8 = u8::MAX * 5;
+   |                      ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:187:26
+   |
+LL | const _NU8_MUL_P: &u8 = &(u8::MAX * 5);
+   |                          ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:189:24
+   |
+LL | const _NU16_MUL: u16 = u16::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:190:28
+   |
+LL | const _NU16_MUL_P: &u16 = &(u16::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:192:24
+   |
+LL | const _NU32_MUL: u32 = u32::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:193:28
+   |
+LL | const _NU32_MUL_P: &u32 = &(u32::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:195:24
+   |
+LL | const _NU64_MUL: u64 = u64::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:196:28
+   |
+LL | const _NU64_MUL_P: &u64 = &(u64::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:198:26
+   |
+LL | const _NU128_MUL: u128 = u128::MAX * 5;
+   |                          ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:199:30
+   |
+LL | const _NU128_MUL_P: &u128 = &(u128::MAX * 5);
+   |                              ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:201:28
+   |
+LL | const _NISIZE_MUL: isize = isize::MAX * 5;
+   |                            ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:202:32
+   |
+LL | const _NISIZE_MUL_P: &isize = &(isize::MAX * 5);
+   |                                ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:204:28
+   |
+LL | const _NUSIZE_MUL: usize = usize::MAX * 5;
+   |                            ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:205:32
+   |
+LL | const _NUSIZE_MUL_P: &usize = &(usize::MAX * 5);
+   |                                ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:209:22
+   |
+LL | const _NI8_DIV: i8 = 1i8 / 0;
+   |                      ^^^^^^^ attempt to divide `1_i8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:210:26
+   |
+LL | const _NI8_DIV_P: &i8 = &(1i8 / 0);
+   |                          ^^^^^^^^^ attempt to divide `1_i8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:212:24
+   |
+LL | const _NI16_DIV: i16 = 1i16 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:213:28
+   |
+LL | const _NI16_DIV_P: &i16 = &(1i16 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:215:24
+   |
+LL | const _NI32_DIV: i32 = 1i32 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:216:28
+   |
+LL | const _NI32_DIV_P: &i32 = &(1i32 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:218:24
+   |
+LL | const _NI64_DIV: i64 = 1i64 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:219:28
+   |
+LL | const _NI64_DIV_P: &i64 = &(1i64 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:221:26
+   |
+LL | const _NI128_DIV: i128 = 1i128 / 0;
+   |                          ^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:222:30
+   |
+LL | const _NI128_DIV_P: &i128 = &(1i128 / 0);
+   |                              ^^^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:224:22
+   |
+LL | const _NU8_DIV: u8 = 1u8 / 0;
+   |                      ^^^^^^^ attempt to divide `1_u8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:225:26
+   |
+LL | const _NU8_DIV_P: &u8 = &(1u8 / 0);
+   |                          ^^^^^^^^^ attempt to divide `1_u8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:227:24
+   |
+LL | const _NU16_DIV: u16 = 1u16 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:228:28
+   |
+LL | const _NU16_DIV_P: &u16 = &(1u16 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:230:24
+   |
+LL | const _NU32_DIV: u32 = 1u32 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:231:28
+   |
+LL | const _NU32_DIV_P: &u32 = &(1u32 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:233:24
+   |
+LL | const _NU64_DIV: u64 = 1u64 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:234:28
+   |
+LL | const _NU64_DIV_P: &u64 = &(1u64 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:236:26
+   |
+LL | const _NU128_DIV: u128 = 1u128 / 0;
+   |                          ^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:237:30
+   |
+LL | const _NU128_DIV_P: &u128 = &(1u128 / 0);
+   |                              ^^^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:239:28
+   |
+LL | const _NISIZE_DIV: isize = 1isize / 0;
+   |                            ^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:240:32
+   |
+LL | const _NISIZE_DIV_P: &isize = &(1isize / 0);
+   |                                ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:242:28
+   |
+LL | const _NUSIZE_DIV: usize = 1usize / 0;
+   |                            ^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:243:32
+   |
+LL | const _NUSIZE_DIV_P: &usize = &(1usize / 0);
+   |                                ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:246:22
+   |
+LL | const _NI8_MOD: i8 = 1i8 % 0;
+   |                      ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:247:26
+   |
+LL | const _NI8_MOD_P: &i8 = &(1i8 % 0);
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:249:24
+   |
+LL | const _NI16_MOD: i16 = 1i16 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:250:28
+   |
+LL | const _NI16_MOD_P: &i16 = &(1i16 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:252:24
+   |
+LL | const _NI32_MOD: i32 = 1i32 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:253:28
+   |
+LL | const _NI32_MOD_P: &i32 = &(1i32 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:255:24
+   |
+LL | const _NI64_MOD: i64 = 1i64 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:256:28
+   |
+LL | const _NI64_MOD_P: &i64 = &(1i64 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:258:26
+   |
+LL | const _NI128_MOD: i128 = 1i128 % 0;
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:259:30
+   |
+LL | const _NI128_MOD_P: &i128 = &(1i128 % 0);
+   |                              ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:261:22
+   |
+LL | const _NU8_MOD: u8 = 1u8 % 0;
+   |                      ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:262:26
+   |
+LL | const _NU8_MOD_P: &u8 = &(1u8 % 0);
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:264:24
+   |
+LL | const _NU16_MOD: u16 = 1u16 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:265:28
+   |
+LL | const _NU16_MOD_P: &u16 = &(1u16 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:267:24
+   |
+LL | const _NU32_MOD: u32 = 1u32 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:268:28
+   |
+LL | const _NU32_MOD_P: &u32 = &(1u32 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:270:24
+   |
+LL | const _NU64_MOD: u64 = 1u64 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:271:28
+   |
+LL | const _NU64_MOD_P: &u64 = &(1u64 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:273:26
+   |
+LL | const _NU128_MOD: u128 = 1u128 % 0;
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:274:30
+   |
+LL | const _NU128_MOD_P: &u128 = &(1u128 % 0);
+   |                              ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:276:28
+   |
+LL | const _NISIZE_MOD: isize = 1isize % 0;
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:277:32
+   |
+LL | const _NISIZE_MOD_P: &isize = &(1isize % 0);
+   |                                ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:279:28
+   |
+LL | const _NUSIZE_MOD: usize = 1usize % 0;
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:280:32
+   |
+LL | const _NUSIZE_MOD_P: &usize = &(1usize % 0);
+   |                                ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:284:24
+   |
+LL | const _NI32_OOB: i32 = [1, 2, 3][4];
+   |                        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:285:28
+   |
+LL | const _NI32_OOB_P: &i32 = &([1, 2, 3][4]);
+   |                            ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 170 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/overflowing-consts.opt.stderr b/tests/ui/consts/overflowing-consts.opt.stderr
new file mode 100644
index 00000000000..81f22944adb
--- /dev/null
+++ b/tests/ui/consts/overflowing-consts.opt.stderr
@@ -0,0 +1,1023 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:19:22
+   |
+LL | const _NI8_SHL: i8 = 1i8 << 8;
+   |                      ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:20:26
+   |
+LL | const _NI8_SHL_P: &i8 = &(1i8 << 8);
+   |                          ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:22:24
+   |
+LL | const _NI16_SHL: i16 = 1i16 << 16;
+   |                        ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:23:28
+   |
+LL | const _NI16_SHL_P: &i16 = &(1i16 << 16);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:25:24
+   |
+LL | const _NI32_SHL: i32 = 1i32 << 32;
+   |                        ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:26:28
+   |
+LL | const _NI32_SHL_P: &i32 = &(1i32 << 32);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:28:24
+   |
+LL | const _NI64_SHL: i64 = 1i64 << 64;
+   |                        ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:29:28
+   |
+LL | const _NI64_SHL_P: &i64 = &(1i64 << 64);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:31:26
+   |
+LL | const _NI128_SHL: i128 = 1i128 << 128;
+   |                          ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:32:30
+   |
+LL | const _NI128_SHL_P: &i128 = &(1i128 << 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:34:22
+   |
+LL | const _NU8_SHL: u8 = 1u8 << 8;
+   |                      ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:35:26
+   |
+LL | const _NU8_SHL_P: &u8 = &(1u8 << 8);
+   |                          ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:37:24
+   |
+LL | const _NU16_SHL: u16 = 1u16 << 16;
+   |                        ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:38:28
+   |
+LL | const _NU16_SHL_P: &u16 = &(1u16 << 16);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:40:24
+   |
+LL | const _NU32_SHL: u32 = 1u32 << 32;
+   |                        ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:41:28
+   |
+LL | const _NU32_SHL_P: &u32 = &(1u32 << 32);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:43:24
+   |
+LL | const _NU64_SHL: u64 = 1u64 << 64;
+   |                        ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:44:28
+   |
+LL | const _NU64_SHL_P: &u64 = &(1u64 << 64);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:46:26
+   |
+LL | const _NU128_SHL: u128 = 1u128 << 128;
+   |                          ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:47:30
+   |
+LL | const _NU128_SHL_P: &u128 = &(1u128 << 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:49:28
+   |
+LL | const _NISIZE_SHL: isize = 1isize << BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:50:32
+   |
+LL | const _NISIZE_SHL_P: &isize = &(1isize << BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:52:28
+   |
+LL | const _NUSIZE_SHL: usize = 1usize << BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:53:32
+   |
+LL | const _NUSIZE_SHL_P: &usize = &(1usize << BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:57:22
+   |
+LL | const _NI8_SHR: i8 = 1i8 >> 8;
+   |                      ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:58:26
+   |
+LL | const _NI8_SHR_P: &i8 = &(1i8 >> 8);
+   |                          ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:60:24
+   |
+LL | const _NI16_SHR: i16 = 1i16 >> 16;
+   |                        ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:61:28
+   |
+LL | const _NI16_SHR_P: &i16 = &(1i16 >> 16);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:63:24
+   |
+LL | const _NI32_SHR: i32 = 1i32 >> 32;
+   |                        ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:64:28
+   |
+LL | const _NI32_SHR_P: &i32 = &(1i32 >> 32);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:66:24
+   |
+LL | const _NI64_SHR: i64 = 1i64 >> 64;
+   |                        ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:67:28
+   |
+LL | const _NI64_SHR_P: &i64 = &(1i64 >> 64);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:69:26
+   |
+LL | const _NI128_SHR: i128 = 1i128 >> 128;
+   |                          ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:70:30
+   |
+LL | const _NI128_SHR_P: &i128 = &(1i128 >> 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:72:22
+   |
+LL | const _NU8_SHR: u8 = 1u8 >> 8;
+   |                      ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:73:26
+   |
+LL | const _NU8_SHR_P: &u8 = &(1u8 >> 8);
+   |                          ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:75:24
+   |
+LL | const _NU16_SHR: u16 = 1u16 >> 16;
+   |                        ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:76:28
+   |
+LL | const _NU16_SHR_P: &u16 = &(1u16 >> 16);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:78:24
+   |
+LL | const _NU32_SHR: u32 = 1u32 >> 32;
+   |                        ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:79:28
+   |
+LL | const _NU32_SHR_P: &u32 = &(1u32 >> 32);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:81:24
+   |
+LL | const _NU64_SHR: u64 = 1u64 >> 64;
+   |                        ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:82:28
+   |
+LL | const _NU64_SHR_P: &u64 = &(1u64 >> 64);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:84:26
+   |
+LL | const _NU128_SHR: u128 = 1u128 >> 128;
+   |                          ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:85:30
+   |
+LL | const _NU128_SHR_P: &u128 = &(1u128 >> 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:87:28
+   |
+LL | const _NISIZE_SHR: isize = 1isize >> BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:88:32
+   |
+LL | const _NISIZE_SHR_P: &isize = &(1isize >> BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:90:28
+   |
+LL | const _NUSIZE_SHR: usize = 1usize >> BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:91:32
+   |
+LL | const _NUSIZE_SHR_P: &usize = &(1usize >> BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:95:22
+   |
+LL | const _NI8_ADD: i8 = 1i8 + i8::MAX;
+   |                      ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:96:26
+   |
+LL | const _NI8_ADD_P: &i8 = &(1i8 + i8::MAX);
+   |                          ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:98:24
+   |
+LL | const _NI16_ADD: i16 = 1i16 + i16::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:99:28
+   |
+LL | const _NI16_ADD_P: &i16 = &(1i16 + i16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:101:24
+   |
+LL | const _NI32_ADD: i32 = 1i32 + i32::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:102:28
+   |
+LL | const _NI32_ADD_P: &i32 = &(1i32 + i32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:104:24
+   |
+LL | const _NI64_ADD: i64 = 1i64 + i64::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:105:28
+   |
+LL | const _NI64_ADD_P: &i64 = &(1i64 + i64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:107:26
+   |
+LL | const _NI128_ADD: i128 = 1i128 + i128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:108:30
+   |
+LL | const _NI128_ADD_P: &i128 = &(1i128 + i128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:110:22
+   |
+LL | const _NU8_ADD: u8 = 1u8 + u8::MAX;
+   |                      ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:111:26
+   |
+LL | const _NU8_ADD_P: &u8 = &(1u8 + u8::MAX);
+   |                          ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:113:24
+   |
+LL | const _NU16_ADD: u16 = 1u16 + u16::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:114:28
+   |
+LL | const _NU16_ADD_P: &u16 = &(1u16 + u16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:116:24
+   |
+LL | const _NU32_ADD: u32 = 1u32 + u32::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:117:28
+   |
+LL | const _NU32_ADD_P: &u32 = &(1u32 + u32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:119:24
+   |
+LL | const _NU64_ADD: u64 = 1u64 + u64::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:120:28
+   |
+LL | const _NU64_ADD_P: &u64 = &(1u64 + u64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:122:26
+   |
+LL | const _NU128_ADD: u128 = 1u128 + u128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:123:30
+   |
+LL | const _NU128_ADD_P: &u128 = &(1u128 + u128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:125:28
+   |
+LL | const _NISIZE_ADD: isize = 1isize + isize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:126:32
+   |
+LL | const _NISIZE_ADD_P: &isize = &(1isize + isize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:128:28
+   |
+LL | const _NUSIZE_ADD: usize = 1usize + usize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:129:32
+   |
+LL | const _NUSIZE_ADD_P: &usize = &(1usize + usize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:133:22
+   |
+LL | const _NI8_SUB: i8 = -5i8 - i8::MAX;
+   |                      ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:134:26
+   |
+LL | const _NI8_SUB_P: &i8 = &(-5i8 - i8::MAX);
+   |                          ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:136:24
+   |
+LL | const _NI16_SUB: i16 = -5i16 - i16::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:137:28
+   |
+LL | const _NI16_SUB_P: &i16 = &(-5i16 - i16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:139:24
+   |
+LL | const _NI32_SUB: i32 = -5i32 - i32::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:140:28
+   |
+LL | const _NI32_SUB_P: &i32 = &(-5i32 - i32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:142:24
+   |
+LL | const _NI64_SUB: i64 = -5i64 - i64::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:143:28
+   |
+LL | const _NI64_SUB_P: &i64 = &(-5i64 - i64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:145:26
+   |
+LL | const _NI128_SUB: i128 = -5i128 - i128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:146:30
+   |
+LL | const _NI128_SUB_P: &i128 = &(-5i128 - i128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:148:22
+   |
+LL | const _NU8_SUB: u8 = 1u8 - 5;
+   |                      ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:149:26
+   |
+LL | const _NU8_SUB_P: &u8 = &(1u8 - 5);
+   |                          ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:151:24
+   |
+LL | const _NU16_SUB: u16 = 1u16 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:152:28
+   |
+LL | const _NU16_SUB_P: &u16 = &(1u16 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:154:24
+   |
+LL | const _NU32_SUB: u32 = 1u32 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:155:28
+   |
+LL | const _NU32_SUB_P: &u32 = &(1u32 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:157:24
+   |
+LL | const _NU64_SUB: u64 = 1u64 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:158:28
+   |
+LL | const _NU64_SUB_P: &u64 = &(1u64 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:160:26
+   |
+LL | const _NU128_SUB: u128 = 1u128 - 5;
+   |                          ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:161:30
+   |
+LL | const _NU128_SUB_P: &u128 = &(1u128 - 5);
+   |                              ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:163:28
+   |
+LL | const _NISIZE_SUB: isize = -5isize - isize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:164:32
+   |
+LL | const _NISIZE_SUB_P: &isize = &(-5isize - isize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:166:28
+   |
+LL | const _NUSIZE_SUB: usize = 1usize - 5 ;
+   |                            ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:167:32
+   |
+LL | const _NUSIZE_SUB_P: &usize = &(1usize - 5 );
+   |                                ^^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:171:22
+   |
+LL | const _NI8_MUL: i8 = i8::MAX * 5;
+   |                      ^^^^^^^^^^^ attempt to compute `i8::MAX * 5_i8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:172:26
+   |
+LL | const _NI8_MUL_P: &i8 = &(i8::MAX * 5);
+   |                          ^^^^^^^^^^^^^ attempt to compute `i8::MAX * 5_i8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:174:24
+   |
+LL | const _NI16_MUL: i16 = i16::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:175:28
+   |
+LL | const _NI16_MUL_P: &i16 = &(i16::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:177:24
+   |
+LL | const _NI32_MUL: i32 = i32::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:178:28
+   |
+LL | const _NI32_MUL_P: &i32 = &(i32::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:180:24
+   |
+LL | const _NI64_MUL: i64 = i64::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:181:28
+   |
+LL | const _NI64_MUL_P: &i64 = &(i64::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:183:26
+   |
+LL | const _NI128_MUL: i128 = i128::MAX * 5;
+   |                          ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:184:30
+   |
+LL | const _NI128_MUL_P: &i128 = &(i128::MAX * 5);
+   |                              ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:186:22
+   |
+LL | const _NU8_MUL: u8 = u8::MAX * 5;
+   |                      ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:187:26
+   |
+LL | const _NU8_MUL_P: &u8 = &(u8::MAX * 5);
+   |                          ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:189:24
+   |
+LL | const _NU16_MUL: u16 = u16::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:190:28
+   |
+LL | const _NU16_MUL_P: &u16 = &(u16::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:192:24
+   |
+LL | const _NU32_MUL: u32 = u32::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:193:28
+   |
+LL | const _NU32_MUL_P: &u32 = &(u32::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:195:24
+   |
+LL | const _NU64_MUL: u64 = u64::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:196:28
+   |
+LL | const _NU64_MUL_P: &u64 = &(u64::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:198:26
+   |
+LL | const _NU128_MUL: u128 = u128::MAX * 5;
+   |                          ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:199:30
+   |
+LL | const _NU128_MUL_P: &u128 = &(u128::MAX * 5);
+   |                              ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:201:28
+   |
+LL | const _NISIZE_MUL: isize = isize::MAX * 5;
+   |                            ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:202:32
+   |
+LL | const _NISIZE_MUL_P: &isize = &(isize::MAX * 5);
+   |                                ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:204:28
+   |
+LL | const _NUSIZE_MUL: usize = usize::MAX * 5;
+   |                            ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:205:32
+   |
+LL | const _NUSIZE_MUL_P: &usize = &(usize::MAX * 5);
+   |                                ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:209:22
+   |
+LL | const _NI8_DIV: i8 = 1i8 / 0;
+   |                      ^^^^^^^ attempt to divide `1_i8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:210:26
+   |
+LL | const _NI8_DIV_P: &i8 = &(1i8 / 0);
+   |                          ^^^^^^^^^ attempt to divide `1_i8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:212:24
+   |
+LL | const _NI16_DIV: i16 = 1i16 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:213:28
+   |
+LL | const _NI16_DIV_P: &i16 = &(1i16 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:215:24
+   |
+LL | const _NI32_DIV: i32 = 1i32 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:216:28
+   |
+LL | const _NI32_DIV_P: &i32 = &(1i32 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:218:24
+   |
+LL | const _NI64_DIV: i64 = 1i64 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:219:28
+   |
+LL | const _NI64_DIV_P: &i64 = &(1i64 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:221:26
+   |
+LL | const _NI128_DIV: i128 = 1i128 / 0;
+   |                          ^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:222:30
+   |
+LL | const _NI128_DIV_P: &i128 = &(1i128 / 0);
+   |                              ^^^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:224:22
+   |
+LL | const _NU8_DIV: u8 = 1u8 / 0;
+   |                      ^^^^^^^ attempt to divide `1_u8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:225:26
+   |
+LL | const _NU8_DIV_P: &u8 = &(1u8 / 0);
+   |                          ^^^^^^^^^ attempt to divide `1_u8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:227:24
+   |
+LL | const _NU16_DIV: u16 = 1u16 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:228:28
+   |
+LL | const _NU16_DIV_P: &u16 = &(1u16 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:230:24
+   |
+LL | const _NU32_DIV: u32 = 1u32 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:231:28
+   |
+LL | const _NU32_DIV_P: &u32 = &(1u32 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:233:24
+   |
+LL | const _NU64_DIV: u64 = 1u64 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:234:28
+   |
+LL | const _NU64_DIV_P: &u64 = &(1u64 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:236:26
+   |
+LL | const _NU128_DIV: u128 = 1u128 / 0;
+   |                          ^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:237:30
+   |
+LL | const _NU128_DIV_P: &u128 = &(1u128 / 0);
+   |                              ^^^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:239:28
+   |
+LL | const _NISIZE_DIV: isize = 1isize / 0;
+   |                            ^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:240:32
+   |
+LL | const _NISIZE_DIV_P: &isize = &(1isize / 0);
+   |                                ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:242:28
+   |
+LL | const _NUSIZE_DIV: usize = 1usize / 0;
+   |                            ^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:243:32
+   |
+LL | const _NUSIZE_DIV_P: &usize = &(1usize / 0);
+   |                                ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:246:22
+   |
+LL | const _NI8_MOD: i8 = 1i8 % 0;
+   |                      ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:247:26
+   |
+LL | const _NI8_MOD_P: &i8 = &(1i8 % 0);
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:249:24
+   |
+LL | const _NI16_MOD: i16 = 1i16 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:250:28
+   |
+LL | const _NI16_MOD_P: &i16 = &(1i16 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:252:24
+   |
+LL | const _NI32_MOD: i32 = 1i32 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:253:28
+   |
+LL | const _NI32_MOD_P: &i32 = &(1i32 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:255:24
+   |
+LL | const _NI64_MOD: i64 = 1i64 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:256:28
+   |
+LL | const _NI64_MOD_P: &i64 = &(1i64 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:258:26
+   |
+LL | const _NI128_MOD: i128 = 1i128 % 0;
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:259:30
+   |
+LL | const _NI128_MOD_P: &i128 = &(1i128 % 0);
+   |                              ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:261:22
+   |
+LL | const _NU8_MOD: u8 = 1u8 % 0;
+   |                      ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:262:26
+   |
+LL | const _NU8_MOD_P: &u8 = &(1u8 % 0);
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:264:24
+   |
+LL | const _NU16_MOD: u16 = 1u16 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:265:28
+   |
+LL | const _NU16_MOD_P: &u16 = &(1u16 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:267:24
+   |
+LL | const _NU32_MOD: u32 = 1u32 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:268:28
+   |
+LL | const _NU32_MOD_P: &u32 = &(1u32 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:270:24
+   |
+LL | const _NU64_MOD: u64 = 1u64 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:271:28
+   |
+LL | const _NU64_MOD_P: &u64 = &(1u64 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:273:26
+   |
+LL | const _NU128_MOD: u128 = 1u128 % 0;
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:274:30
+   |
+LL | const _NU128_MOD_P: &u128 = &(1u128 % 0);
+   |                              ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:276:28
+   |
+LL | const _NISIZE_MOD: isize = 1isize % 0;
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:277:32
+   |
+LL | const _NISIZE_MOD_P: &isize = &(1isize % 0);
+   |                                ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:279:28
+   |
+LL | const _NUSIZE_MOD: usize = 1usize % 0;
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:280:32
+   |
+LL | const _NUSIZE_MOD_P: &usize = &(1usize % 0);
+   |                                ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:284:24
+   |
+LL | const _NI32_OOB: i32 = [1, 2, 3][4];
+   |                        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:285:28
+   |
+LL | const _NI32_OOB_P: &i32 = &([1, 2, 3][4]);
+   |                            ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 170 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/overflowing-consts.opt_with_overflow_checks.stderr b/tests/ui/consts/overflowing-consts.opt_with_overflow_checks.stderr
new file mode 100644
index 00000000000..81f22944adb
--- /dev/null
+++ b/tests/ui/consts/overflowing-consts.opt_with_overflow_checks.stderr
@@ -0,0 +1,1023 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:19:22
+   |
+LL | const _NI8_SHL: i8 = 1i8 << 8;
+   |                      ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:20:26
+   |
+LL | const _NI8_SHL_P: &i8 = &(1i8 << 8);
+   |                          ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:22:24
+   |
+LL | const _NI16_SHL: i16 = 1i16 << 16;
+   |                        ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:23:28
+   |
+LL | const _NI16_SHL_P: &i16 = &(1i16 << 16);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:25:24
+   |
+LL | const _NI32_SHL: i32 = 1i32 << 32;
+   |                        ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:26:28
+   |
+LL | const _NI32_SHL_P: &i32 = &(1i32 << 32);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:28:24
+   |
+LL | const _NI64_SHL: i64 = 1i64 << 64;
+   |                        ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:29:28
+   |
+LL | const _NI64_SHL_P: &i64 = &(1i64 << 64);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:31:26
+   |
+LL | const _NI128_SHL: i128 = 1i128 << 128;
+   |                          ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:32:30
+   |
+LL | const _NI128_SHL_P: &i128 = &(1i128 << 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:34:22
+   |
+LL | const _NU8_SHL: u8 = 1u8 << 8;
+   |                      ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:35:26
+   |
+LL | const _NU8_SHL_P: &u8 = &(1u8 << 8);
+   |                          ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:37:24
+   |
+LL | const _NU16_SHL: u16 = 1u16 << 16;
+   |                        ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:38:28
+   |
+LL | const _NU16_SHL_P: &u16 = &(1u16 << 16);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:40:24
+   |
+LL | const _NU32_SHL: u32 = 1u32 << 32;
+   |                        ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:41:28
+   |
+LL | const _NU32_SHL_P: &u32 = &(1u32 << 32);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:43:24
+   |
+LL | const _NU64_SHL: u64 = 1u64 << 64;
+   |                        ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:44:28
+   |
+LL | const _NU64_SHL_P: &u64 = &(1u64 << 64);
+   |                            ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:46:26
+   |
+LL | const _NU128_SHL: u128 = 1u128 << 128;
+   |                          ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:47:30
+   |
+LL | const _NU128_SHL_P: &u128 = &(1u128 << 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:49:28
+   |
+LL | const _NISIZE_SHL: isize = 1isize << BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:50:32
+   |
+LL | const _NISIZE_SHL_P: &isize = &(1isize << BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:52:28
+   |
+LL | const _NUSIZE_SHL: usize = 1usize << BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:53:32
+   |
+LL | const _NUSIZE_SHL_P: &usize = &(1usize << BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:57:22
+   |
+LL | const _NI8_SHR: i8 = 1i8 >> 8;
+   |                      ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:58:26
+   |
+LL | const _NI8_SHR_P: &i8 = &(1i8 >> 8);
+   |                          ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:60:24
+   |
+LL | const _NI16_SHR: i16 = 1i16 >> 16;
+   |                        ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:61:28
+   |
+LL | const _NI16_SHR_P: &i16 = &(1i16 >> 16);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:63:24
+   |
+LL | const _NI32_SHR: i32 = 1i32 >> 32;
+   |                        ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:64:28
+   |
+LL | const _NI32_SHR_P: &i32 = &(1i32 >> 32);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:66:24
+   |
+LL | const _NI64_SHR: i64 = 1i64 >> 64;
+   |                        ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:67:28
+   |
+LL | const _NI64_SHR_P: &i64 = &(1i64 >> 64);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:69:26
+   |
+LL | const _NI128_SHR: i128 = 1i128 >> 128;
+   |                          ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:70:30
+   |
+LL | const _NI128_SHR_P: &i128 = &(1i128 >> 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:72:22
+   |
+LL | const _NU8_SHR: u8 = 1u8 >> 8;
+   |                      ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:73:26
+   |
+LL | const _NU8_SHR_P: &u8 = &(1u8 >> 8);
+   |                          ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:75:24
+   |
+LL | const _NU16_SHR: u16 = 1u16 >> 16;
+   |                        ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:76:28
+   |
+LL | const _NU16_SHR_P: &u16 = &(1u16 >> 16);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:78:24
+   |
+LL | const _NU32_SHR: u32 = 1u32 >> 32;
+   |                        ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:79:28
+   |
+LL | const _NU32_SHR_P: &u32 = &(1u32 >> 32);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:81:24
+   |
+LL | const _NU64_SHR: u64 = 1u64 >> 64;
+   |                        ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:82:28
+   |
+LL | const _NU64_SHR_P: &u64 = &(1u64 >> 64);
+   |                            ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:84:26
+   |
+LL | const _NU128_SHR: u128 = 1u128 >> 128;
+   |                          ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:85:30
+   |
+LL | const _NU128_SHR_P: &u128 = &(1u128 >> 128);
+   |                              ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:87:28
+   |
+LL | const _NISIZE_SHR: isize = 1isize >> BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:88:32
+   |
+LL | const _NISIZE_SHR_P: &isize = &(1isize >> BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:90:28
+   |
+LL | const _NUSIZE_SHR: usize = 1usize >> BITS;
+   |                            ^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:91:32
+   |
+LL | const _NUSIZE_SHR_P: &usize = &(1usize >> BITS);
+   |                                ^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:95:22
+   |
+LL | const _NI8_ADD: i8 = 1i8 + i8::MAX;
+   |                      ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:96:26
+   |
+LL | const _NI8_ADD_P: &i8 = &(1i8 + i8::MAX);
+   |                          ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:98:24
+   |
+LL | const _NI16_ADD: i16 = 1i16 + i16::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:99:28
+   |
+LL | const _NI16_ADD_P: &i16 = &(1i16 + i16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:101:24
+   |
+LL | const _NI32_ADD: i32 = 1i32 + i32::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:102:28
+   |
+LL | const _NI32_ADD_P: &i32 = &(1i32 + i32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:104:24
+   |
+LL | const _NI64_ADD: i64 = 1i64 + i64::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:105:28
+   |
+LL | const _NI64_ADD_P: &i64 = &(1i64 + i64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:107:26
+   |
+LL | const _NI128_ADD: i128 = 1i128 + i128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:108:30
+   |
+LL | const _NI128_ADD_P: &i128 = &(1i128 + i128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:110:22
+   |
+LL | const _NU8_ADD: u8 = 1u8 + u8::MAX;
+   |                      ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:111:26
+   |
+LL | const _NU8_ADD_P: &u8 = &(1u8 + u8::MAX);
+   |                          ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:113:24
+   |
+LL | const _NU16_ADD: u16 = 1u16 + u16::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:114:28
+   |
+LL | const _NU16_ADD_P: &u16 = &(1u16 + u16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:116:24
+   |
+LL | const _NU32_ADD: u32 = 1u32 + u32::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:117:28
+   |
+LL | const _NU32_ADD_P: &u32 = &(1u32 + u32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:119:24
+   |
+LL | const _NU64_ADD: u64 = 1u64 + u64::MAX;
+   |                        ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:120:28
+   |
+LL | const _NU64_ADD_P: &u64 = &(1u64 + u64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:122:26
+   |
+LL | const _NU128_ADD: u128 = 1u128 + u128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:123:30
+   |
+LL | const _NU128_ADD_P: &u128 = &(1u128 + u128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:125:28
+   |
+LL | const _NISIZE_ADD: isize = 1isize + isize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:126:32
+   |
+LL | const _NISIZE_ADD_P: &isize = &(1isize + isize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:128:28
+   |
+LL | const _NUSIZE_ADD: usize = 1usize + usize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:129:32
+   |
+LL | const _NUSIZE_ADD_P: &usize = &(1usize + usize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:133:22
+   |
+LL | const _NI8_SUB: i8 = -5i8 - i8::MAX;
+   |                      ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:134:26
+   |
+LL | const _NI8_SUB_P: &i8 = &(-5i8 - i8::MAX);
+   |                          ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:136:24
+   |
+LL | const _NI16_SUB: i16 = -5i16 - i16::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:137:28
+   |
+LL | const _NI16_SUB_P: &i16 = &(-5i16 - i16::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:139:24
+   |
+LL | const _NI32_SUB: i32 = -5i32 - i32::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:140:28
+   |
+LL | const _NI32_SUB_P: &i32 = &(-5i32 - i32::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:142:24
+   |
+LL | const _NI64_SUB: i64 = -5i64 - i64::MAX;
+   |                        ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:143:28
+   |
+LL | const _NI64_SUB_P: &i64 = &(-5i64 - i64::MAX);
+   |                            ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:145:26
+   |
+LL | const _NI128_SUB: i128 = -5i128 - i128::MAX;
+   |                          ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:146:30
+   |
+LL | const _NI128_SUB_P: &i128 = &(-5i128 - i128::MAX);
+   |                              ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:148:22
+   |
+LL | const _NU8_SUB: u8 = 1u8 - 5;
+   |                      ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:149:26
+   |
+LL | const _NU8_SUB_P: &u8 = &(1u8 - 5);
+   |                          ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:151:24
+   |
+LL | const _NU16_SUB: u16 = 1u16 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:152:28
+   |
+LL | const _NU16_SUB_P: &u16 = &(1u16 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:154:24
+   |
+LL | const _NU32_SUB: u32 = 1u32 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:155:28
+   |
+LL | const _NU32_SUB_P: &u32 = &(1u32 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:157:24
+   |
+LL | const _NU64_SUB: u64 = 1u64 - 5;
+   |                        ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:158:28
+   |
+LL | const _NU64_SUB_P: &u64 = &(1u64 - 5);
+   |                            ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:160:26
+   |
+LL | const _NU128_SUB: u128 = 1u128 - 5;
+   |                          ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:161:30
+   |
+LL | const _NU128_SUB_P: &u128 = &(1u128 - 5);
+   |                              ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:163:28
+   |
+LL | const _NISIZE_SUB: isize = -5isize - isize::MAX;
+   |                            ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:164:32
+   |
+LL | const _NISIZE_SUB_P: &isize = &(-5isize - isize::MAX);
+   |                                ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:166:28
+   |
+LL | const _NUSIZE_SUB: usize = 1usize - 5 ;
+   |                            ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:167:32
+   |
+LL | const _NUSIZE_SUB_P: &usize = &(1usize - 5 );
+   |                                ^^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:171:22
+   |
+LL | const _NI8_MUL: i8 = i8::MAX * 5;
+   |                      ^^^^^^^^^^^ attempt to compute `i8::MAX * 5_i8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:172:26
+   |
+LL | const _NI8_MUL_P: &i8 = &(i8::MAX * 5);
+   |                          ^^^^^^^^^^^^^ attempt to compute `i8::MAX * 5_i8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:174:24
+   |
+LL | const _NI16_MUL: i16 = i16::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:175:28
+   |
+LL | const _NI16_MUL_P: &i16 = &(i16::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:177:24
+   |
+LL | const _NI32_MUL: i32 = i32::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:178:28
+   |
+LL | const _NI32_MUL_P: &i32 = &(i32::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:180:24
+   |
+LL | const _NI64_MUL: i64 = i64::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:181:28
+   |
+LL | const _NI64_MUL_P: &i64 = &(i64::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:183:26
+   |
+LL | const _NI128_MUL: i128 = i128::MAX * 5;
+   |                          ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:184:30
+   |
+LL | const _NI128_MUL_P: &i128 = &(i128::MAX * 5);
+   |                              ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:186:22
+   |
+LL | const _NU8_MUL: u8 = u8::MAX * 5;
+   |                      ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:187:26
+   |
+LL | const _NU8_MUL_P: &u8 = &(u8::MAX * 5);
+   |                          ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:189:24
+   |
+LL | const _NU16_MUL: u16 = u16::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:190:28
+   |
+LL | const _NU16_MUL_P: &u16 = &(u16::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:192:24
+   |
+LL | const _NU32_MUL: u32 = u32::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:193:28
+   |
+LL | const _NU32_MUL_P: &u32 = &(u32::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:195:24
+   |
+LL | const _NU64_MUL: u64 = u64::MAX * 5;
+   |                        ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:196:28
+   |
+LL | const _NU64_MUL_P: &u64 = &(u64::MAX * 5);
+   |                            ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:198:26
+   |
+LL | const _NU128_MUL: u128 = u128::MAX * 5;
+   |                          ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:199:30
+   |
+LL | const _NU128_MUL_P: &u128 = &(u128::MAX * 5);
+   |                              ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:201:28
+   |
+LL | const _NISIZE_MUL: isize = isize::MAX * 5;
+   |                            ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:202:32
+   |
+LL | const _NISIZE_MUL_P: &isize = &(isize::MAX * 5);
+   |                                ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:204:28
+   |
+LL | const _NUSIZE_MUL: usize = usize::MAX * 5;
+   |                            ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:205:32
+   |
+LL | const _NUSIZE_MUL_P: &usize = &(usize::MAX * 5);
+   |                                ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:209:22
+   |
+LL | const _NI8_DIV: i8 = 1i8 / 0;
+   |                      ^^^^^^^ attempt to divide `1_i8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:210:26
+   |
+LL | const _NI8_DIV_P: &i8 = &(1i8 / 0);
+   |                          ^^^^^^^^^ attempt to divide `1_i8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:212:24
+   |
+LL | const _NI16_DIV: i16 = 1i16 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:213:28
+   |
+LL | const _NI16_DIV_P: &i16 = &(1i16 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:215:24
+   |
+LL | const _NI32_DIV: i32 = 1i32 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:216:28
+   |
+LL | const _NI32_DIV_P: &i32 = &(1i32 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:218:24
+   |
+LL | const _NI64_DIV: i64 = 1i64 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_i64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:219:28
+   |
+LL | const _NI64_DIV_P: &i64 = &(1i64 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_i64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:221:26
+   |
+LL | const _NI128_DIV: i128 = 1i128 / 0;
+   |                          ^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:222:30
+   |
+LL | const _NI128_DIV_P: &i128 = &(1i128 / 0);
+   |                              ^^^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:224:22
+   |
+LL | const _NU8_DIV: u8 = 1u8 / 0;
+   |                      ^^^^^^^ attempt to divide `1_u8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:225:26
+   |
+LL | const _NU8_DIV_P: &u8 = &(1u8 / 0);
+   |                          ^^^^^^^^^ attempt to divide `1_u8` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:227:24
+   |
+LL | const _NU16_DIV: u16 = 1u16 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:228:28
+   |
+LL | const _NU16_DIV_P: &u16 = &(1u16 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u16` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:230:24
+   |
+LL | const _NU32_DIV: u32 = 1u32 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:231:28
+   |
+LL | const _NU32_DIV_P: &u32 = &(1u32 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u32` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:233:24
+   |
+LL | const _NU64_DIV: u64 = 1u64 / 0;
+   |                        ^^^^^^^^ attempt to divide `1_u64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:234:28
+   |
+LL | const _NU64_DIV_P: &u64 = &(1u64 / 0);
+   |                            ^^^^^^^^^^ attempt to divide `1_u64` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:236:26
+   |
+LL | const _NU128_DIV: u128 = 1u128 / 0;
+   |                          ^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:237:30
+   |
+LL | const _NU128_DIV_P: &u128 = &(1u128 / 0);
+   |                              ^^^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:239:28
+   |
+LL | const _NISIZE_DIV: isize = 1isize / 0;
+   |                            ^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:240:32
+   |
+LL | const _NISIZE_DIV_P: &isize = &(1isize / 0);
+   |                                ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:242:28
+   |
+LL | const _NUSIZE_DIV: usize = 1usize / 0;
+   |                            ^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:243:32
+   |
+LL | const _NUSIZE_DIV_P: &usize = &(1usize / 0);
+   |                                ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:246:22
+   |
+LL | const _NI8_MOD: i8 = 1i8 % 0;
+   |                      ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:247:26
+   |
+LL | const _NI8_MOD_P: &i8 = &(1i8 % 0);
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:249:24
+   |
+LL | const _NI16_MOD: i16 = 1i16 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:250:28
+   |
+LL | const _NI16_MOD_P: &i16 = &(1i16 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:252:24
+   |
+LL | const _NI32_MOD: i32 = 1i32 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:253:28
+   |
+LL | const _NI32_MOD_P: &i32 = &(1i32 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:255:24
+   |
+LL | const _NI64_MOD: i64 = 1i64 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:256:28
+   |
+LL | const _NI64_MOD_P: &i64 = &(1i64 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:258:26
+   |
+LL | const _NI128_MOD: i128 = 1i128 % 0;
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:259:30
+   |
+LL | const _NI128_MOD_P: &i128 = &(1i128 % 0);
+   |                              ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:261:22
+   |
+LL | const _NU8_MOD: u8 = 1u8 % 0;
+   |                      ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:262:26
+   |
+LL | const _NU8_MOD_P: &u8 = &(1u8 % 0);
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:264:24
+   |
+LL | const _NU16_MOD: u16 = 1u16 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:265:28
+   |
+LL | const _NU16_MOD_P: &u16 = &(1u16 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:267:24
+   |
+LL | const _NU32_MOD: u32 = 1u32 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:268:28
+   |
+LL | const _NU32_MOD_P: &u32 = &(1u32 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:270:24
+   |
+LL | const _NU64_MOD: u64 = 1u64 % 0;
+   |                        ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:271:28
+   |
+LL | const _NU64_MOD_P: &u64 = &(1u64 % 0);
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:273:26
+   |
+LL | const _NU128_MOD: u128 = 1u128 % 0;
+   |                          ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:274:30
+   |
+LL | const _NU128_MOD_P: &u128 = &(1u128 % 0);
+   |                              ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:276:28
+   |
+LL | const _NISIZE_MOD: isize = 1isize % 0;
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:277:32
+   |
+LL | const _NISIZE_MOD_P: &isize = &(1isize % 0);
+   |                                ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:279:28
+   |
+LL | const _NUSIZE_MOD: usize = 1usize % 0;
+   |                            ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:280:32
+   |
+LL | const _NUSIZE_MOD_P: &usize = &(1usize % 0);
+   |                                ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:284:24
+   |
+LL | const _NI32_OOB: i32 = [1, 2, 3][4];
+   |                        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/overflowing-consts.rs:285:28
+   |
+LL | const _NI32_OOB_P: &i32 = &([1, 2, 3][4]);
+   |                            ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 170 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/overflowing-consts.rs b/tests/ui/consts/overflowing-consts.rs
new file mode 100644
index 00000000000..52c0623f2c0
--- /dev/null
+++ b/tests/ui/consts/overflowing-consts.rs
@@ -0,0 +1,288 @@
+// Tests that overflowing or bound-exceeding operations
+// for compile-time consts raise errors
+
+//@ revisions: noopt opt opt_with_overflow_checks
+//@ [noopt]compile-flags: -C opt-level=0
+//@ [opt]compile-flags: -O
+//@ [opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
+//@ ignore-pass (test tests codegen-time behaviour)
+//@ normalize-stderr-test "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
+//@ normalize-stderr-test "shift right by `(64|32)_usize`, which" -> "shift right by `%BITS%`, which"
+
+
+#[cfg(target_pointer_width = "32")]
+const BITS: usize = 32;
+#[cfg(target_pointer_width = "64")]
+const BITS: usize = 64;
+
+// Shift left
+const _NI8_SHL: i8 = 1i8 << 8; //~ ERROR: evaluation of constant value failed
+const _NI8_SHL_P: &i8 = &(1i8 << 8); //~ ERROR: evaluation of constant value failed
+
+const _NI16_SHL: i16 = 1i16 << 16; //~ ERROR: evaluation of constant value failed
+const _NI16_SHL_P: &i16 = &(1i16 << 16); //~ ERROR: evaluation of constant value failed
+
+const _NI32_SHL: i32 = 1i32 << 32; //~ ERROR: evaluation of constant value failed
+const _NI32_SHL_P: &i32 = &(1i32 << 32); //~ ERROR: evaluation of constant value failed
+
+const _NI64_SHL: i64 = 1i64 << 64; //~ ERROR: evaluation of constant value failed
+const _NI64_SHL_P: &i64 = &(1i64 << 64); //~ ERROR: evaluation of constant value failed
+
+const _NI128_SHL: i128 = 1i128 << 128; //~ ERROR: evaluation of constant value failed
+const _NI128_SHL_P: &i128 = &(1i128 << 128); //~ ERROR: evaluation of constant value failed
+
+const _NU8_SHL: u8 = 1u8 << 8; //~ ERROR: evaluation of constant value failed
+const _NU8_SHL_P: &u8 = &(1u8 << 8); //~ ERROR: evaluation of constant value failed
+
+const _NU16_SHL: u16 = 1u16 << 16; //~ ERROR: evaluation of constant value failed
+const _NU16_SHL_P: &u16 = &(1u16 << 16); //~ ERROR: evaluation of constant value failed
+
+const _NU32_SHL: u32 = 1u32 << 32; //~ ERROR: evaluation of constant value failed
+const _NU32_SHL_P: &u32 = &(1u32 << 32); //~ ERROR: evaluation of constant value failed
+
+const _NU64_SHL: u64 = 1u64 << 64; //~ ERROR: evaluation of constant value failed
+const _NU64_SHL_P: &u64 = &(1u64 << 64); //~ ERROR: evaluation of constant value failed
+
+const _NU128_SHL: u128 = 1u128 << 128; //~ ERROR: evaluation of constant value failed
+const _NU128_SHL_P: &u128 = &(1u128 << 128); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_SHL: isize = 1isize << BITS; //~ ERROR: evaluation of constant value failed
+const _NISIZE_SHL_P: &isize = &(1isize << BITS); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_SHL: usize = 1usize << BITS; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_SHL_P: &usize = &(1usize << BITS); //~ ERROR: evaluation of constant value failed
+
+
+// Shift right
+const _NI8_SHR: i8 = 1i8 >> 8; //~ ERROR: evaluation of constant value failed
+const _NI8_SHR_P: &i8 = &(1i8 >> 8); //~ ERROR: evaluation of constant value failed
+
+const _NI16_SHR: i16 = 1i16 >> 16; //~ ERROR: evaluation of constant value failed
+const _NI16_SHR_P: &i16 = &(1i16 >> 16); //~ ERROR: evaluation of constant value failed
+
+const _NI32_SHR: i32 = 1i32 >> 32; //~ ERROR: evaluation of constant value failed
+const _NI32_SHR_P: &i32 = &(1i32 >> 32); //~ ERROR: evaluation of constant value failed
+
+const _NI64_SHR: i64 = 1i64 >> 64; //~ ERROR: evaluation of constant value failed
+const _NI64_SHR_P: &i64 = &(1i64 >> 64); //~ ERROR: evaluation of constant value failed
+
+const _NI128_SHR: i128 = 1i128 >> 128; //~ ERROR: evaluation of constant value failed
+const _NI128_SHR_P: &i128 = &(1i128 >> 128); //~ ERROR: evaluation of constant value failed
+
+const _NU8_SHR: u8 = 1u8 >> 8; //~ ERROR: evaluation of constant value failed
+const _NU8_SHR_P: &u8 = &(1u8 >> 8); //~ ERROR: evaluation of constant value failed
+
+const _NU16_SHR: u16 = 1u16 >> 16; //~ ERROR: evaluation of constant value failed
+const _NU16_SHR_P: &u16 = &(1u16 >> 16); //~ ERROR: evaluation of constant value failed
+
+const _NU32_SHR: u32 = 1u32 >> 32; //~ ERROR: evaluation of constant value failed
+const _NU32_SHR_P: &u32 = &(1u32 >> 32); //~ ERROR: evaluation of constant value failed
+
+const _NU64_SHR: u64 = 1u64 >> 64; //~ ERROR: evaluation of constant value failed
+const _NU64_SHR_P: &u64 = &(1u64 >> 64); //~ ERROR: evaluation of constant value failed
+
+const _NU128_SHR: u128 = 1u128 >> 128; //~ ERROR: evaluation of constant value failed
+const _NU128_SHR_P: &u128 = &(1u128 >> 128); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_SHR: isize = 1isize >> BITS; //~ ERROR: evaluation of constant value failed
+const _NISIZE_SHR_P: &isize = &(1isize >> BITS); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_SHR: usize = 1usize >> BITS; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_SHR_P: &usize = &(1usize >> BITS); //~ ERROR: evaluation of constant value failed
+
+
+// Addition
+const _NI8_ADD: i8 = 1i8 + i8::MAX; //~ ERROR: evaluation of constant value failed
+const _NI8_ADD_P: &i8 = &(1i8 + i8::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI16_ADD: i16 = 1i16 + i16::MAX; //~ ERROR: evaluation of constant value failed
+const _NI16_ADD_P: &i16 = &(1i16 + i16::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI32_ADD: i32 = 1i32 + i32::MAX; //~ ERROR: evaluation of constant value failed
+const _NI32_ADD_P: &i32 = &(1i32 + i32::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI64_ADD: i64 = 1i64 + i64::MAX; //~ ERROR: evaluation of constant value failed
+const _NI64_ADD_P: &i64 = &(1i64 + i64::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI128_ADD: i128 = 1i128 + i128::MAX; //~ ERROR: evaluation of constant value failed
+const _NI128_ADD_P: &i128 = &(1i128 + i128::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NU8_ADD: u8 = 1u8 + u8::MAX; //~ ERROR: evaluation of constant value failed
+const _NU8_ADD_P: &u8 = &(1u8 + u8::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NU16_ADD: u16 = 1u16 + u16::MAX; //~ ERROR: evaluation of constant value failed
+const _NU16_ADD_P: &u16 = &(1u16 + u16::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NU32_ADD: u32 = 1u32 + u32::MAX; //~ ERROR: evaluation of constant value failed
+const _NU32_ADD_P: &u32 = &(1u32 + u32::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NU64_ADD: u64 = 1u64 + u64::MAX; //~ ERROR: evaluation of constant value failed
+const _NU64_ADD_P: &u64 = &(1u64 + u64::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NU128_ADD: u128 = 1u128 + u128::MAX; //~ ERROR: evaluation of constant value failed
+const _NU128_ADD_P: &u128 = &(1u128 + u128::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_ADD: isize = 1isize + isize::MAX; //~ ERROR: evaluation of constant value failed
+const _NISIZE_ADD_P: &isize = &(1isize + isize::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_ADD: usize = 1usize + usize::MAX; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_ADD_P: &usize = &(1usize + usize::MAX); //~ ERROR: evaluation of constant value failed
+
+
+// Subtraction
+const _NI8_SUB: i8 = -5i8 - i8::MAX; //~ ERROR: evaluation of constant value failed
+const _NI8_SUB_P: &i8 = &(-5i8 - i8::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI16_SUB: i16 = -5i16 - i16::MAX; //~ ERROR: evaluation of constant value failed
+const _NI16_SUB_P: &i16 = &(-5i16 - i16::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI32_SUB: i32 = -5i32 - i32::MAX; //~ ERROR: evaluation of constant value failed
+const _NI32_SUB_P: &i32 = &(-5i32 - i32::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI64_SUB: i64 = -5i64 - i64::MAX; //~ ERROR: evaluation of constant value failed
+const _NI64_SUB_P: &i64 = &(-5i64 - i64::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NI128_SUB: i128 = -5i128 - i128::MAX; //~ ERROR: evaluation of constant value failed
+const _NI128_SUB_P: &i128 = &(-5i128 - i128::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NU8_SUB: u8 = 1u8 - 5; //~ ERROR: evaluation of constant value failed
+const _NU8_SUB_P: &u8 = &(1u8 - 5); //~ ERROR: evaluation of constant value failed
+
+const _NU16_SUB: u16 = 1u16 - 5; //~ ERROR: evaluation of constant value failed
+const _NU16_SUB_P: &u16 = &(1u16 - 5); //~ ERROR: evaluation of constant value failed
+
+const _NU32_SUB: u32 = 1u32 - 5; //~ ERROR: evaluation of constant value failed
+const _NU32_SUB_P: &u32 = &(1u32 - 5); //~ ERROR: evaluation of constant value failed
+
+const _NU64_SUB: u64 = 1u64 - 5; //~ ERROR: evaluation of constant value failed
+const _NU64_SUB_P: &u64 = &(1u64 - 5); //~ ERROR: evaluation of constant value failed
+
+const _NU128_SUB: u128 = 1u128 - 5; //~ ERROR: evaluation of constant value failed
+const _NU128_SUB_P: &u128 = &(1u128 - 5); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_SUB: isize = -5isize - isize::MAX; //~ ERROR: evaluation of constant value failed
+const _NISIZE_SUB_P: &isize = &(-5isize - isize::MAX); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_SUB: usize = 1usize - 5 ; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_SUB_P: &usize = &(1usize - 5 ); //~ ERROR: evaluation of constant value failed
+
+
+// Multiplication
+const _NI8_MUL: i8 = i8::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NI8_MUL_P: &i8 = &(i8::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NI16_MUL: i16 = i16::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NI16_MUL_P: &i16 = &(i16::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NI32_MUL: i32 = i32::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NI32_MUL_P: &i32 = &(i32::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NI64_MUL: i64 = i64::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NI64_MUL_P: &i64 = &(i64::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NI128_MUL: i128 = i128::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NI128_MUL_P: &i128 = &(i128::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NU8_MUL: u8 = u8::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NU8_MUL_P: &u8 = &(u8::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NU16_MUL: u16 = u16::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NU16_MUL_P: &u16 = &(u16::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NU32_MUL: u32 = u32::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NU32_MUL_P: &u32 = &(u32::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NU64_MUL: u64 = u64::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NU64_MUL_P: &u64 = &(u64::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NU128_MUL: u128 = u128::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NU128_MUL_P: &u128 = &(u128::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_MUL: isize = isize::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NISIZE_MUL_P: &isize = &(isize::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_MUL: usize = usize::MAX * 5; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_MUL_P: &usize = &(usize::MAX * 5); //~ ERROR: evaluation of constant value failed
+
+
+// Division
+const _NI8_DIV: i8 = 1i8 / 0; //~ ERROR: evaluation of constant value failed
+const _NI8_DIV_P: &i8 = &(1i8 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NI16_DIV: i16 = 1i16 / 0; //~ ERROR: evaluation of constant value failed
+const _NI16_DIV_P: &i16 = &(1i16 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NI32_DIV: i32 = 1i32 / 0; //~ ERROR: evaluation of constant value failed
+const _NI32_DIV_P: &i32 = &(1i32 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NI64_DIV: i64 = 1i64 / 0; //~ ERROR: evaluation of constant value failed
+const _NI64_DIV_P: &i64 = &(1i64 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NI128_DIV: i128 = 1i128 / 0; //~ ERROR: evaluation of constant value failed
+const _NI128_DIV_P: &i128 = &(1i128 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NU8_DIV: u8 = 1u8 / 0; //~ ERROR: evaluation of constant value failed
+const _NU8_DIV_P: &u8 = &(1u8 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NU16_DIV: u16 = 1u16 / 0; //~ ERROR: evaluation of constant value failed
+const _NU16_DIV_P: &u16 = &(1u16 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NU32_DIV: u32 = 1u32 / 0; //~ ERROR: evaluation of constant value failed
+const _NU32_DIV_P: &u32 = &(1u32 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NU64_DIV: u64 = 1u64 / 0; //~ ERROR: evaluation of constant value failed
+const _NU64_DIV_P: &u64 = &(1u64 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NU128_DIV: u128 = 1u128 / 0; //~ ERROR: evaluation of constant value failed
+const _NU128_DIV_P: &u128 = &(1u128 / 0); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_DIV: isize = 1isize / 0; //~ ERROR: evaluation of constant value failed
+const _NISIZE_DIV_P: &isize = &(1isize / 0); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_DIV: usize = 1usize / 0; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_DIV_P: &usize = &(1usize / 0); //~ ERROR: evaluation of constant value failed
+
+// Modulus
+const _NI8_MOD: i8 = 1i8 % 0; //~ ERROR: evaluation of constant value failed
+const _NI8_MOD_P: &i8 = &(1i8 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NI16_MOD: i16 = 1i16 % 0; //~ ERROR: evaluation of constant value failed
+const _NI16_MOD_P: &i16 = &(1i16 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NI32_MOD: i32 = 1i32 % 0; //~ ERROR: evaluation of constant value failed
+const _NI32_MOD_P: &i32 = &(1i32 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NI64_MOD: i64 = 1i64 % 0; //~ ERROR: evaluation of constant value failed
+const _NI64_MOD_P: &i64 = &(1i64 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NI128_MOD: i128 = 1i128 % 0; //~ ERROR: evaluation of constant value failed
+const _NI128_MOD_P: &i128 = &(1i128 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NU8_MOD: u8 = 1u8 % 0; //~ ERROR: evaluation of constant value failed
+const _NU8_MOD_P: &u8 = &(1u8 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NU16_MOD: u16 = 1u16 % 0; //~ ERROR: evaluation of constant value failed
+const _NU16_MOD_P: &u16 = &(1u16 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NU32_MOD: u32 = 1u32 % 0; //~ ERROR: evaluation of constant value failed
+const _NU32_MOD_P: &u32 = &(1u32 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NU64_MOD: u64 = 1u64 % 0; //~ ERROR: evaluation of constant value failed
+const _NU64_MOD_P: &u64 = &(1u64 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NU128_MOD: u128 = 1u128 % 0; //~ ERROR: evaluation of constant value failed
+const _NU128_MOD_P: &u128 = &(1u128 % 0); //~ ERROR: evaluation of constant value failed
+
+const _NISIZE_MOD: isize = 1isize % 0; //~ ERROR: evaluation of constant value failed
+const _NISIZE_MOD_P: &isize = &(1isize % 0); //~ ERROR: evaluation of constant value failed
+
+const _NUSIZE_MOD: usize = 1usize % 0; //~ ERROR: evaluation of constant value failed
+const _NUSIZE_MOD_P: &usize = &(1usize % 0); //~ ERROR: evaluation of constant value failed
+
+
+// Out of bounds access
+const _NI32_OOB: i32 = [1, 2, 3][4]; //~ ERROR: evaluation of constant value failed
+const _NI32_OOB_P: &i32 = &([1, 2, 3][4]); //~ ERROR: evaluation of constant value failed
+
+
+pub fn main() {}
diff --git a/tests/ui/consts/promote-not.stderr b/tests/ui/consts/promote-not.stderr
index b93358e8dcc..524d6981721 100644
--- a/tests/ui/consts/promote-not.stderr
+++ b/tests/ui/consts/promote-not.stderr
@@ -19,26 +19,6 @@ LL | };
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:20:32
-   |
-LL |         let _x: &'static () = &foo();
-   |                 -----------    ^^^^^ creates a temporary value which is freed while still in use
-   |                 |
-   |                 type annotation requires that borrow lasts for `'static`
-LL |     }
-   |     - temporary value is freed at the end of this statement
-
-error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:28:29
-   |
-LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
-   |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
-   |             |
-   |             type annotation requires that borrow lasts for `'static`
-LL | }
-   | - temporary value is freed at the end of this statement
-
-error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-not.rs:33:29
    |
 LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
@@ -59,6 +39,26 @@ LL | };
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
+  --> $DIR/promote-not.rs:20:32
+   |
+LL |         let _x: &'static () = &foo();
+   |                 -----------    ^^^^^ creates a temporary value which is freed while still in use
+   |                 |
+   |                 type annotation requires that borrow lasts for `'static`
+LL |     }
+   |     - temporary value is freed at the end of this statement
+
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/promote-not.rs:28:29
+   |
+LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
+   |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
+   |             |
+   |             type annotation requires that borrow lasts for `'static`
+LL | }
+   | - temporary value is freed at the end of this statement
+
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-not.rs:46:29
    |
 LL |     let _val: &'static _ = &(Cell::new(1), 2).0;
diff --git a/tests/ui/consts/promoted_const_call2.stderr b/tests/ui/consts/promoted_const_call2.stderr
index 13d864ed3db..177f7aed17d 100644
--- a/tests/ui/consts/promoted_const_call2.stderr
+++ b/tests/ui/consts/promoted_const_call2.stderr
@@ -18,6 +18,12 @@ LL |     let _: &'static _ = &id(&String::new());
    |            |                 creates a temporary value which is freed while still in use
    |            type annotation requires that borrow lasts for `'static`
 
+error[E0493]: destructor of `String` cannot be evaluated at compile-time
+  --> $DIR/promoted_const_call2.rs:4:30
+   |
+LL |     let _: &'static _ = &id(&String::new());
+   |                              ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
+
 error[E0716]: temporary value dropped while borrowed
   --> $DIR/promoted_const_call2.rs:11:26
    |
@@ -38,12 +44,6 @@ LL |     let _: &'static _ = &id(&String::new());
    |            |                 creates a temporary value which is freed while still in use
    |            type annotation requires that borrow lasts for `'static`
 
-error[E0493]: destructor of `String` cannot be evaluated at compile-time
-  --> $DIR/promoted_const_call2.rs:4:30
-   |
-LL |     let _: &'static _ = &id(&String::new());
-   |                              ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
-
 error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0493, E0716.
diff --git a/tests/ui/consts/promotion.rs b/tests/ui/consts/promotion.rs
index 783ca47d2c6..211dcf8a4e8 100644
--- a/tests/ui/consts/promotion.rs
+++ b/tests/ui/consts/promotion.rs
@@ -25,9 +25,8 @@ fn main() {
     assert_static(&["d", "e", "f"]);
     assert_eq!(C, 42);
 
-    // make sure that these do not cause trouble despite overflowing
+    // make sure that this does not cause trouble despite overflowing
     assert_static(&(0-1));
-    assert_static(&-i32::MIN);
 
     // div-by-non-0 is okay
     assert_static(&(1/1));
diff --git a/tests/ui/consts/qualif-indirect-mutation-fail.stderr b/tests/ui/consts/qualif-indirect-mutation-fail.stderr
index 6379c00e4b4..458dc2071c4 100644
--- a/tests/ui/consts/qualif-indirect-mutation-fail.stderr
+++ b/tests/ui/consts/qualif-indirect-mutation-fail.stderr
@@ -1,21 +1,55 @@
-error[E0493]: destructor of `(u32, Option<String>)` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:9:9
-   |
-LL |     let mut a: (u32, Option<String>) = (0, None);
-   |         ^^^^^ the destructor for this type cannot be evaluated in constant functions
-
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
   --> $DIR/qualif-indirect-mutation-fail.rs:15:9
    |
 LL |     let mut x = None;
    |         ^^^^^ the destructor for this type cannot be evaluated in constants
 
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+   |
+   = note: calling non-const function `<Vec<u8> as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<Vec<u8>> - shim(Some(Vec<u8>))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `std::ptr::drop_in_place::<String> - shim(Some(String))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `std::ptr::drop_in_place::<Option<String>> - shim(Some(Option<String>))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `A1`
+  --> $DIR/qualif-indirect-mutation-fail.rs:21:1
+   |
+LL | };
+   | ^
+
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
   --> $DIR/qualif-indirect-mutation-fail.rs:31:9
    |
 LL |     let _z = x;
    |         ^^ the destructor for this type cannot be evaluated in constants
 
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+   |
+   = note: calling non-const function `<Vec<u8> as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<Vec<u8>> - shim(Some(Vec<u8>))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `std::ptr::drop_in_place::<String> - shim(Some(String))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `std::ptr::drop_in_place::<Option<String>> - shim(Some(Option<String>))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `A2`
+  --> $DIR/qualif-indirect-mutation-fail.rs:32:1
+   |
+LL | };
+   | ^
+
+error[E0493]: destructor of `(u32, Option<String>)` cannot be evaluated at compile-time
+  --> $DIR/qualif-indirect-mutation-fail.rs:9:9
+   |
+LL |     let mut a: (u32, Option<String>) = (0, None);
+   |         ^^^^^ the destructor for this type cannot be evaluated in constant functions
+
 error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time
   --> $DIR/qualif-indirect-mutation-fail.rs:36:9
    |
@@ -52,6 +86,7 @@ error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
 LL |     let x: Option<String> = None;
    |         ^ the destructor for this type cannot be evaluated in constant functions
 
-error: aborting due to 9 previous errors
+error: aborting due to 11 previous errors
 
-For more information about this error, try `rustc --explain E0493`.
+Some errors have detailed explanations: E0080, E0493.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/recursive-zst-static.default.stderr b/tests/ui/consts/recursive-zst-static.default.stderr
index 7679c50c74b..dedca16db8d 100644
--- a/tests/ui/consts/recursive-zst-static.default.stderr
+++ b/tests/ui/consts/recursive-zst-static.default.stderr
@@ -16,17 +16,7 @@ note: ...which requires evaluating initializer of static `B`...
 LL | static B: () = A;
    |                ^
    = note: ...which again requires evaluating initializer of static `A`, completing the cycle
-note: cycle used when linting top-level module
-  --> $DIR/recursive-zst-static.rs:10:1
-   |
-LL | / static FOO: () = FOO;
-LL | |
-LL | |
-LL | | static A: () = B;
-...  |
-LL | |     FOO
-LL | | }
-   | |_^
+   = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/recursive-zst-static.unleash.stderr b/tests/ui/consts/recursive-zst-static.unleash.stderr
index 7679c50c74b..dedca16db8d 100644
--- a/tests/ui/consts/recursive-zst-static.unleash.stderr
+++ b/tests/ui/consts/recursive-zst-static.unleash.stderr
@@ -16,17 +16,7 @@ note: ...which requires evaluating initializer of static `B`...
 LL | static B: () = A;
    |                ^
    = note: ...which again requires evaluating initializer of static `A`, completing the cycle
-note: cycle used when linting top-level module
-  --> $DIR/recursive-zst-static.rs:10:1
-   |
-LL | / static FOO: () = FOO;
-LL | |
-LL | |
-LL | | static A: () = B;
-...  |
-LL | |     FOO
-LL | | }
-   | |_^
+   = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/static-promoted-to-mutable-static.rs b/tests/ui/consts/static-promoted-to-mutable-static.rs
index 1cf72781e45..9eb9e1b8dfb 100644
--- a/tests/ui/consts/static-promoted-to-mutable-static.rs
+++ b/tests/ui/consts/static-promoted-to-mutable-static.rs
@@ -1,8 +1,9 @@
 //@ check-pass
-#![allow(non_camel_case_types, non_upper_case_globals, static_mut_ref)]
+
+#![allow(non_camel_case_types, non_upper_case_globals, static_mut_refs)]
 
 pub struct wl_interface {
-    pub version: i32
+    pub version: i32,
 }
 
 pub struct Interface {
@@ -10,20 +11,14 @@ pub struct Interface {
     pub c_ptr: Option<&'static wl_interface>,
 }
 
-pub static mut wl_callback_interface: wl_interface = wl_interface {
-    version: 0,
-};
+pub static mut wl_callback_interface: wl_interface = wl_interface { version: 0 };
 
-pub static WL_CALLBACK_INTERFACE: Interface = Interface {
-    other_interfaces: &[],
-    c_ptr: Some(unsafe { &wl_callback_interface }),
-};
+pub static WL_CALLBACK_INTERFACE: Interface =
+    Interface { other_interfaces: &[], c_ptr: Some(unsafe { &wl_callback_interface }) };
 
 // This static contains a promoted that points to a static that points to a mutable static.
-pub static WL_SURFACE_INTERFACE: Interface = Interface {
-    other_interfaces: &[&WL_CALLBACK_INTERFACE],
-    c_ptr: None,
-};
+pub static WL_SURFACE_INTERFACE: Interface =
+    Interface { other_interfaces: &[&WL_CALLBACK_INTERFACE], c_ptr: None };
 
 // And another variant of the same thing, this time with interior mutability.
 use std::sync::OnceLock;
diff --git a/tests/ui/consts/static_mut_containing_mut_ref.rs b/tests/ui/consts/static_mut_containing_mut_ref.rs
index 710328d6aa7..874a047d807 100644
--- a/tests/ui/consts/static_mut_containing_mut_ref.rs
+++ b/tests/ui/consts/static_mut_containing_mut_ref.rs
@@ -1,5 +1,5 @@
 //@ build-pass (FIXME(62277): could be check-pass?)
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 
 static mut STDERR_BUFFER_SPACE: [u8; 42] = [0u8; 42];
 
diff --git a/tests/ui/consts/static_mut_containing_mut_ref2.rs b/tests/ui/consts/static_mut_containing_mut_ref2.rs
index b5110623606..547f6449f13 100644
--- a/tests/ui/consts/static_mut_containing_mut_ref2.rs
+++ b/tests/ui/consts/static_mut_containing_mut_ref2.rs
@@ -1,5 +1,5 @@
 //@ revisions: stock mut_refs
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 #![cfg_attr(mut_refs, feature(const_mut_refs))]
 
 static mut STDERR_BUFFER_SPACE: u8 = 0;
diff --git a/tests/ui/coroutine/async_gen_fn_iter.rs b/tests/ui/coroutine/async_gen_fn_iter.rs
index c4a7629f314..42288712c70 100644
--- a/tests/ui/coroutine/async_gen_fn_iter.rs
+++ b/tests/ui/coroutine/async_gen_fn_iter.rs
@@ -46,7 +46,6 @@ async fn async_main() {
 use std::pin::{Pin, pin};
 use std::task::*;
 use std::async_iter::AsyncIterator;
-use std::future::Future;
 
 trait AsyncIterExt {
     fn next(&mut self) -> Next<'_, Self>;
diff --git a/tests/ui/crate-loading/missing-std.rs b/tests/ui/crate-loading/missing-std.rs
index ca9501cda3a..aed8b0c530a 100644
--- a/tests/ui/crate-loading/missing-std.rs
+++ b/tests/ui/crate-loading/missing-std.rs
@@ -1,6 +1,6 @@
 //@ compile-flags: --target x86_64-unknown-uefi
 //@ needs-llvm-components: x86
-//@ rustc-env:CARGO=/usr/bin/cargo
+//@ rustc-env:CARGO_CRATE_NAME=foo
 #![feature(no_core)]
 #![no_core]
 extern crate core;
diff --git a/tests/ui/did_you_mean/bad-assoc-ty.stderr b/tests/ui/did_you_mean/bad-assoc-ty.stderr
index 4a119f673c8..dc93762c9b1 100644
--- a/tests/ui/did_you_mean/bad-assoc-ty.stderr
+++ b/tests/ui/did_you_mean/bad-assoc-ty.stderr
@@ -191,7 +191,14 @@ error[E0223]: ambiguous associated type
   --> $DIR/bad-assoc-ty.rs:33:10
    |
 LL | type H = Fn(u8) -> (u8)::Output;
-   |          ^^^^^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output`
+   |          ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use fully-qualified syntax
+   |
+LL | type H = <(dyn Fn(u8) -> u8 + 'static) as BitOr>::Output;
+   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type H = <(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output;
+   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0223]: ambiguous associated type
   --> $DIR/bad-assoc-ty.rs:39:19
diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs
index f283b33f645..1fa68a2e738 100644
--- a/tests/ui/drop/issue-23338-ensure-param-drop-order.rs
+++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.rs
@@ -91,7 +91,7 @@ pub mod d {
     pub fn max_width() -> u32 {
         unsafe {
             (mem::size_of_val(&trails) * 8) as u32
-            //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+            //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
         }
     }
 
diff --git a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr
index fd36ccbcbee..de1194e74b4 100644
--- a/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr
+++ b/tests/ui/drop/issue-23338-ensure-param-drop-order.stderr
@@ -1,14 +1,14 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/issue-23338-ensure-param-drop-order.rs:93:31
    |
 LL |             (mem::size_of_val(&trails) * 8) as u32
-   |                               ^^^^^^^ shared reference of mutable static
+   |                               ^^^^^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |             (mem::size_of_val(addr_of!(trails)) * 8) as u32
    |                               ~~~~~~~~~~~~~~~~
diff --git a/tests/ui/drop/repeat-drop-2.stderr b/tests/ui/drop/repeat-drop-2.stderr
index f030228f71a..009a2057212 100644
--- a/tests/ui/drop/repeat-drop-2.stderr
+++ b/tests/ui/drop/repeat-drop-2.stderr
@@ -1,3 +1,12 @@
+error[E0493]: destructor of `String` cannot be evaluated at compile-time
+  --> $DIR/repeat-drop-2.rs:7:25
+   |
+LL | const _: [String; 0] = [String::new(); 0];
+   |                        -^^^^^^^^^^^^^----
+   |                        ||
+   |                        |the destructor for this type cannot be evaluated in constants
+   |                        value is dropped here
+
 error[E0382]: use of moved value: `foo`
   --> $DIR/repeat-drop-2.rs:4:17
    |
@@ -13,15 +22,6 @@ help: consider cloning the value if the performance cost is acceptable
 LL |     let _bar = foo.clone();
    |                   ++++++++
 
-error[E0493]: destructor of `String` cannot be evaluated at compile-time
-  --> $DIR/repeat-drop-2.rs:7:25
-   |
-LL | const _: [String; 0] = [String::new(); 0];
-   |                        -^^^^^^^^^^^^^----
-   |                        ||
-   |                        |the destructor for this type cannot be evaluated in constants
-   |                        value is dropped here
-
 error[E0381]: used binding `x` isn't initialized
   --> $DIR/repeat-drop-2.rs:12:14
    |
diff --git a/tests/ui/editions/edition-keywords-2018-2018-parsing.rs b/tests/ui/editions/edition-keywords-2018-2018-parsing.rs
index e3eed775a5f..4975246fa94 100644
--- a/tests/ui/editions/edition-keywords-2018-2018-parsing.rs
+++ b/tests/ui/editions/edition-keywords-2018-2018-parsing.rs
@@ -16,7 +16,7 @@ macro_rules! local_passes_ident {
     ($i: ident) => ($i) //~ ERROR macro expansion ends with an incomplete expression
 }
 macro_rules! local_passes_tt {
-    ($i: tt) => ($i) //~ ERROR macro expansion ends with an incomplete expression
+    ($i: tt) => ($i)
 }
 
 pub fn check_async() {
@@ -34,7 +34,7 @@ pub fn check_async() {
     if passes_tt!(r#async) == 1 {} // OK
     if local_passes_ident!(async) == 1 {} // Error reported above in the macro
     if local_passes_ident!(r#async) == 1 {} // OK
-    if local_passes_tt!(async) == 1 {} // Error reported above in the macro
+    if local_passes_tt!(async) == 1 {} //~ ERROR macro expansion ends with an incomplete expression
     if local_passes_tt!(r#async) == 1 {} // OK
     module::async(); //~ ERROR expected identifier, found keyword `async`
     module::r#async(); // OK
diff --git a/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr b/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr
index 6f08cff433b..4bbe1597233 100644
--- a/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr
+++ b/tests/ui/editions/edition-keywords-2018-2018-parsing.stderr
@@ -68,10 +68,10 @@ LL |     ($i: ident) => ($i)
    |                       ^ expected one of `move`, `|`, or `||`
 
 error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
-  --> $DIR/edition-keywords-2018-2018-parsing.rs:19:20
+  --> $DIR/edition-keywords-2018-2018-parsing.rs:37:30
    |
-LL |     ($i: tt) => ($i)
-   |                    ^ expected one of `move`, `|`, or `||`
+LL |     if local_passes_tt!(async) == 1 {}
+   |                              ^ expected one of `move`, `|`, or `||`
 
 error[E0308]: mismatched types
   --> $DIR/edition-keywords-2018-2018-parsing.rs:42:33
diff --git a/tests/ui/error-codes/E0017.rs b/tests/ui/error-codes/E0017.rs
index 9d3433fa543..c29015c8f33 100644
--- a/tests/ui/error-codes/E0017.rs
+++ b/tests/ui/error-codes/E0017.rs
@@ -1,3 +1,8 @@
+#![feature(const_mut_refs)]
+
+//@ normalize-stderr-test "\(size: ., align: .\)" -> ""
+//@ normalize-stderr-test " +│ ╾─+╼" -> ""
+
 static X: i32 = 1;
 const C: i32 = 2;
 static mut M: i32 = 3;
@@ -5,14 +10,13 @@ static mut M: i32 = 3;
 const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
 //~| WARN taking a mutable
 
-static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0658
-//~| ERROR cannot borrow
-//~| ERROR mutable references are not allowed
+static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow immutable static item `X` as mutable
 
 static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
 //~| WARN taking a mutable
 
-static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; //~ ERROR mutable references are not
-//~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
+//~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
+//~| ERROR undefined behavior
 
 fn main() {}
diff --git a/tests/ui/error-codes/E0017.stderr b/tests/ui/error-codes/E0017.stderr
index 2a70f2ee0ae..b5e9bacb122 100644
--- a/tests/ui/error-codes/E0017.stderr
+++ b/tests/ui/error-codes/E0017.stderr
@@ -1,20 +1,20 @@
-warning: mutable reference of mutable static is discouraged
-  --> $DIR/E0017.rs:15:52
+warning: creating a mutable reference to mutable static is discouraged
+  --> $DIR/E0017.rs:18:52
    |
 LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
-   |                                                    ^^^^^^ mutable reference of mutable static
+   |                                                    ^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { addr_of_mut!(M) };
    |                                                    ~~~~~~~~~~~~~~~
 
 warning: taking a mutable reference to a `const` item
-  --> $DIR/E0017.rs:5:30
+  --> $DIR/E0017.rs:10:30
    |
 LL | const CR: &'static mut i32 = &mut C;
    |                              ^^^^^^
@@ -22,42 +22,26 @@ LL | const CR: &'static mut i32 = &mut C;
    = note: each usage of a `const` item creates a new temporary
    = note: the mutable reference will refer to this temporary, not the original `const` item
 note: `const` item defined here
-  --> $DIR/E0017.rs:2:1
+  --> $DIR/E0017.rs:7:1
    |
 LL | const C: i32 = 2;
    | ^^^^^^^^^^^^
    = note: `#[warn(const_item_mutation)]` on by default
 
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/E0017.rs:5:30
+  --> $DIR/E0017.rs:10:30
    |
 LL | const CR: &'static mut i32 = &mut C;
    |                              ^^^^^^
 
-error[E0658]: mutation through a reference is not allowed in statics
-  --> $DIR/E0017.rs:8:39
-   |
-LL | static STATIC_REF: &'static mut i32 = &mut X;
-   |                                       ^^^^^^
-   |
-   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
-   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/E0017.rs:8:39
-   |
-LL | static STATIC_REF: &'static mut i32 = &mut X;
-   |                                       ^^^^^^
-
 error[E0596]: cannot borrow immutable static item `X` as mutable
-  --> $DIR/E0017.rs:8:39
+  --> $DIR/E0017.rs:13:39
    |
 LL | static STATIC_REF: &'static mut i32 = &mut X;
    |                                       ^^^^^^ cannot borrow as mutable
 
 warning: taking a mutable reference to a `const` item
-  --> $DIR/E0017.rs:12:38
+  --> $DIR/E0017.rs:15:38
    |
 LL | static CONST_REF: &'static mut i32 = &mut C;
    |                                      ^^^^^^
@@ -65,24 +49,29 @@ LL | static CONST_REF: &'static mut i32 = &mut C;
    = note: each usage of a `const` item creates a new temporary
    = note: the mutable reference will refer to this temporary, not the original `const` item
 note: `const` item defined here
-  --> $DIR/E0017.rs:2:1
+  --> $DIR/E0017.rs:7:1
    |
 LL | const C: i32 = 2;
    | ^^^^^^^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/E0017.rs:12:38
+  --> $DIR/E0017.rs:15:38
    |
 LL | static CONST_REF: &'static mut i32 = &mut C;
    |                                      ^^^^^^
 
-error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/E0017.rs:15:52
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/E0017.rs:18:1
    |
 LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
-   |                                                    ^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` or `static`
+   |
+   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+   = note: the raw bytes of the constant  {
+               ╾ALLOC0╼
+           }
 
-error: aborting due to 6 previous errors; 3 warnings emitted
+error: aborting due to 4 previous errors; 3 warnings emitted
 
-Some errors have detailed explanations: E0596, E0658, E0764.
-For more information about an error, try `rustc --explain E0596`.
+Some errors have detailed explanations: E0080, E0596, E0764.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/error-codes/E0093.stderr b/tests/ui/error-codes/E0093.stderr
index 387e0c55d4d..51c367b343a 100644
--- a/tests/ui/error-codes/E0093.stderr
+++ b/tests/ui/error-codes/E0093.stderr
@@ -3,6 +3,8 @@ error[E0093]: unrecognized intrinsic function: `foo`
    |
 LL |     fn foo();
    |     ^^^^^^^^^ unrecognized intrinsic
+   |
+   = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0388.rs b/tests/ui/error-codes/E0388.rs
index 6049d95f0d2..bbc5f2710bf 100644
--- a/tests/ui/error-codes/E0388.rs
+++ b/tests/ui/error-codes/E0388.rs
@@ -2,12 +2,12 @@ static X: i32 = 1;
 const C: i32 = 2;
 
 const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
-                                     //~| WARN taking a mutable
-static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow
-                                              //~| ERROR E0658
-                                              //~| ERROR mutable references are not allowed
+
+//~| WARN taking a mutable
+static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0658
 
 static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
-                                             //~| WARN taking a mutable
+
+//~| WARN taking a mutable
 
 fn main() {}
diff --git a/tests/ui/error-codes/E0388.stderr b/tests/ui/error-codes/E0388.stderr
index 1f7b688899e..cb7047072bd 100644
--- a/tests/ui/error-codes/E0388.stderr
+++ b/tests/ui/error-codes/E0388.stderr
@@ -19,8 +19,8 @@ error[E0764]: mutable references are not allowed in the final value of constants
 LL | const CR: &'static mut i32 = &mut C;
    |                              ^^^^^^
 
-error[E0658]: mutation through a reference is not allowed in statics
-  --> $DIR/E0388.rs:6:39
+error[E0658]: mutable references are not allowed in statics
+  --> $DIR/E0388.rs:7:39
    |
 LL | static STATIC_REF: &'static mut i32 = &mut X;
    |                                       ^^^^^^
@@ -29,20 +29,8 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/E0388.rs:6:39
-   |
-LL | static STATIC_REF: &'static mut i32 = &mut X;
-   |                                       ^^^^^^
-
-error[E0596]: cannot borrow immutable static item `X` as mutable
-  --> $DIR/E0388.rs:6:39
-   |
-LL | static STATIC_REF: &'static mut i32 = &mut X;
-   |                                       ^^^^^^ cannot borrow as mutable
-
 warning: taking a mutable reference to a `const` item
-  --> $DIR/E0388.rs:10:38
+  --> $DIR/E0388.rs:9:38
    |
 LL | static CONST_REF: &'static mut i32 = &mut C;
    |                                      ^^^^^^
@@ -56,12 +44,12 @@ LL | const C: i32 = 2;
    | ^^^^^^^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/E0388.rs:10:38
+  --> $DIR/E0388.rs:9:38
    |
 LL | static CONST_REF: &'static mut i32 = &mut C;
    |                                      ^^^^^^
 
-error: aborting due to 5 previous errors; 2 warnings emitted
+error: aborting due to 3 previous errors; 2 warnings emitted
 
-Some errors have detailed explanations: E0596, E0658, E0764.
-For more information about an error, try `rustc --explain E0596`.
+Some errors have detailed explanations: E0658, E0764.
+For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/error-codes/E0396.stderr b/tests/ui/error-codes/E0396.stderr
index ac1e7d65ce8..8bc14139d63 100644
--- a/tests/ui/error-codes/E0396.stderr
+++ b/tests/ui/error-codes/E0396.stderr
@@ -8,42 +8,42 @@ LL | const VALUE: u8 = unsafe { *REG_ADDR };
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
-  --> $DIR/E0396.rs:10:11
+error[E0658]: dereferencing raw mutable pointers in constants is unstable
+  --> $DIR/E0396.rs:14:36
    |
-LL |     match *INFALLIBLE {}
-   |           ^^^^^^^^^^^
+LL |     const BAD: () = unsafe { match *INFALLIBLE {} };
+   |                                    ^^^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
-  --> $DIR/E0396.rs:10:11
+error[E0658]: dereferencing raw mutable pointers in constants is unstable
+  --> $DIR/E0396.rs:14:36
    |
-LL |     match *INFALLIBLE {}
-   |           ^^^^^^^^^^^
+LL |     const BAD: () = unsafe { match *INFALLIBLE {} };
+   |                                    ^^^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0658]: dereferencing raw mutable pointers in constants is unstable
-  --> $DIR/E0396.rs:14:36
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+  --> $DIR/E0396.rs:10:11
    |
-LL |     const BAD: () = unsafe { match *INFALLIBLE {} };
-   |                                    ^^^^^^^^^^^
+LL |     match *INFALLIBLE {}
+   |           ^^^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: dereferencing raw mutable pointers in constants is unstable
-  --> $DIR/E0396.rs:14:36
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+  --> $DIR/E0396.rs:10:11
    |
-LL |     const BAD: () = unsafe { match *INFALLIBLE {} };
-   |                                    ^^^^^^^^^^^
+LL |     match *INFALLIBLE {}
+   |           ^^^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
diff --git a/tests/ui/error-should-say-copy-not-pod.stderr b/tests/ui/error-should-say-copy-not-pod.stderr
index 658584e2ff4..6aa129fa29b 100644
--- a/tests/ui/error-should-say-copy-not-pod.stderr
+++ b/tests/ui/error-should-say-copy-not-pod.stderr
@@ -11,6 +11,11 @@ note: required by a bound in `check_bound`
    |
 LL | fn check_bound<T:Copy>(_: T) {}
    |                  ^^^^ required by this bound in `check_bound`
+help: consider removing this method call, as the receiver has type `&'static str` and `&'static str: Copy` trivially holds
+   |
+LL -     check_bound("nocopy".to_string());
+LL +     check_bound("nocopy");
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/extern-flag/empty-extern-arg.stderr b/tests/ui/extern-flag/empty-extern-arg.stderr
index 6ad3effe0e2..2785b12a0ae 100644
--- a/tests/ui/extern-flag/empty-extern-arg.stderr
+++ b/tests/ui/extern-flag/empty-extern-arg.stderr
@@ -1,6 +1,13 @@
 error: extern location for std does not exist: 
 
+error: `#[panic_handler]` function required, but not found
+
+error: unwinding panics are not supported without std
+   |
+   = help: using nightly cargo, use -Zbuild-std with panic="abort" to avoid unwinding
+   = note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem
+
 error: requires `sized` lang_item
 
-error: aborting due to 2 previous errors
+error: aborting due to 4 previous errors
 
diff --git a/tests/ui/extern/issue-28324.rs b/tests/ui/extern/issue-28324.rs
index f74726e8166..a5e240fa283 100644
--- a/tests/ui/extern/issue-28324.rs
+++ b/tests/ui/extern/issue-28324.rs
@@ -4,5 +4,6 @@ extern "C" {
 
 pub static BAZ: u32 = *&error_message_count;
 //~^ ERROR use of extern static is unsafe and requires
+//~| ERROR could not evaluate static initializer
 
 fn main() {}
diff --git a/tests/ui/extern/issue-28324.stderr b/tests/ui/extern/issue-28324.stderr
index 94ff2131993..1fccb34fdf3 100644
--- a/tests/ui/extern/issue-28324.stderr
+++ b/tests/ui/extern/issue-28324.stderr
@@ -1,3 +1,9 @@
+error[E0080]: could not evaluate static initializer
+  --> $DIR/issue-28324.rs:5:23
+   |
+LL | pub static BAZ: u32 = *&error_message_count;
+   |                       ^^^^^^^^^^^^^^^^^^^^^ cannot access extern static (DefId(0:4 ~ issue_28324[8ec4]::{extern#0}::error_message_count))
+
 error[E0133]: use of extern static is unsafe and requires unsafe function or block
   --> $DIR/issue-28324.rs:5:25
    |
@@ -6,6 +12,7 @@ LL | pub static BAZ: u32 = *&error_message_count;
    |
    = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0133`.
+Some errors have detailed explanations: E0080, E0133.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/feature-gates/feature-gate-abi.stderr b/tests/ui/feature-gates/feature-gate-abi.stderr
index aa60434d9fe..3fd1e1189ab 100644
--- a/tests/ui/feature-gates/feature-gate-abi.stderr
+++ b/tests/ui/feature-gates/feature-gate-abi.stderr
@@ -187,12 +187,16 @@ error[E0093]: unrecognized intrinsic function: `f1`
    |
 LL | extern "rust-intrinsic" fn f1() {}
    |                            ^^ unrecognized intrinsic
+   |
+   = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type`
 
 error[E0093]: unrecognized intrinsic function: `f2`
   --> $DIR/feature-gate-abi.rs:18:32
    |
 LL | extern "platform-intrinsic" fn f2() {}
    |                                ^^ unrecognized intrinsic
+   |
+   = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type`
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
   --> $DIR/feature-gate-abi.rs:25:32
diff --git a/tests/ui/feature-gates/feature-gate-intrinsics.stderr b/tests/ui/feature-gates/feature-gate-intrinsics.stderr
index 78c21843adb..583a4a1a84e 100644
--- a/tests/ui/feature-gates/feature-gate-intrinsics.stderr
+++ b/tests/ui/feature-gates/feature-gate-intrinsics.stderr
@@ -21,12 +21,16 @@ error[E0093]: unrecognized intrinsic function: `bar`
    |
 LL |     fn bar();
    |     ^^^^^^^^^ unrecognized intrinsic
+   |
+   = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type`
 
 error[E0093]: unrecognized intrinsic function: `baz`
   --> $DIR/feature-gate-intrinsics.rs:5:28
    |
 LL | extern "rust-intrinsic" fn baz() {}
    |                            ^^^ unrecognized intrinsic
+   |
+   = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type`
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
   --> $DIR/feature-gate-intrinsics.rs:5:34
diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
index 5afd21a17e5..3a0b7ba4666 100644
--- a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
+++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
@@ -6,7 +6,6 @@ extern crate format_string_proc_macro;
 macro_rules! identity_mbe {
     ($tt:tt) => {
         $tt
-        //~^ ERROR there is no argument named `a`
     };
 }
 
@@ -16,6 +15,7 @@ fn main() {
     format!(identity_pm!("{a}"));
     //~^ ERROR there is no argument named `a`
     format!(identity_mbe!("{a}"));
+    //~^ ERROR there is no argument named `a`
     format!(concat!("{a}"));
     //~^ ERROR there is no argument named `a`
 }
diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr b/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
index 4cf3afad7b8..e399361579f 100644
--- a/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
+++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
@@ -1,5 +1,5 @@
 error: there is no argument named `a`
-  --> $DIR/format-args-capture-first-literal-is-macro.rs:16:26
+  --> $DIR/format-args-capture-first-literal-is-macro.rs:15:26
    |
 LL |     format!(identity_pm!("{a}"));
    |                          ^^^^^
@@ -8,10 +8,10 @@ LL |     format!(identity_pm!("{a}"));
    = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
 
 error: there is no argument named `a`
-  --> $DIR/format-args-capture-first-literal-is-macro.rs:8:9
+  --> $DIR/format-args-capture-first-literal-is-macro.rs:17:27
    |
-LL |         $tt
-   |         ^^^
+LL |     format!(identity_mbe!("{a}"));
+   |                           ^^^^^
    |
    = note: did you intend to capture a variable `a` from the surrounding scope?
    = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
diff --git a/tests/ui/fmt/ifmt-unimpl.stderr b/tests/ui/fmt/ifmt-unimpl.stderr
index 58531c61bbe..3c5428e59fb 100644
--- a/tests/ui/fmt/ifmt-unimpl.stderr
+++ b/tests/ui/fmt/ifmt-unimpl.stderr
@@ -15,7 +15,7 @@ LL |     format!("{:X}", "3");
              i128
              usize
              u8
-           and 20 others
+           and 9 others
    = note: required for `&str` to implement `UpperHex`
 note: required by a bound in `core::fmt::rt::Argument::<'a>::new_upper_hex`
   --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
diff --git a/tests/ui/generic-associated-types/issue-79636-1.rs b/tests/ui/generic-associated-types/issue-79636-1.rs
index a05311d59c1..3357afb9d4d 100644
--- a/tests/ui/generic-associated-types/issue-79636-1.rs
+++ b/tests/ui/generic-associated-types/issue-79636-1.rs
@@ -15,7 +15,6 @@ where
     //~^ ERROR: missing generics for associated type `Monad::Wrapped`
 {
     outer.bind(|inner| inner)
-    //~^ ERROR type annotations needed
 }
 
 fn main() {
diff --git a/tests/ui/generic-associated-types/issue-79636-1.stderr b/tests/ui/generic-associated-types/issue-79636-1.stderr
index 743d8b7d462..c31064dec62 100644
--- a/tests/ui/generic-associated-types/issue-79636-1.stderr
+++ b/tests/ui/generic-associated-types/issue-79636-1.stderr
@@ -30,19 +30,8 @@ help: function arguments must have a statically known size, borrowed types alway
 LL |     fn bind<B, F>(&self, f: F) -> Self::Wrapped<B> {
    |                   +
 
-error[E0282]: type annotations needed
-  --> $DIR/issue-79636-1.rs:17:17
-   |
-LL |     outer.bind(|inner| inner)
-   |                 ^^^^^
-   |
-help: consider giving this closure parameter an explicit type
-   |
-LL |     outer.bind(|inner: /* Type */| inner)
-   |                      ++++++++++++
-
 error[E0277]: the trait bound `Option<Option<bool>>: Monad` is not satisfied
-  --> $DIR/issue-79636-1.rs:22:21
+  --> $DIR/issue-79636-1.rs:21:21
    |
 LL |     assert_eq!(join(Some(Some(true))), Some(true));
    |                ---- ^^^^^^^^^^^^^^^^ the trait `Monad` is not implemented for `Option<Option<bool>>`
@@ -63,7 +52,7 @@ LL | where
 LL |     MOuter: Monad<Unwrapped = MInner>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `join`
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0107, E0277, E0282.
+Some errors have detailed explanations: E0107, E0277.
 For more information about an error, try `rustc --explain E0107`.
diff --git a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs
index dd00b327d2d..93f01c9577c 100644
--- a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs
+++ b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs
@@ -3,7 +3,7 @@
 
 // Ensure that we check if trivial bounds on const items hold or not.
 
-const UNUSABLE: () = ()
+const UNUSABLE: () = () //~ ERROR evaluation of constant value failed
 where
     String: Copy;
 
diff --git a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr
index 942e5dbd88e..407682fee56 100644
--- a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr
+++ b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr
@@ -1,3 +1,11 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/trivially-unsatisfied-bounds-0.rs:6:1
+   |
+LL | / const UNUSABLE: () = ()
+LL | | where
+LL | |     String: Copy;
+   | |_________________^ entering unreachable code
+
 error[E0277]: the trait bound `String: Copy` is not satisfied
   --> $DIR/trivially-unsatisfied-bounds-0.rs:11:13
    |
@@ -13,6 +21,7 @@ LL | where
 LL |     String: Copy;
    |             ^^^^ required by this bound in `UNUSABLE`
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0080, E0277.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/impl-trait/rpit/early_bound.rs b/tests/ui/impl-trait/rpit/early_bound.rs
index 03bd64d4d76..6dda687929c 100644
--- a/tests/ui/impl-trait/rpit/early_bound.rs
+++ b/tests/ui/impl-trait/rpit/early_bound.rs
@@ -5,7 +5,6 @@ fn test<'a: 'a>(n: bool) -> impl Sized + 'a {
     let true = n else { loop {} };
     let _ = || {
         let _ = identity::<&'a ()>(test(false));
-        //~^ ERROR hidden type for `impl Sized + 'a` captures lifetime that does not appear in bounds
     };
     loop {}
 }
diff --git a/tests/ui/impl-trait/rpit/early_bound.stderr b/tests/ui/impl-trait/rpit/early_bound.stderr
index 815368f250e..780dea4e284 100644
--- a/tests/ui/impl-trait/rpit/early_bound.stderr
+++ b/tests/ui/impl-trait/rpit/early_bound.stderr
@@ -1,14 +1,3 @@
-error[E0700]: hidden type for `impl Sized + 'a` captures lifetime that does not appear in bounds
-  --> $DIR/early_bound.rs:7:17
-   |
-LL | fn test<'a: 'a>(n: bool) -> impl Sized + 'a {
-   |         --                  --------------- opaque type defined here
-   |         |
-   |         hidden type `&'a ()` captures the lifetime `'a` as defined here
-...
-LL |         let _ = identity::<&'a ()>(test(false));
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error: concrete type differs from previous defining opaque type use
   --> $DIR/early_bound.rs:3:29
    |
@@ -21,6 +10,5 @@ note: previous use here
 LL |         let _ = identity::<&'a ()>(test(false));
    |                                    ^^^^^^^^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0700`.
diff --git a/tests/ui/impl-trait/where-allowed.rs b/tests/ui/impl-trait/where-allowed.rs
index 505e2d6c171..72ce617693e 100644
--- a/tests/ui/impl-trait/where-allowed.rs
+++ b/tests/ui/impl-trait/where-allowed.rs
@@ -59,7 +59,6 @@ fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
 fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
 //~^ ERROR `impl Trait` is not allowed in the parameters of `Fn` trait bounds
 //~| ERROR nested `impl Trait` is not allowed
-//~| ERROR: type annotations needed
 
 // Allowed
 fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr
index c22312cce19..f203f4cabc8 100644
--- a/tests/ui/impl-trait/where-allowed.stderr
+++ b/tests/ui/impl-trait/where-allowed.stderr
@@ -17,7 +17,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
    |                                                 outer `impl Trait`
 
 error[E0658]: `impl Trait` in associated types is unstable
-  --> $DIR/where-allowed.rs:123:16
+  --> $DIR/where-allowed.rs:122:16
    |
 LL |     type Out = impl Debug;
    |                ^^^^^^^^^^
@@ -27,7 +27,7 @@ LL |     type Out = impl Debug;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: `impl Trait` in type aliases is unstable
-  --> $DIR/where-allowed.rs:160:23
+  --> $DIR/where-allowed.rs:159:23
    |
 LL | type InTypeAlias<R> = impl Debug;
    |                       ^^^^^^^^^^
@@ -37,7 +37,7 @@ LL | type InTypeAlias<R> = impl Debug;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: `impl Trait` in type aliases is unstable
-  --> $DIR/where-allowed.rs:163:39
+  --> $DIR/where-allowed.rs:162:39
    |
 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    |                                       ^^^^^^^^^^
@@ -127,7 +127,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
-  --> $DIR/where-allowed.rs:69:38
+  --> $DIR/where-allowed.rs:68:38
    |
 LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
    |                                      ^^^^^^^^^^
@@ -135,7 +135,7 @@ LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
-  --> $DIR/where-allowed.rs:73:40
+  --> $DIR/where-allowed.rs:72:40
    |
 LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
    |                                        ^^^^^^^^^^
@@ -143,7 +143,7 @@ LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in field types
-  --> $DIR/where-allowed.rs:87:32
+  --> $DIR/where-allowed.rs:86:32
    |
 LL | struct InBraceStructField { x: impl Debug }
    |                                ^^^^^^^^^^
@@ -151,7 +151,7 @@ LL | struct InBraceStructField { x: impl Debug }
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in field types
-  --> $DIR/where-allowed.rs:91:41
+  --> $DIR/where-allowed.rs:90:41
    |
 LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
    |                                         ^^^^^^^^^^
@@ -159,7 +159,7 @@ LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in field types
-  --> $DIR/where-allowed.rs:95:27
+  --> $DIR/where-allowed.rs:94:27
    |
 LL | struct InTupleStructField(impl Debug);
    |                           ^^^^^^^^^^
@@ -167,7 +167,7 @@ LL | struct InTupleStructField(impl Debug);
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in field types
-  --> $DIR/where-allowed.rs:100:25
+  --> $DIR/where-allowed.rs:99:25
    |
 LL |     InBraceVariant { x: impl Debug },
    |                         ^^^^^^^^^^
@@ -175,7 +175,7 @@ LL |     InBraceVariant { x: impl Debug },
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in field types
-  --> $DIR/where-allowed.rs:102:20
+  --> $DIR/where-allowed.rs:101:20
    |
 LL |     InTupleVariant(impl Debug),
    |                    ^^^^^^^^^^
@@ -183,7 +183,7 @@ LL |     InTupleVariant(impl Debug),
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in `extern fn` parameters
-  --> $DIR/where-allowed.rs:144:33
+  --> $DIR/where-allowed.rs:143:33
    |
 LL |     fn in_foreign_parameters(_: impl Debug);
    |                                 ^^^^^^^^^^
@@ -191,7 +191,7 @@ LL |     fn in_foreign_parameters(_: impl Debug);
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in `extern fn` return types
-  --> $DIR/where-allowed.rs:147:31
+  --> $DIR/where-allowed.rs:146:31
    |
 LL |     fn in_foreign_return() -> impl Debug;
    |                               ^^^^^^^^^^
@@ -199,7 +199,7 @@ LL |     fn in_foreign_return() -> impl Debug;
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in `fn` pointer return types
-  --> $DIR/where-allowed.rs:163:39
+  --> $DIR/where-allowed.rs:162:39
    |
 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    |                                       ^^^^^^^^^^
@@ -207,7 +207,7 @@ LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in traits
-  --> $DIR/where-allowed.rs:168:16
+  --> $DIR/where-allowed.rs:167:16
    |
 LL | impl PartialEq<impl Debug> for () {
    |                ^^^^^^^^^^
@@ -215,7 +215,7 @@ LL | impl PartialEq<impl Debug> for () {
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in impl headers
-  --> $DIR/where-allowed.rs:173:24
+  --> $DIR/where-allowed.rs:172:24
    |
 LL | impl PartialEq<()> for impl Debug {
    |                        ^^^^^^^^^^
@@ -223,7 +223,7 @@ LL | impl PartialEq<()> for impl Debug {
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in impl headers
-  --> $DIR/where-allowed.rs:178:6
+  --> $DIR/where-allowed.rs:177:6
    |
 LL | impl impl Debug {
    |      ^^^^^^^^^^
@@ -231,7 +231,7 @@ LL | impl impl Debug {
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in impl headers
-  --> $DIR/where-allowed.rs:184:24
+  --> $DIR/where-allowed.rs:183:24
    |
 LL | impl InInherentImplAdt<impl Debug> {
    |                        ^^^^^^^^^^
@@ -239,7 +239,7 @@ LL | impl InInherentImplAdt<impl Debug> {
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in bounds
-  --> $DIR/where-allowed.rs:190:11
+  --> $DIR/where-allowed.rs:189:11
    |
 LL |     where impl Debug: Debug
    |           ^^^^^^^^^^
@@ -247,7 +247,7 @@ LL |     where impl Debug: Debug
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in bounds
-  --> $DIR/where-allowed.rs:197:15
+  --> $DIR/where-allowed.rs:196:15
    |
 LL |     where Vec<impl Debug>: Debug
    |               ^^^^^^^^^^
@@ -255,7 +255,7 @@ LL |     where Vec<impl Debug>: Debug
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in bounds
-  --> $DIR/where-allowed.rs:204:24
+  --> $DIR/where-allowed.rs:203:24
    |
 LL |     where T: PartialEq<impl Debug>
    |                        ^^^^^^^^^^
@@ -263,7 +263,7 @@ LL |     where T: PartialEq<impl Debug>
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
-  --> $DIR/where-allowed.rs:211:17
+  --> $DIR/where-allowed.rs:210:17
    |
 LL |     where T: Fn(impl Debug)
    |                 ^^^^^^^^^^
@@ -271,7 +271,7 @@ LL |     where T: Fn(impl Debug)
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
-  --> $DIR/where-allowed.rs:218:22
+  --> $DIR/where-allowed.rs:217:22
    |
 LL |     where T: Fn() -> impl Debug
    |                      ^^^^^^^^^^
@@ -279,7 +279,7 @@ LL |     where T: Fn() -> impl Debug
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in generic parameter defaults
-  --> $DIR/where-allowed.rs:224:40
+  --> $DIR/where-allowed.rs:223:40
    |
 LL | struct InStructGenericParamDefault<T = impl Debug>(T);
    |                                        ^^^^^^^^^^
@@ -287,7 +287,7 @@ LL | struct InStructGenericParamDefault<T = impl Debug>(T);
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in generic parameter defaults
-  --> $DIR/where-allowed.rs:228:36
+  --> $DIR/where-allowed.rs:227:36
    |
 LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
    |                                    ^^^^^^^^^^
@@ -295,7 +295,7 @@ LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in generic parameter defaults
-  --> $DIR/where-allowed.rs:232:38
+  --> $DIR/where-allowed.rs:231:38
    |
 LL | trait InTraitGenericParamDefault<T = impl Debug> {}
    |                                      ^^^^^^^^^^
@@ -303,7 +303,7 @@ LL | trait InTraitGenericParamDefault<T = impl Debug> {}
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in generic parameter defaults
-  --> $DIR/where-allowed.rs:236:41
+  --> $DIR/where-allowed.rs:235:41
    |
 LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
    |                                         ^^^^^^^^^^
@@ -311,7 +311,7 @@ LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in generic parameter defaults
-  --> $DIR/where-allowed.rs:240:11
+  --> $DIR/where-allowed.rs:239:11
    |
 LL | impl <T = impl Debug> T {}
    |           ^^^^^^^^^^
@@ -319,7 +319,7 @@ LL | impl <T = impl Debug> T {}
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in generic parameter defaults
-  --> $DIR/where-allowed.rs:247:40
+  --> $DIR/where-allowed.rs:246:40
    |
 LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
    |                                        ^^^^^^^^^^
@@ -327,7 +327,7 @@ LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in the type of variable bindings
-  --> $DIR/where-allowed.rs:253:29
+  --> $DIR/where-allowed.rs:252:29
    |
 LL |     let _in_local_variable: impl Fn() = || {};
    |                             ^^^^^^^^^
@@ -335,7 +335,7 @@ LL |     let _in_local_variable: impl Fn() = || {};
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error[E0562]: `impl Trait` is not allowed in closure return types
-  --> $DIR/where-allowed.rs:255:46
+  --> $DIR/where-allowed.rs:254:46
    |
 LL |     let _in_return_in_local_variable = || -> impl Fn() { || {} };
    |                                              ^^^^^^^^^
@@ -343,7 +343,7 @@ LL |     let _in_return_in_local_variable = || -> impl Fn() { || {} };
    = note: `impl Trait` is only allowed in arguments and return types of functions and methods
 
 error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
-  --> $DIR/where-allowed.rs:240:7
+  --> $DIR/where-allowed.rs:239:7
    |
 LL | impl <T = impl Debug> T {}
    |       ^^^^^^^^^^^^^^
@@ -353,7 +353,7 @@ LL | impl <T = impl Debug> T {}
    = note: `#[deny(invalid_type_param_default)]` on by default
 
 error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
-  --> $DIR/where-allowed.rs:247:36
+  --> $DIR/where-allowed.rs:246:36
    |
 LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
    |                                    ^^^^^^^^^^^^^^
@@ -362,7 +362,7 @@ LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
    = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
 
 error[E0118]: no nominal type found for inherent implementation
-  --> $DIR/where-allowed.rs:240:1
+  --> $DIR/where-allowed.rs:239:1
    |
 LL | impl <T = impl Debug> T {}
    | ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
@@ -377,14 +377,8 @@ LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!
    |
    = note: cannot satisfy `_: Debug`
 
-error[E0282]: type annotations needed
-  --> $DIR/where-allowed.rs:59:49
-   |
-LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
-   |                                                 ^^^^^^^^^^^^^^^^^^^ cannot infer type
-
 error[E0283]: type annotations needed
-  --> $DIR/where-allowed.rs:65:46
+  --> $DIR/where-allowed.rs:64:46
    |
 LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
@@ -396,7 +390,7 @@ LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { pani
              where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
 
 error[E0599]: no function or associated item named `into_vec` found for slice `[_]` in the current scope
-  --> $DIR/where-allowed.rs:82:5
+  --> $DIR/where-allowed.rs:81:5
    |
 LL |     vec![vec![0; 10], vec![12; 7], vec![8; 3]]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `[_]`
@@ -404,7 +398,7 @@ LL |     vec![vec![0; 10], vec![12; 7], vec![8; 3]]
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0053]: method `in_trait_impl_return` has an incompatible type for trait
-  --> $DIR/where-allowed.rs:130:34
+  --> $DIR/where-allowed.rs:129:34
    |
 LL |     type Out = impl Debug;
    |                ---------- the expected opaque type
@@ -416,7 +410,7 @@ LL |     fn in_trait_impl_return() -> impl Debug { () }
    |                                  help: change the output type to match the trait: `<() as DummyTrait>::Out`
    |
 note: type in trait
-  --> $DIR/where-allowed.rs:120:34
+  --> $DIR/where-allowed.rs:119:34
    |
 LL |     fn in_trait_impl_return() -> Self::Out;
    |                                  ^^^^^^^^^
@@ -425,14 +419,14 @@ LL |     fn in_trait_impl_return() -> Self::Out;
    = note: distinct uses of `impl Trait` result in different opaque types
 
 error: unconstrained opaque type
-  --> $DIR/where-allowed.rs:123:16
+  --> $DIR/where-allowed.rs:122:16
    |
 LL |     type Out = impl Debug;
    |                ^^^^^^^^^^
    |
    = note: `Out` must be used in combination with a concrete type within the same impl
 
-error: aborting due to 51 previous errors
+error: aborting due to 50 previous errors
 
-Some errors have detailed explanations: E0053, E0118, E0282, E0283, E0562, E0599, E0658, E0666.
+Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0599, E0658, E0666.
 For more information about an error, try `rustc --explain E0053`.
diff --git a/tests/ui/inference/issue-80409.no-compat.stderr b/tests/ui/inference/issue-80409.no-compat.stderr
index 7bb4786db3a..f9772b2d5a6 100644
--- a/tests/ui/inference/issue-80409.no-compat.stderr
+++ b/tests/ui/inference/issue-80409.no-compat.stderr
@@ -1,6 +1,16 @@
 error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ImpliedOutlivesBounds { ty: &'?2 mut StateContext<'?3, usize> } }
+  --> $DIR/issue-80409.rs:49:30
    |
-   = query stack during panic:
+LL |     builder.state().on_entry(|_| {});
+   |                              ^^^
+   |
+note: 
+  --> $DIR/issue-80409.rs:49:30
+   |
+LL |     builder.state().on_entry(|_| {});
+   |                              ^^^
+
+query stack during panic:
 end of query stack
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/inference/issue-80409.rs b/tests/ui/inference/issue-80409.rs
index e54da78614f..dfb84563e6d 100644
--- a/tests/ui/inference/issue-80409.rs
+++ b/tests/ui/inference/issue-80409.rs
@@ -8,6 +8,7 @@
 //@[no-compat] check-fail
 //@[no-compat] known-bug: #80409
 //@[no-compat] failure-status: 101
+//@[no-compat] normalize-stderr-test "delayed at.*" -> ""
 //@[no-compat] normalize-stderr-test "note: .*\n\n" -> ""
 //@[no-compat] normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
 //@[no-compat] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
diff --git a/tests/ui/intrinsics-always-extern.stderr b/tests/ui/intrinsics-always-extern.stderr
index 32468f99197..1f7bb5a3b0d 100644
--- a/tests/ui/intrinsics-always-extern.stderr
+++ b/tests/ui/intrinsics-always-extern.stderr
@@ -9,6 +9,8 @@ error[E0093]: unrecognized intrinsic function: `hello`
    |
 LL | extern "rust-intrinsic" fn hello() {
    |                            ^^^^^ unrecognized intrinsic
+   |
+   = help: if you're adding an intrinsic, be sure to update `check_intrinsic_type`
 
 error: intrinsic must be in `extern "rust-intrinsic" { ... }` block
   --> $DIR/intrinsics-always-extern.rs:8:43
diff --git a/tests/ui/intrinsics/safe-intrinsic-mismatch.rs b/tests/ui/intrinsics/safe-intrinsic-mismatch.rs
index fcd6612f125..23cd5f10835 100644
--- a/tests/ui/intrinsics/safe-intrinsic-mismatch.rs
+++ b/tests/ui/intrinsics/safe-intrinsic-mismatch.rs
@@ -5,13 +5,13 @@
 extern "rust-intrinsic" {
     fn size_of<T>() -> usize; //~ ERROR intrinsic safety mismatch
     //~^ ERROR intrinsic safety mismatch
-
-    #[rustc_safe_intrinsic]
-    fn assume(b: bool); //~ ERROR intrinsic safety mismatch
-    //~^ ERROR intrinsic safety mismatch
 }
 
 #[rustc_intrinsic]
+const fn assume(_b: bool) {} //~ ERROR intrinsic safety mismatch
+//~| ERROR intrinsic has wrong type
+
+#[rustc_intrinsic]
 const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
 //~^ ERROR intrinsic safety mismatch
 //~| ERROR intrinsic has wrong type
diff --git a/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr b/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr
index 0b579121ac1..2e0812d6472 100644
--- a/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr
+++ b/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr
@@ -4,12 +4,6 @@ error: intrinsic safety mismatch between list of intrinsics within the compiler
 LL |     fn size_of<T>() -> usize;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume`
-  --> $DIR/safe-intrinsic-mismatch.rs:10:5
-   |
-LL |     fn assume(b: bool);
-   |     ^^^^^^^^^^^^^^^^^^
-
 error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of`
   --> $DIR/safe-intrinsic-mismatch.rs:6:5
    |
@@ -19,12 +13,19 @@ LL |     fn size_of<T>() -> usize;
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume`
-  --> $DIR/safe-intrinsic-mismatch.rs:10:5
+  --> $DIR/safe-intrinsic-mismatch.rs:11:1
    |
-LL |     fn assume(b: bool);
-   |     ^^^^^^^^^^^^^^^^^^
+LL | const fn assume(_b: bool) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0308]: intrinsic has wrong type
+  --> $DIR/safe-intrinsic-mismatch.rs:11:16
    |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+LL | const fn assume(_b: bool) {}
+   |                ^ expected unsafe fn, found normal fn
+   |
+   = note: expected signature `unsafe fn(_)`
+              found signature `fn(_)`
 
 error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `const_deallocate`
   --> $DIR/safe-intrinsic-mismatch.rs:15:1
diff --git a/tests/ui/issues/issue-106755.rs b/tests/ui/issues/issue-106755.rs
index 40cb83fcabc..689b1d885ae 100644
--- a/tests/ui/issues/issue-106755.rs
+++ b/tests/ui/issues/issue-106755.rs
@@ -15,7 +15,5 @@ impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and nega
 unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
 
 impl !Send for TestType<i32> {}
-//~^ WARNING
-//~| WARNING this will change its meaning
 
 fn main() {}
diff --git a/tests/ui/issues/issue-106755.stderr b/tests/ui/issues/issue-106755.stderr
index 6b3a8427e77..54397034062 100644
--- a/tests/ui/issues/issue-106755.stderr
+++ b/tests/ui/issues/issue-106755.stderr
@@ -16,23 +16,7 @@ LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
 LL | unsafe impl<T: 'static> Send for TestType<T> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
 
-warning: cross-crate traits with a default impl, like `Send`, should not be specialized
-  --> $DIR/issue-106755.rs:17:1
-   |
-LL | impl !Send for TestType<i32> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = warning: this will change its meaning in a future release!
-   = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
-   = note: `i32` is not a generic parameter
-note: try using the same sequence of generic parameters as the struct definition
-  --> $DIR/issue-106755.rs:9:1
-   |
-LL | struct TestType<T>(::std::marker::PhantomData<T>);
-   | ^^^^^^^^^^^^^^^^^^
-   = note: `#[warn(suspicious_auto_trait_impls)]` on by default
-
-error: aborting due to 2 previous errors; 1 warning emitted
+error: aborting due to 2 previous errors
 
 Some errors have detailed explanations: E0119, E0751.
 For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/issues/issue-17252.rs b/tests/ui/issues/issue-17252.rs
index 7141e4874c0..5941e10f8b0 100644
--- a/tests/ui/issues/issue-17252.rs
+++ b/tests/ui/issues/issue-17252.rs
@@ -4,6 +4,7 @@ fn main() {
     let _x: [u8; FOO]; // caused stack overflow prior to fix
     let _y: usize = 1 + {
         const BAR: usize = BAR;
+        //~^ ERROR: cycle
         let _z: [u8; BAR]; // caused stack overflow prior to fix
         1
     };
diff --git a/tests/ui/issues/issue-17252.stderr b/tests/ui/issues/issue-17252.stderr
index d8984860457..56bc32b19ab 100644
--- a/tests/ui/issues/issue-17252.stderr
+++ b/tests/ui/issues/issue-17252.stderr
@@ -10,13 +10,24 @@ note: ...which requires const-evaluating + checking `FOO`...
 LL | const FOO: usize = FOO;
    |                    ^^^
    = note: ...which again requires simplifying constant for the type system `FOO`, completing the cycle
-note: cycle used when const-evaluating + checking `main::{constant#0}`
-  --> $DIR/issue-17252.rs:4:18
+   = note: cycle used when running analysis passes on this crate
+   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
+
+error[E0391]: cycle detected when simplifying constant for the type system `main::BAR`
+  --> $DIR/issue-17252.rs:6:9
+   |
+LL |         const BAR: usize = BAR;
+   |         ^^^^^^^^^^^^^^^^
+   |
+note: ...which requires const-evaluating + checking `main::BAR`...
+  --> $DIR/issue-17252.rs:6:28
    |
-LL |     let _x: [u8; FOO]; // caused stack overflow prior to fix
-   |                  ^^^
+LL |         const BAR: usize = BAR;
+   |                            ^^^
+   = note: ...which again requires simplifying constant for the type system `main::BAR`, completing the cycle
+   = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/issues/issue-23302-enum-infinite-recursion/issue-23302-3.stderr b/tests/ui/issues/issue-23302-enum-infinite-recursion/issue-23302-3.stderr
index e23957c6de7..8a152f58966 100644
--- a/tests/ui/issues/issue-23302-enum-infinite-recursion/issue-23302-3.stderr
+++ b/tests/ui/issues/issue-23302-enum-infinite-recursion/issue-23302-3.stderr
@@ -20,15 +20,7 @@ note: ...which requires const-evaluating + checking `B`...
 LL | const B: i32 = A;
    |                ^
    = note: ...which again requires simplifying constant for the type system `A`, completing the cycle
-note: cycle used when linting top-level module
-  --> $DIR/issue-23302-3.rs:1:1
-   |
-LL | / const A: i32 = B;
-LL | |
-LL | | const B: i32 = A;
-LL | |
-LL | | fn main() { }
-   | |_____________^
+   = note: cycle used when running analysis passes on this crate
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/issues/issue-23611-enum-swap-in-drop.rs b/tests/ui/issues/issue-23611-enum-swap-in-drop.rs
index 980a2c01f23..1afaff0f735 100644
--- a/tests/ui/issues/issue-23611-enum-swap-in-drop.rs
+++ b/tests/ui/issues/issue-23611-enum-swap-in-drop.rs
@@ -187,7 +187,7 @@ pub mod d {
     pub fn max_width() -> u32 {
         unsafe {
             (mem::size_of_val(&trails) * 8) as u32
-            //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+            //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
         }
     }
 
diff --git a/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr b/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr
index 14a986a3332..bdf46abea8a 100644
--- a/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr
+++ b/tests/ui/issues/issue-23611-enum-swap-in-drop.stderr
@@ -1,14 +1,14 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/issue-23611-enum-swap-in-drop.rs:189:31
    |
 LL |             (mem::size_of_val(&trails) * 8) as u32
-   |                               ^^^^^^^ shared reference of mutable static
+   |                               ^^^^^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |             (mem::size_of_val(addr_of!(trails)) * 8) as u32
    |                               ~~~~~~~~~~~~~~~~
diff --git a/tests/ui/issues/issue-30123.stderr b/tests/ui/issues/issue-30123.stderr
index cf71a01b58a..c086b45ac9b 100644
--- a/tests/ui/issues/issue-30123.stderr
+++ b/tests/ui/issues/issue-30123.stderr
@@ -4,6 +4,11 @@ error[E0599]: no function or associated item named `new_undirected` found for st
 LL |     let ug = Graph::<i32, i32>::new_undirected();
    |                                 ^^^^^^^^^^^^^^ function or associated item not found in `Graph<i32, i32>`
    |
+note: if you're trying to build a new `issue_30123_aux::Graph<i32, i32>`, consider using `issue_30123_aux::Graph::<N, E>::new` which returns `issue_30123_aux::Graph<_, _>`
+  --> $DIR/auxiliary/issue-30123-aux.rs:14:5
+   |
+LL |     pub fn new() -> Self {
+   |     ^^^^^^^^^^^^^^^^^^^^
    = note: the function or associated item was found for
            - `issue_30123_aux::Graph<N, E, Undirected>`
 
diff --git a/tests/ui/issues/issue-54410.rs b/tests/ui/issues/issue-54410.rs
index 51eea3ad9ac..208be6f221c 100644
--- a/tests/ui/issues/issue-54410.rs
+++ b/tests/ui/issues/issue-54410.rs
@@ -5,5 +5,5 @@ extern "C" {
 
 fn main() {
     println!("{:p}", unsafe { &symbol });
-    //~^ WARN: shared reference of mutable static is discouraged
+    //~^ WARN creating a shared reference to mutable static is discouraged [static_mut_refs]
 }
diff --git a/tests/ui/issues/issue-54410.stderr b/tests/ui/issues/issue-54410.stderr
index 941c1be3eab..7cc67ab72c3 100644
--- a/tests/ui/issues/issue-54410.stderr
+++ b/tests/ui/issues/issue-54410.stderr
@@ -6,17 +6,17 @@ LL |     pub static mut symbol: [i8];
    |
    = help: the trait `Sized` is not implemented for `[i8]`
 
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/issue-54410.rs:7:31
    |
 LL |     println!("{:p}", unsafe { &symbol });
-   |                               ^^^^^^^ shared reference of mutable static
+   |                               ^^^^^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     println!("{:p}", unsafe { addr_of!(symbol) });
    |                               ~~~~~~~~~~~~~~~~
diff --git a/tests/ui/issues/issue-76191.rs b/tests/ui/issues/issue-76191.rs
index d9790d2b56e..277624c005a 100644
--- a/tests/ui/issues/issue-76191.rs
+++ b/tests/ui/issues/issue-76191.rs
@@ -6,6 +6,7 @@ use std::ops::RangeInclusive;
 const RANGE: RangeInclusive<i32> = 0..=255;
 
 const RANGE2: RangeInclusive<i32> = panic!();
+//~^ ERROR evaluation of constant value failed
 
 fn main() {
     let n: i32 = 1;
diff --git a/tests/ui/issues/issue-76191.stderr b/tests/ui/issues/issue-76191.stderr
index 32d9105b259..3702bfb7769 100644
--- a/tests/ui/issues/issue-76191.stderr
+++ b/tests/ui/issues/issue-76191.stderr
@@ -1,5 +1,13 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/issue-76191.rs:8:37
+   |
+LL | const RANGE2: RangeInclusive<i32> = panic!();
+   |                                     ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/issue-76191.rs:8:37
+   |
+   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
 error[E0308]: mismatched types
-  --> $DIR/issue-76191.rs:13:9
+  --> $DIR/issue-76191.rs:14:9
    |
 LL | const RANGE: RangeInclusive<i32> = 0..=255;
    | -------------------------------- constant defined here
@@ -20,7 +28,7 @@ LL |         0..=255 => {}
    |         ~~~~~~~
 
 error[E0308]: mismatched types
-  --> $DIR/issue-76191.rs:15:9
+  --> $DIR/issue-76191.rs:16:9
    |
 LL | const RANGE2: RangeInclusive<i32> = panic!();
    | --------------------------------- constant defined here
@@ -38,6 +46,7 @@ LL |         RANGE2 => {}
             found struct `RangeInclusive<i32>`
    = note: constants only support matching by type, if you meant to match against a range of values, consider using a range pattern like `min ..= max` in the match block
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0308`.
+Some errors have detailed explanations: E0080, E0308.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/lazy-type-alias/constrained-late-bound-regions.rs b/tests/ui/lazy-type-alias/constrained-late-bound-regions.rs
new file mode 100644
index 00000000000..e759e72d745
--- /dev/null
+++ b/tests/ui/lazy-type-alias/constrained-late-bound-regions.rs
@@ -0,0 +1,15 @@
+//@ check-pass
+// Weak alias types constrain late-bound regions if their normalized form constrains them.
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Ref<'a> = &'a ();
+
+type FnPtr = for<'a> fn(Ref<'a>) -> &'a (); // OK
+type DynCl = dyn for<'a> Fn(Ref<'a>) -> &'a (); // OK
+
+fn map0(_: Ref) -> Ref { &() } // OK
+fn map1(_: Ref<'_>) -> Ref<'_> { &() } // OK
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/constrained-params-in-impl.rs b/tests/ui/lazy-type-alias/constrained-params-in-impl.rs
new file mode 100644
index 00000000000..59693dd5461
--- /dev/null
+++ b/tests/ui/lazy-type-alias/constrained-params-in-impl.rs
@@ -0,0 +1,27 @@
+//@ check-pass
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Injective<T> = Local<T>;
+struct Local<T>(T);
+
+impl<T> Injective<T> {
+    fn take(_: T) {}
+}
+
+trait Trait {
+    type Out;
+    fn produce() -> Self::Out;
+}
+
+impl<T: Default> Trait for Injective<T> {
+    type Out = T;
+    fn produce() -> Self::Out { T::default() }
+}
+
+fn main() {
+    Injective::take(0);
+    let _: String = Injective::produce();
+    let _: bool = Local::produce();
+}
diff --git a/tests/ui/lazy-type-alias/inherent-impls-conflicting.rs b/tests/ui/lazy-type-alias/inherent-impls-conflicting.rs
new file mode 100644
index 00000000000..2adb04839ae
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-conflicting.rs
@@ -0,0 +1,10 @@
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Alias = Local;
+struct Local;
+
+impl Alias { fn method() {} } //~ ERROR duplicate definitions with name `method`
+impl Local { fn method() {} }
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/inherent-impls-conflicting.stderr b/tests/ui/lazy-type-alias/inherent-impls-conflicting.stderr
new file mode 100644
index 00000000000..3f8dcef857f
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-conflicting.stderr
@@ -0,0 +1,11 @@
+error[E0592]: duplicate definitions with name `method`
+  --> $DIR/inherent-impls-conflicting.rs:7:14
+   |
+LL | impl Alias { fn method() {} }
+   |              ^^^^^^^^^^^ duplicate definitions for `method`
+LL | impl Local { fn method() {} }
+   |              ----------- other definition for `method`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0592`.
diff --git a/tests/ui/lazy-type-alias/inherent-impls-not-nominal.rs b/tests/ui/lazy-type-alias/inherent-impls-not-nominal.rs
new file mode 100644
index 00000000000..0ec23bb7fb7
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-not-nominal.rs
@@ -0,0 +1,12 @@
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Alias = <() as Trait>::Out;
+
+trait Trait { type Out; }
+impl Trait for () { type Out = Local; }
+struct Local;
+
+impl Alias {} //~ ERROR no nominal type found for inherent implementation
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/inherent-impls-not-nominal.stderr b/tests/ui/lazy-type-alias/inherent-impls-not-nominal.stderr
new file mode 100644
index 00000000000..2936e70f5b4
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-not-nominal.stderr
@@ -0,0 +1,11 @@
+error[E0118]: no nominal type found for inherent implementation
+  --> $DIR/inherent-impls-not-nominal.rs:10:1
+   |
+LL | impl Alias {}
+   | ^^^^^^^^^^ impl requires a nominal type
+   |
+   = note: either implement a trait on it or create a newtype to wrap it instead
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0118`.
diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.classic.stderr b/tests/ui/lazy-type-alias/inherent-impls-overflow.classic.stderr
new file mode 100644
index 00000000000..1cace470627
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.classic.stderr
@@ -0,0 +1,43 @@
+error[E0275]: overflow evaluating the requirement `Loop`
+  --> $DIR/inherent-impls-overflow.rs:7:13
+   |
+LL | type Loop = Loop;
+   |             ^^^^
+   |
+   = note: in case this is a recursive type alias, consider using a struct, enum, or union instead
+
+error[E0275]: overflow evaluating the requirement `Loop`
+  --> $DIR/inherent-impls-overflow.rs:9:1
+   |
+LL | impl Loop {}
+   | ^^^^^^^^^^^^
+   |
+   = note: in case this is a recursive type alias, consider using a struct, enum, or union instead
+
+error[E0275]: overflow evaluating the requirement `Poly0<((((((...,),),),),),)>`
+  --> $DIR/inherent-impls-overflow.rs:11:17
+   |
+LL | type Poly0<T> = Poly1<(T,)>;
+   |                 ^^^^^^^^^^^
+   |
+   = note: in case this is a recursive type alias, consider using a struct, enum, or union instead
+
+error[E0275]: overflow evaluating the requirement `Poly1<((((((...,),),),),),)>`
+  --> $DIR/inherent-impls-overflow.rs:14:17
+   |
+LL | type Poly1<T> = Poly0<(T,)>;
+   |                 ^^^^^^^^^^^
+   |
+   = note: in case this is a recursive type alias, consider using a struct, enum, or union instead
+
+error[E0275]: overflow evaluating the requirement `Poly1<((((((...,),),),),),)>`
+  --> $DIR/inherent-impls-overflow.rs:18:1
+   |
+LL | impl Poly0<()> {}
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = note: in case this is a recursive type alias, consider using a struct, enum, or union instead
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr b/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr
new file mode 100644
index 00000000000..1a6259b5cf9
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr
@@ -0,0 +1,38 @@
+error[E0275]: overflow evaluating the requirement `Loop == _`
+  --> $DIR/inherent-impls-overflow.rs:9:6
+   |
+LL | impl Loop {}
+   |      ^^^^
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inherent_impls_overflow`)
+
+error[E0392]: type parameter `T` is never used
+  --> $DIR/inherent-impls-overflow.rs:11:12
+   |
+LL | type Poly0<T> = Poly1<(T,)>;
+   |            ^ unused type parameter
+   |
+   = help: consider removing `T` or referring to it in the body of the type alias
+   = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
+
+error[E0392]: type parameter `T` is never used
+  --> $DIR/inherent-impls-overflow.rs:14:12
+   |
+LL | type Poly1<T> = Poly0<(T,)>;
+   |            ^ unused type parameter
+   |
+   = help: consider removing `T` or referring to it in the body of the type alias
+   = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
+
+error[E0275]: overflow evaluating the requirement `Poly0<()> == _`
+  --> $DIR/inherent-impls-overflow.rs:18:6
+   |
+LL | impl Poly0<()> {}
+   |      ^^^^^^^^^
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inherent_impls_overflow`)
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0275, E0392.
+For more information about an error, try `rustc --explain E0275`.
diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.rs b/tests/ui/lazy-type-alias/inherent-impls-overflow.rs
new file mode 100644
index 00000000000..b260dedeb07
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.rs
@@ -0,0 +1,20 @@
+//@ revisions: classic next
+//@[next] compile-flags: -Znext-solver
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Loop = Loop; //[classic]~ ERROR overflow evaluating the requirement
+
+impl Loop {} //~ ERROR overflow evaluating the requirement
+
+type Poly0<T> = Poly1<(T,)>;
+//[classic]~^ ERROR overflow evaluating the requirement
+//[next]~^^ ERROR type parameter `T` is never used
+type Poly1<T> = Poly0<(T,)>;
+//[classic]~^ ERROR overflow evaluating the requirement
+//[next]~^^ ERROR type parameter `T` is never used
+
+impl Poly0<()> {} //~ ERROR overflow evaluating the requirement
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/inherent-impls.rs b/tests/ui/lazy-type-alias/inherent-impls.rs
new file mode 100644
index 00000000000..835b70bf67a
--- /dev/null
+++ b/tests/ui/lazy-type-alias/inherent-impls.rs
@@ -0,0 +1,18 @@
+//@ check-pass
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Alias = Local;
+struct Local;
+
+impl Alias {
+    fn method(self) {}
+}
+
+fn main() {
+    let _ = Local.method();
+    let _ = Local::method;
+    let _ = Alias {}.method();
+    let _ = Alias::method;
+}
diff --git a/tests/ui/lazy-type-alias/unconstrained-late-bound-regions.rs b/tests/ui/lazy-type-alias/unconstrained-late-bound-regions.rs
new file mode 100644
index 00000000000..844570e22d2
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unconstrained-late-bound-regions.rs
@@ -0,0 +1,23 @@
+// Weak alias types only constrain late-bound regions if their normalized form constrains them.
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type NotInjective<'a> = <() as Discard>::Output<'a>;
+
+type FnPtr0 = for<'a> fn(NotInjective<'a>) -> &'a ();
+//~^ ERROR references lifetime `'a`, which is not constrained by the fn input types
+type FnPtr1 = for<'a> fn(NotInjectiveEither<'a, ()>) -> NotInjectiveEither<'a, ()>;
+//~^ ERROR references lifetime `'a`, which is not constrained by the fn input types
+type DynCl = dyn for<'a> Fn(NotInjective<'a>) -> &'a ();
+//~^ ERROR references lifetime `'a`, which does not appear in the trait input types
+
+trait Discard { type Output<'a>; }
+impl Discard for () { type Output<'_a> = (); }
+
+type NotInjectiveEither<'a, Linchpin> = Linchpin
+where
+    Linchpin: Fn() -> &'a ();
+
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/unconstrained-late-bound-regions.stderr b/tests/ui/lazy-type-alias/unconstrained-late-bound-regions.stderr
new file mode 100644
index 00000000000..241c7761c60
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unconstrained-late-bound-regions.stderr
@@ -0,0 +1,22 @@
+error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types
+  --> $DIR/unconstrained-late-bound-regions.rs:8:47
+   |
+LL | type FnPtr0 = for<'a> fn(NotInjective<'a>) -> &'a ();
+   |                                               ^^^^^^
+
+error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types
+  --> $DIR/unconstrained-late-bound-regions.rs:10:57
+   |
+LL | type FnPtr1 = for<'a> fn(NotInjectiveEither<'a, ()>) -> NotInjectiveEither<'a, ()>;
+   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
+  --> $DIR/unconstrained-late-bound-regions.rs:12:50
+   |
+LL | type DynCl = dyn for<'a> Fn(NotInjective<'a>) -> &'a ();
+   |                                                  ^^^^^^
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0581, E0582.
+For more information about an error, try `rustc --explain E0581`.
diff --git a/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.rs b/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.rs
new file mode 100644
index 00000000000..eceefa719ec
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.rs
@@ -0,0 +1,8 @@
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+impl<T> Loop<T> {} //~ ERROR the type parameter `T` is not constrained
+
+type Loop<T> = Loop<T>;
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr b/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr
new file mode 100644
index 00000000000..b65c84226ce
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unconstrained-params-in-impl-due-to-overflow.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+  --> $DIR/unconstrained-params-in-impl-due-to-overflow.rs:4:6
+   |
+LL | impl<T> Loop<T> {}
+   |      ^ unconstrained type parameter
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/lazy-type-alias/unconstrained-params-in-impl.rs b/tests/ui/lazy-type-alias/unconstrained-params-in-impl.rs
new file mode 100644
index 00000000000..d58938b3070
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unconstrained-params-in-impl.rs
@@ -0,0 +1,12 @@
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+impl<T> NotInjective<T> {} //~ ERROR the type parameter `T` is not constrained
+
+type NotInjective<T: ?Sized> = Local<<T as Discard>::Out>;
+struct Local<T>(T);
+
+trait Discard { type Out; }
+impl<T: ?Sized> Discard for T { type Out = (); }
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr b/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr
new file mode 100644
index 00000000000..2419c78cba8
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unconstrained-params-in-impl.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+  --> $DIR/unconstrained-params-in-impl.rs:4:6
+   |
+LL | impl<T> NotInjective<T> {}
+   |      ^ unconstrained type parameter
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/lint/issue-117949.noopt.stderr b/tests/ui/lint/issue-117949.noopt.stderr
new file mode 100644
index 00000000000..607488e2a4a
--- /dev/null
+++ b/tests/ui/lint/issue-117949.noopt.stderr
@@ -0,0 +1,54 @@
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:16:24
+   |
+LL |     format_args!("{}", 5 * i32::MAX);
+   |                        ^^^^^^^^^^^^ attempt to compute `5_i32 * i32::MAX`, which would overflow
+   |
+   = note: `#[deny(arithmetic_overflow)]` on by default
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:15:24
+   |
+LL |     format_args!("{}", -5 - i32::MAX);
+   |                        ^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:14:24
+   |
+LL |     format_args!("{}", 1 + i32::MAX);
+   |                        ^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:13:24
+   |
+LL |     format_args!("{}", 1 >> 32);
+   |                        ^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:12:24
+   |
+LL |     format_args!("{}", 1 << 32);
+   |                        ^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:17:24
+   |
+LL |     format_args!("{}", 1 / 0);
+   |                        ^^^^^ attempt to divide `1_i32` by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:18:24
+   |
+LL |     format_args!("{}", 1 % 0);
+   |                        ^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:19:24
+   |
+LL |     format_args!("{}", [1, 2, 3][4]);
+   |                        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/lint/issue-117949.opt.stderr b/tests/ui/lint/issue-117949.opt.stderr
new file mode 100644
index 00000000000..607488e2a4a
--- /dev/null
+++ b/tests/ui/lint/issue-117949.opt.stderr
@@ -0,0 +1,54 @@
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:16:24
+   |
+LL |     format_args!("{}", 5 * i32::MAX);
+   |                        ^^^^^^^^^^^^ attempt to compute `5_i32 * i32::MAX`, which would overflow
+   |
+   = note: `#[deny(arithmetic_overflow)]` on by default
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:15:24
+   |
+LL |     format_args!("{}", -5 - i32::MAX);
+   |                        ^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:14:24
+   |
+LL |     format_args!("{}", 1 + i32::MAX);
+   |                        ^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:13:24
+   |
+LL |     format_args!("{}", 1 >> 32);
+   |                        ^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:12:24
+   |
+LL |     format_args!("{}", 1 << 32);
+   |                        ^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:17:24
+   |
+LL |     format_args!("{}", 1 / 0);
+   |                        ^^^^^ attempt to divide `1_i32` by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:18:24
+   |
+LL |     format_args!("{}", 1 % 0);
+   |                        ^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:19:24
+   |
+LL |     format_args!("{}", [1, 2, 3][4]);
+   |                        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/lint/issue-117949.opt_with_overflow_checks.stderr b/tests/ui/lint/issue-117949.opt_with_overflow_checks.stderr
new file mode 100644
index 00000000000..607488e2a4a
--- /dev/null
+++ b/tests/ui/lint/issue-117949.opt_with_overflow_checks.stderr
@@ -0,0 +1,54 @@
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:16:24
+   |
+LL |     format_args!("{}", 5 * i32::MAX);
+   |                        ^^^^^^^^^^^^ attempt to compute `5_i32 * i32::MAX`, which would overflow
+   |
+   = note: `#[deny(arithmetic_overflow)]` on by default
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:15:24
+   |
+LL |     format_args!("{}", -5 - i32::MAX);
+   |                        ^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:14:24
+   |
+LL |     format_args!("{}", 1 + i32::MAX);
+   |                        ^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:13:24
+   |
+LL |     format_args!("{}", 1 >> 32);
+   |                        ^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/issue-117949.rs:12:24
+   |
+LL |     format_args!("{}", 1 << 32);
+   |                        ^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:17:24
+   |
+LL |     format_args!("{}", 1 / 0);
+   |                        ^^^^^ attempt to divide `1_i32` by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:18:24
+   |
+LL |     format_args!("{}", 1 % 0);
+   |                        ^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/issue-117949.rs:19:24
+   |
+LL |     format_args!("{}", [1, 2, 3][4]);
+   |                        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/lint/issue-117949.rs b/tests/ui/lint/issue-117949.rs
new file mode 100644
index 00000000000..5673227f35d
--- /dev/null
+++ b/tests/ui/lint/issue-117949.rs
@@ -0,0 +1,20 @@
+// Regression test for issue #117949
+
+//@ revisions: noopt opt opt_with_overflow_checks
+//@ [noopt]compile-flags: -C opt-level=0 -Z deduplicate-diagnostics=yes
+//@ [opt]compile-flags: -O
+//@ [opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O -Z deduplicate-diagnostics=yes
+//@ build-fail
+//@ ignore-pass (test tests codegen-time behaviour)
+
+
+fn main() {
+    format_args!("{}", 1 << 32); //~ ERROR: arithmetic operation will overflow
+    format_args!("{}", 1 >> 32); //~ ERROR: arithmetic operation will overflow
+    format_args!("{}", 1 + i32::MAX); //~ ERROR: arithmetic operation will overflow
+    format_args!("{}", -5 - i32::MAX); //~ ERROR: arithmetic operation will overflow
+    format_args!("{}", 5 * i32::MAX); //~ ERROR: arithmetic operation will overflow
+    format_args!("{}", 1 / 0); //~ ERROR: this operation will panic at runtime
+    format_args!("{}", 1 % 0); //~ ERROR: this operation will panic at runtime
+    format_args!("{}", [1, 2, 3][4]); //~ ERROR: this operation will panic at runtime
+}
diff --git a/tests/ui/lint/lint-exceeding-bitshifts.noopt.stderr b/tests/ui/lint/lint-exceeding-bitshifts.noopt.stderr
deleted file mode 100644
index 3a84c6c1fb1..00000000000
--- a/tests/ui/lint/lint-exceeding-bitshifts.noopt.stderr
+++ /dev/null
@@ -1,152 +0,0 @@
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:18:20
-   |
-LL |     const N: i32 = T::N << 42;
-   |                    ^^^^^^^^^^ attempt to shift left by `42_i32`, which would overflow
-   |
-note: the lint level is defined here
-  --> $DIR/lint-exceeding-bitshifts.rs:10:9
-   |
-LL | #![warn(arithmetic_overflow)]
-   |         ^^^^^^^^^^^^^^^^^^^
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:22:13
-   |
-LL |     let _ = x << 42;
-   |             ^^^^^^^ attempt to shift left by `42_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:27:15
-   |
-LL |       let n = 1u8 << 8;
-   |               ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:29:15
-   |
-LL |       let n = 1u16 << 16;
-   |               ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:31:15
-   |
-LL |       let n = 1u32 << 32;
-   |               ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:33:15
-   |
-LL |       let n = 1u64 << 64;
-   |               ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:35:15
-   |
-LL |       let n = 1i8 << 8;
-   |               ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:37:15
-   |
-LL |       let n = 1i16 << 16;
-   |               ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:39:15
-   |
-LL |       let n = 1i32 << 32;
-   |               ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:41:15
-   |
-LL |       let n = 1i64 << 64;
-   |               ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:44:15
-   |
-LL |       let n = 1u8 >> 8;
-   |               ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:46:15
-   |
-LL |       let n = 1u16 >> 16;
-   |               ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:48:15
-   |
-LL |       let n = 1u32 >> 32;
-   |               ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:50:15
-   |
-LL |       let n = 1u64 >> 64;
-   |               ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:52:15
-   |
-LL |       let n = 1i8 >> 8;
-   |               ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:54:15
-   |
-LL |       let n = 1i16 >> 16;
-   |               ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:56:15
-   |
-LL |       let n = 1i32 >> 32;
-   |               ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:58:15
-   |
-LL |       let n = 1i64 >> 64;
-   |               ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:62:15
-   |
-LL |       let n = n << 8;
-   |               ^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:64:15
-   |
-LL |       let n = 1u8 << -8;
-   |               ^^^^^^^^^ attempt to shift left by `-8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:69:15
-   |
-LL |       let n = 1u8 << (4+4);
-   |               ^^^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:71:15
-   |
-LL |       let n = 1i64 >> [64][0];
-   |               ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:77:15
-   |
-LL |       let n = 1_isize << BITS;
-   |               ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:78:15
-   |
-LL |       let n = 1_usize << BITS;
-   |               ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
-
-warning: 24 warnings emitted
-
diff --git a/tests/ui/lint/lint-exceeding-bitshifts.opt.stderr b/tests/ui/lint/lint-exceeding-bitshifts.opt.stderr
deleted file mode 100644
index 3a84c6c1fb1..00000000000
--- a/tests/ui/lint/lint-exceeding-bitshifts.opt.stderr
+++ /dev/null
@@ -1,152 +0,0 @@
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:18:20
-   |
-LL |     const N: i32 = T::N << 42;
-   |                    ^^^^^^^^^^ attempt to shift left by `42_i32`, which would overflow
-   |
-note: the lint level is defined here
-  --> $DIR/lint-exceeding-bitshifts.rs:10:9
-   |
-LL | #![warn(arithmetic_overflow)]
-   |         ^^^^^^^^^^^^^^^^^^^
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:22:13
-   |
-LL |     let _ = x << 42;
-   |             ^^^^^^^ attempt to shift left by `42_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:27:15
-   |
-LL |       let n = 1u8 << 8;
-   |               ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:29:15
-   |
-LL |       let n = 1u16 << 16;
-   |               ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:31:15
-   |
-LL |       let n = 1u32 << 32;
-   |               ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:33:15
-   |
-LL |       let n = 1u64 << 64;
-   |               ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:35:15
-   |
-LL |       let n = 1i8 << 8;
-   |               ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:37:15
-   |
-LL |       let n = 1i16 << 16;
-   |               ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:39:15
-   |
-LL |       let n = 1i32 << 32;
-   |               ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:41:15
-   |
-LL |       let n = 1i64 << 64;
-   |               ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:44:15
-   |
-LL |       let n = 1u8 >> 8;
-   |               ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:46:15
-   |
-LL |       let n = 1u16 >> 16;
-   |               ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:48:15
-   |
-LL |       let n = 1u32 >> 32;
-   |               ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:50:15
-   |
-LL |       let n = 1u64 >> 64;
-   |               ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:52:15
-   |
-LL |       let n = 1i8 >> 8;
-   |               ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:54:15
-   |
-LL |       let n = 1i16 >> 16;
-   |               ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:56:15
-   |
-LL |       let n = 1i32 >> 32;
-   |               ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:58:15
-   |
-LL |       let n = 1i64 >> 64;
-   |               ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:62:15
-   |
-LL |       let n = n << 8;
-   |               ^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:64:15
-   |
-LL |       let n = 1u8 << -8;
-   |               ^^^^^^^^^ attempt to shift left by `-8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:69:15
-   |
-LL |       let n = 1u8 << (4+4);
-   |               ^^^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:71:15
-   |
-LL |       let n = 1i64 >> [64][0];
-   |               ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:77:15
-   |
-LL |       let n = 1_isize << BITS;
-   |               ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:78:15
-   |
-LL |       let n = 1_usize << BITS;
-   |               ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
-
-warning: 24 warnings emitted
-
diff --git a/tests/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr b/tests/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr
deleted file mode 100644
index 3a84c6c1fb1..00000000000
--- a/tests/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr
+++ /dev/null
@@ -1,152 +0,0 @@
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:18:20
-   |
-LL |     const N: i32 = T::N << 42;
-   |                    ^^^^^^^^^^ attempt to shift left by `42_i32`, which would overflow
-   |
-note: the lint level is defined here
-  --> $DIR/lint-exceeding-bitshifts.rs:10:9
-   |
-LL | #![warn(arithmetic_overflow)]
-   |         ^^^^^^^^^^^^^^^^^^^
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:22:13
-   |
-LL |     let _ = x << 42;
-   |             ^^^^^^^ attempt to shift left by `42_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:27:15
-   |
-LL |       let n = 1u8 << 8;
-   |               ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:29:15
-   |
-LL |       let n = 1u16 << 16;
-   |               ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:31:15
-   |
-LL |       let n = 1u32 << 32;
-   |               ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:33:15
-   |
-LL |       let n = 1u64 << 64;
-   |               ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:35:15
-   |
-LL |       let n = 1i8 << 8;
-   |               ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:37:15
-   |
-LL |       let n = 1i16 << 16;
-   |               ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:39:15
-   |
-LL |       let n = 1i32 << 32;
-   |               ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:41:15
-   |
-LL |       let n = 1i64 << 64;
-   |               ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:44:15
-   |
-LL |       let n = 1u8 >> 8;
-   |               ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:46:15
-   |
-LL |       let n = 1u16 >> 16;
-   |               ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:48:15
-   |
-LL |       let n = 1u32 >> 32;
-   |               ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:50:15
-   |
-LL |       let n = 1u64 >> 64;
-   |               ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:52:15
-   |
-LL |       let n = 1i8 >> 8;
-   |               ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:54:15
-   |
-LL |       let n = 1i16 >> 16;
-   |               ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:56:15
-   |
-LL |       let n = 1i32 >> 32;
-   |               ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:58:15
-   |
-LL |       let n = 1i64 >> 64;
-   |               ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:62:15
-   |
-LL |       let n = n << 8;
-   |               ^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:64:15
-   |
-LL |       let n = 1u8 << -8;
-   |               ^^^^^^^^^ attempt to shift left by `-8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:69:15
-   |
-LL |       let n = 1u8 << (4+4);
-   |               ^^^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:71:15
-   |
-LL |       let n = 1i64 >> [64][0];
-   |               ^^^^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:77:15
-   |
-LL |       let n = 1_isize << BITS;
-   |               ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
-
-warning: this arithmetic operation will overflow
-  --> $DIR/lint-exceeding-bitshifts.rs:78:15
-   |
-LL |       let n = 1_usize << BITS;
-   |               ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
-
-warning: 24 warnings emitted
-
diff --git a/tests/ui/lint/lint-exceeding-bitshifts.rs b/tests/ui/lint/lint-exceeding-bitshifts.rs
deleted file mode 100644
index ea9d5ce6781..00000000000
--- a/tests/ui/lint/lint-exceeding-bitshifts.rs
+++ /dev/null
@@ -1,79 +0,0 @@
-//@ revisions: noopt opt opt_with_overflow_checks
-//@[noopt]compile-flags: -C opt-level=0
-//@[opt]compile-flags: -O
-//@[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
-//@ build-pass
-//@ ignore-pass (test emits codegen-time warnings and verifies that they are not errors)
-//@ normalize-stderr-test "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
-
-#![crate_type="lib"]
-#![warn(arithmetic_overflow)]
-
-
-pub trait Foo {
-    const N: i32;
-}
-
-impl<T: Foo> Foo for Vec<T> {
-    const N: i32 = T::N << 42; //~ WARN: arithmetic operation will overflow
-}
-
-pub fn foo(x: i32) {
-    let _ = x << 42; //~ WARN: arithmetic operation will overflow
-}
-
-pub fn main() {
-      let n = 1u8 << 7;
-      let n = 1u8 << 8;   //~ WARN: arithmetic operation will overflow
-      let n = 1u16 << 15;
-      let n = 1u16 << 16; //~ WARN: arithmetic operation will overflow
-      let n = 1u32 << 31;
-      let n = 1u32 << 32; //~ WARN: arithmetic operation will overflow
-      let n = 1u64 << 63;
-      let n = 1u64 << 64; //~ WARN: arithmetic operation will overflow
-      let n = 1i8 << 7;
-      let n = 1i8 << 8;   //~ WARN: arithmetic operation will overflow
-      let n = 1i16 << 15;
-      let n = 1i16 << 16; //~ WARN: arithmetic operation will overflow
-      let n = 1i32 << 31;
-      let n = 1i32 << 32; //~ WARN: arithmetic operation will overflow
-      let n = 1i64 << 63;
-      let n = 1i64 << 64; //~ WARN: arithmetic operation will overflow
-
-      let n = 1u8 >> 7;
-      let n = 1u8 >> 8;   //~ WARN: arithmetic operation will overflow
-      let n = 1u16 >> 15;
-      let n = 1u16 >> 16; //~ WARN: arithmetic operation will overflow
-      let n = 1u32 >> 31;
-      let n = 1u32 >> 32; //~ WARN: arithmetic operation will overflow
-      let n = 1u64 >> 63;
-      let n = 1u64 >> 64; //~ WARN: arithmetic operation will overflow
-      let n = 1i8 >> 7;
-      let n = 1i8 >> 8;   //~ WARN: arithmetic operation will overflow
-      let n = 1i16 >> 15;
-      let n = 1i16 >> 16; //~ WARN: arithmetic operation will overflow
-      let n = 1i32 >> 31;
-      let n = 1i32 >> 32; //~ WARN: arithmetic operation will overflow
-      let n = 1i64 >> 63;
-      let n = 1i64 >> 64; //~ WARN: arithmetic operation will overflow
-
-      let n = 1u8;
-      let n = n << 7;
-      let n = n << 8; //~ WARN: arithmetic operation will overflow
-
-      let n = 1u8 << -8; //~ WARN: arithmetic operation will overflow
-
-      let n = 1i8<<(1isize+-1);
-
-      let n = 1u8 << (4+3);
-      let n = 1u8 << (4+4); //~ WARN: arithmetic operation will overflow
-      let n = 1i64 >> [63][0];
-      let n = 1i64 >> [64][0]; //~ WARN: arithmetic operation will overflow
-
-      #[cfg(target_pointer_width = "32")]
-      const BITS: usize = 32;
-      #[cfg(target_pointer_width = "64")]
-      const BITS: usize = 64;
-      let n = 1_isize << BITS; //~ WARN: arithmetic operation will overflow
-      let n = 1_usize << BITS; //~ WARN: arithmetic operation will overflow
-}
diff --git a/tests/ui/lint/lint-overflowing-ops.noopt.stderr b/tests/ui/lint/lint-overflowing-ops.noopt.stderr
new file mode 100644
index 00000000000..93fc19ce79e
--- /dev/null
+++ b/tests/ui/lint/lint-overflowing-ops.noopt.stderr
@@ -0,0 +1,1030 @@
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:26:14
+   |
+LL |     let _n = 1u8 << 8;
+   |              ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+   |
+note: the lint level is defined here
+  --> $DIR/lint-overflowing-ops.rs:17:9
+   |
+LL | #![deny(arithmetic_overflow)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:212:15
+   |
+LL |     let _n = &(usize::MAX * 5);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:209:15
+   |
+LL |     let _n = &(isize::MAX * 5);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:206:15
+   |
+LL |     let _n = &(i128::MAX * 5);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:203:15
+   |
+LL |     let _n = &(i64::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:200:15
+   |
+LL |     let _n = &(i32::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:197:15
+   |
+LL |     let _n = &(i16::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:194:15
+   |
+LL |     let _n = &(i8::MAX * i8::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:191:15
+   |
+LL |     let _n = &(u128::MAX * 5);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:188:15
+   |
+LL |     let _n = &(u64::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:185:15
+   |
+LL |     let _n = &(u32::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:182:15
+   |
+LL |     let _n = &(u16::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:179:15
+   |
+LL |     let _n = &(u8::MAX * 5);
+   |               ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:174:15
+   |
+LL |     let _n = &(1usize - 5);
+   |               ^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:171:15
+   |
+LL |     let _n = &(-5isize - isize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:168:15
+   |
+LL |     let _n = &(-5i128 - i128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:165:15
+   |
+LL |     let _n = &(-5i64 - i64::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:162:15
+   |
+LL |     let _n = &(-5i32 - i32::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:159:15
+   |
+LL |     let _n = &(-5i16 - i16::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:156:15
+   |
+LL |     let _n = &(-5i8 - i8::MAX);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:153:15
+   |
+LL |     let _n = &(1u128 - 5);
+   |               ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:150:15
+   |
+LL |     let _n = &(1u64 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:147:15
+   |
+LL |     let _n = &(1u32 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:144:15
+   |
+LL |     let _n = &(1u16 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:141:15
+   |
+LL |     let _n = &(1u8 - 5);
+   |               ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:136:15
+   |
+LL |     let _n = &(1usize + usize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:133:15
+   |
+LL |     let _n = &(1isize + isize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:130:15
+   |
+LL |     let _n = &(1i128 + i128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:127:15
+   |
+LL |     let _n = &(1i64 + i64::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:124:15
+   |
+LL |     let _n = &(1i32 + i32::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:121:15
+   |
+LL |     let _n = &(1i16 + i16::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:118:15
+   |
+LL |     let _n = &(1i8 + i8::MAX);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:115:15
+   |
+LL |     let _n = &(1u128 + u128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:112:15
+   |
+LL |     let _n = &(1u64 + u64::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:109:15
+   |
+LL |     let _n = &(1u32 + u32::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:106:15
+   |
+LL |     let _n = &(1u16 + u16::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:103:15
+   |
+LL |     let _n = &(1u8 + u8::MAX);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:98:15
+   |
+LL |     let _n = &(1_usize >> BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:95:15
+   |
+LL |     let _n = &(1_isize >> BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:92:15
+   |
+LL |     let _n = &(1i128 >> 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:89:15
+   |
+LL |     let _n = &(1i64 >> 64);
+   |               ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:86:15
+   |
+LL |     let _n = &(1i32 >> 32);
+   |               ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:83:15
+   |
+LL |     let _n = &(1i16 >> 16);
+   |               ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:80:15
+   |
+LL |     let _n = &(1i8 >> 8);
+   |               ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:77:15
+   |
+LL |     let _n = &(1u128 >> 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:74:15
+   |
+LL |     let _n = &(1u64 >> 64);
+   |               ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:71:15
+   |
+LL |     let _n = &(1u32 >> 32);
+   |               ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:68:15
+   |
+LL |     let _n = &(1u16 >> 16);
+   |               ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:65:15
+   |
+LL |     let _n = &(1u8 >> 8);
+   |               ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:60:15
+   |
+LL |     let _n = &(1_usize << BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:57:15
+   |
+LL |     let _n = &(1_isize << BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:54:15
+   |
+LL |     let _n = &(1i128 << 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:51:15
+   |
+LL |     let _n = &(1i64 << 64);
+   |               ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:48:15
+   |
+LL |     let _n = &(1i32 << 32);
+   |               ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:45:15
+   |
+LL |     let _n = &(1i16 << 16);
+   |               ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:42:15
+   |
+LL |     let _n = &(1i8 << 8);
+   |               ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:39:15
+   |
+LL |     let _n = &(1u128 << 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:36:15
+   |
+LL |     let _n = &(1u64 << 64);
+   |               ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:33:15
+   |
+LL |     let _n = &(1u32 << 32);
+   |               ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:30:15
+   |
+LL |     let _n = &(1u16 << 16);
+   |               ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:27:15
+   |
+LL |     let _n = &(1u8 << 8);
+   |               ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:29:14
+   |
+LL |     let _n = 1u16 << 16;
+   |              ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:32:14
+   |
+LL |     let _n = 1u32 << 32;
+   |              ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:35:14
+   |
+LL |     let _n = 1u64 << 64;
+   |              ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:38:14
+   |
+LL |     let _n = 1u128 << 128;
+   |              ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:41:14
+   |
+LL |     let _n = 1i8 << 8;
+   |              ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:44:14
+   |
+LL |     let _n = 1i16 << 16;
+   |              ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:47:14
+   |
+LL |     let _n = 1i32 << 32;
+   |              ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:50:14
+   |
+LL |     let _n = 1i64 << 64;
+   |              ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:53:14
+   |
+LL |     let _n = 1i128 << 128;
+   |              ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:56:14
+   |
+LL |     let _n = 1_isize << BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:59:14
+   |
+LL |     let _n = 1_usize << BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:64:14
+   |
+LL |     let _n = 1u8 >> 8;
+   |              ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:67:14
+   |
+LL |     let _n = 1u16 >> 16;
+   |              ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:70:14
+   |
+LL |     let _n = 1u32 >> 32;
+   |              ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:73:14
+   |
+LL |     let _n = 1u64 >> 64;
+   |              ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:76:14
+   |
+LL |     let _n = 1u128 >> 128;
+   |              ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:79:14
+   |
+LL |     let _n = 1i8 >> 8;
+   |              ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:82:14
+   |
+LL |     let _n = 1i16 >> 16;
+   |              ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:85:14
+   |
+LL |     let _n = 1i32 >> 32;
+   |              ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:88:14
+   |
+LL |     let _n = 1i64 >> 64;
+   |              ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:91:14
+   |
+LL |     let _n = 1i128 >> 128;
+   |              ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:94:14
+   |
+LL |     let _n = 1_isize >> BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:97:14
+   |
+LL |     let _n = 1_usize >> BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:102:14
+   |
+LL |     let _n = 1u8 + u8::MAX;
+   |              ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:105:14
+   |
+LL |     let _n = 1u16 + u16::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:108:14
+   |
+LL |     let _n = 1u32 + u32::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:111:14
+   |
+LL |     let _n = 1u64 + u64::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:114:14
+   |
+LL |     let _n = 1u128 + u128::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:117:14
+   |
+LL |     let _n = 1i8 + i8::MAX;
+   |              ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:120:14
+   |
+LL |     let _n = 1i16 + i16::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:123:14
+   |
+LL |     let _n = 1i32 + i32::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:126:14
+   |
+LL |     let _n = 1i64 + i64::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:129:14
+   |
+LL |     let _n = 1i128 + i128::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:132:14
+   |
+LL |     let _n = 1isize + isize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:135:14
+   |
+LL |     let _n = 1usize + usize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:140:14
+   |
+LL |     let _n = 1u8 - 5;
+   |              ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:143:14
+   |
+LL |     let _n = 1u16 - 5;
+   |              ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:146:14
+   |
+LL |     let _n = 1u32 - 5;
+   |              ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:149:14
+   |
+LL |     let _n = 1u64 - 5 ;
+   |              ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:152:14
+   |
+LL |     let _n = 1u128 - 5 ;
+   |              ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:155:14
+   |
+LL |     let _n = -5i8 - i8::MAX;
+   |              ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:158:14
+   |
+LL |     let _n = -5i16 - i16::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:161:14
+   |
+LL |     let _n = -5i32 - i32::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:164:14
+   |
+LL |     let _n = -5i64 - i64::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:167:14
+   |
+LL |     let _n = -5i128 - i128::MAX;
+   |              ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:170:14
+   |
+LL |     let _n = -5isize - isize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:173:14
+   |
+LL |     let _n = 1usize - 5;
+   |              ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:178:14
+   |
+LL |     let _n = u8::MAX * 5;
+   |              ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:181:14
+   |
+LL |     let _n = u16::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:184:14
+   |
+LL |     let _n = u32::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:187:14
+   |
+LL |     let _n = u64::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:190:14
+   |
+LL |     let _n = u128::MAX * 5;
+   |              ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:193:14
+   |
+LL |     let _n = i8::MAX * i8::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:196:14
+   |
+LL |     let _n = i16::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:199:14
+   |
+LL |     let _n = i32::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:202:14
+   |
+LL |     let _n = i64::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:205:14
+   |
+LL |     let _n = i128::MAX * 5;
+   |              ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:208:14
+   |
+LL |     let _n = isize::MAX * 5;
+   |              ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:211:14
+   |
+LL |     let _n = usize::MAX * 5;
+   |              ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:216:14
+   |
+LL |     let _n = 1u8 / 0;
+   |              ^^^^^^^ attempt to divide `1_u8` by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:217:15
+   |
+LL |     let _n = &(1u8 / 0);
+   |               ^^^^^^^^^ attempt to divide `1_u8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:219:14
+   |
+LL |     let _n = 1u16 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:220:15
+   |
+LL |     let _n = &(1u16 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:222:14
+   |
+LL |     let _n = 1u32 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:223:15
+   |
+LL |     let _n = &(1u32 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:225:14
+   |
+LL |     let _n = 1u64 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:226:15
+   |
+LL |     let _n = &(1u64 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:228:14
+   |
+LL |     let _n = 1u128 / 0;
+   |              ^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:229:15
+   |
+LL |     let _n = &(1u128 / 0);
+   |               ^^^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:231:14
+   |
+LL |     let _n = 1i8 / 0;
+   |              ^^^^^^^ attempt to divide `1_i8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:232:15
+   |
+LL |     let _n = &(1i8 / 0);
+   |               ^^^^^^^^^ attempt to divide `1_i8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:234:14
+   |
+LL |     let _n = 1i16 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:235:15
+   |
+LL |     let _n = &(1i16 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:237:14
+   |
+LL |     let _n = 1i32 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:238:15
+   |
+LL |     let _n = &(1i32 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:240:14
+   |
+LL |     let _n = 1i64 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:241:15
+   |
+LL |     let _n = &(1i64 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:243:14
+   |
+LL |     let _n = 1i128 / 0;
+   |              ^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:244:15
+   |
+LL |     let _n = &(1i128 / 0);
+   |               ^^^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:246:14
+   |
+LL |     let _n = 1isize / 0;
+   |              ^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:247:15
+   |
+LL |     let _n = &(1isize / 0);
+   |               ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:249:14
+   |
+LL |     let _n = 1usize / 0;
+   |              ^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:250:15
+   |
+LL |     let _n = &(1usize / 0);
+   |               ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:254:14
+   |
+LL |     let _n = 1u8 % 0;
+   |              ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:255:15
+   |
+LL |     let _n = &(1u8 % 0);
+   |               ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:257:14
+   |
+LL |     let _n = 1u16 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:258:15
+   |
+LL |     let _n = &(1u16 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:260:14
+   |
+LL |     let _n = 1u32 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:261:15
+   |
+LL |     let _n = &(1u32 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:263:14
+   |
+LL |     let _n = 1u64 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:264:15
+   |
+LL |     let _n = &(1u64 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:266:14
+   |
+LL |     let _n = 1u128 % 0;
+   |              ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:267:15
+   |
+LL |     let _n = &(1u128 % 0);
+   |               ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:269:14
+   |
+LL |     let _n = 1i8 % 0;
+   |              ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:270:15
+   |
+LL |     let _n = &(1i8 % 0);
+   |               ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:272:14
+   |
+LL |     let _n = 1i16 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:273:15
+   |
+LL |     let _n = &(1i16 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:275:14
+   |
+LL |     let _n = 1i32 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:276:15
+   |
+LL |     let _n = &(1i32 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:278:14
+   |
+LL |     let _n = 1i64 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:279:15
+   |
+LL |     let _n = &(1i64 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:281:14
+   |
+LL |     let _n = 1i128 % 0;
+   |              ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:282:15
+   |
+LL |     let _n = &(1i128 % 0);
+   |               ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:284:14
+   |
+LL |     let _n = 1isize % 0;
+   |              ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:285:15
+   |
+LL |     let _n = &(1isize % 0);
+   |               ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:287:14
+   |
+LL |     let _n = 1usize % 0;
+   |              ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:288:15
+   |
+LL |     let _n = &(1usize % 0);
+   |               ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:292:14
+   |
+LL |     let _n = [1, 2, 3][4];
+   |              ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:293:15
+   |
+LL |     let _n = &([1, 2, 3][4]);
+   |               ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 170 previous errors
+
diff --git a/tests/ui/lint/lint-overflowing-ops.opt.stderr b/tests/ui/lint/lint-overflowing-ops.opt.stderr
new file mode 100644
index 00000000000..93fc19ce79e
--- /dev/null
+++ b/tests/ui/lint/lint-overflowing-ops.opt.stderr
@@ -0,0 +1,1030 @@
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:26:14
+   |
+LL |     let _n = 1u8 << 8;
+   |              ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+   |
+note: the lint level is defined here
+  --> $DIR/lint-overflowing-ops.rs:17:9
+   |
+LL | #![deny(arithmetic_overflow)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:212:15
+   |
+LL |     let _n = &(usize::MAX * 5);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:209:15
+   |
+LL |     let _n = &(isize::MAX * 5);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:206:15
+   |
+LL |     let _n = &(i128::MAX * 5);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:203:15
+   |
+LL |     let _n = &(i64::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:200:15
+   |
+LL |     let _n = &(i32::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:197:15
+   |
+LL |     let _n = &(i16::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:194:15
+   |
+LL |     let _n = &(i8::MAX * i8::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:191:15
+   |
+LL |     let _n = &(u128::MAX * 5);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:188:15
+   |
+LL |     let _n = &(u64::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:185:15
+   |
+LL |     let _n = &(u32::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:182:15
+   |
+LL |     let _n = &(u16::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:179:15
+   |
+LL |     let _n = &(u8::MAX * 5);
+   |               ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:174:15
+   |
+LL |     let _n = &(1usize - 5);
+   |               ^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:171:15
+   |
+LL |     let _n = &(-5isize - isize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:168:15
+   |
+LL |     let _n = &(-5i128 - i128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:165:15
+   |
+LL |     let _n = &(-5i64 - i64::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:162:15
+   |
+LL |     let _n = &(-5i32 - i32::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:159:15
+   |
+LL |     let _n = &(-5i16 - i16::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:156:15
+   |
+LL |     let _n = &(-5i8 - i8::MAX);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:153:15
+   |
+LL |     let _n = &(1u128 - 5);
+   |               ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:150:15
+   |
+LL |     let _n = &(1u64 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:147:15
+   |
+LL |     let _n = &(1u32 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:144:15
+   |
+LL |     let _n = &(1u16 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:141:15
+   |
+LL |     let _n = &(1u8 - 5);
+   |               ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:136:15
+   |
+LL |     let _n = &(1usize + usize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:133:15
+   |
+LL |     let _n = &(1isize + isize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:130:15
+   |
+LL |     let _n = &(1i128 + i128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:127:15
+   |
+LL |     let _n = &(1i64 + i64::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:124:15
+   |
+LL |     let _n = &(1i32 + i32::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:121:15
+   |
+LL |     let _n = &(1i16 + i16::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:118:15
+   |
+LL |     let _n = &(1i8 + i8::MAX);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:115:15
+   |
+LL |     let _n = &(1u128 + u128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:112:15
+   |
+LL |     let _n = &(1u64 + u64::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:109:15
+   |
+LL |     let _n = &(1u32 + u32::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:106:15
+   |
+LL |     let _n = &(1u16 + u16::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:103:15
+   |
+LL |     let _n = &(1u8 + u8::MAX);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:98:15
+   |
+LL |     let _n = &(1_usize >> BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:95:15
+   |
+LL |     let _n = &(1_isize >> BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:92:15
+   |
+LL |     let _n = &(1i128 >> 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:89:15
+   |
+LL |     let _n = &(1i64 >> 64);
+   |               ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:86:15
+   |
+LL |     let _n = &(1i32 >> 32);
+   |               ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:83:15
+   |
+LL |     let _n = &(1i16 >> 16);
+   |               ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:80:15
+   |
+LL |     let _n = &(1i8 >> 8);
+   |               ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:77:15
+   |
+LL |     let _n = &(1u128 >> 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:74:15
+   |
+LL |     let _n = &(1u64 >> 64);
+   |               ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:71:15
+   |
+LL |     let _n = &(1u32 >> 32);
+   |               ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:68:15
+   |
+LL |     let _n = &(1u16 >> 16);
+   |               ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:65:15
+   |
+LL |     let _n = &(1u8 >> 8);
+   |               ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:60:15
+   |
+LL |     let _n = &(1_usize << BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:57:15
+   |
+LL |     let _n = &(1_isize << BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:54:15
+   |
+LL |     let _n = &(1i128 << 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:51:15
+   |
+LL |     let _n = &(1i64 << 64);
+   |               ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:48:15
+   |
+LL |     let _n = &(1i32 << 32);
+   |               ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:45:15
+   |
+LL |     let _n = &(1i16 << 16);
+   |               ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:42:15
+   |
+LL |     let _n = &(1i8 << 8);
+   |               ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:39:15
+   |
+LL |     let _n = &(1u128 << 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:36:15
+   |
+LL |     let _n = &(1u64 << 64);
+   |               ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:33:15
+   |
+LL |     let _n = &(1u32 << 32);
+   |               ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:30:15
+   |
+LL |     let _n = &(1u16 << 16);
+   |               ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:27:15
+   |
+LL |     let _n = &(1u8 << 8);
+   |               ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:29:14
+   |
+LL |     let _n = 1u16 << 16;
+   |              ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:32:14
+   |
+LL |     let _n = 1u32 << 32;
+   |              ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:35:14
+   |
+LL |     let _n = 1u64 << 64;
+   |              ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:38:14
+   |
+LL |     let _n = 1u128 << 128;
+   |              ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:41:14
+   |
+LL |     let _n = 1i8 << 8;
+   |              ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:44:14
+   |
+LL |     let _n = 1i16 << 16;
+   |              ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:47:14
+   |
+LL |     let _n = 1i32 << 32;
+   |              ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:50:14
+   |
+LL |     let _n = 1i64 << 64;
+   |              ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:53:14
+   |
+LL |     let _n = 1i128 << 128;
+   |              ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:56:14
+   |
+LL |     let _n = 1_isize << BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:59:14
+   |
+LL |     let _n = 1_usize << BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:64:14
+   |
+LL |     let _n = 1u8 >> 8;
+   |              ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:67:14
+   |
+LL |     let _n = 1u16 >> 16;
+   |              ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:70:14
+   |
+LL |     let _n = 1u32 >> 32;
+   |              ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:73:14
+   |
+LL |     let _n = 1u64 >> 64;
+   |              ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:76:14
+   |
+LL |     let _n = 1u128 >> 128;
+   |              ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:79:14
+   |
+LL |     let _n = 1i8 >> 8;
+   |              ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:82:14
+   |
+LL |     let _n = 1i16 >> 16;
+   |              ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:85:14
+   |
+LL |     let _n = 1i32 >> 32;
+   |              ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:88:14
+   |
+LL |     let _n = 1i64 >> 64;
+   |              ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:91:14
+   |
+LL |     let _n = 1i128 >> 128;
+   |              ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:94:14
+   |
+LL |     let _n = 1_isize >> BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:97:14
+   |
+LL |     let _n = 1_usize >> BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:102:14
+   |
+LL |     let _n = 1u8 + u8::MAX;
+   |              ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:105:14
+   |
+LL |     let _n = 1u16 + u16::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:108:14
+   |
+LL |     let _n = 1u32 + u32::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:111:14
+   |
+LL |     let _n = 1u64 + u64::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:114:14
+   |
+LL |     let _n = 1u128 + u128::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:117:14
+   |
+LL |     let _n = 1i8 + i8::MAX;
+   |              ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:120:14
+   |
+LL |     let _n = 1i16 + i16::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:123:14
+   |
+LL |     let _n = 1i32 + i32::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:126:14
+   |
+LL |     let _n = 1i64 + i64::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:129:14
+   |
+LL |     let _n = 1i128 + i128::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:132:14
+   |
+LL |     let _n = 1isize + isize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:135:14
+   |
+LL |     let _n = 1usize + usize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:140:14
+   |
+LL |     let _n = 1u8 - 5;
+   |              ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:143:14
+   |
+LL |     let _n = 1u16 - 5;
+   |              ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:146:14
+   |
+LL |     let _n = 1u32 - 5;
+   |              ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:149:14
+   |
+LL |     let _n = 1u64 - 5 ;
+   |              ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:152:14
+   |
+LL |     let _n = 1u128 - 5 ;
+   |              ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:155:14
+   |
+LL |     let _n = -5i8 - i8::MAX;
+   |              ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:158:14
+   |
+LL |     let _n = -5i16 - i16::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:161:14
+   |
+LL |     let _n = -5i32 - i32::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:164:14
+   |
+LL |     let _n = -5i64 - i64::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:167:14
+   |
+LL |     let _n = -5i128 - i128::MAX;
+   |              ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:170:14
+   |
+LL |     let _n = -5isize - isize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:173:14
+   |
+LL |     let _n = 1usize - 5;
+   |              ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:178:14
+   |
+LL |     let _n = u8::MAX * 5;
+   |              ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:181:14
+   |
+LL |     let _n = u16::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:184:14
+   |
+LL |     let _n = u32::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:187:14
+   |
+LL |     let _n = u64::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:190:14
+   |
+LL |     let _n = u128::MAX * 5;
+   |              ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:193:14
+   |
+LL |     let _n = i8::MAX * i8::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:196:14
+   |
+LL |     let _n = i16::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:199:14
+   |
+LL |     let _n = i32::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:202:14
+   |
+LL |     let _n = i64::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:205:14
+   |
+LL |     let _n = i128::MAX * 5;
+   |              ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:208:14
+   |
+LL |     let _n = isize::MAX * 5;
+   |              ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:211:14
+   |
+LL |     let _n = usize::MAX * 5;
+   |              ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:216:14
+   |
+LL |     let _n = 1u8 / 0;
+   |              ^^^^^^^ attempt to divide `1_u8` by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:217:15
+   |
+LL |     let _n = &(1u8 / 0);
+   |               ^^^^^^^^^ attempt to divide `1_u8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:219:14
+   |
+LL |     let _n = 1u16 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:220:15
+   |
+LL |     let _n = &(1u16 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:222:14
+   |
+LL |     let _n = 1u32 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:223:15
+   |
+LL |     let _n = &(1u32 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:225:14
+   |
+LL |     let _n = 1u64 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:226:15
+   |
+LL |     let _n = &(1u64 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:228:14
+   |
+LL |     let _n = 1u128 / 0;
+   |              ^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:229:15
+   |
+LL |     let _n = &(1u128 / 0);
+   |               ^^^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:231:14
+   |
+LL |     let _n = 1i8 / 0;
+   |              ^^^^^^^ attempt to divide `1_i8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:232:15
+   |
+LL |     let _n = &(1i8 / 0);
+   |               ^^^^^^^^^ attempt to divide `1_i8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:234:14
+   |
+LL |     let _n = 1i16 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:235:15
+   |
+LL |     let _n = &(1i16 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:237:14
+   |
+LL |     let _n = 1i32 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:238:15
+   |
+LL |     let _n = &(1i32 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:240:14
+   |
+LL |     let _n = 1i64 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:241:15
+   |
+LL |     let _n = &(1i64 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:243:14
+   |
+LL |     let _n = 1i128 / 0;
+   |              ^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:244:15
+   |
+LL |     let _n = &(1i128 / 0);
+   |               ^^^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:246:14
+   |
+LL |     let _n = 1isize / 0;
+   |              ^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:247:15
+   |
+LL |     let _n = &(1isize / 0);
+   |               ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:249:14
+   |
+LL |     let _n = 1usize / 0;
+   |              ^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:250:15
+   |
+LL |     let _n = &(1usize / 0);
+   |               ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:254:14
+   |
+LL |     let _n = 1u8 % 0;
+   |              ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:255:15
+   |
+LL |     let _n = &(1u8 % 0);
+   |               ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:257:14
+   |
+LL |     let _n = 1u16 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:258:15
+   |
+LL |     let _n = &(1u16 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:260:14
+   |
+LL |     let _n = 1u32 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:261:15
+   |
+LL |     let _n = &(1u32 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:263:14
+   |
+LL |     let _n = 1u64 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:264:15
+   |
+LL |     let _n = &(1u64 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:266:14
+   |
+LL |     let _n = 1u128 % 0;
+   |              ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:267:15
+   |
+LL |     let _n = &(1u128 % 0);
+   |               ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:269:14
+   |
+LL |     let _n = 1i8 % 0;
+   |              ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:270:15
+   |
+LL |     let _n = &(1i8 % 0);
+   |               ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:272:14
+   |
+LL |     let _n = 1i16 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:273:15
+   |
+LL |     let _n = &(1i16 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:275:14
+   |
+LL |     let _n = 1i32 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:276:15
+   |
+LL |     let _n = &(1i32 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:278:14
+   |
+LL |     let _n = 1i64 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:279:15
+   |
+LL |     let _n = &(1i64 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:281:14
+   |
+LL |     let _n = 1i128 % 0;
+   |              ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:282:15
+   |
+LL |     let _n = &(1i128 % 0);
+   |               ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:284:14
+   |
+LL |     let _n = 1isize % 0;
+   |              ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:285:15
+   |
+LL |     let _n = &(1isize % 0);
+   |               ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:287:14
+   |
+LL |     let _n = 1usize % 0;
+   |              ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:288:15
+   |
+LL |     let _n = &(1usize % 0);
+   |               ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:292:14
+   |
+LL |     let _n = [1, 2, 3][4];
+   |              ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:293:15
+   |
+LL |     let _n = &([1, 2, 3][4]);
+   |               ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 170 previous errors
+
diff --git a/tests/ui/lint/lint-overflowing-ops.opt_with_overflow_checks.stderr b/tests/ui/lint/lint-overflowing-ops.opt_with_overflow_checks.stderr
new file mode 100644
index 00000000000..93fc19ce79e
--- /dev/null
+++ b/tests/ui/lint/lint-overflowing-ops.opt_with_overflow_checks.stderr
@@ -0,0 +1,1030 @@
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:26:14
+   |
+LL |     let _n = 1u8 << 8;
+   |              ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+   |
+note: the lint level is defined here
+  --> $DIR/lint-overflowing-ops.rs:17:9
+   |
+LL | #![deny(arithmetic_overflow)]
+   |         ^^^^^^^^^^^^^^^^^^^
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:212:15
+   |
+LL |     let _n = &(usize::MAX * 5);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:209:15
+   |
+LL |     let _n = &(isize::MAX * 5);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:206:15
+   |
+LL |     let _n = &(i128::MAX * 5);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:203:15
+   |
+LL |     let _n = &(i64::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:200:15
+   |
+LL |     let _n = &(i32::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:197:15
+   |
+LL |     let _n = &(i16::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:194:15
+   |
+LL |     let _n = &(i8::MAX * i8::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:191:15
+   |
+LL |     let _n = &(u128::MAX * 5);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:188:15
+   |
+LL |     let _n = &(u64::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:185:15
+   |
+LL |     let _n = &(u32::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:182:15
+   |
+LL |     let _n = &(u16::MAX * 5);
+   |               ^^^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:179:15
+   |
+LL |     let _n = &(u8::MAX * 5);
+   |               ^^^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:174:15
+   |
+LL |     let _n = &(1usize - 5);
+   |               ^^^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:171:15
+   |
+LL |     let _n = &(-5isize - isize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:168:15
+   |
+LL |     let _n = &(-5i128 - i128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:165:15
+   |
+LL |     let _n = &(-5i64 - i64::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:162:15
+   |
+LL |     let _n = &(-5i32 - i32::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:159:15
+   |
+LL |     let _n = &(-5i16 - i16::MAX);
+   |               ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:156:15
+   |
+LL |     let _n = &(-5i8 - i8::MAX);
+   |               ^^^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:153:15
+   |
+LL |     let _n = &(1u128 - 5);
+   |               ^^^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:150:15
+   |
+LL |     let _n = &(1u64 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:147:15
+   |
+LL |     let _n = &(1u32 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:144:15
+   |
+LL |     let _n = &(1u16 - 5);
+   |               ^^^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:141:15
+   |
+LL |     let _n = &(1u8 - 5);
+   |               ^^^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:136:15
+   |
+LL |     let _n = &(1usize + usize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:133:15
+   |
+LL |     let _n = &(1isize + isize::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:130:15
+   |
+LL |     let _n = &(1i128 + i128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:127:15
+   |
+LL |     let _n = &(1i64 + i64::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:124:15
+   |
+LL |     let _n = &(1i32 + i32::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:121:15
+   |
+LL |     let _n = &(1i16 + i16::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:118:15
+   |
+LL |     let _n = &(1i8 + i8::MAX);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:115:15
+   |
+LL |     let _n = &(1u128 + u128::MAX);
+   |               ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:112:15
+   |
+LL |     let _n = &(1u64 + u64::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:109:15
+   |
+LL |     let _n = &(1u32 + u32::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:106:15
+   |
+LL |     let _n = &(1u16 + u16::MAX);
+   |               ^^^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:103:15
+   |
+LL |     let _n = &(1u8 + u8::MAX);
+   |               ^^^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:98:15
+   |
+LL |     let _n = &(1_usize >> BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:95:15
+   |
+LL |     let _n = &(1_isize >> BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:92:15
+   |
+LL |     let _n = &(1i128 >> 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:89:15
+   |
+LL |     let _n = &(1i64 >> 64);
+   |               ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:86:15
+   |
+LL |     let _n = &(1i32 >> 32);
+   |               ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:83:15
+   |
+LL |     let _n = &(1i16 >> 16);
+   |               ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:80:15
+   |
+LL |     let _n = &(1i8 >> 8);
+   |               ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:77:15
+   |
+LL |     let _n = &(1u128 >> 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:74:15
+   |
+LL |     let _n = &(1u64 >> 64);
+   |               ^^^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:71:15
+   |
+LL |     let _n = &(1u32 >> 32);
+   |               ^^^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:68:15
+   |
+LL |     let _n = &(1u16 >> 16);
+   |               ^^^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:65:15
+   |
+LL |     let _n = &(1u8 >> 8);
+   |               ^^^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:60:15
+   |
+LL |     let _n = &(1_usize << BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:57:15
+   |
+LL |     let _n = &(1_isize << BITS);
+   |               ^^^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:54:15
+   |
+LL |     let _n = &(1i128 << 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:51:15
+   |
+LL |     let _n = &(1i64 << 64);
+   |               ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:48:15
+   |
+LL |     let _n = &(1i32 << 32);
+   |               ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:45:15
+   |
+LL |     let _n = &(1i16 << 16);
+   |               ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:42:15
+   |
+LL |     let _n = &(1i8 << 8);
+   |               ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:39:15
+   |
+LL |     let _n = &(1u128 << 128);
+   |               ^^^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:36:15
+   |
+LL |     let _n = &(1u64 << 64);
+   |               ^^^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:33:15
+   |
+LL |     let _n = &(1u32 << 32);
+   |               ^^^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:30:15
+   |
+LL |     let _n = &(1u16 << 16);
+   |               ^^^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:27:15
+   |
+LL |     let _n = &(1u8 << 8);
+   |               ^^^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:29:14
+   |
+LL |     let _n = 1u16 << 16;
+   |              ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:32:14
+   |
+LL |     let _n = 1u32 << 32;
+   |              ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:35:14
+   |
+LL |     let _n = 1u64 << 64;
+   |              ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:38:14
+   |
+LL |     let _n = 1u128 << 128;
+   |              ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:41:14
+   |
+LL |     let _n = 1i8 << 8;
+   |              ^^^^^^^^ attempt to shift left by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:44:14
+   |
+LL |     let _n = 1i16 << 16;
+   |              ^^^^^^^^^^ attempt to shift left by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:47:14
+   |
+LL |     let _n = 1i32 << 32;
+   |              ^^^^^^^^^^ attempt to shift left by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:50:14
+   |
+LL |     let _n = 1i64 << 64;
+   |              ^^^^^^^^^^ attempt to shift left by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:53:14
+   |
+LL |     let _n = 1i128 << 128;
+   |              ^^^^^^^^^^^^ attempt to shift left by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:56:14
+   |
+LL |     let _n = 1_isize << BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:59:14
+   |
+LL |     let _n = 1_usize << BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift left by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:64:14
+   |
+LL |     let _n = 1u8 >> 8;
+   |              ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:67:14
+   |
+LL |     let _n = 1u16 >> 16;
+   |              ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:70:14
+   |
+LL |     let _n = 1u32 >> 32;
+   |              ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:73:14
+   |
+LL |     let _n = 1u64 >> 64;
+   |              ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:76:14
+   |
+LL |     let _n = 1u128 >> 128;
+   |              ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:79:14
+   |
+LL |     let _n = 1i8 >> 8;
+   |              ^^^^^^^^ attempt to shift right by `8_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:82:14
+   |
+LL |     let _n = 1i16 >> 16;
+   |              ^^^^^^^^^^ attempt to shift right by `16_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:85:14
+   |
+LL |     let _n = 1i32 >> 32;
+   |              ^^^^^^^^^^ attempt to shift right by `32_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:88:14
+   |
+LL |     let _n = 1i64 >> 64;
+   |              ^^^^^^^^^^ attempt to shift right by `64_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:91:14
+   |
+LL |     let _n = 1i128 >> 128;
+   |              ^^^^^^^^^^^^ attempt to shift right by `128_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:94:14
+   |
+LL |     let _n = 1_isize >> BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:97:14
+   |
+LL |     let _n = 1_usize >> BITS;
+   |              ^^^^^^^^^^^^^^^ attempt to shift right by `%BITS%`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:102:14
+   |
+LL |     let _n = 1u8 + u8::MAX;
+   |              ^^^^^^^^^^^^^ attempt to compute `1_u8 + u8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:105:14
+   |
+LL |     let _n = 1u16 + u16::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u16 + u16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:108:14
+   |
+LL |     let _n = 1u32 + u32::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u32 + u32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:111:14
+   |
+LL |     let _n = 1u64 + u64::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_u64 + u64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:114:14
+   |
+LL |     let _n = 1u128 + u128::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `1_u128 + u128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:117:14
+   |
+LL |     let _n = 1i8 + i8::MAX;
+   |              ^^^^^^^^^^^^^ attempt to compute `1_i8 + i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:120:14
+   |
+LL |     let _n = 1i16 + i16::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i16 + i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:123:14
+   |
+LL |     let _n = 1i32 + i32::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:126:14
+   |
+LL |     let _n = 1i64 + i64::MAX;
+   |              ^^^^^^^^^^^^^^^ attempt to compute `1_i64 + i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:129:14
+   |
+LL |     let _n = 1i128 + i128::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `1_i128 + i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:132:14
+   |
+LL |     let _n = 1isize + isize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_isize + isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:135:14
+   |
+LL |     let _n = 1usize + usize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^ attempt to compute `1_usize + usize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:140:14
+   |
+LL |     let _n = 1u8 - 5;
+   |              ^^^^^^^ attempt to compute `1_u8 - 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:143:14
+   |
+LL |     let _n = 1u16 - 5;
+   |              ^^^^^^^^ attempt to compute `1_u16 - 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:146:14
+   |
+LL |     let _n = 1u32 - 5;
+   |              ^^^^^^^^ attempt to compute `1_u32 - 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:149:14
+   |
+LL |     let _n = 1u64 - 5 ;
+   |              ^^^^^^^^ attempt to compute `1_u64 - 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:152:14
+   |
+LL |     let _n = 1u128 - 5 ;
+   |              ^^^^^^^^^ attempt to compute `1_u128 - 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:155:14
+   |
+LL |     let _n = -5i8 - i8::MAX;
+   |              ^^^^^^^^^^^^^^ attempt to compute `-5_i8 - i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:158:14
+   |
+LL |     let _n = -5i16 - i16::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i16 - i16::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:161:14
+   |
+LL |     let _n = -5i32 - i32::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:164:14
+   |
+LL |     let _n = -5i64 - i64::MAX;
+   |              ^^^^^^^^^^^^^^^^ attempt to compute `-5_i64 - i64::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:167:14
+   |
+LL |     let _n = -5i128 - i128::MAX;
+   |              ^^^^^^^^^^^^^^^^^^ attempt to compute `-5_i128 - i128::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:170:14
+   |
+LL |     let _n = -5isize - isize::MAX;
+   |              ^^^^^^^^^^^^^^^^^^^^ attempt to compute `-5_isize - isize::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:173:14
+   |
+LL |     let _n = 1usize - 5;
+   |              ^^^^^^^^^^ attempt to compute `1_usize - 5_usize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:178:14
+   |
+LL |     let _n = u8::MAX * 5;
+   |              ^^^^^^^^^^^ attempt to compute `u8::MAX * 5_u8`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:181:14
+   |
+LL |     let _n = u16::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u16::MAX * 5_u16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:184:14
+   |
+LL |     let _n = u32::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u32::MAX * 5_u32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:187:14
+   |
+LL |     let _n = u64::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `u64::MAX * 5_u64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:190:14
+   |
+LL |     let _n = u128::MAX * 5;
+   |              ^^^^^^^^^^^^^ attempt to compute `u128::MAX * 5_u128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:193:14
+   |
+LL |     let _n = i8::MAX * i8::MAX;
+   |              ^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX * i8::MAX`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:196:14
+   |
+LL |     let _n = i16::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i16::MAX * 5_i16`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:199:14
+   |
+LL |     let _n = i32::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i32::MAX * 5_i32`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:202:14
+   |
+LL |     let _n = i64::MAX * 5;
+   |              ^^^^^^^^^^^^ attempt to compute `i64::MAX * 5_i64`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:205:14
+   |
+LL |     let _n = i128::MAX * 5;
+   |              ^^^^^^^^^^^^^ attempt to compute `i128::MAX * 5_i128`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:208:14
+   |
+LL |     let _n = isize::MAX * 5;
+   |              ^^^^^^^^^^^^^^ attempt to compute `isize::MAX * 5_isize`, which would overflow
+
+error: this arithmetic operation will overflow
+  --> $DIR/lint-overflowing-ops.rs:211:14
+   |
+LL |     let _n = usize::MAX * 5;
+   |              ^^^^^^^^^^^^^^ attempt to compute `usize::MAX * 5_usize`, which would overflow
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:216:14
+   |
+LL |     let _n = 1u8 / 0;
+   |              ^^^^^^^ attempt to divide `1_u8` by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:217:15
+   |
+LL |     let _n = &(1u8 / 0);
+   |               ^^^^^^^^^ attempt to divide `1_u8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:219:14
+   |
+LL |     let _n = 1u16 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:220:15
+   |
+LL |     let _n = &(1u16 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:222:14
+   |
+LL |     let _n = 1u32 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:223:15
+   |
+LL |     let _n = &(1u32 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:225:14
+   |
+LL |     let _n = 1u64 / 0;
+   |              ^^^^^^^^ attempt to divide `1_u64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:226:15
+   |
+LL |     let _n = &(1u64 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_u64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:228:14
+   |
+LL |     let _n = 1u128 / 0;
+   |              ^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:229:15
+   |
+LL |     let _n = &(1u128 / 0);
+   |               ^^^^^^^^^^^ attempt to divide `1_u128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:231:14
+   |
+LL |     let _n = 1i8 / 0;
+   |              ^^^^^^^ attempt to divide `1_i8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:232:15
+   |
+LL |     let _n = &(1i8 / 0);
+   |               ^^^^^^^^^ attempt to divide `1_i8` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:234:14
+   |
+LL |     let _n = 1i16 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:235:15
+   |
+LL |     let _n = &(1i16 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i16` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:237:14
+   |
+LL |     let _n = 1i32 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:238:15
+   |
+LL |     let _n = &(1i32 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i32` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:240:14
+   |
+LL |     let _n = 1i64 / 0;
+   |              ^^^^^^^^ attempt to divide `1_i64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:241:15
+   |
+LL |     let _n = &(1i64 / 0);
+   |               ^^^^^^^^^^ attempt to divide `1_i64` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:243:14
+   |
+LL |     let _n = 1i128 / 0;
+   |              ^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:244:15
+   |
+LL |     let _n = &(1i128 / 0);
+   |               ^^^^^^^^^^^ attempt to divide `1_i128` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:246:14
+   |
+LL |     let _n = 1isize / 0;
+   |              ^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:247:15
+   |
+LL |     let _n = &(1isize / 0);
+   |               ^^^^^^^^^^^^ attempt to divide `1_isize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:249:14
+   |
+LL |     let _n = 1usize / 0;
+   |              ^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:250:15
+   |
+LL |     let _n = &(1usize / 0);
+   |               ^^^^^^^^^^^^ attempt to divide `1_usize` by zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:254:14
+   |
+LL |     let _n = 1u8 % 0;
+   |              ^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:255:15
+   |
+LL |     let _n = &(1u8 % 0);
+   |               ^^^^^^^^^ attempt to calculate the remainder of `1_u8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:257:14
+   |
+LL |     let _n = 1u16 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:258:15
+   |
+LL |     let _n = &(1u16 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:260:14
+   |
+LL |     let _n = 1u32 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:261:15
+   |
+LL |     let _n = &(1u32 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:263:14
+   |
+LL |     let _n = 1u64 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:264:15
+   |
+LL |     let _n = &(1u64 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_u64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:266:14
+   |
+LL |     let _n = 1u128 % 0;
+   |              ^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:267:15
+   |
+LL |     let _n = &(1u128 % 0);
+   |               ^^^^^^^^^^^ attempt to calculate the remainder of `1_u128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:269:14
+   |
+LL |     let _n = 1i8 % 0;
+   |              ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:270:15
+   |
+LL |     let _n = &(1i8 % 0);
+   |               ^^^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:272:14
+   |
+LL |     let _n = 1i16 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:273:15
+   |
+LL |     let _n = &(1i16 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:275:14
+   |
+LL |     let _n = 1i32 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:276:15
+   |
+LL |     let _n = &(1i32 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:278:14
+   |
+LL |     let _n = 1i64 % 0;
+   |              ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:279:15
+   |
+LL |     let _n = &(1i64 % 0);
+   |               ^^^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:281:14
+   |
+LL |     let _n = 1i128 % 0;
+   |              ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:282:15
+   |
+LL |     let _n = &(1i128 % 0);
+   |               ^^^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:284:14
+   |
+LL |     let _n = 1isize % 0;
+   |              ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:285:15
+   |
+LL |     let _n = &(1isize % 0);
+   |               ^^^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:287:14
+   |
+LL |     let _n = 1usize % 0;
+   |              ^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:288:15
+   |
+LL |     let _n = &(1usize % 0);
+   |               ^^^^^^^^^^^^ attempt to calculate the remainder of `1_usize` with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:292:14
+   |
+LL |     let _n = [1, 2, 3][4];
+   |              ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: this operation will panic at runtime
+  --> $DIR/lint-overflowing-ops.rs:293:15
+   |
+LL |     let _n = &([1, 2, 3][4]);
+   |               ^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
+
+error: aborting due to 170 previous errors
+
diff --git a/tests/ui/lint/lint-overflowing-ops.rs b/tests/ui/lint/lint-overflowing-ops.rs
new file mode 100644
index 00000000000..e64c210bade
--- /dev/null
+++ b/tests/ui/lint/lint-overflowing-ops.rs
@@ -0,0 +1,294 @@
+// Tests that overflowing or bound-exceeding operations
+// are correclty linted including when they are const promoted
+
+// We are using "-Z deduplicate-diagnostics=yes" because different
+// build configurations emit different number of duplicate diagnostics
+// and this flag lets us test them all with a single .rs file like this
+
+//@ revisions: noopt opt opt_with_overflow_checks
+//@ [noopt]compile-flags: -C opt-level=0 -Z deduplicate-diagnostics=yes
+//@ [opt]compile-flags: -O
+//@ [opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O -Z deduplicate-diagnostics=yes
+//@ build-fail
+//@ ignore-pass (test tests codegen-time behaviour)
+//@ normalize-stderr-test "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
+//@ normalize-stderr-test "shift right by `(64|32)_usize`, which" -> "shift right by `%BITS%`, which"
+
+#![deny(arithmetic_overflow)]
+
+#[cfg(target_pointer_width = "32")]
+const BITS: usize = 32;
+#[cfg(target_pointer_width = "64")]
+const BITS: usize = 64;
+
+fn main() {
+    // Shift left
+    let _n = 1u8 << 8;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u8 << 8);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u16 << 16; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u16 << 16); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u32 << 32; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u32 << 32); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u64 << 64; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u64 << 64); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u128 << 128; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u128 << 128); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i8 << 8;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i8 << 8);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i16 << 16; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i16 << 16); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i32 << 32; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i32 << 32); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i64 << 64; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i64 << 64); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i128 << 128; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i128 << 128); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1_isize << BITS; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1_isize << BITS); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1_usize << BITS; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1_usize << BITS); //~ ERROR: arithmetic operation will overflow
+
+
+    // Shift right
+    let _n = 1u8 >> 8;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u8 >> 8);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u16 >> 16; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u16 >> 16); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u32 >> 32; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u32 >> 32); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u64 >> 64; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u64 >> 64); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u128 >> 128; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u128 >> 128); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i8 >> 8;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i8 >> 8);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i16 >> 16; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i16 >> 16); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i32 >> 32; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i32 >> 32); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i64 >> 64; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i64 >> 64); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i128 >> 128; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i128 >> 128); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1_isize >> BITS; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1_isize >> BITS); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1_usize >> BITS; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1_usize >> BITS); //~ ERROR: arithmetic operation will overflow
+
+
+    // Addition
+    let _n = 1u8 + u8::MAX;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u8 + u8::MAX);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u16 + u16::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u16 + u16::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u32 + u32::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u32 + u32::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u64 + u64::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u64 + u64::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u128 + u128::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u128 + u128::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i8 + i8::MAX;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i8 + i8::MAX);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i16 + i16::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i16 + i16::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i32 + i32::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i32 + i32::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i64 + i64::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i64 + i64::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1i128 + i128::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1i128 + i128::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1isize + isize::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1isize + isize::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1usize + usize::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1usize + usize::MAX); //~ ERROR: arithmetic operation will overflow
+
+
+    // Subtraction
+    let _n = 1u8 - 5;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u8 - 5);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u16 - 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u16 - 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u32 - 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u32 - 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u64 - 5 ; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u64 - 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1u128 - 5 ; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1u128 - 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = -5i8 - i8::MAX;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(-5i8 - i8::MAX);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = -5i16 - i16::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(-5i16 - i16::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = -5i32 - i32::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(-5i32 - i32::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = -5i64 - i64::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(-5i64 - i64::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = -5i128 - i128::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(-5i128 - i128::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = -5isize - isize::MAX; //~ ERROR: arithmetic operation will overflow
+    let _n = &(-5isize - isize::MAX); //~ ERROR: arithmetic operation will overflow
+
+    let _n = 1usize - 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(1usize - 5); //~ ERROR: arithmetic operation will overflow
+
+
+    // Multiplication
+    let _n = u8::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(u8::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = u16::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(u16::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = u32::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(u32::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = u64::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(u64::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = u128::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(u128::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = i8::MAX * i8::MAX;   //~ ERROR: arithmetic operation will overflow
+    let _n = &(i8::MAX * i8::MAX);   //~ ERROR: arithmetic operation will overflow
+
+    let _n = i16::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(i16::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = i32::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(i32::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = i64::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(i64::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = i128::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(i128::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = isize::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(isize::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+    let _n = usize::MAX * 5; //~ ERROR: arithmetic operation will overflow
+    let _n = &(usize::MAX * 5); //~ ERROR: arithmetic operation will overflow
+
+
+    // Division
+    let _n = 1u8 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u8 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u16 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u16 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u32 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u32 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u64 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u64 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u128 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u128 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i8 / 0;   //~ ERROR: this operation will panic at runtime
+    let _n = &(1i8 / 0);   //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i16 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i16 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i32 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i32 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i64 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i64 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i128 / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i128 / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1isize / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1isize / 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1usize / 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1usize / 0); //~ ERROR: this operation will panic at runtime
+
+
+    // Modulus
+    let _n = 1u8 % 0;   //~ ERROR: this operation will panic at runtime
+    let _n = &(1u8 % 0);   //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u16 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u16 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u32 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u32 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u64 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u64 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1u128 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1u128 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i8 % 0;   //~ ERROR: this operation will panic at runtime
+    let _n = &(1i8 % 0);   //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i16 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i16 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i32 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i32 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i64 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i64 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1i128 % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1i128 % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1isize % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1isize % 0); //~ ERROR: this operation will panic at runtime
+
+    let _n = 1usize % 0; //~ ERROR: this operation will panic at runtime
+    let _n = &(1usize % 0); //~ ERROR: this operation will panic at runtime
+
+
+    // Out of bounds access
+    let _n = [1, 2, 3][4]; //~ ERROR: this operation will panic at runtime
+    let _n = &([1, 2, 3][4]); //~ ERROR: this operation will panic at runtime
+}
diff --git a/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs b/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs
new file mode 100644
index 00000000000..02df0e6de95
--- /dev/null
+++ b/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs
@@ -0,0 +1,20 @@
+//@ needs-asm-support
+#![deny(unsafe_code)]
+
+use std::arch::global_asm;
+
+#[allow(unsafe_code)]
+mod allowed_unsafe {
+    std::arch::global_asm!("");
+}
+
+macro_rules! unsafe_in_macro {
+    () => {
+        global_asm!(""); //~ ERROR: usage of `core::arch::global_asm`
+    };
+}
+
+global_asm!(""); //~ ERROR: usage of `core::arch::global_asm`
+unsafe_in_macro!();
+
+fn main() {}
diff --git a/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.stderr b/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.stderr
new file mode 100644
index 00000000000..deb67a174f1
--- /dev/null
+++ b/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.stderr
@@ -0,0 +1,27 @@
+error: usage of `core::arch::global_asm`
+  --> $DIR/lint-global-asm-as-unsafe.rs:17:1
+   |
+LL | global_asm!("");
+   | ^^^^^^^^^^^^^^^
+   |
+   = note: using this macro is unsafe even though it does not need an `unsafe` block
+note: the lint level is defined here
+  --> $DIR/lint-global-asm-as-unsafe.rs:2:9
+   |
+LL | #![deny(unsafe_code)]
+   |         ^^^^^^^^^^^
+
+error: usage of `core::arch::global_asm`
+  --> $DIR/lint-global-asm-as-unsafe.rs:13:9
+   |
+LL |         global_asm!("");
+   |         ^^^^^^^^^^^^^^^
+...
+LL | unsafe_in_macro!();
+   | ------------------ in this macro invocation
+   |
+   = note: using this macro is unsafe even though it does not need an `unsafe` block
+   = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/unused/lint-unused-imports.rs b/tests/ui/lint/unused/lint-unused-imports.rs
index 4fa6511c97e..88f2baa5da9 100644
--- a/tests/ui/lint/unused/lint-unused-imports.rs
+++ b/tests/ui/lint/unused/lint-unused-imports.rs
@@ -66,7 +66,6 @@ pub mod bar {
 
 fn g() {
     use self::g; //~ ERROR unused import: `self::g`
-    //~^ ERROR the item `g` is imported redundantly
     fn f() {
         self::g();
     }
@@ -76,7 +75,6 @@ fn g() {
 #[allow(unused_variables)]
 fn h() {
     use test2::foo; //~ ERROR unused import: `test2::foo`
-    //~^ ERROR the item `foo` is imported redundantly
     let foo = 0;
 }
 
diff --git a/tests/ui/lint/unused/lint-unused-imports.stderr b/tests/ui/lint/unused/lint-unused-imports.stderr
index 0574ca4569f..07684a84a64 100644
--- a/tests/ui/lint/unused/lint-unused-imports.stderr
+++ b/tests/ui/lint/unused/lint-unused-imports.stderr
@@ -34,36 +34,14 @@ error: unused import: `foo::Square`
 LL |         use foo::Square;
    |             ^^^^^^^^^^^
 
-error: the item `g` is imported redundantly
-  --> $DIR/lint-unused-imports.rs:68:9
-   |
-LL | / fn g() {
-LL | |     use self::g;
-   | |         ^^^^^^^
-LL | |
-LL | |     fn f() {
-LL | |         self::g();
-LL | |     }
-LL | | }
-   | |_- the item `g` is already defined here
-
 error: unused import: `self::g`
   --> $DIR/lint-unused-imports.rs:68:9
    |
 LL |     use self::g;
    |         ^^^^^^^
 
-error: the item `foo` is imported redundantly
-  --> $DIR/lint-unused-imports.rs:78:9
-   |
-LL | use test2::{foo, bar};
-   |             --- the item `foo` is already imported here
-...
-LL |     use test2::foo;
-   |         ^^^^^^^^^^
-
 error: unused import: `test2::foo`
-  --> $DIR/lint-unused-imports.rs:78:9
+  --> $DIR/lint-unused-imports.rs:77:9
    |
 LL |     use test2::foo;
    |         ^^^^^^^^^^
@@ -74,5 +52,5 @@ error: unused import: `test::B2`
 LL | use test::B2;
    |     ^^^^^^^^
 
-error: aborting due to 10 previous errors
+error: aborting due to 8 previous errors
 
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs
new file mode 100644
index 00000000000..ae5118b2729
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs
@@ -0,0 +1,19 @@
+//@ check-pass
+#![warn(unused_imports)]
+
+
+use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly
+use std::option::Option::None; //~ WARNING the item `None` is imported redundantly
+
+use std::result::Result::Ok;//~ WARNING the item `Ok` is imported redundantly
+use std::result::Result::Err;//~ WARNING the item `Err` is imported redundantly
+use std::convert::{TryFrom, TryInto};
+
+fn main() {
+    let _a: Option<i32> = Some(1);
+    let _b: Option<i32>  = None;
+    let _c: Result<i32, String> = Ok(1);
+    let _d: Result<i32, &str> = Err("error");
+    let _e: Result<i32, _> = 8u8.try_into();
+    let _f: Result<i32, _> = i32::try_from(8u8);
+}
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr
new file mode 100644
index 00000000000..1b09df911eb
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr
@@ -0,0 +1,44 @@
+warning: the item `Some` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:5:5
+   |
+LL | use std::option::Option::Some;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Some` is already defined here
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-prelude-rust-2015.rs:2:9
+   |
+LL | #![warn(unused_imports)]
+   |         ^^^^^^^^^^^^^^
+
+warning: the item `None` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:6:5
+   |
+LL | use std::option::Option::None;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `None` is already defined here
+
+warning: the item `Ok` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:8:5
+   |
+LL | use std::result::Result::Ok;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Ok` is already defined here
+
+warning: the item `Err` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:9:5
+   |
+LL | use std::result::Result::Err;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Err` is already defined here
+
+warning: 4 warnings emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs
new file mode 100644
index 00000000000..cb4dcb6c0bd
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs
@@ -0,0 +1,11 @@
+//@ check-pass
+//@ edition:2021
+#![warn(unused_imports)]
+
+use std::convert::TryFrom;//~ WARNING the item `TryFrom` is imported redundantly
+use std::convert::TryInto;//~ WARNING the item `TryInto` is imported redundantly
+
+fn main() {
+    let _e: Result<i32, _> = 8u8.try_into();
+    let _f: Result<i32, _> = i32::try_from(8u8);
+}
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr
new file mode 100644
index 00000000000..542356dc996
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr
@@ -0,0 +1,26 @@
+warning: the item `TryFrom` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2021.rs:5:5
+   |
+LL | use std::convert::TryFrom;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryFrom` is already defined here
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-prelude-rust-2021.rs:3:9
+   |
+LL | #![warn(unused_imports)]
+   |         ^^^^^^^^^^^^^^
+
+warning: the item `TryInto` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2021.rs:6:5
+   |
+LL | use std::convert::TryInto;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryInto` is already defined here
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/lint/wide_pointer_comparisons.rs b/tests/ui/lint/wide_pointer_comparisons.rs
index 37807776d2f..31369001075 100644
--- a/tests/ui/lint/wide_pointer_comparisons.rs
+++ b/tests/ui/lint/wide_pointer_comparisons.rs
@@ -110,10 +110,12 @@ fn main() {
     {
         macro_rules! cmp {
             ($a:tt, $b:tt) => { $a == $b }
-            //~^ WARN ambiguous wide pointer comparison
         }
 
+        // FIXME: This lint uses some custom span combination logic.
+        // Rewrite it to adapt to the new metavariable span rules.
         cmp!(a, b);
+        //~^ WARN ambiguous wide pointer comparison
     }
 
     {
diff --git a/tests/ui/lint/wide_pointer_comparisons.stderr b/tests/ui/lint/wide_pointer_comparisons.stderr
index 349ff467d0f..6ef117c63c5 100644
--- a/tests/ui/lint/wide_pointer_comparisons.stderr
+++ b/tests/ui/lint/wide_pointer_comparisons.stderr
@@ -421,18 +421,18 @@ LL |         std::ptr::eq(*a, *b)
    |         ~~~~~~~~~~~~~  ~   +
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
-  --> $DIR/wide_pointer_comparisons.rs:112:33
+  --> $DIR/wide_pointer_comparisons.rs:117:14
    |
-LL |             ($a:tt, $b:tt) => { $a == $b }
-   |                                 ^^^^^^^^
+LL |         cmp!(a, b);
+   |              ^^^^
    |
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
-LL |             ($a:tt, $b:tt) => { std::ptr::addr_eq($a, $b) }
-   |                                 ++++++++++++++++++  ~   +
+LL |         cmp!(std::ptr::addr_eq(a, b));
+   |              ++++++++++++++++++ ~  +
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
-  --> $DIR/wide_pointer_comparisons.rs:121:39
+  --> $DIR/wide_pointer_comparisons.rs:123:39
    |
 LL |             ($a:ident, $b:ident) => { $a == $b }
    |                                       ^^^^^^^^
@@ -447,7 +447,7 @@ LL |             ($a:ident, $b:ident) => { std::ptr::addr_eq($a, $b) }
    |                                       ++++++++++++++++++  ~   +
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
-  --> $DIR/wide_pointer_comparisons.rs:131:37
+  --> $DIR/wide_pointer_comparisons.rs:133:37
    |
 LL |             ($a:expr, $b:expr) => { $a == $b }
    |                                     ^^
diff --git a/tests/ui/liveness/liveness-consts.stderr b/tests/ui/liveness/liveness-consts.stderr
index 016debdd396..34ce3947337 100644
--- a/tests/ui/liveness/liveness-consts.stderr
+++ b/tests/ui/liveness/liveness-consts.stderr
@@ -23,12 +23,6 @@ warning: unused variable: `z`
 LL | pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8;  { let z = 18; 100 }] {
    |                                                       ^ help: if this is intentional, prefix it with an underscore: `_z`
 
-warning: unused variable: `z`
-  --> $DIR/liveness-consts.rs:60:13
-   |
-LL |         let z = 42;
-   |             ^ help: if this is intentional, prefix it with an underscore: `_z`
-
 warning: variable `a` is assigned to, but never used
   --> $DIR/liveness-consts.rs:7:13
    |
@@ -46,6 +40,12 @@ LL |     b += 1;
    = help: maybe it is overwritten before being read?
    = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
 
+warning: unused variable: `z`
+  --> $DIR/liveness-consts.rs:60:13
+   |
+LL |         let z = 42;
+   |             ^ help: if this is intentional, prefix it with an underscore: `_z`
+
 warning: value assigned to `t` is never read
   --> $DIR/liveness-consts.rs:42:9
    |
diff --git a/tests/ui/macros/invalid-fragment-specifier.rs b/tests/ui/macros/invalid-fragment-specifier.rs
new file mode 100644
index 00000000000..1daf0a95434
--- /dev/null
+++ b/tests/ui/macros/invalid-fragment-specifier.rs
@@ -0,0 +1,10 @@
+macro_rules! test {
+    ($wrong:id) => {};
+} //~^ ERROR: invalid fragment specifier `id`
+
+// guard against breaking raw identifier diagnostic
+macro_rules! test_raw_identifer {
+    ($wrong:r#if) => {};
+} //~^ ERROR: invalid fragment specifier `r#if`
+
+fn main() {}
diff --git a/tests/ui/macros/invalid-fragment-specifier.stderr b/tests/ui/macros/invalid-fragment-specifier.stderr
new file mode 100644
index 00000000000..7516dbc3a08
--- /dev/null
+++ b/tests/ui/macros/invalid-fragment-specifier.stderr
@@ -0,0 +1,18 @@
+error: invalid fragment specifier `id`
+  --> $DIR/invalid-fragment-specifier.rs:2:6
+   |
+LL |     ($wrong:id) => {};
+   |      ^^^^^^^^^
+   |
+   = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
+
+error: invalid fragment specifier `r#if`
+  --> $DIR/invalid-fragment-specifier.rs:7:6
+   |
+LL |     ($wrong:r#if) => {};
+   |      ^^^^^^^^^^^
+   |
+   = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/macros/issue-118786.rs b/tests/ui/macros/issue-118786.rs
index cc6c751813b..97454c9de07 100644
--- a/tests/ui/macros/issue-118786.rs
+++ b/tests/ui/macros/issue-118786.rs
@@ -5,8 +5,7 @@
 macro_rules! make_macro {
     ($macro_name:tt) => {
         macro_rules! $macro_name {
-        //~^ ERROR macros that expand to items must be delimited with braces or followed by a semicolon
-        //~| ERROR macro expansion ignores token `{` and any following
+        //~^ ERROR macro expansion ignores token `{` and any following
         //~| ERROR cannot find macro `macro_rules` in this scope
             () => {}
         }
@@ -14,3 +13,4 @@ macro_rules! make_macro {
 }
 
 make_macro!((meow));
+//~^ ERROR macros that expand to items must be delimited with braces or followed by a semicolon
diff --git a/tests/ui/macros/issue-118786.stderr b/tests/ui/macros/issue-118786.stderr
index 1a8ac9340da..03e65c94ba7 100644
--- a/tests/ui/macros/issue-118786.stderr
+++ b/tests/ui/macros/issue-118786.stderr
@@ -1,13 +1,13 @@
 error: macros that expand to items must be delimited with braces or followed by a semicolon
-  --> $DIR/issue-118786.rs:7:22
+  --> $DIR/issue-118786.rs:15:13
    |
-LL |         macro_rules! $macro_name {
-   |                      ^^^^^^^^^^^
+LL | make_macro!((meow));
+   |             ^^^^^^
    |
 help: change the delimiters to curly braces
    |
-LL |         macro_rules! {$macro_name} {
-   |                      +           +
+LL | make_macro!({meow});
+   |             ~    ~
 help: add a semicolon
    |
 LL |         macro_rules! $macro_name; {
diff --git a/tests/ui/macros/macro-invalid-fragment-spec.rs b/tests/ui/macros/macro-invalid-fragment-spec.rs
deleted file mode 100644
index dc4d75096af..00000000000
--- a/tests/ui/macros/macro-invalid-fragment-spec.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-macro_rules! foo(
-    ($x:foo) => ()
-    //~^ ERROR invalid fragment specifier
-);
-
-fn main() {
-    foo!(foo);
-}
diff --git a/tests/ui/macros/macro-invalid-fragment-spec.stderr b/tests/ui/macros/macro-invalid-fragment-spec.stderr
deleted file mode 100644
index 919111ede51..00000000000
--- a/tests/ui/macros/macro-invalid-fragment-spec.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: invalid fragment specifier `foo`
-  --> $DIR/macro-invalid-fragment-spec.rs:2:6
-   |
-LL |     ($x:foo) => ()
-   |      ^^^^^^
-   |
-   = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/methods/method-on-ambiguous-numeric-type.stderr b/tests/ui/methods/method-on-ambiguous-numeric-type.stderr
index 060595e1d40..12427040272 100644
--- a/tests/ui/methods/method-on-ambiguous-numeric-type.stderr
+++ b/tests/ui/methods/method-on-ambiguous-numeric-type.stderr
@@ -47,8 +47,8 @@ LL |     local_bar_tt.pow(2);
    |
 help: you must specify a type for this binding, like `i32`
    |
-LL |     ($tt:tt) => { let $tt: i32 = 42; }
-   |                          +++++
+LL |     local_mac_tt!(local_bar_tt: i32);
+   |                               +++++
 
 error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
   --> $DIR/method-on-ambiguous-numeric-type.rs:37:9
diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs
index fd49b232265..be882085c5c 100644
--- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs
+++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs
@@ -15,7 +15,7 @@ struct S1 {
 impl S1 {
     fn new(_x: u64) -> S1 {
         S1 { a: unsafe { &mut X1 } }
-        //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+        //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
     }
 }
 
diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr
index 17217cd5859..82065cc06ea 100644
--- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr
+++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr
@@ -1,14 +1,14 @@
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/borrowck-thread-local-static-mut-borrow-outlives-fn.rs:17:26
    |
 LL |         S1 { a: unsafe { &mut X1 } }
-   |                          ^^^^^^^ mutable reference of mutable static
+   |                          ^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |         S1 { a: unsafe { addr_of_mut!(X1) } }
    |                          ~~~~~~~~~~~~~~~~
diff --git a/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs b/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs
deleted file mode 100644
index 7004c9a3665..00000000000
--- a/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-//@ run-pass
-
-//@ compile-flags: -O
-
-fn main() {
-    let x = &(0u32 - 1);
-    assert_eq!(*x, u32::MAX)
-}
diff --git a/tests/ui/parser/issues/issue-44406.stderr b/tests/ui/parser/issues/issue-44406.stderr
index d005f116e12..78cde9b6dca 100644
--- a/tests/ui/parser/issues/issue-44406.stderr
+++ b/tests/ui/parser/issues/issue-44406.stderr
@@ -15,7 +15,7 @@ LL |         bar { baz: $rest }
 help: if `bar` is a function, use the arguments directly
    |
 LL -         bar(baz: $rest)
-LL +         bar(: $rest)
+LL +         bar($rest)
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr b/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr
index 8e125864b8b..a68fae1a36e 100644
--- a/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr
+++ b/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr
@@ -5,6 +5,11 @@ LL |         $($c)ö* {}
    |             ^   - if this block is the condition of the `if` expression, then it must be followed by another block
    |             |
    |             expected condition here
+...
+LL |     x!(if);
+   |     ------ in this macro invocation
+   |
+   = note: this error originates in the macro `x` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs
index 1a90b4724d4..d489df85c44 100644
--- a/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs
+++ b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs
@@ -1,9 +1,9 @@
 macro_rules! x {
     ($($c:tt)*) => {
-        $($c)ö* //~ ERROR macro expansion ends with an incomplete expression: expected expression
+        $($c)ö*
     };
 }
 
 fn main() {
-    x!(!);
+    x!(!); //~ ERROR macro expansion ends with an incomplete expression: expected expression
 }
diff --git a/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr
index 15aa62e0810..3a4b0cbf2a5 100644
--- a/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr
+++ b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr
@@ -1,8 +1,8 @@
 error: macro expansion ends with an incomplete expression: expected expression
-  --> $DIR/issue-68092-unicode-ident-after-incomplete-expr.rs:3:13
+  --> $DIR/issue-68092-unicode-ident-after-incomplete-expr.rs:8:9
    |
-LL |         $($c)ö*
-   |             ^ expected expression
+LL |     x!(!);
+   |         ^ expected expression
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/precondition-checks/out-of-bounds-get-unchecked.rs b/tests/ui/precondition-checks/out-of-bounds-get-unchecked.rs
index 7956d5e8743..77bec6aab7f 100644
--- a/tests/ui/precondition-checks/out-of-bounds-get-unchecked.rs
+++ b/tests/ui/precondition-checks/out-of-bounds-get-unchecked.rs
@@ -1,6 +1,6 @@
 //@ run-fail
 //@ compile-flags: -Copt-level=3 -Cdebug-assertions=yes
-//@ error-pattern: unsafe precondition(s) violated: hint::assert_unchecked
+//@ error-pattern: slice::get_unchecked requires
 //@ ignore-debug
 //@ ignore-wasm32-bare no panic messages
 
diff --git a/tests/ui/proc-macro/capture-macro-rules-invoke.stdout b/tests/ui/proc-macro/capture-macro-rules-invoke.stdout
index bbab08bca49..71e34119ba7 100644
--- a/tests/ui/proc-macro/capture-macro-rules-invoke.stdout
+++ b/tests/ui/proc-macro/capture-macro-rules-invoke.stdout
@@ -271,7 +271,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
                 span: $DIR/capture-macro-rules-invoke.rs:47:19: 47:20 (#0),
             },
         ],
-        span: $DIR/capture-macro-rules-invoke.rs:15:60: 15:63 (#0),
+        span: $DIR/capture-macro-rules-invoke.rs:47:13: 47:22 (#0),
     },
     Punct {
         ch: ',',
diff --git a/tests/ui/proc-macro/custom-attr-panic.rs b/tests/ui/proc-macro/custom-attr-panic.rs
new file mode 100644
index 00000000000..23bcb66319d
--- /dev/null
+++ b/tests/ui/proc-macro/custom-attr-panic.rs
@@ -0,0 +1,8 @@
+//@ aux-build: test-macros.rs
+
+extern crate test_macros;
+
+#[test_macros::panic_attr] //~ ERROR custom attribute panicked
+fn foo() {}
+
+fn main() {}
diff --git a/tests/ui/proc-macro/custom-attr-panic.stderr b/tests/ui/proc-macro/custom-attr-panic.stderr
new file mode 100644
index 00000000000..e436162bcc1
--- /dev/null
+++ b/tests/ui/proc-macro/custom-attr-panic.stderr
@@ -0,0 +1,10 @@
+error: custom attribute panicked
+  --> $DIR/custom-attr-panic.rs:5:1
+   |
+LL | #[test_macros::panic_attr]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: message: panic-attr
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/reify-intrinsic.rs b/tests/ui/reify-intrinsic.rs
index 00398d272be..6c52651f060 100644
--- a/tests/ui/reify-intrinsic.rs
+++ b/tests/ui/reify-intrinsic.rs
@@ -13,10 +13,9 @@ fn b() {
 }
 
 fn c() {
-    let _ = [
-        std::intrinsics::likely,
+    let _: [unsafe extern "rust-intrinsic" fn(bool) -> bool; 2] = [
+        std::intrinsics::likely, //~ ERROR cannot coerce
         std::intrinsics::unlikely,
-        //~^ ERROR cannot coerce
     ];
 }
 
diff --git a/tests/ui/reify-intrinsic.stderr b/tests/ui/reify-intrinsic.stderr
index 310b6c224e0..0119a1a6650 100644
--- a/tests/ui/reify-intrinsic.stderr
+++ b/tests/ui/reify-intrinsic.stderr
@@ -16,14 +16,13 @@ LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: cannot coerce intrinsics to function pointers
-  --> $DIR/reify-intrinsic.rs:18:9
+  --> $DIR/reify-intrinsic.rs:17:9
    |
-LL |         std::intrinsics::unlikely,
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
+LL |         std::intrinsics::likely,
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
    |
-   = note: expected fn item `extern "rust-intrinsic" fn(_) -> _ {likely}`
-              found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`
-   = note: different fn items have unique types, even if their signatures are the same
+   = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(_) -> _`
+                 found fn item `fn(_) -> _ {likely}`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr
index e72d259e8a5..f802841d2e4 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr
@@ -1,12 +1,3 @@
-error[E0015]: cannot call non-const fn `<i32 as Plus>::plus` in constant functions
-  --> $DIR/call-const-trait-method-pass.rs:36:7
-   |
-LL |     a.plus(b)
-   |       ^^^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = help: add `#![feature(effects)]` to the crate attributes to enable
-
 error[E0015]: cannot call non-const operator in constants
   --> $DIR/call-const-trait-method-pass.rs:39:22
    |
@@ -21,6 +12,15 @@ LL | impl const std::ops::Add for Int {
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(effects)]` to the crate attributes to enable
 
+error[E0015]: cannot call non-const fn `<i32 as Plus>::plus` in constant functions
+  --> $DIR/call-const-trait-method-pass.rs:36:7
+   |
+LL |     a.plus(b)
+   |       ^^^^^^^
+   |
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+   = help: add `#![feature(effects)]` to the crate attributes to enable
+
 error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr
index b66b27ad2bd..a225125ef53 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr
@@ -23,23 +23,23 @@ LL | const fn answer<F: ~const Fn() -> u8>(f: &F) -> u8 {
    |                           ^^^^^^^^^^
 
 error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closures.rs:12:5
+  --> $DIR/const-closures.rs:24:5
    |
-LL |     f() * 7
+LL |     f() + f()
    |     ^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(effects)]` to the crate attributes to enable
 help: consider further restricting this bound
    |
-LL |         F: ~const FnOnce() -> u8 + ~const std::ops::Fn<()>,
-   |                                  +++++++++++++++++++++++++
+LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 {
+   |                                      +++++++++++++++++++++++++
 
 error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closures.rs:24:5
+  --> $DIR/const-closures.rs:24:11
    |
 LL |     f() + f()
-   |     ^^^
+   |           ^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(effects)]` to the crate attributes to enable
@@ -49,17 +49,17 @@ LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u
    |                                      +++++++++++++++++++++++++
 
 error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closures.rs:24:11
+  --> $DIR/const-closures.rs:12:5
    |
-LL |     f() + f()
-   |           ^^^
+LL |     f() * 7
+   |     ^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(effects)]` to the crate attributes to enable
 help: consider further restricting this bound
    |
-LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 {
-   |                                      +++++++++++++++++++++++++
+LL |         F: ~const FnOnce() -> u8 + ~const std::ops::Fn<()>,
+   |                                  +++++++++++++++++++++++++
 
 error: aborting due to 7 previous errors
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
index 8997e7ade6c..9afa2072dde 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
@@ -4,6 +4,57 @@ error[E0493]: destructor of `T` cannot be evaluated at compile-time
 LL | const fn check<T: ~const Destruct>(_: T) {}
    |                                    ^ the destructor for this type cannot be evaluated in constant functions
 
-error: aborting due to 1 previous error
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+   |
+   = note: calling non-const function `<NonTrivialDrop as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<NonTrivialDrop> - shim(Some(NonTrivialDrop))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `check::<NonTrivialDrop>`
+  --> $DIR/const-drop-fail.rs:24:43
+   |
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                                           ^
+note: inside `_`
+  --> $DIR/const-drop-fail.rs:28:23
+   |
+LL |           const _: () = check($exp);
+   |                         ^^^^^^^^^^^
+...
+LL | / check_all! {
+LL | |     NonTrivialDrop,
+LL | |     ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+   | |_- in this macro invocation
+   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+   |
+   = note: calling non-const function `<ConstImplWithDropGlue as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<ConstImplWithDropGlue> - shim(Some(ConstImplWithDropGlue))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `check::<ConstImplWithDropGlue>`
+  --> $DIR/const-drop-fail.rs:24:43
+   |
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                                           ^
+note: inside `_`
+  --> $DIR/const-drop-fail.rs:28:23
+   |
+LL |           const _: () = check($exp);
+   |                         ^^^^^^^^^^^
+...
+LL | / check_all! {
+LL | |     NonTrivialDrop,
+LL | |     ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+   | |_- in this macro invocation
+   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0493`.
+Some errors have detailed explanations: E0080, E0493.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
index f166bdf6cec..5ff3be713a7 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
@@ -1,15 +1,92 @@
+error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
+  --> $DIR/const-drop.rs:24:13
+   |
+LL |     let _ = S(&mut c);
+   |             ^^^^^^^^^ the destructor for this type cannot be evaluated in constant functions
+
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+   |
+   = note: calling non-const function `<S<'_> as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<S<'_>> - shim(Some(S<'_>))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `b`
+  --> $DIR/const-drop.rs:24:22
+   |
+LL |     let _ = S(&mut c);
+   |                      ^
+note: inside `C`
+  --> $DIR/const-drop.rs:30:15
+   |
+LL | const C: u8 = b();
+   |               ^^^
+
 error[E0493]: destructor of `T` cannot be evaluated at compile-time
   --> $DIR/const-drop.rs:19:32
    |
 LL | const fn a<T: ~const Destruct>(_: T) {}
    |                                ^ the destructor for this type cannot be evaluated in constant functions
 
-error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
-  --> $DIR/const-drop.rs:24:13
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
-LL |     let _ = S(&mut c);
-   |             ^^^^^^^^^ the destructor for this type cannot be evaluated in constant functions
+   = note: calling non-const function `<t::ConstDrop as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<t::ConstDrop> - shim(Some(t::ConstDrop))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `a::<t::ConstDrop>`
+  --> $DIR/const-drop.rs:19:39
+   |
+LL | const fn a<T: ~const Destruct>(_: T) {}
+   |                                       ^
+note: inside `_`
+  --> $DIR/const-drop.rs:35:27
+   |
+LL |               const _: () = a($exp);
+   |                             ^^^^^^^
+...
+LL | / implements_const_drop! {
+LL | |     1u8,
+LL | |     2,
+LL | |     3.0,
+...  |
+LL | |     Result::<i32, !>::Ok(1),
+LL | | }
+   | |_- in this macro invocation
+   = note: this error originates in the macro `implements_const_drop` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+   |
+   = note: calling non-const function `<t::ConstDrop as Drop>::drop`
+   |
+note: inside `std::ptr::drop_in_place::<t::ConstDrop> - shim(Some(t::ConstDrop))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `std::ptr::drop_in_place::<t::HasConstDrop> - shim(Some(t::HasConstDrop))`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `a::<t::HasConstDrop>`
+  --> $DIR/const-drop.rs:19:39
+   |
+LL | const fn a<T: ~const Destruct>(_: T) {}
+   |                                       ^
+note: inside `_`
+  --> $DIR/const-drop.rs:35:27
+   |
+LL |               const _: () = a($exp);
+   |                             ^^^^^^^
+...
+LL | / implements_const_drop! {
+LL | |     1u8,
+LL | |     2,
+LL | |     3.0,
+...  |
+LL | |     Result::<i32, !>::Ok(1),
+LL | | }
+   | |_- in this macro invocation
+   = note: this error originates in the macro `implements_const_drop` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 2 previous errors
+error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0493`.
+Some errors have detailed explanations: E0080, E0493.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
index 23e36887025..40e39cbefbc 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
@@ -1,11 +1,3 @@
-error[E0493]: destructor of `T` cannot be evaluated at compile-time
-  --> $DIR/const-drop.rs:19:32
-   |
-LL | const fn a<T: ~const Destruct>(_: T) {}
-   |                                ^      - value is dropped here
-   |                                |
-   |                                the destructor for this type cannot be evaluated in constant functions
-
 error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
   --> $DIR/const-drop.rs:24:13
    |
@@ -14,6 +6,14 @@ LL |     let _ = S(&mut c);
    |             |
    |             the destructor for this type cannot be evaluated in constant functions
 
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-drop.rs:19:32
+   |
+LL | const fn a<T: ~const Destruct>(_: T) {}
+   |                                ^      - value is dropped here
+   |                                |
+   |                                the destructor for this type cannot be evaluated in constant functions
+
 error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed b/tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed
index 38d8a36bcdf..435857224ac 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed
@@ -111,10 +111,13 @@ mod everything_outside_with_tt_inner {
 mod everything_outside_with_tt_outer {
     macro_rules! m {
         ($b:lifetime $colon:tt $a:tt) => {
-            struct Foo<$a, $b >(&$a &$b ());
+            // FIXME: replacement span is corrupted due to a collision in metavar span table.
+            // struct Foo<$a, $b $colon $a>(&$a &$b ());
+            // ^ ERROR: outlives requirements can be inferred
+            struct Bar<$a, $b>(&$a &$b ()) ;
+            //~^ ERROR: outlives requirements can be inferred
+            struct Baz<$a, $b>(&$a &$b ()) where (): Sized, ;
             //~^ ERROR: outlives requirements can be inferred
-            struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a;
-            struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a;
         }
     }
     m!('b: 'a);
@@ -123,9 +126,10 @@ mod everything_outside_with_tt_outer {
 mod everything_outside_with_tt_both {
     macro_rules! m {
         ($b:tt $colon:tt $a:tt) => {
-            struct Foo<$a, $b >(&$a &$b ());
-            //~^ ERROR: outlives requirements can be inferred
-            struct Bar<$a, $b>(&$a &$b ()) where ;
+            // FIXME: replacement span is corrupted due to a collision in metavar span table.
+            // struct Foo<$a, $b $colon $a>(&$a &$b ());
+            // ^ ERROR: outlives requirements can be inferred
+            struct Bar<$a, $b>(&$a &$b ()) ;
             //~^ ERROR: outlives requirements can be inferred
             struct Baz<$a, $b>(&$a &$b ()) where (): Sized, ;
             //~^ ERROR: outlives requirements can be inferred
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs b/tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs
index 60eedf7b069..6c879231a16 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs
@@ -111,10 +111,13 @@ mod everything_outside_with_tt_inner {
 mod everything_outside_with_tt_outer {
     macro_rules! m {
         ($b:lifetime $colon:tt $a:tt) => {
-            struct Foo<$a, $b $colon $a>(&$a &$b ());
-            //~^ ERROR: outlives requirements can be inferred
+            // FIXME: replacement span is corrupted due to a collision in metavar span table.
+            // struct Foo<$a, $b $colon $a>(&$a &$b ());
+            // ^ ERROR: outlives requirements can be inferred
             struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a;
+            //~^ ERROR: outlives requirements can be inferred
             struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a;
+            //~^ ERROR: outlives requirements can be inferred
         }
     }
     m!('b: 'a);
@@ -123,8 +126,9 @@ mod everything_outside_with_tt_outer {
 mod everything_outside_with_tt_both {
     macro_rules! m {
         ($b:tt $colon:tt $a:tt) => {
-            struct Foo<$a, $b $colon $a>(&$a &$b ());
-            //~^ ERROR: outlives requirements can be inferred
+            // FIXME: replacement span is corrupted due to a collision in metavar span table.
+            // struct Foo<$a, $b $colon $a>(&$a &$b ());
+            // ^ ERROR: outlives requirements can be inferred
             struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a;
             //~^ ERROR: outlives requirements can be inferred
             struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a;
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr b/tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr
index 734ae687978..d684911be39 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr
+++ b/tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr
@@ -83,25 +83,40 @@ LL |     m!('b: 'a);
    = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: outlives requirements can be inferred
-  --> $DIR/edition-lint-infer-outlives-macro.rs:114:31
+  --> $DIR/edition-lint-infer-outlives-macro.rs:117:44
    |
-LL |             struct Foo<$a, $b $colon $a>(&$a &$b ());
-   |                               ^^^^^^^^^ help: remove this bound
+LL |             struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a;
+   |                                            ^^^^^^^^^^^^^^^^^^ help: remove this bound
+...
+LL |     m!('b: 'a);
+   |     ---------- in this macro invocation
+   |
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: outlives requirements can be inferred
-  --> $DIR/edition-lint-infer-outlives-macro.rs:126:31
+  --> $DIR/edition-lint-infer-outlives-macro.rs:119:61
+   |
+LL |             struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a;
+   |                                                             ^^^^^^^^^^^^ help: remove this bound
+...
+LL |     m!('b: 'a);
+   |     ---------- in this macro invocation
    |
-LL |             struct Foo<$a, $b $colon $a>(&$a &$b ());
-   |                               ^^^^^^^^^ help: remove this bound
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: outlives requirements can be inferred
-  --> $DIR/edition-lint-infer-outlives-macro.rs:128:50
+  --> $DIR/edition-lint-infer-outlives-macro.rs:132:44
    |
 LL |             struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a;
-   |                                                  ^^^^^^^^^^^^ help: remove this bound
+   |                                            ^^^^^^^^^^^^^^^^^^ help: remove this bound
+...
+LL |     m!('b: 'a);
+   |     ---------- in this macro invocation
+   |
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: outlives requirements can be inferred
-  --> $DIR/edition-lint-infer-outlives-macro.rs:130:61
+  --> $DIR/edition-lint-infer-outlives-macro.rs:134:61
    |
 LL |             struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a;
    |                                                             ^^^^^^^^^^^^ help: remove this bound
diff --git a/tests/ui/rust-2018/remove-extern-crate.fixed b/tests/ui/rust-2018/remove-extern-crate.fixed
index f025ccfeaeb..19b1dc6fb01 100644
--- a/tests/ui/rust-2018/remove-extern-crate.fixed
+++ b/tests/ui/rust-2018/remove-extern-crate.fixed
@@ -6,6 +6,7 @@
 
 #![warn(rust_2018_idioms)]
 #![allow(dropping_copy_types)]
+#![allow(unused_imports)]
 
  //~ WARNING unused extern crate
 // Shouldn't suggest changing to `use`, as `another_name`
diff --git a/tests/ui/rust-2018/remove-extern-crate.rs b/tests/ui/rust-2018/remove-extern-crate.rs
index 0312964d5f6..88ef858da14 100644
--- a/tests/ui/rust-2018/remove-extern-crate.rs
+++ b/tests/ui/rust-2018/remove-extern-crate.rs
@@ -6,6 +6,7 @@
 
 #![warn(rust_2018_idioms)]
 #![allow(dropping_copy_types)]
+#![allow(unused_imports)]
 
 extern crate core; //~ WARNING unused extern crate
 // Shouldn't suggest changing to `use`, as `another_name`
diff --git a/tests/ui/rust-2018/remove-extern-crate.stderr b/tests/ui/rust-2018/remove-extern-crate.stderr
index f752cac8ed6..020db9975c0 100644
--- a/tests/ui/rust-2018/remove-extern-crate.stderr
+++ b/tests/ui/rust-2018/remove-extern-crate.stderr
@@ -1,5 +1,5 @@
 warning: unused extern crate
-  --> $DIR/remove-extern-crate.rs:10:1
+  --> $DIR/remove-extern-crate.rs:11:1
    |
 LL | extern crate core;
    | ^^^^^^^^^^^^^^^^^^ help: remove it
@@ -12,7 +12,7 @@ LL | #![warn(rust_2018_idioms)]
    = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]`
 
 warning: `extern crate` is not idiomatic in the new edition
-  --> $DIR/remove-extern-crate.rs:34:5
+  --> $DIR/remove-extern-crate.rs:35:5
    |
 LL |     extern crate core;
    |     ^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL |     use core;
    |     ~~~
 
 warning: `extern crate` is not idiomatic in the new edition
-  --> $DIR/remove-extern-crate.rs:44:5
+  --> $DIR/remove-extern-crate.rs:45:5
    |
 LL |     pub extern crate core;
    |     ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rust-2024/prelude2024.rs b/tests/ui/rust-2024/prelude2024.rs
new file mode 100644
index 00000000000..e58ebe74188
--- /dev/null
+++ b/tests/ui/rust-2024/prelude2024.rs
@@ -0,0 +1,9 @@
+//@ check-pass
+//@ compile-flags: -Zunstable-options
+//@ edition:2024
+
+fn main() {
+    fut(async {}.into_future(), async {});
+}
+
+fn fut(_: impl Future, _: impl IntoFuture) {}
diff --git a/tests/ui/span/macro-span-replacement.rs b/tests/ui/span/macro-span-replacement.rs
index e6fcfa4c709..16f4018cf3e 100644
--- a/tests/ui/span/macro-span-replacement.rs
+++ b/tests/ui/span/macro-span-replacement.rs
@@ -4,10 +4,10 @@
 
 macro_rules! m {
     ($a:tt $b:tt) => {
-        $b $a; //~ WARN struct `S` is never constructed
+        $b $a;
     }
 }
 
 fn main() {
-    m!(S struct);
+    m!(S struct); //~ WARN struct `S` is never constructed
 }
diff --git a/tests/ui/span/macro-span-replacement.stderr b/tests/ui/span/macro-span-replacement.stderr
index 5dd56342889..6248db112f8 100644
--- a/tests/ui/span/macro-span-replacement.stderr
+++ b/tests/ui/span/macro-span-replacement.stderr
@@ -1,11 +1,8 @@
 warning: struct `S` is never constructed
-  --> $DIR/macro-span-replacement.rs:7:12
+  --> $DIR/macro-span-replacement.rs:12:8
    |
-LL |         $b $a;
-   |            ^^
-...
 LL |     m!(S struct);
-   |     ------------ in this macro invocation
+   |        ^
    |
 note: the lint level is defined here
   --> $DIR/macro-span-replacement.rs:3:9
diff --git a/tests/ui/static/reference-of-mut-static-safe.e2021.stderr b/tests/ui/static/reference-of-mut-static-safe.e2021.stderr
deleted file mode 100644
index 16f47ace3a9..00000000000
--- a/tests/ui/static/reference-of-mut-static-safe.e2021.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-warning: shared reference of mutable static is discouraged
-  --> $DIR/reference-of-mut-static-safe.rs:9:14
-   |
-LL |     let _x = &X;
-   |              ^^ shared reference of mutable static
-   |
-   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
-   |
-LL |     let _x = addr_of!(X);
-   |              ~~~~~~~~~~~
-
-error[E0133]: use of mutable static is unsafe and requires unsafe function or block
-  --> $DIR/reference-of-mut-static-safe.rs:9:15
-   |
-LL |     let _x = &X;
-   |               ^ use of mutable static
-   |
-   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
-
-error: aborting due to 1 previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/static/reference-of-mut-static-safe.e2024.stderr b/tests/ui/static/reference-of-mut-static-safe.e2024.stderr
deleted file mode 100644
index 53f81179de5..00000000000
--- a/tests/ui/static/reference-of-mut-static-safe.e2024.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0796]: reference of mutable static is disallowed
-  --> $DIR/reference-of-mut-static-safe.rs:9:14
-   |
-LL |     let _x = &X;
-   |              ^^ reference of mutable static
-   |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
-   |
-LL |     let _x = addr_of!(X);
-   |              ~~~~~~~~~~~
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-of-mut-static-unsafe-fn.rs b/tests/ui/static/reference-of-mut-static-unsafe-fn.rs
index 8f3b3eb7745..5652703a271 100644
--- a/tests/ui/static/reference-of-mut-static-unsafe-fn.rs
+++ b/tests/ui/static/reference-of-mut-static-unsafe-fn.rs
@@ -7,17 +7,20 @@ unsafe fn _foo() {
     static mut Y: i32 = 1;
 
     let _y = &X;
-    //~^ ERROR reference of mutable static is disallowed
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
 
     let ref _a = X;
-    //~^ ERROR reference of mutable static is disallowed
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
 
-    let (_b, _c) = (&X, &Y);
-    //~^ ERROR reference of mutable static is disallowed
-    //~^^ ERROR reference of mutable static is disallowed
+    let ref mut _a = X;
+    //~^ ERROR creating a mutable reference to a mutable static [E0796]
+
+    let (_b, _c) = (&X, &mut Y);
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
+    //~^^ ERROR creating a mutable reference to a mutable static [E0796]
 
     foo(&X);
-    //~^ ERROR reference of mutable static is disallowed
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
 }
 
 fn foo<'a>(_x: &'a i32) {}
diff --git a/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr b/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr
index 5c6fdedfa96..5675d313e07 100644
--- a/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr
+++ b/tests/ui/static/reference-of-mut-static-unsafe-fn.stderr
@@ -1,63 +1,75 @@
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static-unsafe-fn.rs:9:14
    |
 LL |     let _y = &X;
-   |              ^^ reference of mutable static
+   |              ^^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     let _y = addr_of!(X);
    |              ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static-unsafe-fn.rs:12:18
    |
 LL |     let ref _a = X;
-   |                  ^ reference of mutable static
+   |                  ^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     let ref _a = addr_of!(X);
    |                  ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
-  --> $DIR/reference-of-mut-static-unsafe-fn.rs:15:21
+error[E0796]: creating a mutable reference to a mutable static
+  --> $DIR/reference-of-mut-static-unsafe-fn.rs:15:22
    |
-LL |     let (_b, _c) = (&X, &Y);
-   |                     ^^ reference of mutable static
+LL |     let ref mut _a = X;
+   |                      ^ mutable reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
-LL |     let (_b, _c) = (addr_of!(X), &Y);
+LL |     let ref mut _a = addr_of_mut!(X);
+   |                      ~~~~~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-of-mut-static-unsafe-fn.rs:18:21
+   |
+LL |     let (_b, _c) = (&X, &mut Y);
+   |                     ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     let (_b, _c) = (addr_of!(X), &mut Y);
    |                     ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
-  --> $DIR/reference-of-mut-static-unsafe-fn.rs:15:25
+error[E0796]: creating a mutable reference to a mutable static
+  --> $DIR/reference-of-mut-static-unsafe-fn.rs:18:25
    |
-LL |     let (_b, _c) = (&X, &Y);
-   |                         ^^ reference of mutable static
+LL |     let (_b, _c) = (&X, &mut Y);
+   |                         ^^^^^^ mutable reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
-LL |     let (_b, _c) = (&X, addr_of!(Y));
-   |                         ~~~~~~~~~~~
+LL |     let (_b, _c) = (&X, addr_of_mut!(Y));
+   |                         ~~~~~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
-  --> $DIR/reference-of-mut-static-unsafe-fn.rs:19:9
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-of-mut-static-unsafe-fn.rs:22:9
    |
 LL |     foo(&X);
-   |         ^^ reference of mutable static
+   |         ^^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     foo(addr_of!(X));
    |         ~~~~~~~~~~~
 
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-of-mut-static.e2021.stderr b/tests/ui/static/reference-of-mut-static.e2021.stderr
index 77a6b3d304b..f7ad51b6157 100644
--- a/tests/ui/static/reference-of-mut-static.e2021.stderr
+++ b/tests/ui/static/reference-of-mut-static.e2021.stderr
@@ -1,88 +1,88 @@
-error: shared reference of mutable static is discouraged
+error: creating a shared reference to mutable static is discouraged
   --> $DIR/reference-of-mut-static.rs:16:18
    |
 LL |         let _y = &X;
-   |                  ^^ shared reference of mutable static
+   |                  ^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
 note: the lint level is defined here
   --> $DIR/reference-of-mut-static.rs:6:9
    |
-LL | #![deny(static_mut_ref)]
-   |         ^^^^^^^^^^^^^^
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+LL | #![deny(static_mut_refs)]
+   |         ^^^^^^^^^^^^^^^
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let _y = addr_of!(X);
    |                  ~~~~~~~~~~~
 
-error: mutable reference of mutable static is discouraged
+error: creating a mutable reference to mutable static is discouraged
   --> $DIR/reference-of-mut-static.rs:20:18
    |
 LL |         let _y = &mut X;
-   |                  ^^^^^^ mutable reference of mutable static
+   |                  ^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |         let _y = addr_of_mut!(X);
    |                  ~~~~~~~~~~~~~~~
 
-error: shared reference of mutable static is discouraged
+error: creating a shared reference to mutable static is discouraged
   --> $DIR/reference-of-mut-static.rs:28:22
    |
 LL |         let ref _a = X;
-   |                      ^ shared reference of mutable static
+   |                      ^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let ref _a = addr_of!(X);
    |                      ~~~~~~~~~~~
 
-error: shared reference of mutable static is discouraged
+error: creating a shared reference to mutable static is discouraged
   --> $DIR/reference-of-mut-static.rs:32:25
    |
 LL |         let (_b, _c) = (&X, &Y);
-   |                         ^^ shared reference of mutable static
+   |                         ^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let (_b, _c) = (addr_of!(X), &Y);
    |                         ~~~~~~~~~~~
 
-error: shared reference of mutable static is discouraged
+error: creating a shared reference to mutable static is discouraged
   --> $DIR/reference-of-mut-static.rs:32:29
    |
 LL |         let (_b, _c) = (&X, &Y);
-   |                             ^^ shared reference of mutable static
+   |                             ^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let (_b, _c) = (&X, addr_of!(Y));
    |                             ~~~~~~~~~~~
 
-error: shared reference of mutable static is discouraged
+error: creating a shared reference to mutable static is discouraged
   --> $DIR/reference-of-mut-static.rs:38:13
    |
 LL |         foo(&X);
-   |             ^^ shared reference of mutable static
+   |             ^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         foo(addr_of!(X));
    |             ~~~~~~~~~~~
diff --git a/tests/ui/static/reference-of-mut-static.e2024.stderr b/tests/ui/static/reference-of-mut-static.e2024.stderr
index f445ec65a5d..6205c10ac41 100644
--- a/tests/ui/static/reference-of-mut-static.e2024.stderr
+++ b/tests/ui/static/reference-of-mut-static.e2024.stderr
@@ -1,71 +1,71 @@
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static.rs:16:18
    |
 LL |         let _y = &X;
-   |                  ^^ reference of mutable static
+   |                  ^^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let _y = addr_of!(X);
    |                  ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a mutable reference to a mutable static
   --> $DIR/reference-of-mut-static.rs:20:18
    |
 LL |         let _y = &mut X;
-   |                  ^^^^^^ reference of mutable static
+   |                  ^^^^^^ mutable reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |         let _y = addr_of_mut!(X);
    |                  ~~~~~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static.rs:28:22
    |
 LL |         let ref _a = X;
-   |                      ^ reference of mutable static
+   |                      ^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let ref _a = addr_of!(X);
    |                      ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static.rs:32:25
    |
 LL |         let (_b, _c) = (&X, &Y);
-   |                         ^^ reference of mutable static
+   |                         ^^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let (_b, _c) = (addr_of!(X), &Y);
    |                         ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static.rs:32:29
    |
 LL |         let (_b, _c) = (&X, &Y);
-   |                             ^^ reference of mutable static
+   |                             ^^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         let (_b, _c) = (&X, addr_of!(Y));
    |                             ~~~~~~~~~~~
 
-error[E0796]: reference of mutable static is disallowed
+error[E0796]: creating a shared reference to a mutable static
   --> $DIR/reference-of-mut-static.rs:38:13
    |
 LL |         foo(&X);
-   |             ^^ reference of mutable static
+   |             ^^ shared reference to mutable static
    |
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |         foo(addr_of!(X));
    |             ~~~~~~~~~~~
diff --git a/tests/ui/static/reference-of-mut-static.rs b/tests/ui/static/reference-of-mut-static.rs
index 166303f0257..af2cab7dd87 100644
--- a/tests/ui/static/reference-of-mut-static.rs
+++ b/tests/ui/static/reference-of-mut-static.rs
@@ -3,7 +3,7 @@
 //@ [e2021] edition:2021
 //@ [e2024] compile-flags: --edition 2024 -Z unstable-options
 
-#![deny(static_mut_ref)]
+#![deny(static_mut_refs)]
 
 use std::ptr::{addr_of, addr_of_mut};
 
@@ -14,30 +14,30 @@ fn main() {
 
     unsafe {
         let _y = &X;
-        //[e2024]~^ ERROR reference of mutable static is disallowed
-        //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref]
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
 
         let _y = &mut X;
-        //[e2024]~^ ERROR reference of mutable static is disallowed
-        //[e2021]~^^ ERROR mutable reference of mutable static is discouraged [static_mut_ref]
+        //[e2024]~^ ERROR creating a mutable reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR mutable reference to mutable static is discouraged [static_mut_refs]
 
         let _z = addr_of_mut!(X);
 
         let _p = addr_of!(X);
 
         let ref _a = X;
-        //[e2024]~^ ERROR reference of mutable static is disallowed
-        //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref]
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
 
         let (_b, _c) = (&X, &Y);
-        //[e2024]~^ ERROR reference of mutable static is disallowed
-        //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref]
-        //[e2024]~^^^ ERROR reference of mutable static is disallowed
-        //[e2021]~^^^^ ERROR shared reference of mutable static is discouraged [static_mut_ref]
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
 
         foo(&X);
-        //[e2024]~^ ERROR reference of mutable static is disallowed
-        //[e2021]~^^ ERROR shared reference of mutable static is discouraged [static_mut_ref]
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
 
         static mut Z: &[i32; 3] = &[0, 1, 2];
 
diff --git a/tests/ui/static/reference-to-mut-static-safe.e2021.stderr b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr
new file mode 100644
index 00000000000..9ea34290e36
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static-safe.e2021.stderr
@@ -0,0 +1,26 @@
+warning: creating a shared reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static-safe.rs:9:14
+   |
+LL |     let _x = &X;
+   |              ^^ shared reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     let _x = addr_of!(X);
+   |              ~~~~~~~~~~~
+
+error[E0133]: use of mutable static is unsafe and requires unsafe function or block
+  --> $DIR/reference-to-mut-static-safe.rs:9:15
+   |
+LL |     let _x = &X;
+   |               ^ use of mutable static
+   |
+   = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
+
+error: aborting due to 1 previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/static/reference-to-mut-static-safe.e2024.stderr b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr
new file mode 100644
index 00000000000..607c1bba135
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static-safe.e2024.stderr
@@ -0,0 +1,15 @@
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static-safe.rs:9:14
+   |
+LL |     let _x = &X;
+   |              ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     let _x = addr_of!(X);
+   |              ~~~~~~~~~~~
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-of-mut-static-safe.rs b/tests/ui/static/reference-to-mut-static-safe.rs
index d113d0ee48d..de4f4be8f76 100644
--- a/tests/ui/static/reference-of-mut-static-safe.rs
+++ b/tests/ui/static/reference-to-mut-static-safe.rs
@@ -7,7 +7,7 @@ fn main() {
     static mut X: i32 = 1;
 
     let _x = &X;
-    //[e2024]~^ reference of mutable static is disallowed [E0796]
+    //[e2024]~^ creating a shared reference to a mutable static [E0796]
     //[e2021]~^^ use of mutable static is unsafe and requires unsafe function or block [E0133]
-    //[e2021]~^^^ shared reference of mutable static is discouraged [static_mut_ref]
+    //[e2021]~^^^ shared reference to mutable static is discouraged [static_mut_refs]
 }
diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.rs b/tests/ui/static/reference-to-mut-static-unsafe-fn.rs
new file mode 100644
index 00000000000..5652703a271
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static-unsafe-fn.rs
@@ -0,0 +1,26 @@
+//@ compile-flags: --edition 2024 -Z unstable-options
+
+fn main() {}
+
+unsafe fn _foo() {
+    static mut X: i32 = 1;
+    static mut Y: i32 = 1;
+
+    let _y = &X;
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
+
+    let ref _a = X;
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
+
+    let ref mut _a = X;
+    //~^ ERROR creating a mutable reference to a mutable static [E0796]
+
+    let (_b, _c) = (&X, &mut Y);
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
+    //~^^ ERROR creating a mutable reference to a mutable static [E0796]
+
+    foo(&X);
+    //~^ ERROR creating a shared reference to a mutable static [E0796]
+}
+
+fn foo<'a>(_x: &'a i32) {}
diff --git a/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr
new file mode 100644
index 00000000000..77d2aa5d1ae
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static-unsafe-fn.stderr
@@ -0,0 +1,75 @@
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static-unsafe-fn.rs:9:14
+   |
+LL |     let _y = &X;
+   |              ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     let _y = addr_of!(X);
+   |              ~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static-unsafe-fn.rs:12:18
+   |
+LL |     let ref _a = X;
+   |                  ^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     let ref _a = addr_of!(X);
+   |                  ~~~~~~~~~~~
+
+error[E0796]: creating a mutable reference to a mutable static
+  --> $DIR/reference-to-mut-static-unsafe-fn.rs:15:22
+   |
+LL |     let ref mut _a = X;
+   |                      ^ mutable reference to mutable static
+   |
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
+   |
+LL |     let ref mut _a = addr_of_mut!(X);
+   |                      ~~~~~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static-unsafe-fn.rs:18:21
+   |
+LL |     let (_b, _c) = (&X, &mut Y);
+   |                     ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     let (_b, _c) = (addr_of!(X), &mut Y);
+   |                     ~~~~~~~~~~~
+
+error[E0796]: creating a mutable reference to a mutable static
+  --> $DIR/reference-to-mut-static-unsafe-fn.rs:18:25
+   |
+LL |     let (_b, _c) = (&X, &mut Y);
+   |                         ^^^^^^ mutable reference to mutable static
+   |
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
+   |
+LL |     let (_b, _c) = (&X, addr_of_mut!(Y));
+   |                         ~~~~~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static-unsafe-fn.rs:22:9
+   |
+LL |     foo(&X);
+   |         ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |     foo(addr_of!(X));
+   |         ~~~~~~~~~~~
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-to-mut-static.e2021.stderr b/tests/ui/static/reference-to-mut-static.e2021.stderr
new file mode 100644
index 00000000000..f477e5ac6c5
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static.e2021.stderr
@@ -0,0 +1,91 @@
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static.rs:16:18
+   |
+LL |         let _y = &X;
+   |                  ^^ shared reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+note: the lint level is defined here
+  --> $DIR/reference-to-mut-static.rs:6:9
+   |
+LL | #![deny(static_mut_refs)]
+   |         ^^^^^^^^^^^^^^^
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let _y = addr_of!(X);
+   |                  ~~~~~~~~~~~
+
+error: creating a mutable reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static.rs:20:18
+   |
+LL |         let _y = &mut X;
+   |                  ^^^^^^ mutable reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
+   |
+LL |         let _y = addr_of_mut!(X);
+   |                  ~~~~~~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static.rs:28:22
+   |
+LL |         let ref _a = X;
+   |                      ^ shared reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let ref _a = addr_of!(X);
+   |                      ~~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static.rs:32:25
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                         ^^ shared reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (addr_of!(X), &Y);
+   |                         ~~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static.rs:32:29
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                             ^^ shared reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (&X, addr_of!(Y));
+   |                             ~~~~~~~~~~~
+
+error: creating a shared reference to mutable static is discouraged
+  --> $DIR/reference-to-mut-static.rs:38:13
+   |
+LL |         foo(&X);
+   |             ^^ shared reference to mutable static
+   |
+   = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         foo(addr_of!(X));
+   |             ~~~~~~~~~~~
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/static/reference-to-mut-static.e2024.stderr b/tests/ui/static/reference-to-mut-static.e2024.stderr
new file mode 100644
index 00000000000..b18e214e84f
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static.e2024.stderr
@@ -0,0 +1,75 @@
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static.rs:16:18
+   |
+LL |         let _y = &X;
+   |                  ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let _y = addr_of!(X);
+   |                  ~~~~~~~~~~~
+
+error[E0796]: creating a mutable reference to a mutable static
+  --> $DIR/reference-to-mut-static.rs:20:18
+   |
+LL |         let _y = &mut X;
+   |                  ^^^^^^ mutable reference to mutable static
+   |
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
+   |
+LL |         let _y = addr_of_mut!(X);
+   |                  ~~~~~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static.rs:28:22
+   |
+LL |         let ref _a = X;
+   |                      ^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let ref _a = addr_of!(X);
+   |                      ~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static.rs:32:25
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                         ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (addr_of!(X), &Y);
+   |                         ~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static.rs:32:29
+   |
+LL |         let (_b, _c) = (&X, &Y);
+   |                             ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         let (_b, _c) = (&X, addr_of!(Y));
+   |                             ~~~~~~~~~~~
+
+error[E0796]: creating a shared reference to a mutable static
+  --> $DIR/reference-to-mut-static.rs:38:13
+   |
+LL |         foo(&X);
+   |             ^^ shared reference to mutable static
+   |
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
+   |
+LL |         foo(addr_of!(X));
+   |             ~~~~~~~~~~~
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0796`.
diff --git a/tests/ui/static/reference-to-mut-static.rs b/tests/ui/static/reference-to-mut-static.rs
new file mode 100644
index 00000000000..af2cab7dd87
--- /dev/null
+++ b/tests/ui/static/reference-to-mut-static.rs
@@ -0,0 +1,50 @@
+//@ revisions: e2021 e2024
+
+//@ [e2021] edition:2021
+//@ [e2024] compile-flags: --edition 2024 -Z unstable-options
+
+#![deny(static_mut_refs)]
+
+use std::ptr::{addr_of, addr_of_mut};
+
+fn main() {
+    static mut X: i32 = 1;
+
+    static mut Y: i32 = 1;
+
+    unsafe {
+        let _y = &X;
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        let _y = &mut X;
+        //[e2024]~^ ERROR creating a mutable reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR mutable reference to mutable static is discouraged [static_mut_refs]
+
+        let _z = addr_of_mut!(X);
+
+        let _p = addr_of!(X);
+
+        let ref _a = X;
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        let (_b, _c) = (&X, &Y);
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+        //[e2024]~^^^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        foo(&X);
+        //[e2024]~^ ERROR creating a shared reference to a mutable static [E0796]
+        //[e2021]~^^ ERROR shared reference to mutable static is discouraged [static_mut_refs]
+
+        static mut Z: &[i32; 3] = &[0, 1, 2];
+
+        let _ = Z.len();
+        let _ = Z[0];
+        let _ = format!("{:?}", Z);
+    }
+}
+
+fn foo<'a>(_x: &'a i32) {}
diff --git a/tests/ui/static/safe-extern-statics-mut.rs b/tests/ui/static/safe-extern-statics-mut.rs
index 8aa0b47a311..05a1bee8891 100644
--- a/tests/ui/static/safe-extern-statics-mut.rs
+++ b/tests/ui/static/safe-extern-statics-mut.rs
@@ -10,8 +10,8 @@ extern "C" {
 fn main() {
     let b = B; //~ ERROR use of mutable static is unsafe
     let rb = &B; //~ ERROR use of mutable static is unsafe
-    //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
     let xb = XB; //~ ERROR use of mutable static is unsafe
     let xrb = &XB; //~ ERROR use of mutable static is unsafe
-    //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
 }
diff --git a/tests/ui/static/safe-extern-statics-mut.stderr b/tests/ui/static/safe-extern-statics-mut.stderr
index eda353ce673..9a4b651405f 100644
--- a/tests/ui/static/safe-extern-statics-mut.stderr
+++ b/tests/ui/static/safe-extern-statics-mut.stderr
@@ -1,28 +1,28 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/safe-extern-statics-mut.rs:12:14
    |
 LL |     let rb = &B;
-   |              ^^ shared reference of mutable static
+   |              ^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     let rb = addr_of!(B);
    |              ~~~~~~~~~~~
 
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/safe-extern-statics-mut.rs:15:15
    |
 LL |     let xrb = &XB;
-   |               ^^^ shared reference of mutable static
+   |               ^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     let xrb = addr_of!(XB);
    |               ~~~~~~~~~~~~
diff --git a/tests/ui/static/static-drop-scope.stderr b/tests/ui/static/static-drop-scope.stderr
index 2c55161628f..24658bc601e 100644
--- a/tests/ui/static/static-drop-scope.stderr
+++ b/tests/ui/static/static-drop-scope.stderr
@@ -30,6 +30,22 @@ LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1;
    |                           |
    |                           the destructor for this type cannot be evaluated in constants
 
+error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
+  --> $DIR/static-drop-scope.rs:27:34
+   |
+LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
+   |                                  ^^^^^^^^^^^^^^^^^^^ - value is dropped here
+   |                                  |
+   |                                  the destructor for this type cannot be evaluated in constants
+
+error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
+  --> $DIR/static-drop-scope.rs:32:43
+   |
+LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
+   |                                           ^^^^^^^^^^^ - value is dropped here
+   |                                           |
+   |                                           the destructor for this type cannot be evaluated in constants
+
 error[E0493]: destructor of `T` cannot be evaluated at compile-time
   --> $DIR/static-drop-scope.rs:19:24
    |
@@ -47,22 +63,6 @@ LL |
 LL | }
    | - value is dropped here
 
-error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
-  --> $DIR/static-drop-scope.rs:27:34
-   |
-LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
-   |                                  ^^^^^^^^^^^^^^^^^^^ - value is dropped here
-   |                                  |
-   |                                  the destructor for this type cannot be evaluated in constants
-
-error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
-  --> $DIR/static-drop-scope.rs:32:43
-   |
-LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
-   |                                           ^^^^^^^^^^^ - value is dropped here
-   |                                           |
-   |                                           the destructor for this type cannot be evaluated in constants
-
 error: aborting due to 8 previous errors
 
 For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/statics/issue-14227.rs b/tests/ui/statics/issue-14227.rs
index a1fde14600a..8a70f51d3b4 100644
--- a/tests/ui/statics/issue-14227.rs
+++ b/tests/ui/statics/issue-14227.rs
@@ -3,5 +3,6 @@ extern "C" {
 }
 static CRASH: u32 = symbol;
 //~^ ERROR use of extern static is unsafe and requires
+//~| ERROR could not evaluate static initializer
 
 fn main() {}
diff --git a/tests/ui/statics/issue-14227.stderr b/tests/ui/statics/issue-14227.stderr
index 085d6df9c41..0aeb973bff3 100644
--- a/tests/ui/statics/issue-14227.stderr
+++ b/tests/ui/statics/issue-14227.stderr
@@ -1,3 +1,9 @@
+error[E0080]: could not evaluate static initializer
+  --> $DIR/issue-14227.rs:4:21
+   |
+LL | static CRASH: u32 = symbol;
+   |                     ^^^^^^ cannot access extern static (DefId(0:4 ~ issue_14227[1133]::{extern#0}::symbol))
+
 error[E0133]: use of extern static is unsafe and requires unsafe function or block
   --> $DIR/issue-14227.rs:4:21
    |
@@ -6,6 +12,7 @@ LL | static CRASH: u32 = symbol;
    |
    = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0133`.
+Some errors have detailed explanations: E0080, E0133.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/statics/issue-15261.rs b/tests/ui/statics/issue-15261.rs
index 71eeb2a6d26..e168abce078 100644
--- a/tests/ui/statics/issue-15261.rs
+++ b/tests/ui/statics/issue-15261.rs
@@ -7,6 +7,6 @@
 static mut n_mut: usize = 0;
 
 static n: &'static usize = unsafe { &n_mut };
-//~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+//~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
 
 fn main() {}
diff --git a/tests/ui/statics/issue-15261.stderr b/tests/ui/statics/issue-15261.stderr
index 72d88ce1b38..c31793f3d8f 100644
--- a/tests/ui/statics/issue-15261.stderr
+++ b/tests/ui/statics/issue-15261.stderr
@@ -1,14 +1,14 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/issue-15261.rs:9:37
    |
 LL | static n: &'static usize = unsafe { &n_mut };
-   |                                     ^^^^^^ shared reference of mutable static
+   |                                     ^^^^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL | static n: &'static usize = unsafe { addr_of!(n_mut) };
    |                                     ~~~~~~~~~~~~~~~
diff --git a/tests/ui/statics/static-mut-xc.rs b/tests/ui/statics/static-mut-xc.rs
index 75a4faed83d..a772d4151f7 100644
--- a/tests/ui/statics/static-mut-xc.rs
+++ b/tests/ui/statics/static-mut-xc.rs
@@ -26,9 +26,9 @@ unsafe fn run() {
     static_mut_xc::a = -3;
     assert_eq!(static_mut_xc::a, -3);
     static_bound(&static_mut_xc::a);
-    //~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
     static_bound_set(&mut static_mut_xc::a);
-    //~^ WARN mutable reference of mutable static is discouraged [static_mut_ref]
+    //~^ WARN mutable reference to mutable static is discouraged [static_mut_refs]
 }
 
 pub fn main() {
diff --git a/tests/ui/statics/static-mut-xc.stderr b/tests/ui/statics/static-mut-xc.stderr
index 37aa336bc50..d381328c071 100644
--- a/tests/ui/statics/static-mut-xc.stderr
+++ b/tests/ui/statics/static-mut-xc.stderr
@@ -1,28 +1,28 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/static-mut-xc.rs:28:18
    |
 LL |     static_bound(&static_mut_xc::a);
-   |                  ^^^^^^^^^^^^^^^^^ shared reference of mutable static
+   |                  ^^^^^^^^^^^^^^^^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL |     static_bound(addr_of!(static_mut_xc::a));
    |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-warning: mutable reference of mutable static is discouraged
+warning: creating a mutable reference to mutable static is discouraged
   --> $DIR/static-mut-xc.rs:30:22
    |
 LL |     static_bound_set(&mut static_mut_xc::a);
-   |                      ^^^^^^^^^^^^^^^^^^^^^ mutable reference of mutable static
+   |                      ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-help: mutable references are dangerous since if there's any other pointer or reference used for that static while the reference lives, that's UB; use `addr_of_mut!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this mutable reference has lifetime `'static`, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
+help: use `addr_of_mut!` instead to create a raw pointer
    |
 LL |     static_bound_set(addr_of_mut!(static_mut_xc::a));
    |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/statics/static-recursive.rs b/tests/ui/statics/static-recursive.rs
index f504e2a79f0..29b80818b7d 100644
--- a/tests/ui/statics/static-recursive.rs
+++ b/tests/ui/statics/static-recursive.rs
@@ -1,7 +1,7 @@
 //@ run-pass
 
 static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 };
-//~^ WARN shared reference of mutable static is discouraged [static_mut_ref]
+//~^ WARN shared reference to mutable static is discouraged [static_mut_refs]
 
 struct StaticDoubleLinked {
     prev: &'static StaticDoubleLinked,
diff --git a/tests/ui/statics/static-recursive.stderr b/tests/ui/statics/static-recursive.stderr
index 15888e5c68d..cd285c6c2a4 100644
--- a/tests/ui/statics/static-recursive.stderr
+++ b/tests/ui/statics/static-recursive.stderr
@@ -1,14 +1,14 @@
-warning: shared reference of mutable static is discouraged
+warning: creating a shared reference to mutable static is discouraged
   --> $DIR/static-recursive.rs:3:36
    |
 LL | static mut S: *const u8 = unsafe { &S as *const *const u8 as *const u8 };
-   |                                    ^^ shared reference of mutable static
+   |                                    ^^ shared reference to mutable static
    |
    = note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447>
-   = note: reference of mutable static is a hard error from 2024 edition
-   = note: mutable statics can be written to by multiple threads: aliasing violations or data races will cause undefined behavior
-   = note: `#[warn(static_mut_ref)]` on by default
-help: shared references are dangerous since if there's any kind of mutation of that static while the reference lives, that's UB; use `addr_of!` instead to create a raw pointer
+   = note: this will be a hard error in the 2024 edition
+   = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior
+   = note: `#[warn(static_mut_refs)]` on by default
+help: use `addr_of!` instead to create a raw pointer
    |
 LL | static mut S: *const u8 = unsafe { addr_of!(S) as *const *const u8 as *const u8 };
    |                                    ~~~~~~~~~~~
diff --git a/tests/ui/statics/uninhabited-static.rs b/tests/ui/statics/uninhabited-static.rs
index f5c6f444317..a0f83f45079 100644
--- a/tests/ui/statics/uninhabited-static.rs
+++ b/tests/ui/statics/uninhabited-static.rs
@@ -12,10 +12,8 @@ extern {
 static VOID2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
 //~| WARN: previously accepted
 //~| ERROR could not evaluate static initializer
-//~| WARN: type `Void` does not permit zero-initialization
 static NEVER2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type
 //~| WARN: previously accepted
 //~| ERROR could not evaluate static initializer
-//~| WARN: type `Void` does not permit zero-initialization
 
 fn main() {}
diff --git a/tests/ui/statics/uninhabited-static.stderr b/tests/ui/statics/uninhabited-static.stderr
index 9260930473f..f891c0ce25b 100644
--- a/tests/ui/statics/uninhabited-static.stderr
+++ b/tests/ui/statics/uninhabited-static.stderr
@@ -34,7 +34,7 @@ LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
    = note: uninhabited statics cannot be initialized, and any access would be an immediate error
 
 error: static of uninhabited type
-  --> $DIR/uninhabited-static.rs:16:1
+  --> $DIR/uninhabited-static.rs:15:1
    |
 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
    | ^^^^^^^^^^^^^^^^^^^
@@ -49,37 +49,12 @@ error[E0080]: could not evaluate static initializer
 LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Void`
 
-warning: the type `Void` does not permit zero-initialization
-  --> $DIR/uninhabited-static.rs:12:31
-   |
-LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
-   |                               ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
-   |
-note: enums with no inhabited variants have no valid value
-  --> $DIR/uninhabited-static.rs:4:1
-   |
-LL | enum Void {}
-   | ^^^^^^^^^
-   = note: `#[warn(invalid_value)]` on by default
-
 error[E0080]: could not evaluate static initializer
-  --> $DIR/uninhabited-static.rs:16:32
+  --> $DIR/uninhabited-static.rs:15:32
    |
 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
    |                                ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Void`
 
-warning: the type `Void` does not permit zero-initialization
-  --> $DIR/uninhabited-static.rs:16:32
-   |
-LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
-   |                                ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
-   |
-note: enums with no inhabited variants have no valid value
-  --> $DIR/uninhabited-static.rs:4:1
-   |
-LL | enum Void {}
-   | ^^^^^^^^^
-
-error: aborting due to 6 previous errors; 2 warnings emitted
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/suggestions/issue-84973-blacklist.stderr b/tests/ui/suggestions/issue-84973-blacklist.stderr
index 8e980997089..33338228328 100644
--- a/tests/ui/suggestions/issue-84973-blacklist.stderr
+++ b/tests/ui/suggestions/issue-84973-blacklist.stderr
@@ -11,6 +11,11 @@ note: required by a bound in `f_copy`
    |
 LL | fn f_copy<T: Copy>(t: T) {}
    |              ^^^^ required by this bound in `f_copy`
+help: consider removing this method call, as the receiver has type `&'static str` and `&'static str: Copy` trivially holds
+   |
+LL -     f_copy("".to_string());
+LL +     f_copy("");
+   |
 
 error[E0277]: the trait bound `S: Clone` is not satisfied
   --> $DIR/issue-84973-blacklist.rs:16:13
diff --git a/tests/ui/thread-local/thread-local-static.rs b/tests/ui/thread-local/thread-local-static.rs
index a1b72323f71..05df0471b14 100644
--- a/tests/ui/thread-local/thread-local-static.rs
+++ b/tests/ui/thread-local/thread-local-static.rs
@@ -2,7 +2,7 @@
 
 #![feature(thread_local)]
 #![feature(const_swap)]
-#![allow(static_mut_ref)]
+#![allow(static_mut_refs)]
 
 #[thread_local]
 static mut STATIC_VAR_2: [u32; 8] = [4; 8];
diff --git a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs
new file mode 100644
index 00000000000..d8fd1d44a98
--- /dev/null
+++ b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.rs
@@ -0,0 +1,11 @@
+struct Foo;
+struct Bar;
+impl From<Bar> for Foo {
+    fn from(_: Bar) -> Self { Foo }
+}
+fn qux(_: impl From<Bar>) {}
+fn main() {
+    qux(Bar.into()); //~ ERROR type annotations needed
+    //~| HELP try using a fully qualified path to specify the expected types
+    //~| HELP consider removing this method call, as the receiver has type `Bar` and `Bar: From<Bar>` trivially holds
+}
diff --git a/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr
new file mode 100644
index 00000000000..49230c98a12
--- /dev/null
+++ b/tests/ui/trait-bounds/argument-with-unnecessary-method-call.stderr
@@ -0,0 +1,27 @@
+error[E0283]: type annotations needed
+  --> $DIR/argument-with-unnecessary-method-call.rs:8:13
+   |
+LL |     qux(Bar.into());
+   |     ---     ^^^^
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = note: cannot satisfy `_: From<Bar>`
+note: required by a bound in `qux`
+  --> $DIR/argument-with-unnecessary-method-call.rs:6:16
+   |
+LL | fn qux(_: impl From<Bar>) {}
+   |                ^^^^^^^^^ required by this bound in `qux`
+help: try using a fully qualified path to specify the expected types
+   |
+LL |     qux(<Bar as Into<T>>::into(Bar));
+   |         +++++++++++++++++++++++   ~
+help: consider removing this method call, as the receiver has type `Bar` and `Bar: From<Bar>` trivially holds
+   |
+LL -     qux(Bar.into());
+LL +     qux(Bar);
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/traits/issue-77982.stderr b/tests/ui/traits/issue-77982.stderr
index bffad037fba..5be8d2f4b32 100644
--- a/tests/ui/traits/issue-77982.stderr
+++ b/tests/ui/traits/issue-77982.stderr
@@ -46,7 +46,6 @@ LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect(
    = note: multiple `impl`s satisfying `u32: From<_>` found in the `core` crate:
            - impl From<Char> for u32;
            - impl From<Ipv4Addr> for u32;
-           - impl From<NonZero<u32>> for u32;
            - impl From<bool> for u32;
            - impl From<char> for u32;
            - impl From<u16> for u32;
diff --git a/tests/ui/traits/next-solver/coherence-fulfill-overflow.rs b/tests/ui/traits/next-solver/coherence-fulfill-overflow.rs
new file mode 100644
index 00000000000..ff577da32c2
--- /dev/null
+++ b/tests/ui/traits/next-solver/coherence-fulfill-overflow.rs
@@ -0,0 +1,15 @@
+//@ compile-flags: -Znext-solver=coherence
+
+#![recursion_limit = "10"]
+
+trait Trait {}
+
+struct W<T: ?Sized>(*const T);
+trait TwoW {}
+impl<T: ?Sized + TwoW> TwoW for W<W<T>> {}
+
+impl<T: ?Sized + TwoW> Trait for W<T> {}
+impl<T: ?Sized + TwoW> Trait for T {}
+//~^ ERROR conflicting implementations of trait `Trait` for type `W
+
+fn main() {}
diff --git a/tests/ui/traits/next-solver/coherence-fulfill-overflow.stderr b/tests/ui/traits/next-solver/coherence-fulfill-overflow.stderr
new file mode 100644
index 00000000000..406c0ccca97
--- /dev/null
+++ b/tests/ui/traits/next-solver/coherence-fulfill-overflow.stderr
@@ -0,0 +1,11 @@
+error[E0119]: conflicting implementations of trait `Trait` for type `W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<_>>>>>>>>>>>>>>>>>>>>>`
+  --> $DIR/coherence-fulfill-overflow.rs:12:1
+   |
+LL | impl<T: ?Sized + TwoW> Trait for W<T> {}
+   | ------------------------------------- first implementation here
+LL | impl<T: ?Sized + TwoW> Trait for T {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<_>>>>>>>>>>>>>>>>>>>>>`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/traits/next-solver/generalize/occurs-check-nested-alias.next.stderr b/tests/ui/traits/next-solver/generalize/occurs-check-nested-alias.next.stderr
index aaadf604a80..cde925db184 100644
--- a/tests/ui/traits/next-solver/generalize/occurs-check-nested-alias.next.stderr
+++ b/tests/ui/traits/next-solver/generalize/occurs-check-nested-alias.next.stderr
@@ -1,8 +1,8 @@
-error[E0284]: type annotations needed: cannot satisfy `<<T as Id<_>>::Id as Unnormalizable>::Assoc == _`
+error[E0284]: type annotations needed: cannot satisfy `_ == <<T as Id<_>>::Id as Unnormalizable>::Assoc`
   --> $DIR/occurs-check-nested-alias.rs:36:9
    |
 LL |     x = y;
-   |         ^ cannot satisfy `<<T as Id<_>>::Id as Unnormalizable>::Assoc == _`
+   |         ^ cannot satisfy `_ == <<T as Id<_>>::Id as Unnormalizable>::Assoc`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/treat-err-as-bug/err.stderr b/tests/ui/treat-err-as-bug/err.stderr
index ca04ee9e0cf..eb7b50b4210 100644
--- a/tests/ui/treat-err-as-bug/err.stderr
+++ b/tests/ui/treat-err-as-bug/err.stderr
@@ -8,5 +8,5 @@ error: the compiler unexpectedly panicked. this is a bug.
 
 query stack during panic:
 #0 [eval_static_initializer] evaluating initializer of static `C`
-#1 [lint_mod] linting top-level module
+#1 [analysis] running analysis passes on this crate
 end of query stack
diff --git a/tests/ui/try-trait/bad-interconversion.stderr b/tests/ui/try-trait/bad-interconversion.stderr
index 80471c0ab1a..817acc8fc99 100644
--- a/tests/ui/try-trait/bad-interconversion.stderr
+++ b/tests/ui/try-trait/bad-interconversion.stderr
@@ -11,7 +11,6 @@ LL |     Ok(Err(123_i32)?)
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <u8 as From<bool>>
-             <u8 as From<NonZero<u8>>>
              <u8 as From<Char>>
    = note: required for `Result<u64, u8>` to implement `FromResidual<Result<Infallible, i32>>`
 
diff --git a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs
index a3f65146f75..71416eb531a 100644
--- a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs
+++ b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs
@@ -18,7 +18,6 @@ impl Foo for () {
 
     type Baz<T> = impl Sized;
     //~^ ERROR type `Baz` has 1 type parameter but its trait declaration has 0 type parameters
-    //~| ERROR unconstrained opaque type
 
     fn test<'a>() -> Self::Bar<'a> {
         &()
diff --git a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr
index 13f5d8b8ea6..e5a21ff8b4e 100644
--- a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr
+++ b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr
@@ -7,14 +7,6 @@ LL |     type Baz<'a>;
 LL |     type Baz<T> = impl Sized;
    |              ^ found 1 type parameter
 
-error: unconstrained opaque type
-  --> $DIR/impl-trait-in-type-alias-with-bad-substs.rs:19:19
-   |
-LL |     type Baz<T> = impl Sized;
-   |                   ^^^^^^^^^^
-   |
-   = note: `Baz` must be used in combination with a concrete type within the same impl
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr b/tests/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr
index 1ef02321e15..1a3848bbcf5 100644
--- a/tests/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr
+++ b/tests/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr
@@ -1,8 +1,8 @@
 error: function can not have more than 65535 arguments
-  --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:22
+  --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:17
    |
 LL |         fn _f($($t: ()),*) {}
-   |                      ^
+   |                 ^^^^^^
 ...
 LL | many_args!{[_]########## ######}
    | -------------------------------- in this macro invocation
diff --git a/tests/ui/typeck/cyclic_type_ice.rs b/tests/ui/typeck/cyclic_type_ice.rs
new file mode 100644
index 00000000000..7899b354f38
--- /dev/null
+++ b/tests/ui/typeck/cyclic_type_ice.rs
@@ -0,0 +1,7 @@
+fn thing() {
+    let f = |_, _| ();
+    f(f); //~ ERROR: closure/coroutine type that references itself
+    //~^ ERROR: this function takes 2 arguments but 1 argument was supplied
+}
+
+fn main() {}
diff --git a/tests/ui/typeck/cyclic_type_ice.stderr b/tests/ui/typeck/cyclic_type_ice.stderr
new file mode 100644
index 00000000000..bfff6830fc5
--- /dev/null
+++ b/tests/ui/typeck/cyclic_type_ice.stderr
@@ -0,0 +1,31 @@
+error[E0644]: closure/coroutine type that references itself
+  --> $DIR/cyclic_type_ice.rs:3:7
+   |
+LL |     f(f);
+   |       ^ cyclic type of infinite size
+   |
+   = note: closures cannot capture themselves or take themselves as argument;
+           this error may be the result of a recent compiler bug-fix,
+           see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
+           for more information
+
+error[E0057]: this function takes 2 arguments but 1 argument was supplied
+  --> $DIR/cyclic_type_ice.rs:3:5
+   |
+LL |     f(f);
+   |     ^--- an argument is missing
+   |
+note: closure defined here
+  --> $DIR/cyclic_type_ice.rs:2:13
+   |
+LL |     let f = |_, _| ();
+   |             ^^^^^^
+help: provide the argument
+   |
+LL |     f(/*  */, /*  */);
+   |      ~~~~~~~~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0057, E0644.
+For more information about an error, try `rustc --explain E0057`.
diff --git a/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.rs b/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.rs
index c319c63eda2..cc66b5fd6f2 100644
--- a/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.rs
+++ b/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.rs
@@ -58,12 +58,12 @@ macro_rules! nested2_ident {
 // instead of the enum variant
 macro_rules! nested1_tt_args_in_first_macro {
     () => (nested2_tt_args_in_first_macro!(i32, u32));
+    //~^ ERROR type arguments are not allowed on this type
 }
 
 macro_rules! nested2_tt_args_in_first_macro {
     ($arg1:tt, $arg2:tt) => (if let EnumUnit::VariantB::<$arg1, $arg2> {}
-    //~^ ERROR type arguments are not allowed on this type
-    //~| ERROR mismatched types
+    //~^ ERROR mismatched types
             = 5 { true } else { false });
 }
 
diff --git a/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.stderr b/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.stderr
index b17936ee3d3..cb7666657ef 100644
--- a/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.stderr
+++ b/tests/ui/typeck/issue-116473-ice-wrong-span-variant-args.stderr
@@ -1,10 +1,10 @@
 error[E0109]: type arguments are not allowed on this type
   --> $DIR/issue-116473-ice-wrong-span-variant-args.rs:15:51
    |
+LL |     () => (recursive_tt!(VariantB));
+   |                          -------- not allowed on this type
 LL |     ($variant:tt) => (if let EnumUnit::$variant::<i32, u32> {} = 5 { true } else { false });
-   |                                        --------   ^^^  ^^^ type argument not allowed
-   |                                        |
-   |                                        not allowed on this type
+   |                                                   ^^^  ^^^ type argument not allowed
 ...
 LL |     recursive_tt!();
    |     --------------- in this macro invocation
@@ -69,10 +69,11 @@ LL |     recursive_ident!();
 error[E0109]: type arguments are not allowed on this type
   --> $DIR/issue-116473-ice-wrong-span-variant-args.rs:38:51
    |
+LL |     () => (nested2_tt!(VariantB));
+   |                        -------- not allowed on this type
+...
 LL |     ($variant:tt) => (if let EnumUnit::$variant::<i32, u32> {} = 5 { true } else { false });
-   |                                        --------   ^^^  ^^^ type argument not allowed
-   |                                        |
-   |                                        not allowed on this type
+   |                                                   ^^^  ^^^ type argument not allowed
 ...
 LL |     nested1_tt!();
    |     ------------- in this macro invocation
@@ -136,12 +137,13 @@ LL |     nested1_ident!();
    = note: this error originates in the macro `nested2_ident` which comes from the expansion of the macro `nested1_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0109]: type arguments are not allowed on this type
-  --> $DIR/issue-116473-ice-wrong-span-variant-args.rs:64:58
+  --> $DIR/issue-116473-ice-wrong-span-variant-args.rs:60:44
    |
+LL |     () => (nested2_tt_args_in_first_macro!(i32, u32));
+   |                                            ^^^  ^^^ type argument not allowed
+...
 LL |     ($arg1:tt, $arg2:tt) => (if let EnumUnit::VariantB::<$arg1, $arg2> {}
-   |                                               --------   ^^^^^  ^^^^^ type argument not allowed
-   |                                               |
-   |                                               not allowed on this type
+   |                                               -------- not allowed on this type
 ...
 LL |     nested1_tt_args_in_first_macro!();
    |     --------------------------------- in this macro invocation
@@ -155,11 +157,11 @@ LL +     ($arg1:tt, $arg2:tt) => (if let EnumUnit::<$arg1, $arg2>::VariantB {}
    |
 
 error[E0308]: mismatched types
-  --> $DIR/issue-116473-ice-wrong-span-variant-args.rs:64:37
+  --> $DIR/issue-116473-ice-wrong-span-variant-args.rs:65:37
    |
 LL |     ($arg1:tt, $arg2:tt) => (if let EnumUnit::VariantB::<$arg1, $arg2> {}
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected integer, found `Enum<(), ()>`
-...
+LL |
 LL |             = 5 { true } else { false });
    |               - this expression has type `{integer}`
 ...
diff --git a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.rs b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.rs
index 3e15e28b8fd..ce0b60b6411 100644
--- a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.rs
+++ b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.rs
@@ -1,5 +1,4 @@
 //@ aux-build:tdticc_coherence_lib.rs
-#![allow(suspicious_auto_trait_impls)]
 
 // Test that we do not consider associated types to be sendable without
 // some applicable trait bound (and we don't ICE).
@@ -11,15 +10,15 @@ extern crate tdticc_coherence_lib as lib;
 use lib::DefaultedTrait;
 
 struct A;
-impl DefaultedTrait for (A,) { } //~ ERROR E0117
+impl DefaultedTrait for (A,) {} //~ ERROR E0117
 
 struct B;
-impl !DefaultedTrait for (B,) { } //~ ERROR E0117
+impl !DefaultedTrait for (B,) {} //~ ERROR E0117
 
 struct C;
 struct D<T>(T);
-impl DefaultedTrait for Box<C> { } //~ ERROR E0321
-impl DefaultedTrait for lib::Something<C> { } //~ ERROR E0117
-impl DefaultedTrait for D<C> { } // OK
+impl DefaultedTrait for Box<C> {} //~ ERROR E0321
+impl DefaultedTrait for lib::Something<C> {} //~ ERROR E0117
+impl DefaultedTrait for D<C> {} // OK
 
-fn main() { }
+fn main() {}
diff --git a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr
index fc3778b7967..32e6e88fc48 100644
--- a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr
+++ b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr
@@ -1,7 +1,7 @@
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:14:1
+  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:13:1
    |
-LL | impl DefaultedTrait for (A,) { }
+LL | impl DefaultedTrait for (A,) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^----
    | |                       |
    | |                       this is not defined in the current crate because tuples are always foreign
@@ -10,9 +10,9 @@ LL | impl DefaultedTrait for (A,) { }
    = note: define and implement a trait or new type instead
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:17:1
+  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:16:1
    |
-LL | impl !DefaultedTrait for (B,) { }
+LL | impl !DefaultedTrait for (B,) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^----
    | |                        |
    | |                        this is not defined in the current crate because tuples are always foreign
@@ -21,15 +21,15 @@ LL | impl !DefaultedTrait for (B,) { }
    = note: define and implement a trait or new type instead
 
 error[E0321]: cross-crate traits with a default impl, like `DefaultedTrait`, can only be implemented for a struct/enum type defined in the current crate
-  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:21:1
+  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:20:1
    |
-LL | impl DefaultedTrait for Box<C> { }
+LL | impl DefaultedTrait for Box<C> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait for type in another crate
 
 error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
-  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:22:1
+  --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:21:1
    |
-LL | impl DefaultedTrait for lib::Something<C> { }
+LL | impl DefaultedTrait for lib::Something<C> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^-----------------
    | |                       |
    | |                       `Something` is not defined in the current crate
diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr
index 18f6edad5c0..c102926fcf5 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr
@@ -666,12 +666,6 @@ LL |     type F: std::ops::Fn(_);
 LL | impl Qux for Struct {
    | ^^^^^^^^^^^^^^^^^^^ missing `F` in implementation
 
-error[E0515]: cannot return reference to function parameter `x`
-  --> $DIR/typeck_type_placeholder_item.rs:50:5
-   |
-LL |     &x
-   |     ^^ returns a reference to data owned by the current function
-
 error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::filter::<{closure@$DIR/typeck_type_placeholder_item.rs:230:29: 230:32}>` in constants
   --> $DIR/typeck_type_placeholder_item.rs:230:22
    |
@@ -690,6 +684,12 @@ LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x);
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
+error[E0515]: cannot return reference to function parameter `x`
+  --> $DIR/typeck_type_placeholder_item.rs:50:5
+   |
+LL |     &x
+   |     ^^ returns a reference to data owned by the current function
+
 error: aborting due to 75 previous errors
 
 Some errors have detailed explanations: E0015, E0046, E0121, E0282, E0403, E0515.
diff --git a/tests/ui/ufcs/bad-builder.rs b/tests/ui/ufcs/bad-builder.rs
new file mode 100644
index 00000000000..350c96acca0
--- /dev/null
+++ b/tests/ui/ufcs/bad-builder.rs
@@ -0,0 +1,6 @@
+fn hello<Q>() -> Vec<Q> {
+    Vec::<Q>::mew()
+    //~^ ERROR no function or associated item named `mew` found for struct `Vec<Q>` in the current scope
+}
+
+fn main() {}
diff --git a/tests/ui/ufcs/bad-builder.stderr b/tests/ui/ufcs/bad-builder.stderr
new file mode 100644
index 00000000000..7fa47c82de2
--- /dev/null
+++ b/tests/ui/ufcs/bad-builder.stderr
@@ -0,0 +1,20 @@
+error[E0599]: no function or associated item named `mew` found for struct `Vec<Q>` in the current scope
+  --> $DIR/bad-builder.rs:2:15
+   |
+LL |     Vec::<Q>::mew()
+   |               ^^^
+   |               |
+   |               function or associated item not found in `Vec<Q>`
+   |               help: there is an associated function with a similar name: `new`
+   |
+note: if you're trying to build a new `Vec<Q>` consider using one of the following associated functions:
+      Vec::<T>::new
+      Vec::<T>::with_capacity
+      Vec::<T>::from_raw_parts
+      Vec::<T, A>::new_in
+      and 2 others
+  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/union/unnamed-fields/auxiliary/dep.rs b/tests/ui/union/unnamed-fields/auxiliary/dep.rs
new file mode 100644
index 00000000000..a11f3e18f52
--- /dev/null
+++ b/tests/ui/union/unnamed-fields/auxiliary/dep.rs
@@ -0,0 +1,18 @@
+#[repr(C)]
+pub struct GoodStruct(());
+
+pub struct BadStruct(());
+
+pub enum BadEnum {
+    A,
+    B,
+}
+
+#[repr(C)]
+pub enum BadEnum2 {
+    A,
+    B,
+}
+
+pub type GoodAlias = GoodStruct;
+pub type BadAlias = i32;
diff --git a/tests/ui/union/unnamed-fields/restrict_type_hir.rs b/tests/ui/union/unnamed-fields/restrict_type_hir.rs
new file mode 100644
index 00000000000..80e4608be82
--- /dev/null
+++ b/tests/ui/union/unnamed-fields/restrict_type_hir.rs
@@ -0,0 +1,44 @@
+//@ aux-build:dep.rs
+
+// test for #121151
+
+#![allow(incomplete_features)]
+#![feature(unnamed_fields)]
+
+extern crate dep;
+
+#[repr(C)]
+struct A {
+    a: u8,
+}
+
+enum BadEnum {
+    A,
+    B,
+}
+
+#[repr(C)]
+enum BadEnum2 {
+    A,
+    B,
+}
+
+type MyStruct = A;
+type MyI32 = i32;
+
+#[repr(C)]
+struct L {
+    _: i32, //~ ERROR unnamed fields can only have struct or union types
+    _: MyI32, //~ ERROR unnamed fields can only have struct or union types
+    _: BadEnum, //~ ERROR unnamed fields can only have struct or union types
+    _: BadEnum2, //~ ERROR unnamed fields can only have struct or union types
+    _: MyStruct,
+    _: dep::BadStruct, //~ ERROR named type of unnamed field must have `#[repr(C)]` representation
+    _: dep::BadEnum, //~ ERROR unnamed fields can only have struct or union types
+    _: dep::BadEnum2, //~ ERROR unnamed fields can only have struct or union types
+    _: dep::BadAlias, //~ ERROR unnamed fields can only have struct or union types
+    _: dep::GoodAlias,
+    _: dep::GoodStruct,
+}
+
+fn main() {}
diff --git a/tests/ui/union/unnamed-fields/restrict_type_hir.stderr b/tests/ui/union/unnamed-fields/restrict_type_hir.stderr
new file mode 100644
index 00000000000..3e80d7fbf5c
--- /dev/null
+++ b/tests/ui/union/unnamed-fields/restrict_type_hir.stderr
@@ -0,0 +1,62 @@
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:31:5
+   |
+LL |     _: i32,
+   |     ^^^^^^
+
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:32:5
+   |
+LL |     _: MyI32,
+   |     ^^^^^^^^
+
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:33:5
+   |
+LL |     _: BadEnum,
+   |     ^^^^^^^^^^
+
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:34:5
+   |
+LL |     _: BadEnum2,
+   |     ^^^^^^^^^^^
+
+error: named type of unnamed field must have `#[repr(C)]` representation
+  --> $DIR/restrict_type_hir.rs:36:5
+   |
+LL |     _: dep::BadStruct,
+   |     ^^^^^^^^^^^^^^^^^ unnamed field defined here
+   |
+  ::: $DIR/auxiliary/dep.rs:4:1
+   |
+LL | pub struct BadStruct(());
+   | -------------------- `BadStruct` defined here
+   |
+help: add `#[repr(C)]` to this struct
+  --> $DIR/auxiliary/dep.rs:4:1
+   |
+LL + #[repr(C)]
+LL | pub struct BadStruct(());
+   |
+
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:37:5
+   |
+LL |     _: dep::BadEnum,
+   |     ^^^^^^^^^^^^^^^
+
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:38:5
+   |
+LL |     _: dep::BadEnum2,
+   |     ^^^^^^^^^^^^^^^^
+
+error: unnamed fields can only have struct or union types
+  --> $DIR/restrict_type_hir.rs:39:5
+   |
+LL |     _: dep::BadAlias,
+   |     ^^^^^^^^^^^^^^^^
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/wf/issue-110157.rs b/tests/ui/wf/issue-110157.rs
index 07e2c5d58c3..1a3d13e93b0 100644
--- a/tests/ui/wf/issue-110157.rs
+++ b/tests/ui/wf/issue-110157.rs
@@ -1,8 +1,7 @@
 struct NeedsDropTypes<'tcx, F>(std::marker::PhantomData<&'tcx F>);
 
 impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
-//~^ ERROR type annotations needed
-//~| ERROR not all trait items implemented
+//~^ ERROR not all trait items implemented
 where
     F: Fn(&Missing) -> Result<I, ()>,
     //~^ ERROR cannot find type `Missing` in this scope
diff --git a/tests/ui/wf/issue-110157.stderr b/tests/ui/wf/issue-110157.stderr
index 16bd34a6d8e..e750ea47d51 100644
--- a/tests/ui/wf/issue-110157.stderr
+++ b/tests/ui/wf/issue-110157.stderr
@@ -1,37 +1,20 @@
 error[E0412]: cannot find type `Missing` in this scope
-  --> $DIR/issue-110157.rs:7:12
+  --> $DIR/issue-110157.rs:6:12
    |
 LL |     F: Fn(&Missing) -> Result<I, ()>,
    |            ^^^^^^^ not found in this scope
 
 error[E0412]: cannot find type `Missing` in this scope
-  --> $DIR/issue-110157.rs:9:24
+  --> $DIR/issue-110157.rs:8:24
    |
 LL |     I: Iterator<Item = Missing>,
    |                        ^^^^^^^ not found in this scope
 
-error[E0283]: type annotations needed
-  --> $DIR/issue-110157.rs:3:31
-   |
-LL | impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
-   |                               ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `I`
-   |
-   = note: cannot satisfy `_: Iterator`
-note: required for `NeedsDropTypes<'tcx, F>` to implement `Iterator`
-  --> $DIR/issue-110157.rs:3:18
-   |
-LL | impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
-   |                  ^^^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^
-...
-LL |     I: Iterator<Item = Missing>,
-   |        ------------------------ unsatisfied trait bound introduced here
-
 error[E0046]: not all trait items implemented, missing: `Item`, `next`
   --> $DIR/issue-110157.rs:3:1
    |
 LL | / impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
 LL | |
-LL | |
 LL | | where
 LL | |     F: Fn(&Missing) -> Result<I, ()>,
 LL | |
@@ -41,7 +24,7 @@ LL | |     I: Iterator<Item = Missing>,
    = help: implement the missing item: `type Item = /* Type */;`
    = help: implement the missing item: `fn next(&mut self) -> Option<<Self as Iterator>::Item> { todo!() }`
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0046, E0283, E0412.
+Some errors have detailed explanations: E0046, E0412.
 For more information about an error, try `rustc --explain E0046`.