about summary refs log tree commit diff
diff options
context:
space:
mode:
authorb-naber <bn263@gmx.de>2022-09-22 14:22:51 +0200
committerb-naber <bn263@gmx.de>2022-09-22 14:46:14 +0200
commita9e657dbfccd2fb0dbbd53ddc29fcfc000377561 (patch)
tree1bc138fac01c0127b867e70e1d46a65b969293fc
parentb79b7d8b4e0f2b112142a9ce1fea335f321a6558 (diff)
downloadrust-a9e657dbfccd2fb0dbbd53ddc29fcfc000377561.tar.gz
rust-a9e657dbfccd2fb0dbbd53ddc29fcfc000377561.zip
don't convert valtree to constvalue during normalization
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/normalize.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
index 88000d46978..a3ac24f27d1 100644
--- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
@@ -351,25 +351,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
         &mut self,
         constant: mir::ConstantKind<'tcx>,
     ) -> Result<mir::ConstantKind<'tcx>, Self::Error> {
-        Ok(match constant {
-            mir::ConstantKind::Ty(c) => {
-                let const_folded = c.try_super_fold_with(self)?;
-                match const_folded.kind() {
-                    ty::ConstKind::Value(valtree) => {
-                        let tcx = self.infcx.tcx;
-                        let ty = const_folded.ty();
-                        let const_val = tcx.valtree_to_const_val((ty, valtree));
-                        debug!(?ty, ?valtree, ?const_val);
-
-                        mir::ConstantKind::Val(const_val, ty)
-                    }
-                    _ => mir::ConstantKind::Ty(const_folded),
-                }
-            }
-            mir::ConstantKind::Val(_, _) | mir::ConstantKind::Unevaluated(..) => {
-                constant.try_super_fold_with(self)?
-            }
-        })
+        constant.try_super_fold_with(self)
     }
 
     #[inline]