Skip to content

Commit a9e657d

Browse files
committed
don't convert valtree to constvalue during normalization
1 parent b79b7d8 commit a9e657d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

compiler/rustc_trait_selection/src/traits/query/normalize.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -351,25 +351,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
351351
&mut self,
352352
constant: mir::ConstantKind<'tcx>,
353353
) -> Result<mir::ConstantKind<'tcx>, Self::Error> {
354-
Ok(match constant {
355-
mir::ConstantKind::Ty(c) => {
356-
let const_folded = c.try_super_fold_with(self)?;
357-
match const_folded.kind() {
358-
ty::ConstKind::Value(valtree) => {
359-
let tcx = self.infcx.tcx;
360-
let ty = const_folded.ty();
361-
let const_val = tcx.valtree_to_const_val((ty, valtree));
362-
debug!(?ty, ?valtree, ?const_val);
363-
364-
mir::ConstantKind::Val(const_val, ty)
365-
}
366-
_ => mir::ConstantKind::Ty(const_folded),
367-
}
368-
}
369-
mir::ConstantKind::Val(_, _) | mir::ConstantKind::Unevaluated(..) => {
370-
constant.try_super_fold_with(self)?
371-
}
372-
})
354+
constant.try_super_fold_with(self)
373355
}
374356

375357
#[inline]

0 commit comments

Comments
 (0)