From d7c77313cb108b8a8fbeb61dffb74adcc36a82ca Mon Sep 17 00:00:00 2001 From: b-naber Date: Thu, 15 Sep 2022 22:27:41 +0200 Subject: [PATCH] nits --- src/constant.rs | 12 +----------- 1 file changed, 1 insertion(+), 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) => {