about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-24 03:33:09 +0000
committerbors <bors@rust-lang.org>2024-12-24 03:33:09 +0000
commitd3e71fd2d3cf68addac558a807c9ba83f6217a64 (patch)
tree371816eeebc7bd1535b418d550fa23180422cbc4
parentf3343420c813a3dad6746e274137ba51bf97f063 (diff)
parent772b95e7554194dfbb04aaee65fcd983d0b84221 (diff)
downloadrust-d3e71fd2d3cf68addac558a807c9ba83f6217a64.tar.gz
rust-d3e71fd2d3cf68addac558a807c9ba83f6217a64.zip
Auto merge of #134716 - Zalathar:rollup-1h4q8cc, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #134638 (Fix effect predicates from item bounds in old solver)
 - #134662 (Fix safety docs for `dyn Any + Send {+ Sync}`)
 - #134689 (core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets)
 - #134699 (Belay new reviews for workingjubilee)
 - #134701 (Correctly note item kind in `NonConstFunctionCall` error message)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_const_eval/messages.ftl2
-rw-r--r--compiler/rustc_const_eval/src/check_consts/ops.rs1
-rw-r--r--compiler/rustc_const_eval/src/errors.rs1
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0015.md2
-rw-r--r--compiler/rustc_trait_selection/src/traits/effects.rs165
-rw-r--r--library/core/src/any.rs14
-rw-r--r--library/core/src/intrinsics/mod.rs14
-rw-r--r--library/core/src/ptr/mod.rs73
-rw-r--r--library/core/tests/lib.rs1
-rw-r--r--library/core/tests/ptr.rs63
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr2
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr2
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr2
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr2
-rw-r--r--tests/ui/asm/non-const.rs2
-rw-r--r--tests/ui/asm/non-const.stderr2
-rw-r--r--tests/ui/borrowck/issue-64453.rs2
-rw-r--r--tests/ui/borrowck/issue-64453.stderr2
-rw-r--r--tests/ui/const-generics/nested-type.full.stderr2
-rw-r--r--tests/ui/const-generics/nested-type.min.stderr2
-rw-r--r--tests/ui/const-generics/nested-type.rs2
-rw-r--r--tests/ui/consts/const-call.rs2
-rw-r--r--tests/ui/consts/const-call.stderr2
-rw-r--r--tests/ui/consts/const-eval/format.rs6
-rw-r--r--tests/ui/consts/const-eval/format.stderr6
-rw-r--r--tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr2
-rw-r--r--tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs4
-rw-r--r--tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr4
-rw-r--r--tests/ui/consts/const-fn-not-safe-for-const.stderr2
-rw-r--r--tests/ui/consts/control-flow/issue-46843.rs2
-rw-r--r--tests/ui/consts/control-flow/issue-46843.stderr2
-rw-r--r--tests/ui/consts/issue-16538.stderr2
-rw-r--r--tests/ui/consts/issue-32829-2.rs6
-rw-r--r--tests/ui/consts/issue-32829-2.stderr6
-rw-r--r--tests/ui/consts/issue-43105.rs2
-rw-r--r--tests/ui/consts/issue-43105.stderr2
-rw-r--r--tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs2
-rw-r--r--tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr2
-rw-r--r--tests/ui/consts/mir_check_nonconst.rs2
-rw-r--r--tests/ui/consts/mir_check_nonconst.stderr2
-rw-r--r--tests/ui/consts/missing_span_in_backtrace.stderr3
-rw-r--r--tests/ui/error-codes/E0010-teach.rs2
-rw-r--r--tests/ui/error-codes/E0010-teach.stderr2
-rw-r--r--tests/ui/error-codes/E0010.rs2
-rw-r--r--tests/ui/error-codes/E0010.stderr2
-rw-r--r--tests/ui/error-codes/E0015.rs2
-rw-r--r--tests/ui/error-codes/E0015.stderr2
-rw-r--r--tests/ui/explicit-tail-calls/constck.rs4
-rw-r--r--tests/ui/explicit-tail-calls/constck.stderr4
-rw-r--r--tests/ui/issues/issue-7364.rs2
-rw-r--r--tests/ui/issues/issue-7364.stderr2
-rw-r--r--tests/ui/resolve/issue-39559-2.stderr4
-rw-r--r--tests/ui/static/static-mut-not-constant.rs2
-rw-r--r--tests/ui/static/static-mut-not-constant.stderr2
-rw-r--r--tests/ui/static/static-vec-repeat-not-constant.stderr2
-rw-r--r--tests/ui/statics/check-values-constraints.rs2
-rw-r--r--tests/ui/statics/check-values-constraints.stderr16
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-0.rs3
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.rs3
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.stderr35
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.current.stderr15
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.next.stderr (renamed from tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr)4
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.rs9
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.current.stderr (renamed from tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr)4
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.next.stderr15
-rw-r--r--tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.rs3
-rw-r--r--tests/ui/traits/const-traits/assoc-type.current.stderr (renamed from tests/ui/traits/const-traits/assoc-type.stderr)4
-rw-r--r--tests/ui/traits/const-traits/assoc-type.next.stderr15
-rw-r--r--tests/ui/traits/const-traits/assoc-type.rs3
-rw-r--r--tests/ui/traits/const-traits/call-const-trait-method-pass.stderr2
-rw-r--r--tests/ui/traits/const-traits/call-generic-in-impl.stderr2
-rw-r--r--tests/ui/traits/const-traits/call-generic-method-chain.stderr2
-rw-r--r--tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr2
-rw-r--r--tests/ui/traits/const-traits/call-generic-method-pass.stderr2
-rw-r--r--tests/ui/traits/const-traits/const-check-fns-in-const-impl.rs2
-rw-r--r--tests/ui/traits/const-traits/const-check-fns-in-const-impl.stderr2
-rw-r--r--tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs2
-rw-r--r--tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr2
-rw-r--r--tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr2
-rw-r--r--tests/ui/traits/const-traits/const_derives/derive-const-use.stderr6
-rw-r--r--tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs2
-rw-r--r--tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr2
-rw-r--r--tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.rs2
-rw-r--r--tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.stderr2
-rw-r--r--tests/ui/traits/const-traits/issue-79450.rs2
-rw-r--r--tests/ui/traits/const-traits/issue-79450.stderr2
-rw-r--r--tests/ui/traits/const-traits/issue-88155.rs2
-rw-r--r--tests/ui/traits/const-traits/issue-88155.stderr2
-rw-r--r--tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs2
-rw-r--r--tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr2
-rw-r--r--tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr2
-rw-r--r--tests/ui/traits/const-traits/std-impl-gate.gated.stderr2
-rw-r--r--tests/ui/traits/const-traits/std-impl-gate.rs2
-rw-r--r--tests/ui/traits/const-traits/std-impl-gate.stock.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-2.rs2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.rs2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr2
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item.stderr4
-rw-r--r--triagebot.toml1
104 files changed, 427 insertions, 232 deletions
diff --git a/compiler/rustc_const_eval/messages.ftl b/compiler/rustc_const_eval/messages.ftl
index c31c94495d0..0c2242b810b 100644
--- a/compiler/rustc_const_eval/messages.ftl
+++ b/compiler/rustc_const_eval/messages.ftl
@@ -253,7 +253,7 @@ const_eval_non_const_fmt_macro_call =
     cannot call non-const formatting macro in {const_eval_const_context}s
 
 const_eval_non_const_fn_call =
-    cannot call non-const fn `{$def_path_str}` in {const_eval_const_context}s
+    cannot call non-const {$def_descr} `{$def_path_str}` in {const_eval_const_context}s
 
 const_eval_non_const_impl =
     impl defined here, but it is not `const`
diff --git a/compiler/rustc_const_eval/src/check_consts/ops.rs b/compiler/rustc_const_eval/src/check_consts/ops.rs
index afb7900c4b0..ebd680ac28a 100644
--- a/compiler/rustc_const_eval/src/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/check_consts/ops.rs
@@ -304,6 +304,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
             }
             _ => ccx.dcx().create_err(errors::NonConstFnCall {
                 span,
+                def_descr: ccx.tcx.def_descr(callee),
                 def_path_str: ccx.tcx.def_path_str_with_args(callee, args),
                 kind: ccx.const_kind(),
             }),
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs
index 80236ee05b7..57534540019 100644
--- a/compiler/rustc_const_eval/src/errors.rs
+++ b/compiler/rustc_const_eval/src/errors.rs
@@ -192,6 +192,7 @@ pub(crate) struct NonConstFnCall {
     #[primary_span]
     pub span: Span,
     pub def_path_str: String,
+    pub def_descr: &'static str,
     pub kind: ConstContext,
 }
 
diff --git a/compiler/rustc_error_codes/src/error_codes/E0015.md b/compiler/rustc_error_codes/src/error_codes/E0015.md
index ac78f66adad..244cc476243 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0015.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0015.md
@@ -7,7 +7,7 @@ fn create_some() -> Option<u8> {
     Some(1)
 }
 
