Don't normalize constants unless they need normalization
This commit is contained in:
parent
7eef946fc0
commit
152646f23f
2 changed files with 5 additions and 1 deletions
|
@ -353,6 +353,10 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
|
|||
&mut self,
|
||||
constant: ty::Const<'tcx>,
|
||||
) -> Result<ty::Const<'tcx>, Self::Error> {
|
||||
if !needs_normalization(&constant, self.param_env.reveal()) {
|
||||
return Ok(constant);
|
||||
}
|
||||
|
||||
let constant = constant.try_super_fold_with(self)?;
|
||||
debug!(?constant, ?self.param_env);
|
||||
Ok(crate::traits::project::with_replaced_escaping_bound_vars(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue