about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2024-12-10 10:12:36 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2024-12-12 20:06:03 +0000
commit2ffe3b1e70a55867de5c85b9cb24cb1a2a3d6162 (patch)
tree8b53d33212677e3b2d417a61e102ebb335d4f412 /compiler/rustc_trait_selection/src/traits
parentc0e0d8f8746740768c13bdb632d7b7f1fef2f17a (diff)
downloadrust-2ffe3b1e70a55867de5c85b9cb24cb1a2a3d6162.tar.gz
rust-2ffe3b1e70a55867de5c85b9cb24cb1a2a3d6162.zip
Move impl constness into impl trait header
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/effects.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/effects.rs b/compiler/rustc_trait_selection/src/traits/effects.rs
index 07fb2efb7fe..b17a489a857 100644
--- a/compiler/rustc_trait_selection/src/traits/effects.rs
+++ b/compiler/rustc_trait_selection/src/traits/effects.rs
@@ -128,7 +128,9 @@ fn evaluate_host_effect_from_selection_candiate<'tcx>(
             Err(_) => Err(EvaluationFailure::NoSolution),
             Ok(Some(source)) => match source {
                 ImplSource::UserDefined(impl_) => {
-                    if tcx.constness(impl_.impl_def_id) != hir::Constness::Const {
+                    if tcx.impl_trait_header(impl_.impl_def_id).unwrap().constness
+                        != hir::Constness::Const
+                    {
                         return Err(EvaluationFailure::NoSolution);
                     }