-// error: cannot call non-const fn `create_some` in constants
+// error: cannot call non-const function `create_some` in constants
 const FOO: Option<u8> = create_some();
 ```
 
diff --git a/compiler/rustc_trait_selection/src/traits/effects.rs b/compiler/rustc_trait_selection/src/traits/effects.rs
index b17a489a857..91484ef99db 100644
--- a/compiler/rustc_trait_selection/src/traits/effects.rs
+++ b/compiler/rustc_trait_selection/src/traits/effects.rs
@@ -1,13 +1,15 @@
 use rustc_hir as hir;
-use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferCtxt};
+use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes};
 use rustc_infer::traits::{ImplSource, Obligation, PredicateObligation};
 use rustc_middle::span_bug;
 use rustc_middle::ty::fast_reject::DeepRejectCtxt;
 use rustc_middle::ty::{self, TypingMode};
+use rustc_type_ir::elaborate::elaborate;
 use rustc_type_ir::solve::NoSolution;
-use thin_vec::ThinVec;
+use thin_vec::{ThinVec, thin_vec};
 
 use super::SelectionContext;
+use super::normalize::normalize_with_depth_to;
 
 pub type HostEffectObligation<'tcx> = Obligation<'tcx, ty::HostEffectPredicate<'tcx>>;
 
@@ -38,6 +40,12 @@ pub fn evaluate_host_effect_obligation<'tcx>(
         Err(EvaluationFailure::NoSolution) => {}
     }
 
+    match evaluate_host_effect_from_item_bounds(selcx, obligation) {
+        Ok(result) => return Ok(result),
+        Err(EvaluationFailure::Ambiguous) => return Err(EvaluationFailure::Ambiguous),
+        Err(EvaluationFailure::NoSolution) => {}
+    }
+
     match evaluate_host_effect_from_selection_candiate(selcx, obligation) {
         Ok(result) => return Ok(result),
         Err(EvaluationFailure::Ambiguous) => return Err(EvaluationFailure::Ambiguous),
@@ -48,24 +56,45 @@ pub fn evaluate_host_effect_obligation<'tcx>(
 }
 
 fn match_candidate<'tcx>(
-    infcx: &InferCtxt<'tcx>,
+    selcx: &mut SelectionContext<'_, 'tcx>,
     obligation: &HostEffectObligation<'tcx>,
     candidate: ty::Binder<'tcx, ty::HostEffectPredicate<'tcx>>,
+    candidate_is_unnormalized: bool,
+    more_nested: impl FnOnce(&mut SelectionContext<'_, 'tcx>, &mut ThinVec<PredicateObligation<'tcx>>),
 ) -> Result<ThinVec<PredicateObligation<'tcx>>, NoSolution> {
     if !candidate.skip_binder().constness.satisfies(obligation.predicate.constness) {
         return Err(NoSolution);
     }
 
-    let candidate = infcx.instantiate_binder_with_fresh_vars(
+    let mut candidate = selcx.infcx.instantiate_binder_with_fresh_vars(
         obligation.cause.span,
         BoundRegionConversionTime::HigherRankedType,
         candidate,
     );
 
-    let mut nested = infcx
-        .at(&obligation.cause, obligation.param_env)
-        .eq(DefineOpaqueTypes::Yes, obligation.predicate.trait_ref, candidate.trait_ref)?
-        .into_obligations();
+    let mut nested = thin_vec![];
+
+    // Unlike param-env bounds, item bounds may not be normalized.
+    if candidate_is_unnormalized {
+        candidate = normalize_with_depth_to(
+            selcx,
+            obligation.param_env,
+            obligation.cause.clone(),
+            obligation.recursion_depth,
+            candidate,
+            &mut nested,
+        );
+    }
+
+    nested.extend(
+        selcx
+            .infcx
+            .at(&obligation.cause, obligation.param_env)
+            .eq(DefineOpaqueTypes::Yes, obligation.predicate.trait_ref, candidate.trait_ref)?
+            .into_obligations(),
+    );
+
+    more_nested(selcx, &mut nested);
 
     for nested in &mut nested {
         nested.set_depth_from_parent(obligation.recursion_depth);
@@ -82,36 +111,116 @@ fn evaluate_host_effect_from_bounds<'tcx>(
     let drcx = DeepRejectCtxt::relate_rigid_rigid(selcx.tcx());
     let mut candidate = None;
 
-    for predicate in obligation.param_env.caller_bounds() {
-        let bound_predicate = predicate.kind();
-        if let ty::ClauseKind::HostEffect(data) = predicate.kind().skip_binder() {
-            let data = bound_predicate.rebind(data);
-            if data.skip_binder().trait_ref.def_id != obligation.predicate.trait_ref.def_id {
-                continue;
+    for clause in obligation.param_env.caller_bounds() {
+        let bound_clause = clause.kind();
+        let ty::ClauseKind::HostEffect(data) = bound_clause.skip_binder() else {
+            continue;
+        };
+        let data = bound_clause.rebind(data);
+        if data.skip_binder().trait_ref.def_id != obligation.predicate.trait_ref.def_id {
+            continue;
+        }
+
+        if !drcx
+            .args_may_unify(obligation.predicate.trait_ref.args, data.skip_binder().trait_ref.args)
+        {
+            continue;
+        }
+
+        let is_match =
+            infcx.probe(|_| match_candidate(selcx, obligation, data, false, |_, _| {}).is_ok());
+
+        if is_match {
+            if candidate.is_some() {
+                return Err(EvaluationFailure::Ambiguous);
+            } else {
+                candidate = Some(data);
             }
+        }
+    }
 
-            if !drcx.args_may_unify(
-                obligation.predicate.trait_ref.args,
-                data.skip_binder().trait_ref.args,
+    if let Some(data) = candidate {
+        Ok(match_candidate(selcx, obligation, data, false, |_, _| {})
+            .expect("candidate matched before, so it should match again"))
+    } else {
+        Err(EvaluationFailure::NoSolution)
+    }
+}
+
+fn evaluate_host_effect_from_item_bounds<'tcx>(
+    selcx: &mut SelectionContext<'_, 'tcx>,
+    obligation: &HostEffectObligation<'tcx>,
+) -> Result<ThinVec<PredicateObligation<'tcx>>, EvaluationFailure> {
+    let infcx = selcx.infcx;
+    let tcx = infcx.tcx;
+    let drcx = DeepRejectCtxt::relate_rigid_rigid(selcx.tcx());
+    let mut candidate = None;
+
+    let mut consider_ty = obligation.predicate.self_ty();
+    while let ty::Alias(kind @ (ty::Projection | ty::Opaque), alias_ty) = *consider_ty.kind() {
+        if tcx.is_conditionally_const(alias_ty.def_id) {
+            for clause in elaborate(
+                tcx,
+                tcx.explicit_implied_const_bounds(alias_ty.def_id)
+                    .iter_instantiated_copied(tcx, alias_ty.args)
+                    .map(|(trait_ref, _)| {
+                        trait_ref.to_host_effect_clause(tcx, obligation.predicate.constness)
+                    }),
             ) {
-                continue;
-            }
+                let bound_clause = clause.kind();
+                let ty::ClauseKind::HostEffect(data) = bound_clause.skip_binder() else {
+                    unreachable!("should not elaborate non-HostEffect from HostEffect")
+                };
+                let data = bound_clause.rebind(data);
+                if data.skip_binder().trait_ref.def_id != obligation.predicate.trait_ref.def_id {
+                    continue;
+                }
 
-            let is_match = infcx.probe(|_| match_candidate(infcx, obligation, data).is_ok());
+                if !drcx.args_may_unify(
+                    obligation.predicate.trait_ref.args,
+                    data.skip_binder().trait_ref.args,
+                ) {
+                    continue;
+                }
 
-            if is_match {
-                if candidate.is_some() {
-                    return Err(EvaluationFailure::Ambiguous);
-                } else {
-                    candidate = Some(data);
+                let is_match = infcx
+                    .probe(|_| match_candidate(selcx, obligation, data, true, |_, _| {}).is_ok());
+
+                if is_match {
+                    if candidate.is_some() {
+                        return Err(EvaluationFailure::Ambiguous);
+                    } else {
+                        candidate = Some((data, alias_ty));
+                    }
                 }
             }
         }
+
+        if kind != ty::Projection {
+            break;
+        }
+
+        consider_ty = alias_ty.self_ty();
     }
 
-    if let Some(data) = candidate {
-        Ok(match_candidate(infcx, obligation, data)
-            .expect("candidate matched before, so it should match again"))
+    if let Some((data, alias_ty)) = candidate {
+        Ok(match_candidate(selcx, obligation, data, true, |selcx, nested| {
+            // An alias bound only holds if we also check the const conditions
+            // of the alias, so we need to register those, too.
+            let const_conditions = normalize_with_depth_to(
+                selcx,
+                obligation.param_env,
+                obligation.cause.clone(),
+                obligation.recursion_depth,
+                tcx.const_conditions(alias_ty.def_id).instantiate(tcx, alias_ty.args),
+                nested,
+            );
+            nested.extend(const_conditions.into_iter().map(|(trait_ref, _)| {
+                obligation
+                    .with(tcx, trait_ref.to_host_effect_clause(tcx, obligation.predicate.constness))
+            }));
+        })
+        .expect("candidate matched before, so it should match again"))
     } else {
         Err(EvaluationFailure::NoSolution)
     }
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index 58107b1e7d0..17d94555927 100644
--- a/library/core/src/any.rs
+++ b/library/core/src/any.rs
@@ -423,7 +423,8 @@ impl dyn Any + Send {
     ///
     /// # Safety
     ///
-    /// Same as the method on the type `dyn Any`.
+    /// The contained value must be of type `T`. Calling this method
+    /// with the incorrect type is *undefined behavior*.
     #[unstable(feature = "downcast_unchecked", issue = "90850")]
     #[inline]
     pub unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T {
@@ -451,7 +452,8 @@ impl dyn Any + Send {
     ///
     /// # Safety
     ///
-    /// Same as the method on the type `dyn Any`.
+    /// The contained value must be of type `T`. Calling this method
+    /// with the incorrect type is *undefined behavior*.
     #[unstable(feature = "downcast_unchecked", issue = "90850")]
     #[inline]
     pub unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T {
@@ -552,6 +554,10 @@ impl dyn Any + Send + Sync {
     ///     assert_eq!(*x.downcast_ref_unchecked::<usize>(), 1);
     /// }
     /// ```
