Skip to content

Commit 1999d06

Browse files
author
Lukas Markeffsky
committed
skip normalizing param env if it is already normalized
1 parent b0af276 commit 1999d06

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+3
-0
lines changed

compiler/rustc_trait_selection/src/traits/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ pub fn normalize_param_env_or_error<'tcx>(
409409
debug!("normalize_param_env_or_error: elaborated-predicates={:?}", predicates);
410410

411411
let elaborated_env = ty::ParamEnv::new(tcx.mk_clauses(&predicates), unnormalized_env.reveal());
412+
if !normalize::needs_normalization(&elaborated_env, unnormalized_env.reveal()) {
413+
return elaborated_env;
414+
}
412415

413416
// HACK: we are trying to normalize the param-env inside *itself*. The problem is that
414417
// normalization expects its param-env to be already normalized, which means we have

0 commit comments

Comments
 (0)