We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eef8a02 commit 6e5c7f1Copy full SHA for 6e5c7f1
1 file changed
compiler/rustc_trait_selection/src/traits/mod.rs
@@ -635,9 +635,18 @@ pub fn try_evaluate_const<'tcx>(
635
return Err(EvaluateConstErr::HasGenericsOrInfers);
636
}
637
638
- let typing_env = infcx
+ let mut typing_env;
639
+
640
+ typing_env = infcx
641
.typing_env(tcx.erase_and_anonymize_regions(param_env))
642
.with_post_analysis_normalized(tcx);
643
644
+ // Since there is no generic parameter, we can just drop the environment
645
+ // to prevent query cycle.
646
+ if !uv.args.has_non_region_param() {
647
+ typing_env = infcx.typing_env(ty::ParamEnv::empty());
648
+ }
649
650
(uv.args, typing_env)
651
652
};
0 commit comments