From 46d8adeb616bcc2534d9a16ce8b3056ea12ea451 Mon Sep 17 00:00:00 2001 From: tiif Date: Fri, 21 Nov 2025 14:52:09 +0000 Subject: [PATCH] Use TypingEnv::fully_monomorphized for evaluating const without generic param path --- compiler/rustc_trait_selection/src/traits/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index 6032bcacec6a..01b7d354b433 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -637,7 +637,7 @@ pub fn try_evaluate_const<'tcx>( // Since there is no generic parameter, we can just drop the environment // to prevent query cycle. - let typing_env = infcx.typing_env(ty::ParamEnv::empty()); + let typing_env = ty::TypingEnv::fully_monomorphized(); (uv.args, typing_env) }