+    /// # Safety
+    ///
+    /// The contained value must be of type `T`. Calling this method
+    /// with the incorrect type is *undefined behavior*.
     #[unstable(feature = "downcast_unchecked", issue = "90850")]
     #[inline]
     pub unsafe fn downcast_ref_unchecked<T: Any>(&self) -> &T {
@@ -576,6 +582,10 @@ impl dyn Any + Send + Sync {
     ///
     /// assert_eq!(*x.downcast_ref::<usize>().unwrap(), 2);
     /// ```
+    /// # Safety
+    ///
+    /// The contained value must be of type `T`. Calling this method
+    /// with the incorrect type is *undefined behavior*.
     #[unstable(feature = "downcast_unchecked", issue = "90850")]
     #[inline]
     pub unsafe fn downcast_mut_unchecked<T: Any>(&mut self) -> &mut T {
diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs
index 3e53c0497cc..42b8eb33a1a 100644
--- a/library/core/src/intrinsics/mod.rs
+++ b/library/core/src/intrinsics/mod.rs
@@ -3795,7 +3795,7 @@ where
 /// See [`const_eval_select()`] for the rules and requirements around that intrinsic.
 pub(crate) macro const_eval_select {
     (
-        @capture { $($arg:ident : $ty:ty = $val:expr),* $(,)? } $( -> $ret:ty )? :
+        @capture$([$($binders:tt)*])? { $($arg:ident : $ty:ty = $val:expr),* $(,)? } $( -> $ret:ty )? :
         if const
             $(#[$compiletime_attr:meta])* $compiletime:block
         else
@@ -3803,7 +3803,7 @@ pub(crate) macro const_eval_select {
     ) => {
         // Use the `noinline` arm, after adding explicit `inline` attributes
         $crate::intrinsics::const_eval_select!(
-            @capture { $($arg : $ty = $val),* } $(-> $ret)? :
+            @capture$([$($binders)*])? { $($arg : $ty = $val),* } $(-> $ret)? :
             #[noinline]
             if const
                 #[inline] // prevent codegen on this function
@@ -3817,7 +3817,7 @@ pub(crate) macro const_eval_select {
     },
     // With a leading #[noinline], we don't add inline attributes
     (
-        @capture { $($arg:ident : $ty:ty = $val:expr),* $(,)? } $( -> $ret:ty )? :
+        @capture$([$($binders:tt)*])? { $($arg:ident : $ty:ty = $val:expr),* $(,)? } $( -> $ret:ty )? :
         #[noinline]
         if const
             $(#[$compiletime_attr:meta])* $compiletime:block
@@ -3825,12 +3825,12 @@ pub(crate) macro const_eval_select {
             $(#[$runtime_attr:meta])* $runtime:block
     ) => {{
         $(#[$runtime_attr])*
-        fn runtime($($arg: $ty),*) $( -> $ret )? {
+        fn runtime$(<$($binders)*>)?($($arg: $ty),*) $( -> $ret )? {
             $runtime
         }
 
         $(#[$compiletime_attr])*
-        const fn compiletime($($arg: $ty),*) $( -> $ret )? {
+        const fn compiletime$(<$($binders)*>)?($($arg: $ty),*) $( -> $ret )? {
             // Don't warn if one of the arguments is unused.
             $(let _ = $arg;)*
 
@@ -3842,14 +3842,14 @@ pub(crate) macro const_eval_select {
     // We support leaving away the `val` expressions for *all* arguments
     // (but not for *some* arguments, that's too tricky).
     (
-        @capture { $($arg:ident : $ty:ty),* $(,)? } $( -> $ret:ty )? :
+        @capture$([$($binders:tt)*])? { $($arg:ident : $ty:ty),* $(,)? } $( -> $ret:ty )? :
         if const
             $(#[$compiletime_attr:meta])* $compiletime:block
         else
             $(#[$runtime_attr:meta])* $runtime:block
     ) => {
         $crate::intrinsics::const_eval_select!(
-            @capture { $($arg : $ty = $arg),* } $(-> $ret)? :
+            @capture$([$($binders)*])? { $($arg : $ty = $arg),* } $(-> $ret)? :
             if const
                 $(#[$compiletime_attr])* $compiletime
             else
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 1423e7ea8d1..e6e13eaff7b 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -395,6 +395,7 @@
 #![allow(clippy::not_unsafe_ptr_arg_deref)]
 
 use crate::cmp::Ordering;
+use crate::intrinsics::const_eval_select;
 use crate::marker::FnPtr;
 use crate::mem::{self, MaybeUninit, SizedTypeProperties};
 use crate::{fmt, hash, intrinsics, ub_checks};
@@ -1074,25 +1075,6 @@ pub const unsafe fn swap<T>(x: *mut T, y: *mut T) {
 #[rustc_const_unstable(feature = "const_swap_nonoverlapping", issue = "133668")]
 #[rustc_diagnostic_item = "ptr_swap_nonoverlapping"]
 pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
-    #[allow(unused)]
-    macro_rules! attempt_swap_as_chunks {
-        ($ChunkTy:ty) => {
-            if mem::align_of::<T>() >= mem::align_of::<$ChunkTy>()
-                && mem::size_of::<T>() % mem::size_of::<$ChunkTy>() == 0
-            {
-                let x: *mut $ChunkTy = x.cast();
-                let y: *mut $ChunkTy = y.cast();
-                let count = count * (mem::size_of::<T>() / mem::size_of::<$ChunkTy>());
-                // SAFETY: these are the same bytes that the caller promised were
-                // ok, just typed as `MaybeUninit<ChunkTy>`s instead of as `T`s.
-                // The `if` condition above ensures that we're not violating
-                // alignment requirements, and that the division is exact so
-                // that we don't lose any bytes off the end.
-                return unsafe { swap_nonoverlapping_simple_untyped(x, y, count) };
-            }
-        };
-    }
-
     ub_checks::assert_unsafe_precondition!(
         check_language_ub,
         "ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null \
@@ -1111,19 +1093,48 @@ pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
         }
     );
 
-    // Split up the slice into small power-of-two-sized chunks that LLVM is able
-    // to vectorize (unless it's a special type with more-than-pointer alignment,
-    // because we don't want to pessimize things like slices of SIMD vectors.)
-    if mem::align_of::<T>() <= mem::size_of::<usize>()
-        && (!mem::size_of::<T>().is_power_of_two()
-            || mem::size_of::<T>() > mem::size_of::<usize>() * 2)
-    {
-        attempt_swap_as_chunks!(usize);
-        attempt_swap_as_chunks!(u8);
-    }
+    const_eval_select!(
+        @capture[T] { x: *mut T, y: *mut T, count: usize }:
+        if const {
+            // At compile-time we want to always copy this in chunks of `T`, to ensure that if there
+            // are pointers inside `T` we will copy them in one go rather than trying to copy a part
+            // of a pointer (which would not work).
+            // SAFETY: Same preconditions as this function
+            unsafe { swap_nonoverlapping_simple_untyped(x, y, count) }
+        } else {
+            macro_rules! attempt_swap_as_chunks {
+                ($ChunkTy:ty) => {
+                    if mem::align_of::<T>() >= mem::align_of::<$ChunkTy>()
+                        && mem::size_of::<T>() % mem::size_of::<$ChunkTy>() == 0
+                    {
+                        let x: *mut $ChunkTy = x.cast();
+                        let y: *mut $ChunkTy = y.cast();
+                        let count = count * (mem::size_of::<T>() / mem::size_of::<$ChunkTy>());
+                        // SAFETY: these are the same bytes that the caller promised were
+                        // ok, just typed as `MaybeUninit<ChunkTy>`s instead of as `T`s.
+                        // The `if` condition above ensures that we're not violating
+                        // alignment requirements, and that the division is exact so
+                        // that we don't lose any bytes off the end.
+                        return unsafe { swap_nonoverlapping_simple_untyped(x, y, count) };
+                    }
+                };
+            }
+
+            // Split up the slice into small power-of-two-sized chunks that LLVM is able
+            // to vectorize (unless it's a special type with more-than-pointer alignment,
+            // because we don't want to pessimize things like slices of SIMD vectors.)
+            if mem::align_of::<T>() <= mem::size_of::<usize>()
+            && (!mem::size_of::<T>().is_power_of_two()
+                || mem::size_of::<T>() > mem::size_of::<usize>() * 2)
+            {
+                attempt_swap_as_chunks!(usize);
+                attempt_swap_as_chunks!(u8);
+            }
 
-    // SAFETY: Same preconditions as this function
-    unsafe { swap_nonoverlapping_simple_untyped(x, y, count) }
+            // SAFETY: Same preconditions as this function
+            unsafe { swap_nonoverlapping_simple_untyped(x, y, count) }
+        }
+    )
 }
 
 /// Same behavior and safety conditions as [`swap_nonoverlapping`]
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index 89b65eefd02..9f0ab7b3f29 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -16,6 +16,7 @@
 #![feature(const_black_box)]
 #![feature(const_eval_select)]
 #![feature(const_swap)]
+#![feature(const_swap_nonoverlapping)]
 #![feature(const_trait_impl)]
 #![feature(core_intrinsics)]
 #![feature(core_io_borrowed_buf)]
diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs
index 454b13a7ee3..e6825d8e39e 100644
--- a/library/core/tests/ptr.rs
+++ b/library/core/tests/ptr.rs
@@ -860,7 +860,10 @@ fn swap_copy_untyped() {
 }
 
 #[test]
-fn test_const_copy() {
+fn test_const_copy_ptr() {
+    // `copy` and `copy_nonoverlapping` are thin layers on top of intrinsics. Ensure they correctly
+    // deal with pointers even when the pointers cross the boundary from one "element" being copied
+    // to another.
     const {
         let ptr1 = &1;
         let mut ptr2 = &666;
@@ -899,21 +902,61 @@ fn test_const_copy() {
 }
 
 #[test]
-fn test_const_swap() {
+fn test_const_swap_ptr() {
+    // The `swap` functions are implemented in the library, they are not primitives.
+    // Only `swap_nonoverlapping` takes a count; pointers that cross multiple elements
+    // are *not* supported.
+    // We put the pointer at an odd offset in the type and copy them as an array of bytes,
+    // which should catch most of the ways that the library implementation can get it wrong.
+
+    #[cfg(target_pointer_width = "32")]
+    type HalfPtr = i16;
+    #[cfg(target_pointer_width = "64")]
+    type HalfPtr = i32;
+
+    #[repr(C, packed)]
+    #[allow(unused)]
+    struct S {
+        f1: HalfPtr,
+        // Crucially this field is at an offset that is not a multiple of the pointer size.
+        ptr: &'static i32,
+        // Make sure the entire type does not have a power-of-2 size:
+        // make it 3 pointers in size. This used to hit a bug in `swap_nonoverlapping`.
+        f2: [HalfPtr; 3],
+    }
+
+    // Ensure the entire thing is usize-aligned, so in principle this
+    // looks like it could be eligible for a `usize` copying loop.
+    #[cfg_attr(target_pointer_width = "32", repr(align(4)))]
+    #[cfg_attr(target_pointer_width = "64", repr(align(8)))]
+    struct A(S);
+
     const {
-        let mut ptr1 = &1;
-        let mut ptr2 = &666;
+        let mut s1 = A(S { ptr: &1, f1: 0, f2: [0; 3] });
+        let mut s2 = A(S { ptr: &666, f1: 0, f2: [0; 3] });
 
-        // Swap ptr1 and ptr2, bytewise. `swap` does not take a count
-        // so the best we can do is use an array.
-        type T = [u8; mem::size_of::<&i32>()];
+        // Swap ptr1 and ptr2, as an array.
+        type T = [u8; mem::size_of::<A>()];
         unsafe {
-            ptr::swap(ptr::from_mut(&mut ptr1).cast::<T>(), ptr::from_mut(&mut ptr2).cast::<T>());
+            ptr::swap(ptr::from_mut(&mut s1).cast::<T>(), ptr::from_mut(&mut s2).cast::<T>());
         }
 
         // Make sure they still work.
-        assert!(*ptr1 == 666);
-        assert!(*ptr2 == 1);
+        assert!(*s1.0.ptr == 666);
+        assert!(*s2.0.ptr == 1);
+
+        // Swap them back, again as an array.
+        unsafe {
+            ptr::swap_nonoverlapping(
+                ptr::from_mut(&mut s1).cast::<T>(),
+                ptr::from_mut(&mut s2).cast::<T>(),
+                1,
+            );
+        }
+
+        // Make sure they still work.
+        assert!(*s1.0.ptr == 1);
+        assert!(*s2.0.ptr == 666);
     };
 }
 
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
index 596f7c510be..82f57864d85 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
@@ -52,7 +52,7 @@ help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[
 LL | #[const_trait] trait Bar: ~const Foo {}
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> const-super-trait.rs:10:7
    |
 LL |     x.a();
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr
index 7235278d1bd..8f4c78ccfa4 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr
@@ -32,7 +32,7 @@ help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations
 LL | #[const_trait] trait Bar: ~const Foo {}
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> const-super-trait.rs:10:7
    |
 LL |     x.a();
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
index eacdaf5e369..b7cd7097f44 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
@@ -50,7 +50,7 @@ note: `Bar` can't be used with `~const` because it isn't annotated with `#[const
 7 | trait Bar: ~const Foo {}
   | ^^^^^^^^^^^^^^^^^^^^^
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> const-super-trait.rs:10:7
    |
 10 |     x.a();
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr
index 9ddec6e422c..4c59d870671 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr
@@ -40,7 +40,7 @@ note: `Bar` can't be used with `~const` because it isn't annotated with `#[const
 7 | trait Bar: ~const Foo {}
   | ^^^^^^^^^^^^^^^^^^^^^
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> const-super-trait.rs:10:7
    |
 10 |     x.a();
diff --git a/tests/ui/asm/non-const.rs b/tests/ui/asm/non-const.rs
index 63c46563226..dc9317b90b1 100644
--- a/tests/ui/asm/non-const.rs
+++ b/tests/ui/asm/non-const.rs
@@ -8,4 +8,4 @@ fn main() {}
 fn non_const_fn(x: i32) -> i32 { x }
 
 global_asm!("/* {} */", const non_const_fn(0));
-//~^ERROR: cannot call non-const fn
+//~^ERROR: cannot call non-const function
diff --git a/tests/ui/asm/non-const.stderr b/tests/ui/asm/non-const.stderr
index 5fae2ac9843..eac4fe841bf 100644
--- a/tests/ui/asm/non-const.stderr
+++ b/tests/ui/asm/non-const.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `non_const_fn` in constants
+error[E0015]: cannot call non-const function `non_const_fn` in constants
   --> $DIR/non-const.rs:10:31
    |
 LL | global_asm!("/* {} */", const non_const_fn(0));
diff --git a/tests/ui/borrowck/issue-64453.rs b/tests/ui/borrowck/issue-64453.rs
index 5f1f35d6ca9..587bf0e80f5 100644
--- a/tests/ui/borrowck/issue-64453.rs
+++ b/tests/ui/borrowck/issue-64453.rs
@@ -2,7 +2,7 @@ struct Project;
 struct Value;
 
 static settings_dir: String = format!("");
-//~^ ERROR cannot call non-const fn
+//~^ ERROR cannot call non-const function
 
 fn from_string(_: String) -> Value {
     Value
diff --git a/tests/ui/borrowck/issue-64453.stderr b/tests/ui/borrowck/issue-64453.stderr
index 98b05ead649..8ec9a10f09f 100644
--- a/tests/ui/borrowck/issue-64453.stderr
+++ b/tests/ui/borrowck/issue-64453.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `format` in statics
+error[E0015]: cannot call non-const function `format` in statics
   --> $DIR/issue-64453.rs:4:31
    |
 LL | static settings_dir: String = format!("");
diff --git a/tests/ui/const-generics/nested-type.full.stderr b/tests/ui/const-generics/nested-type.full.stderr
index 04dc84ea3cf..e5a1f230380 100644
--- a/tests/ui/const-generics/nested-type.full.stderr
+++ b/tests/ui/const-generics/nested-type.full.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `Foo::{constant#0}::Foo::<17>::value` in constants
+error[E0015]: cannot call non-const associated function `Foo::{constant#0}::Foo::<17>::value` in constants
   --> $DIR/nested-type.rs:15:5
    |
 LL |     Foo::<17>::value()
diff --git a/tests/ui/const-generics/nested-type.min.stderr b/tests/ui/const-generics/nested-type.min.stderr
index cdc0b9807d9..8282acd4ea7 100644
--- a/tests/ui/const-generics/nested-type.min.stderr
+++ b/tests/ui/const-generics/nested-type.min.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `Foo::{constant#0}::Foo::<17>::value` in constants
+error[E0015]: cannot call non-const associated function `Foo::{constant#0}::Foo::<17>::value` in constants
   --> $DIR/nested-type.rs:15:5
    |
 LL |     Foo::<17>::value()
diff --git a/tests/ui/const-generics/nested-type.rs b/tests/ui/const-generics/nested-type.rs
index a9d106237b3..ddd84d472bf 100644
--- a/tests/ui/const-generics/nested-type.rs
+++ b/tests/ui/const-generics/nested-type.rs
@@ -13,7 +13,7 @@ struct Foo<const N: [u8; {
     }
 
     Foo::<17>::value()
-    //~^ ERROR cannot call non-const fn
+    //~^ ERROR cannot call non-const associated function
 }]>;
 //[min]~^^^^^^^^^^^^ ERROR `[u8; {
 
diff --git a/tests/ui/consts/const-call.rs b/tests/ui/consts/const-call.rs
index 28e89559fe5..851b66f7623 100644
--- a/tests/ui/consts/const-call.rs
+++ b/tests/ui/consts/const-call.rs
@@ -4,5 +4,5 @@ fn f(x: usize) -> usize {
 
 fn main() {
     let _ = [0; f(2)];
-    //~^ ERROR cannot call non-const fn
+    //~^ ERROR cannot call non-const function
 }
diff --git a/tests/ui/consts/const-call.stderr b/tests/ui/consts/const-call.stderr
index 4e7098a5c8f..b9dcf5addb5 100644
--- a/tests/ui/consts/const-call.stderr
+++ b/tests/ui/consts/const-call.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `f` in constants
+error[E0015]: cannot call non-const function `f` in constants
   --> $DIR/const-call.rs:6:17
    |
 LL |     let _ = [0; f(2)];
diff --git a/tests/ui/consts/const-eval/format.rs b/tests/ui/consts/const-eval/format.rs
index b12df824a33..e56d15e935b 100644
--- a/tests/ui/consts/const-eval/format.rs
+++ b/tests/ui/consts/const-eval/format.rs
@@ -1,14 +1,14 @@
 const fn failure() {
     panic!("{:?}", 0);
     //~^ ERROR cannot call non-const formatting macro in constant functions
-    //~| ERROR cannot call non-const fn `Arguments::<'_>::new_v1::<1, 1>` in constant functions
+    //~| ERROR cannot call non-const associated function `Arguments::<'_>::new_v1::<1, 1>` in constant functions
 }
 
 const fn print() {
     println!("{:?}", 0);
     //~^ ERROR cannot call non-const formatting macro in constant functions
-    //~| ERROR cannot call non-const fn `Arguments::<'_>::new_v1::<2, 1>` in constant functions
-    //~| ERROR cannot call non-const fn `_print` in constant functions
+    //~| ERROR cannot call non-const associated function `Arguments::<'_>::new_v1::<2, 1>` in constant functions
+    //~| ERROR cannot call non-const function `_print` in constant functions
 }
 
 fn main() {}
diff --git a/tests/ui/consts/const-eval/format.stderr b/tests/ui/consts/const-eval/format.stderr
index ce3f9f2190e..25ed44e0f33 100644
--- a/tests/ui/consts/const-eval/format.stderr
+++ b/tests/ui/consts/const-eval/format.stderr
@@ -7,7 +7,7 @@ LL |     panic!("{:?}", 0);
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `Arguments::<'_>::new_v1::<1, 1>` in constant functions
+error[E0015]: cannot call non-const associated function `Arguments::<'_>::new_v1::<1, 1>` in constant functions
   --> $DIR/format.rs:2:5
    |
 LL |     panic!("{:?}", 0);
@@ -25,7 +25,7 @@ LL |     println!("{:?}", 0);
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = note: this error 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)
 
-error[E0015]: cannot call non-const fn `Arguments::<'_>::new_v1::<2, 1>` in constant functions
+error[E0015]: cannot call non-const associated function `Arguments::<'_>::new_v1::<2, 1>` in constant functions
   --> $DIR/format.rs:8:5
    |
 LL |     println!("{:?}", 0);
@@ -34,7 +34,7 @@ LL |     println!("{:?}", 0);
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = note: this error 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)
 
-error[E0015]: cannot call non-const fn `_print` in constant functions
+error[E0015]: cannot call non-const function `_print` in constant functions
   --> $DIR/format.rs:8:5
    |
 LL |     println!("{:?}", 0);
diff --git a/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr b/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr
index 94aa3ee4d7a..6e428079afe 100644
--- a/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr
+++ b/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `core::slice::<impl [()]>::get_unchecked::<std::ops::Range<usize>>` in constants
+error[E0015]: cannot call non-const method `core::slice::<impl [()]>::get_unchecked::<std::ops::Range<usize>>` in constants
   --> $DIR/ub-slice-get-unchecked.rs:7:29
    |
 LL | const B: &[()] = unsafe { A.get_unchecked(3..1) };
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
index 31c15400f84..0b475087d55 100644
--- a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
@@ -5,7 +5,7 @@ extern "C" {
 const extern "C" fn bar() {
     unsafe {
         regular_in_block();
-        //~^ ERROR: cannot call non-const fn
+        //~^ ERROR: cannot call non-const function
     }
 }
 
@@ -14,7 +14,7 @@ extern "C" fn regular() {}
 const extern "C" fn foo() {
     unsafe {
         regular();
-        //~^ ERROR: cannot call non-const fn
+        //~^ ERROR: cannot call non-const function
     }
 }
 
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
index 5d37f524e03..1fa881cf42b 100644
--- a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `regular_in_block` in constant functions
+error[E0015]: cannot call non-const function `regular_in_block` in constant functions
   --> $DIR/const-extern-fn-call-extern-fn.rs:7:9
    |
 LL |         regular_in_block();
@@ -6,7 +6,7 @@ LL |         regular_in_block();
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `regular` in constant functions
+error[E0015]: cannot call non-const function `regular` in constant functions
   --> $DIR/const-extern-fn-call-extern-fn.rs:16:9
    |
 LL |         regular();
diff --git a/tests/ui/consts/const-fn-not-safe-for-const.stderr b/tests/ui/consts/const-fn-not-safe-for-const.stderr
index 674e05a0ba9..e8f0566e73d 100644
--- a/tests/ui/consts/const-fn-not-safe-for-const.stderr
+++ b/tests/ui/consts/const-fn-not-safe-for-const.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `random` in constant functions
+error[E0015]: cannot call non-const function `random` in constant functions
   --> $DIR/const-fn-not-safe-for-const.rs:14:5
    |
 LL |     random()
diff --git a/tests/ui/consts/control-flow/issue-46843.rs b/tests/ui/consts/control-flow/issue-46843.rs
index ddddc8505c6..fd6366d3c18 100644
--- a/tests/ui/consts/control-flow/issue-46843.rs
+++ b/tests/ui/consts/control-flow/issue-46843.rs
@@ -8,7 +8,7 @@ fn non_const() -> Thing {
 }
 
 pub const Q: i32 = match non_const() {
-    //~^ ERROR cannot call non-const fn
+    //~^ ERROR cannot call non-const function
     Thing::This => 1,
     Thing::That => 0
 };
diff --git a/tests/ui/consts/control-flow/issue-46843.stderr b/tests/ui/consts/control-flow/issue-46843.stderr
index 69bf78839be..42eb035647c 100644
--- a/tests/ui/consts/control-flow/issue-46843.stderr
+++ b/tests/ui/consts/control-flow/issue-46843.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `non_const` in constants
+error[E0015]: cannot call non-const function `non_const` in constants
   --> $DIR/issue-46843.rs:10:26
    |
 LL | pub const Q: i32 = match non_const() {
diff --git a/tests/ui/consts/issue-16538.stderr b/tests/ui/consts/issue-16538.stderr
index c4f5364b4d7..8bd11541a7d 100644
--- a/tests/ui/consts/issue-16538.stderr
+++ b/tests/ui/consts/issue-16538.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `Y::foo` in statics
+error[E0015]: cannot call non-const function `Y::foo` in statics
   --> $DIR/issue-16538.rs:11:23
    |
 LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
diff --git a/tests/ui/consts/issue-32829-2.rs b/tests/ui/consts/issue-32829-2.rs
index d70b5a8c4e1..c7ad0979293 100644
--- a/tests/ui/consts/issue-32829-2.rs
+++ b/tests/ui/consts/issue-32829-2.rs
@@ -8,7 +8,7 @@ const bad : u32 = {
 const bad_two : u32 = {
     {
         invalid();
-        //~^ ERROR: cannot call non-const fn `invalid`
+        //~^ ERROR: cannot call non-const function `invalid`
         0
     }
 };
@@ -30,7 +30,7 @@ static bad_four : u32 = {
 static bad_five : u32 = {
     {
         invalid();
-        //~^ ERROR: cannot call non-const fn `invalid`
+        //~^ ERROR: cannot call non-const function `invalid`
         0
     }
 };
@@ -52,7 +52,7 @@ static mut bad_seven : u32 = {
 static mut bad_eight : u32 = {
     {
         invalid();
-        //~^ ERROR: cannot call non-const fn `invalid`
+        //~^ ERROR: cannot call non-const function `invalid`
         0
     }
 };
diff --git a/tests/ui/consts/issue-32829-2.stderr b/tests/ui/consts/issue-32829-2.stderr
index bd0b8c15b55..eedd9d34e55 100644
--- a/tests/ui/consts/issue-32829-2.stderr
+++ b/tests/ui/consts/issue-32829-2.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `invalid` in constants
+error[E0015]: cannot call non-const function `invalid` in constants
   --> $DIR/issue-32829-2.rs:10:9
    |
 LL |         invalid();
@@ -6,7 +6,7 @@ LL |         invalid();
    |
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `invalid` in statics
+error[E0015]: cannot call non-const function `invalid` in statics
   --> $DIR/issue-32829-2.rs:32:9
    |
 LL |         invalid();
@@ -15,7 +15,7 @@ LL |         invalid();
    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
 
-error[E0015]: cannot call non-const fn `invalid` in statics
+error[E0015]: cannot call non-const function `invalid` in statics
   --> $DIR/issue-32829-2.rs:54:9
    |
 LL |         invalid();
diff --git a/tests/ui/consts/issue-43105.rs b/tests/ui/consts/issue-43105.rs
index a4ee34c0532..738b73416e0 100644
--- a/tests/ui/consts/issue-43105.rs
+++ b/tests/ui/consts/issue-43105.rs
@@ -1,7 +1,7 @@
 fn xyz() -> u8 { 42 }
 
 const NUM: u8 = xyz();
-//~^ ERROR cannot call non-const fn
+//~^ ERROR cannot call non-const function
 
 fn main() {
     match 1 {
diff --git a/tests/ui/consts/issue-43105.stderr b/tests/ui/consts/issue-43105.stderr
index 0e08feb58de..c030c0f5fcd 100644
--- a/tests/ui/consts/issue-43105.stderr
+++ b/tests/ui/consts/issue-43105.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `xyz` in constants
+error[E0015]: cannot call non-const function `xyz` in constants
   --> $DIR/issue-43105.rs:3:17
    |
 LL | const NUM: u8 = xyz();
diff --git a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs b/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs
index 258997597ea..6a6b0e666e1 100644
--- a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs
+++ b/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs
@@ -1,7 +1,7 @@
 const fn foo(a: i32) -> Vec<i32> {
     vec![1, 2, 3]
     //~^ ERROR allocations are not allowed
-    //~| ERROR cannot call non-const fn
+    //~| ERROR cannot call non-const method
 }
 
 fn main() {}
diff --git a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr b/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr
index 74234108911..8e52a7aa35e 100644
--- a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr
+++ b/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr
@@ -6,7 +6,7 @@ LL |     vec![1, 2, 3]
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constant functions
+error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constant functions
   --> $DIR/bad_const_fn_body_ice.rs:2:5
    |
 LL |     vec![1, 2, 3]
diff --git a/tests/ui/consts/mir_check_nonconst.rs b/tests/ui/consts/mir_check_nonconst.rs
index b6f34b922fa..eede36bd6ed 100644
--- a/tests/ui/consts/mir_check_nonconst.rs
+++ b/tests/ui/consts/mir_check_nonconst.rs
@@ -6,6 +6,6 @@ fn bar() -> Foo {
 }
 
 static foo: Foo = bar();
-//~^ ERROR cannot call non-const fn
+//~^ ERROR cannot call non-const function
 
 fn main() {}
diff --git a/tests/ui/consts/mir_check_nonconst.stderr b/tests/ui/consts/mir_check_nonconst.stderr
index 95d64622ad7..e930fa2103d 100644
--- a/tests/ui/consts/mir_check_nonconst.stderr
+++ b/tests/ui/consts/mir_check_nonconst.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `bar` in statics
+error[E0015]: cannot call non-const function `bar` in statics
   --> $DIR/mir_check_nonconst.rs:8:19
    |
 LL | static foo: Foo = bar();
diff --git a/tests/ui/consts/missing_span_in_backtrace.stderr b/tests/ui/consts/missing_span_in_backtrace.stderr
index 72d15702e89..05ae7305dbc 100644
--- a/tests/ui/consts/missing_span_in_backtrace.stderr
+++ b/tests/ui/consts/missing_span_in_backtrace.stderr
@@ -7,6 +7,8 @@ note: inside `std::ptr::read::<MaybeUninit<MaybeUninit<u8>>>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `std::ptr::swap_nonoverlapping_simple_untyped::<MaybeUninit<u8>>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+note: inside `swap_nonoverlapping::compiletime::<MaybeUninit<u8>>`
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `swap_nonoverlapping::<MaybeUninit<u8>>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `X`
@@ -20,6 +22,7 @@ note: inside `X`
    | |_________^
    = help: this code performed an operation that depends on the underlying bytes representing a pointer
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
+   = note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0010-teach.rs b/tests/ui/error-codes/E0010-teach.rs
index 146e68df14a..0eef2478387 100644
--- a/tests/ui/error-codes/E0010-teach.rs
+++ b/tests/ui/error-codes/E0010-teach.rs
@@ -3,5 +3,5 @@
 #![allow(warnings)]
 
 const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
-//~| ERROR cannot call non-const fn
+//~| ERROR cannot call non-const method
 fn main() {}
diff --git a/tests/ui/error-codes/E0010-teach.stderr b/tests/ui/error-codes/E0010-teach.stderr
index 37a9892ccbf..82bbe01aef7 100644
--- a/tests/ui/error-codes/E0010-teach.stderr
+++ b/tests/ui/error-codes/E0010-teach.stderr
@@ -7,7 +7,7 @@ LL | const CON: Vec<i32> = vec![1, 2, 3];
    = note: The runtime heap is not yet available at compile-time, so no runtime heap allocations can be created.
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
+error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
   --> $DIR/E0010-teach.rs:5:23
    |
 LL | const CON: Vec<i32> = vec![1, 2, 3];
diff --git a/tests/ui/error-codes/E0010.rs b/tests/ui/error-codes/E0010.rs
index 11721efffcb..edb96714dd3 100644
--- a/tests/ui/error-codes/E0010.rs
+++ b/tests/ui/error-codes/E0010.rs
@@ -1,5 +1,5 @@
 #![allow(warnings)]
 
 const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
-//~| ERROR cannot call non-const fn
+//~| ERROR cannot call non-const method
 fn main() {}
diff --git a/tests/ui/error-codes/E0010.stderr b/tests/ui/error-codes/E0010.stderr
index 08947222422..87b722b5f65 100644
--- a/tests/ui/error-codes/E0010.stderr
+++ b/tests/ui/error-codes/E0010.stderr
@@ -6,7 +6,7 @@ LL | const CON: Vec<i32> = vec![1, 2, 3];
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
+error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
   --> $DIR/E0010.rs:3:23
    |
 LL | const CON: Vec<i32> = vec![1, 2, 3];
diff --git a/tests/ui/error-codes/E0015.rs b/tests/ui/error-codes/E0015.rs
index b0211358d81..7a80308d7bb 100644
--- a/tests/ui/error-codes/E0015.rs
+++ b/tests/ui/error-codes/E0015.rs
@@ -3,6 +3,6 @@ fn create_some() -> Option<u8> {
 }
 
 const FOO: Option<u8> = create_some();
-//~^ ERROR cannot call non-const fn `create_some` in constants [E0015]
+//~^ ERROR cannot call non-const function `create_some` in constants [E0015]
 
 fn main() {}
diff --git a/tests/ui/error-codes/E0015.stderr b/tests/ui/error-codes/E0015.stderr
index 9d892a3e098..0c983d28434 100644
--- a/tests/ui/error-codes/E0015.stderr
+++ b/tests/ui/error-codes/E0015.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `create_some` in constants
+error[E0015]: cannot call non-const function `create_some` in constants
   --> $DIR/E0015.rs:5:25
    |
 LL | const FOO: Option<u8> = create_some();
diff --git a/tests/ui/explicit-tail-calls/constck.rs b/tests/ui/explicit-tail-calls/constck.rs
index 36fc3ef6f99..4179fe8caf3 100644
--- a/tests/ui/explicit-tail-calls/constck.rs
+++ b/tests/ui/explicit-tail-calls/constck.rs
@@ -4,14 +4,14 @@
 const fn f() {
     if false {
         become not_const();
-        //~^ error: cannot call non-const fn `not_const` in constant functions
+        //~^ error: cannot call non-const function `not_const` in constant functions
     }
 }
 
 const fn g((): ()) {
     if false {
         become yes_const(not_const());
-        //~^ error: cannot call non-const fn `not_const` in constant functions
+        //~^ error: cannot call non-const function `not_const` in constant functions
     }
 }
 
diff --git a/tests/ui/explicit-tail-calls/constck.stderr b/tests/ui/explicit-tail-calls/constck.stderr
index d9967c45fa0..c223d273b38 100644
--- a/tests/ui/explicit-tail-calls/constck.stderr
+++ b/tests/ui/explicit-tail-calls/constck.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `not_const` in constant functions
+error[E0015]: cannot call non-const function `not_const` in constant functions
   --> $DIR/constck.rs:6:16
    |
 LL |         become not_const();
@@ -6,7 +6,7 @@ LL |         become not_const();
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `not_const` in constant functions
+error[E0015]: cannot call non-const function `not_const` in constant functions
   --> $DIR/constck.rs:13:26
    |
 LL |         become yes_const(not_const());
diff --git a/tests/ui/issues/issue-7364.rs b/tests/ui/issues/issue-7364.rs
index 0608f902fde..4ce9beb68cd 100644
--- a/tests/ui/issues/issue-7364.rs
+++ b/tests/ui/issues/issue-7364.rs
@@ -3,6 +3,6 @@ use std::cell::RefCell;
 // Regression test for issue 7364
 static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
 //~^ ERROR `RefCell<isize>` cannot be shared between threads safely [E0277]
-//~| ERROR cannot call non-const fn
+//~| ERROR cannot call non-const associated function
 
 fn main() { }
diff --git a/tests/ui/issues/issue-7364.stderr b/tests/ui/issues/issue-7364.stderr
index 65ec1d75053..a47a90c90ce 100644
--- a/tests/ui/issues/issue-7364.stderr
+++ b/tests/ui/issues/issue-7364.stderr
@@ -11,7 +11,7 @@ note: required because it appears within the type `Box<RefCell<isize>>`
   --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
    = note: shared static variables must have a type that implements `Sync`
 
-error[E0015]: cannot call non-const fn `Box::<RefCell<isize>>::new` in statics
+error[E0015]: cannot call non-const associated function `Box::<RefCell<isize>>::new` in statics
   --> $DIR/issue-7364.rs:4:37
    |
 LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
diff --git a/tests/ui/resolve/issue-39559-2.stderr b/tests/ui/resolve/issue-39559-2.stderr
index ea27e7bd250..f6e6917d01e 100644
--- a/tests/ui/resolve/issue-39559-2.stderr
+++ b/tests/ui/resolve/issue-39559-2.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
+error[E0015]: cannot call non-const associated function `<Dim3 as Dim>::dim` in constants
   --> $DIR/issue-39559-2.rs:14:24
    |
 LL |     let array: [usize; Dim3::dim()]
@@ -6,7 +6,7 @@ LL |     let array: [usize; Dim3::dim()]
    |
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
+error[E0015]: cannot call non-const associated function `<Dim3 as Dim>::dim` in constants
   --> $DIR/issue-39559-2.rs:16:15
    |
 LL |         = [0; Dim3::dim()];
diff --git a/tests/ui/static/static-mut-not-constant.rs b/tests/ui/static/static-mut-not-constant.rs
index d501e5c2956..3830b468287 100644
--- a/tests/ui/static/static-mut-not-constant.rs
+++ b/tests/ui/static/static-mut-not-constant.rs
@@ -1,4 +1,4 @@
 static mut a: Box<isize> = Box::new(3);
-//~^ ERROR cannot call non-const fn
+//~^ ERROR cannot call non-const associated function
 
 fn main() {}
diff --git a/tests/ui/static/static-mut-not-constant.stderr b/tests/ui/static/static-mut-not-constant.stderr
index 46dc175cb29..f28ea0b1689 100644
--- a/tests/ui/static/static-mut-not-constant.stderr
+++ b/tests/ui/static/static-mut-not-constant.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `Box::<isize>::new` in statics
+error[E0015]: cannot call non-const associated function `Box::<isize>::new` in statics
   --> $DIR/static-mut-not-constant.rs:1:28
    |
 LL | static mut a: Box<isize> = Box::new(3);
diff --git a/tests/ui/static/static-vec-repeat-not-constant.stderr b/tests/ui/static/static-vec-repeat-not-constant.stderr
index a3b930323d5..e6ff199ae01 100644
--- a/tests/ui/static/static-vec-repeat-not-constant.stderr
+++ b/tests/ui/static/static-vec-repeat-not-constant.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `foo` in statics
+error[E0015]: cannot call non-const function `foo` in statics
   --> $DIR/static-vec-repeat-not-constant.rs:3:25
    |
 LL | static a: [isize; 2] = [foo(); 2];
diff --git a/tests/ui/statics/check-values-constraints.rs b/tests/ui/statics/check-values-constraints.rs
index 005a7798895..9df76b5c149 100644
--- a/tests/ui/statics/check-values-constraints.rs
+++ b/tests/ui/statics/check-values-constraints.rs
@@ -89,7 +89,7 @@ static mut STATIC13: SafeStruct =
 
 static mut STATIC14: SafeStruct = SafeStruct {
     field1: SafeEnum::Variant1,
-    field2: SafeEnum::Variant4("str".to_string()), //~ ERROR cannot call non-const fn
+    field2: SafeEnum::Variant4("str".to_string()), //~ ERROR cannot call non-const method
 };
 
 static STATIC15: &'static [Vec<MyOwned>] = &[
diff --git a/tests/ui/statics/check-values-constraints.stderr b/tests/ui/statics/check-values-constraints.stderr
index b4ee34530d3..eb2d37d297e 100644
--- a/tests/ui/statics/check-values-constraints.stderr
+++ b/tests/ui/statics/check-values-constraints.stderr
@@ -19,7 +19,7 @@ LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:81:33
    |
 LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
@@ -29,7 +29,7 @@ LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
+error[E0015]: cannot call non-const method `<str as ToString>::to_string` in statics
   --> $DIR/check-values-constraints.rs:92:38
    |
 LL |     field2: SafeEnum::Variant4("str".to_string()),
@@ -46,7 +46,7 @@ LL |     vec![MyOwned],
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:96:5
    |
 LL |     vec![MyOwned],
@@ -64,7 +64,7 @@ LL |     vec![MyOwned],
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:98:5
    |
 LL |     vec![MyOwned],
@@ -82,7 +82,7 @@ LL |     &vec![MyOwned],
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:103:6
    |
 LL |     &vec![MyOwned],
@@ -100,7 +100,7 @@ LL |     &vec![MyOwned],
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:105:6
    |
 LL |     &vec![MyOwned],
@@ -118,7 +118,7 @@ LL | static STATIC19: Vec<isize> = vec![3];
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:111:31
    |
 LL | static STATIC19: Vec<isize> = vec![3];
@@ -136,7 +136,7 @@ LL |         static x: Vec<isize> = vec![3];
    |
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
+error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
   --> $DIR/check-values-constraints.rs:117:32
    |
 LL |         static x: Vec<isize> = vec![3];
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-0.rs b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-0.rs
index bac7ee023f4..9141d327aee 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-0.rs
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-0.rs
@@ -1,4 +1,5 @@
-//@ compile-flags: -Znext-solver
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
 //@ check-pass
 
 #![feature(const_trait_impl)]
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.rs b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.rs
index a0375cda079..19e86b50d33 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.rs
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.rs
@@ -1,5 +1,4 @@
-//@ compile-flags: -Znext-solver
-//@ known-bug: unknown
+//@ check-pass
 
 #![feature(const_trait_impl, generic_const_exprs)]
 #![allow(incomplete_features)]
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.stderr
deleted file mode 100644
index 8d1c85c0c8a..00000000000
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed
-  --> $DIR/assoc-type-const-bound-usage-1.rs:4:30
-   |
-LL | #![feature(const_trait_impl, generic_const_exprs)]
-   |                              ^^^^^^^^^^^^^^^^^^^
-   |
-   = help: remove one of these features
-
-error[E0284]: type annotations needed: cannot normalize `unqualified<T>::{constant#0}`
-  --> $DIR/assoc-type-const-bound-usage-1.rs:15:37
-   |
-LL | fn unqualified<T: const Trait>() -> Type<{ T::Assoc::func() }> {
-   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `unqualified<T>::{constant#0}`
-
-error[E0284]: type annotations needed: cannot normalize `qualified<T>::{constant#0}`
-  --> $DIR/assoc-type-const-bound-usage-1.rs:19:35
-   |
-LL | fn qualified<T: const Trait>() -> Type<{ <T as Trait>::Assoc::func() }> {
-   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `qualified<T>::{constant#0}`
-
-error[E0284]: type annotations needed: cannot normalize `unqualified<T>::{constant#0}`
-  --> $DIR/assoc-type-const-bound-usage-1.rs:16:5
-   |
-LL |     Type
-   |     ^^^^ cannot normalize `unqualified<T>::{constant#0}`
-
-error[E0284]: type annotations needed: cannot normalize `qualified<T>::{constant#0}`
-  --> $DIR/assoc-type-const-bound-usage-1.rs:20:5
-   |
-LL |     Type
-   |     ^^^^ cannot normalize `qualified<T>::{constant#0}`
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0284`.
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.current.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.current.stderr
new file mode 100644
index 00000000000..03da9159bea
--- /dev/null
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.current.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `U: ~const Other` is not satisfied
+  --> $DIR/assoc-type-const-bound-usage-fail-2.rs:24:5
+   |
+LL |     T::Assoc::<U>::func();
+   |     ^^^^^^^^^^^^^
+
+error[E0277]: the trait bound `U: ~const Other` is not satisfied
+  --> $DIR/assoc-type-const-bound-usage-fail-2.rs:27:5
+   |
+LL |     <T as Trait>::Assoc::<U>::func();
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.next.stderr
index c7af0a220ca..ce58b486a16 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.stderr
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.next.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
-  --> $DIR/assoc-type-const-bound-usage-fail-2.rs:23:5
+  --> $DIR/assoc-type-const-bound-usage-fail-2.rs:24:5
    |
 LL |     T::Assoc::<U>::func();
    |     ^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
-  --> $DIR/assoc-type-const-bound-usage-fail-2.rs:25:5
+  --> $DIR/assoc-type-const-bound-usage-fail-2.rs:27:5
    |
 LL |     <T as Trait>::Assoc::<U>::func();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.rs b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.rs
index b3a636b0f71..bdd98eaf541 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.rs
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail-2.rs
@@ -1,4 +1,5 @@
-//@ compile-flags: -Znext-solver
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
 
 // Check that `~const` item bounds only hold if the where clauses on the
 // associated type are also const.
@@ -21,9 +22,11 @@ trait Other {}
 
 const fn fails<T: ~const Trait, U: Other>() {
     T::Assoc::<U>::func();
-    //~^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
+    //[current]~^ ERROR the trait bound `U: ~const Other` is not satisfied
+    //[next]~^^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
     <T as Trait>::Assoc::<U>::func();
-    //~^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
+    //[current]~^ ERROR the trait bound `U: ~const Other` is not satisfied
+    //[next]~^^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied
 }
 
 const fn works<T: ~const Trait, U: ~const Other>() {
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.current.stderr
index 99fc924ad06..9c29a894749 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.stderr
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.current.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `T: ~const Trait` is not satisfied
-  --> $DIR/assoc-type-const-bound-usage-fail.rs:16:5
+  --> $DIR/assoc-type-const-bound-usage-fail.rs:17:5
    |
 LL |     T::Assoc::func();
    |     ^^^^^^^^
 
 error[E0277]: the trait bound `T: ~const Trait` is not satisfied
-  --> $DIR/assoc-type-const-bound-usage-fail.rs:18:5
+  --> $DIR/assoc-type-const-bound-usage-fail.rs:19:5
    |
 LL |     <T as Trait>::Assoc::func();
    |     ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.next.stderr b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.next.stderr
new file mode 100644
index 00000000000..9c29a894749
--- /dev/null
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.next.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `T: ~const Trait` is not satisfied
+  --> $DIR/assoc-type-const-bound-usage-fail.rs:17:5
+   |
+LL |     T::Assoc::func();
+   |     ^^^^^^^^
+
+error[E0277]: the trait bound `T: ~const Trait` is not satisfied
+  --> $DIR/assoc-type-const-bound-usage-fail.rs:19:5
+   |
+LL |     <T as Trait>::Assoc::func();
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.rs b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.rs
index ce01086f0dc..3761fea1968 100644
--- a/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.rs
+++ b/tests/ui/traits/const-traits/assoc-type-const-bound-usage-fail.rs
@@ -1,4 +1,5 @@
-//@ compile-flags: -Znext-solver
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
 
 // Check that `~const` item bounds only hold if the parent trait is `~const`.
 // i.e. check that we validate the const conditions for the associated type
diff --git a/tests/ui/traits/const-traits/assoc-type.stderr b/tests/ui/traits/const-traits/assoc-type.current.stderr
index b318675b612..4bf9acfbd65 100644
--- a/tests/ui/traits/const-traits/assoc-type.stderr
+++ b/tests/ui/traits/const-traits/assoc-type.current.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied
-  --> $DIR/assoc-type.rs:36:16
+  --> $DIR/assoc-type.rs:37:16
    |
 LL |     type Bar = NonConstAdd;
    |                ^^^^^^^^^^^
    |
 note: required by a bound in `Foo::Bar`
-  --> $DIR/assoc-type.rs:32:15
+  --> $DIR/assoc-type.rs:33:15
    |
 LL |     type Bar: ~const Add;
    |               ^^^^^^ required by this bound in `Foo::Bar`
diff --git a/tests/ui/traits/const-traits/assoc-type.next.stderr b/tests/ui/traits/const-traits/assoc-type.next.stderr
new file mode 100644
index 00000000000..4bf9acfbd65
--- /dev/null
+++ b/tests/ui/traits/const-traits/assoc-type.next.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied
+  --> $DIR/assoc-type.rs:37:16
+   |
+LL |     type Bar = NonConstAdd;
+   |                ^^^^^^^^^^^
+   |
+note: required by a bound in `Foo::Bar`
+  --> $DIR/assoc-type.rs:33:15
+   |
+LL |     type Bar: ~const Add;
+   |               ^^^^^^ required by this bound in `Foo::Bar`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/assoc-type.rs b/tests/ui/traits/const-traits/assoc-type.rs
index 32c91fa51f1..a169b61994c 100644
--- a/tests/ui/traits/const-traits/assoc-type.rs
+++ b/tests/ui/traits/const-traits/assoc-type.rs
@@ -1,4 +1,5 @@
-//@ compile-flags: -Znext-solver
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
 
 #![feature(const_trait_impl)]
 
diff --git a/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr b/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr
index ef494bde98c..7746f103ac3 100644
--- a/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr
+++ b/tests/ui/traits/const-traits/call-const-trait-method-pass.stderr
@@ -7,7 +7,7 @@ LL | impl const PartialEq for Int {
    = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
    = note: adding a non-const method body in the future would be a breaking change
 
-error[E0015]: cannot call non-const fn `<Int as PartialEq>::eq` in constant functions
+error[E0015]: cannot call non-const method `<Int as PartialEq>::eq` in constant functions
   --> $DIR/call-const-trait-method-pass.rs:20:15
    |
 LL |         !self.eq(other)
diff --git a/tests/ui/traits/const-traits/call-generic-in-impl.stderr b/tests/ui/traits/const-traits/call-generic-in-impl.stderr
index 58d0997f5a3..a45dfd95b4a 100644
--- a/tests/ui/traits/const-traits/call-generic-in-impl.stderr
+++ b/tests/ui/traits/const-traits/call-generic-in-impl.stderr
@@ -17,7 +17,7 @@ note: `PartialEq` can't be used with `~const` because it isn't annotated with `#
   --> $SRC_DIR/core/src/cmp.rs:LL:COL
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0015]: cannot call non-const fn `<T as PartialEq>::eq` in constant functions
+error[E0015]: cannot call non-const method `<T as PartialEq>::eq` in constant functions
   --> $DIR/call-generic-in-impl.rs:12:9
    |
 LL |         PartialEq::eq(self, other)
diff --git a/tests/ui/traits/const-traits/call-generic-method-chain.stderr b/tests/ui/traits/const-traits/call-generic-method-chain.stderr
index d7a2a186494..40b4f14733f 100644
--- a/tests/ui/traits/const-traits/call-generic-method-chain.stderr
+++ b/tests/ui/traits/const-traits/call-generic-method-chain.stderr
@@ -53,7 +53,7 @@ LL |     *t == *t
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `<S as PartialEq>::eq` in constant functions
+error[E0015]: cannot call non-const method `<S as PartialEq>::eq` in constant functions
   --> $DIR/call-generic-method-chain.rs:16:15
    |
 LL |         !self.eq(other)
diff --git a/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr b/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr
index 90465d0a5b2..c74f5cf786c 100644
--- a/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr
+++ b/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr
@@ -53,7 +53,7 @@ LL |     *t == *t
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `<S as PartialEq>::eq` in constant functions
+error[E0015]: cannot call non-const method `<S as PartialEq>::eq` in constant functions
   --> $DIR/call-generic-method-dup-bound.rs:14:15
    |
 LL |         !self.eq(other)
diff --git a/tests/ui/traits/const-traits/call-generic-method-pass.stderr b/tests/ui/traits/const-traits/call-generic-method-pass.stderr
index a7626a4e99d..1a33ff5ab45 100644
--- a/tests/ui/traits/const-traits/call-generic-method-pass.stderr
+++ b/tests/ui/traits/const-traits/call-generic-method-pass.stderr
@@ -34,7 +34,7 @@ LL |     *t == *t
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `<S as PartialEq>::eq` in constant functions
+error[E0015]: cannot call non-const method `<S as PartialEq>::eq` in constant functions
   --> $DIR/call-generic-method-pass.rs:16:15
    |
 LL |         !self.eq(other)
diff --git a/tests/ui/traits/const-traits/const-check-fns-in-const-impl.rs b/tests/ui/traits/const-traits/const-check-fns-in-const-impl.rs
index 0330ed5ca8b..f7686ea6139 100644
--- a/tests/ui/traits/const-traits/const-check-fns-in-const-impl.rs
+++ b/tests/ui/traits/const-traits/const-check-fns-in-const-impl.rs
@@ -12,7 +12,7 @@ fn non_const() {}
 
 impl const T for S {
     fn foo() { non_const() }
-    //~^ ERROR cannot call non-const fn
+    //~^ ERROR cannot call non-const function
 }
 
 fn main() {}
diff --git a/tests/ui/traits/const-traits/const-check-fns-in-const-impl.stderr b/tests/ui/traits/const-traits/const-check-fns-in-const-impl.stderr
index d111a9d5639..599a5503b0f 100644
--- a/tests/ui/traits/const-traits/const-check-fns-in-const-impl.stderr
+++ b/tests/ui/traits/const-traits/const-check-fns-in-const-impl.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `non_const` in constant functions
+error[E0015]: cannot call non-const function `non_const` in constant functions
   --> $DIR/const-check-fns-in-const-impl.rs:14:16
    |
 LL |     fn foo() { non_const() }
diff --git a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
index 877249135cd..92427039b43 100644
--- a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
+++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
@@ -12,6 +12,6 @@ impl Foo for () {
 
 fn main() {
     (const || { (()).foo() })();
-    //~^ ERROR: cannot call non-const fn `<() as Foo>::foo` in constant functions
+    //~^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions
     // FIXME(const_trait_impl) this should probably say constant closures
 }
diff --git a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
index 243e94087bb..c08642ba5a3 100644
--- a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
+++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `<() as Foo>::foo` in constant functions
+error[E0015]: cannot call non-const method `<() as Foo>::foo` in constant functions
   --> $DIR/const_closure-const_trait_impl-ice-113381.rs:14:22
    |
 LL |     (const || { (()).foo() })();
diff --git a/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr b/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr
index 8a6401afcf1..64564de2a0c 100644
--- a/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr
+++ b/tests/ui/traits/const-traits/const_derives/derive-const-non-const-type.stderr
@@ -8,7 +8,7 @@ LL | #[derive_const(Default)]
    = note: adding a non-const method body in the future would be a breaking change
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `<A as Default>::default` in constant functions
+error[E0015]: cannot call non-const associated function `<A as Default>::default` in constant functions
   --> $DIR/derive-const-non-const-type.rs:11:14
    |
 LL | #[derive_const(Default)]
diff --git a/tests/ui/traits/const-traits/const_derives/derive-const-use.stderr b/tests/ui/traits/const-traits/const_derives/derive-const-use.stderr
index 3b06f4d801a..9ad3b0c1617 100644
--- a/tests/ui/traits/const-traits/const_derives/derive-const-use.stderr
+++ b/tests/ui/traits/const-traits/const_derives/derive-const-use.stderr
@@ -48,7 +48,7 @@ LL | #[derive_const(Default, PartialEq)]
    = note: adding a non-const method body in the future would be a breaking change
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `<S as Default>::default` in constants
+error[E0015]: cannot call non-const associated function `<S as Default>::default` in constants
   --> $DIR/derive-const-use.rs:18:35
    |
 LL | const _: () = assert!(S((), A) == S::default());
@@ -64,7 +64,7 @@ LL | const _: () = assert!(S((), A) == S::default());
    |
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
 
-error[E0015]: cannot call non-const fn `<() as Default>::default` in constant functions
+error[E0015]: cannot call non-const associated function `<() as Default>::default` in constant functions
   --> $DIR/derive-const-use.rs:16:14
    |
 LL | #[derive_const(Default, PartialEq)]
@@ -75,7 +75,7 @@ LL | pub struct S((), A);
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `<A as Default>::default` in constant functions
+error[E0015]: cannot call non-const associated function `<A as Default>::default` in constant functions
   --> $DIR/derive-const-use.rs:16:18
    |
 LL | #[derive_const(Default, PartialEq)]
diff --git a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
index 8ff15dd09cc..4cb013b9323 100644
--- a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
+++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
@@ -10,7 +10,7 @@ const fn test() -> impl ~const Fn() {
         match sl {
             [first, remainder @ ..] => {
                 assert_eq!(first, &b'f');
-                //~^ ERROR cannot call non-const fn
+                //~^ ERROR cannot call non-const function
                 //~| ERROR cannot call non-const operator
             }
             [] => panic!(),
diff --git a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
index 280f8807f5f..8d9371bf9f6 100644
--- a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
+++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
@@ -46,7 +46,7 @@ LL |                 assert_eq!(first, &b'f');
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0015]: cannot call non-const fn `core::panicking::assert_failed::<&u8, &u8>` in constant functions
+error[E0015]: cannot call non-const function `core::panicking::assert_failed::<&u8, &u8>` in constant functions
   --> $DIR/ice-112822-expected-type-for-param.rs:12:17
    |
 LL |                 assert_eq!(first, &b'f');
diff --git a/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.rs b/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.rs
index 86cb38e0bcf..da533d5e321 100644
--- a/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.rs
+++ b/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.rs
@@ -24,7 +24,7 @@ impl Trait for () {
 
 const fn foo() {
     ().foo();
-    //~^ ERROR cannot call non-const fn `<() as Trait>::foo` in constant functions
+    //~^ ERROR cannot call non-const method `<() as Trait>::foo` in constant functions
 }
 
 const UWU: () = foo();
diff --git a/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.stderr b/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.stderr
index c4547f4c43d..ad0829ff05f 100644
--- a/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.stderr
+++ b/tests/ui/traits/const-traits/inline-incorrect-early-bound-in-ctfe.stderr
@@ -7,7 +7,7 @@ LL |     fn foo(self);
 LL |     fn foo<T>(self) {
    |            ^ found 1 type parameter
 
-error[E0015]: cannot call non-const fn `<() as Trait>::foo` in constant functions
+error[E0015]: cannot call non-const method `<() as Trait>::foo` in constant functions
   --> $DIR/inline-incorrect-early-bound-in-ctfe.rs:26:8
    |
 LL |     ().foo();
diff --git a/tests/ui/traits/const-traits/issue-79450.rs b/tests/ui/traits/const-traits/issue-79450.rs
index 521576d27ef..5ba5036ce27 100644
--- a/tests/ui/traits/const-traits/issue-79450.rs
+++ b/tests/ui/traits/const-traits/issue-79450.rs
@@ -6,7 +6,7 @@ trait Tr {
     fn req(&self);
 
     fn prov(&self) {
-        println!("lul"); //~ ERROR: cannot call non-const fn `_print` in constant functions
+        println!("lul"); //~ ERROR: cannot call non-const function `_print` in constant functions
         self.req();
     }
 }
diff --git a/tests/ui/traits/const-traits/issue-79450.stderr b/tests/ui/traits/const-traits/issue-79450.stderr
index 85996c21211..5bdebbbfb03 100644
--- a/tests/ui/traits/const-traits/issue-79450.stderr
+++ b/tests/ui/traits/const-traits/issue-79450.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `_print` in constant functions
+error[E0015]: cannot call non-const function `_print` in constant functions
   --> $DIR/issue-79450.rs:9:9
    |
 LL |         println!("lul");
diff --git a/tests/ui/traits/const-traits/issue-88155.rs b/tests/ui/traits/const-traits/issue-88155.rs
index 08739de8313..a26128a6ecc 100644
--- a/tests/ui/traits/const-traits/issue-88155.rs
+++ b/tests/ui/traits/const-traits/issue-88155.rs
@@ -9,7 +9,7 @@ pub trait A {
 pub const fn foo<T: A>() -> bool {
     T::assoc()
     //FIXME ~^ ERROR the trait bound
-    //FIXME ~| ERROR cannot call non-const fn
+    //FIXME ~| ERROR cannot call non-const function
 }
 
 fn main() {}
diff --git a/tests/ui/traits/const-traits/issue-88155.stderr b/tests/ui/traits/const-traits/issue-88155.stderr
index 157b54214fa..2e140ac9ff6 100644
--- a/tests/ui/traits/const-traits/issue-88155.stderr
+++ b/tests/ui/traits/const-traits/issue-88155.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `<T as A>::assoc` in constant functions
+error[E0015]: cannot call non-const associated function `<T as A>::assoc` in constant functions
   --> $DIR/issue-88155.rs:10:5
    |
 LL |     T::assoc()
diff --git a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs
index cd8bb5963ad..fa0f7869644 100644
--- a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs
+++ b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs
@@ -11,5 +11,5 @@ impl Foo for () {
 
 fn main() {
     (const || { (()).foo() })();
-    //~^ ERROR: cannot call non-const fn
+    //~^ ERROR: cannot call non-const method
 }
diff --git a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr
index 97ad83130d4..2d33406c222 100644
--- a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr
+++ b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `<() as Foo>::foo` in constant functions
+error[E0015]: cannot call non-const method `<() as Foo>::foo` in constant functions
   --> $DIR/non-const-op-const-closure-non-const-outer.rs:13:22
    |
 LL |     (const || { (()).foo() })();
diff --git a/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr b/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr
index 4ddb1e8c5a9..190af5e7c2d 100644
--- a/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr
+++ b/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr
@@ -17,7 +17,7 @@ note: `From` can't be used with `~const` because it isn't annotated with `#[cons
   --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0015]: cannot call non-const fn `<B as From<A>>::from` in constant functions
+error[E0015]: cannot call non-const associated function `<B as From<A>>::from` in constant functions
   --> $DIR/non-const-op-in-closure-in-const.rs:12:9
    |
 LL |         B::from(self)
diff --git a/tests/ui/traits/const-traits/std-impl-gate.gated.stderr b/tests/ui/traits/const-traits/std-impl-gate.gated.stderr
index f3b17130761..a78cf8ce61e 100644
--- a/tests/ui/traits/const-traits/std-impl-gate.gated.stderr
+++ b/tests/ui/traits/const-traits/std-impl-gate.gated.stderr
@@ -4,7 +4,7 @@ error[E0635]: unknown feature `const_default_impls`
 LL | #![cfg_attr(gated, feature(const_trait_impl, const_default_impls))]
    |                                              ^^^^^^^^^^^^^^^^^^^
 
-error[E0015]: cannot call non-const fn `<Vec<usize> as Default>::default` in constant functions
+error[E0015]: cannot call non-const associated function `<Vec<usize> as Default>::default` in constant functions
   --> $DIR/std-impl-gate.rs:13:5
    |
 LL |     Default::default()
diff --git a/tests/ui/traits/const-traits/std-impl-gate.rs b/tests/ui/traits/const-traits/std-impl-gate.rs
index a9e2ff06290..84091931997 100644
--- a/tests/ui/traits/const-traits/std-impl-gate.rs
+++ b/tests/ui/traits/const-traits/std-impl-gate.rs
@@ -11,7 +11,7 @@ fn non_const_context() -> Vec<usize> {
 
 const fn const_context() -> Vec<usize> {
     Default::default()
-    //[stock]~^ ERROR cannot call non-const fn
+    //[stock]~^ ERROR cannot call non-const associated function
 }
 
 fn main() {
diff --git a/tests/ui/traits/const-traits/std-impl-gate.stock.stderr b/tests/ui/traits/const-traits/std-impl-gate.stock.stderr
index 7240b5f4a94..8728f652ef9 100644
--- a/tests/ui/traits/const-traits/std-impl-gate.stock.stderr
+++ b/tests/ui/traits/const-traits/std-impl-gate.stock.stderr
@@ -1,4 +1,4 @@
-error[E0015]: cannot call non-const fn `<Vec<usize> as Default>::default` in constant functions
+error[E0015]: cannot call non-const associated function `<Vec<usize> as Default>::default` in constant functions
   --> $DIR/std-impl-gate.rs:13:5
    |
 LL |     Default::default()
diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr
index 51b88cf8702..8f88e3aa8bc 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr
@@ -45,7 +45,7 @@ help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations
 LL | #[const_trait] trait Foo {
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-2.rs:20:7
    |
 LL |     x.a();
diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr
index 38fb6f05412..087e80de788 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr
@@ -57,7 +57,7 @@ help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations
 LL | #[const_trait] trait Foo {
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-2.rs:20:7
    |
 LL |     x.a();
diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.rs b/tests/ui/traits/const-traits/super-traits-fail-2.rs
index 53a84bcdd1b..6cc9d739476 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-2.rs
+++ b/tests/ui/traits/const-traits/super-traits-fail-2.rs
@@ -19,7 +19,7 @@ trait Bar: ~const Foo {}
 const fn foo<T: Bar>(x: &T) {
     x.a();
     //[yy,yn]~^ ERROR the trait bound `T: ~const Foo`
-    //[nn,ny]~^^ ERROR cannot call non-const fn `<T as Foo>::a` in constant functions
+    //[nn,ny]~^^ ERROR cannot call non-const method `<T as Foo>::a` in constant functions
 }
 
 fn main() {}
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr
index fd802fde5bd..a5ef716a62a 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr
@@ -88,7 +88,7 @@ help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[
 LL | #[const_trait] trait Bar: ~const Foo {}
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-3.rs:36:7
    |
 LL |     x.a();
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr
index fd802fde5bd..a5ef716a62a 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr
@@ -88,7 +88,7 @@ help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[
 LL | #[const_trait] trait Bar: ~const Foo {}
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-3.rs:36:7
    |
 LL |     x.a();
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.rs b/tests/ui/traits/const-traits/super-traits-fail-3.rs
index aa27554e7f8..d7e0cdc26ed 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.rs
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.rs
@@ -35,7 +35,7 @@ const fn foo<T: ~const Bar>(x: &T) {
     //[nyy,nyn,nny,nnn]~^^^ ERROR: const trait impls are experimental
     x.a();
     //[yyn]~^ ERROR: the trait bound `T: ~const Foo` is not satisfied
-    //[ynn,yny,nny,nnn]~^^ ERROR: cannot call non-const fn `<T as Foo>::a` in constant functions
+    //[ynn,yny,nny,nnn]~^^ ERROR: cannot call non-const method `<T as Foo>::a` in constant functions
     //[nyy,nyn]~^^^ ERROR: cannot call conditionally-const method `<T as Foo>::a` in constant functions
 }
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr
index 16424696eeb..f22bdd472e5 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr
@@ -68,7 +68,7 @@ help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations
 LL | #[const_trait] trait Bar: ~const Foo {}
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-3.rs:36:7
    |
 LL |     x.a();
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr
index c81544c4bf5..14b50815b8e 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr
@@ -57,7 +57,7 @@ help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations
 LL | #[const_trait] trait Foo {
    | ++++++++++++++
 
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
+error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-3.rs:36:7
    |
 LL |     x.a();
diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr
index 5e32d5c429e..e62ebae5fd2 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr
@@ -668,7 +668,7 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
 LL |     type F: std::ops::Fn(_);
    |                          ^ not allowed in type signatures
 
-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
+error[E0015]: cannot call non-const method `<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
    |
 LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x);
@@ -676,7 +676,7 @@ 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
 
-error[E0015]: cannot call non-const fn `<Filter<std::ops::Range<i32>, {closure@$DIR/typeck_type_placeholder_item.rs:230:29: 230:32}> as Iterator>::map::<i32, {closure@$DIR/typeck_type_placeholder_item.rs:230:49: 230:52}>` in constants
+error[E0015]: cannot call non-const method `<Filter<std::ops::Range<i32>, {closure@$DIR/typeck_type_placeholder_item.rs:230:29: 230:32}> as Iterator>::map::<i32, {closure@$DIR/typeck_type_placeholder_item.rs:230:49: 230:52}>` in constants
   --> $DIR/typeck_type_placeholder_item.rs:230:45
    |
 LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x);
diff --git a/triagebot.toml b/triagebot.toml
index eefb87aa298..da652ef7042 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -997,6 +997,7 @@ users_on_vacation = [
     "jyn514",
     "celinval",
     "nnethercote",
+    "workingjubilee",
 ]
 
 [[assign.warn_non_default_branch.exceptions]]