about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorb-naber <bn263@gmx.de>2022-09-15 22:27:41 +0200
committerb-naber <bn263@gmx.de>2022-09-15 22:27:41 +0200
commitd7c77313cb108b8a8fbeb61dffb74adcc36a82ca (patch)
treee35e146052870b61cbd35c5d4aaab64ae4c4f801 /src
parenta10dd1f340c425660557c042836da9e1e52e7453 (diff)
downloadrust-d7c77313cb108b8a8fbeb61dffb74adcc36a82ca.tar.gz
rust-d7c77313cb108b8a8fbeb61dffb74adcc36a82ca.zip
nits
Diffstat (limited to 'src')
-rw-r--r--src/constant.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/constant.rs b/src/constant.rs
index bc34802fa72..6b4ed9b9d40 100644
--- a/src/constant.rs
+++ b/src/constant.rs
@@ -117,17 +117,7 @@ pub(crate) fn codegen_constant<'tcx>(
     constant: &Constant<'tcx>,
 ) -> CValue<'tcx> {
     let (const_val, ty) = match fx.monomorphize(constant.literal) {
-        ConstantKind::Ty(const_) => match const_.kind() {
-            ConstKind::Value(valtree) => {
-                (fx.tcx.valtree_to_const_val((const_.ty(), valtree)), const_.ty())
-            }
-            ConstKind::Unevaluated(_) => bug!("expected constant to be evaluated at this stage"),
-            ConstKind::Param(_)
-            | ConstKind::Infer(_)
-            | ConstKind::Bound(_, _)
-            | ConstKind::Placeholder(_)
-            | ConstKind::Error(_) => unreachable!("{:?}", const_),
-        },
+        ConstantKind::Ty(const_) => unreachable!("{:?}", const_),
         ConstantKind::Unevaluated(ty::Unevaluated { def, substs, promoted }, ty)
             if fx.tcx.is_static(def.did) =>
         {