Skip to content

Commit d7c7731

Browse files
committed
nits
1 parent a10dd1f commit d7c7731

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/constant.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,7 @@ pub(crate) fn codegen_constant<'tcx>(
117117
constant: &Constant<'tcx>,
118118
) -> CValue<'tcx> {
119119
let (const_val, ty) = match fx.monomorphize(constant.literal) {
120-
ConstantKind::Ty(const_) => match const_.kind() {
121-
ConstKind::Value(valtree) => {
122-
(fx.tcx.valtree_to_const_val((const_.ty(), valtree)), const_.ty())
123-
}
124-
ConstKind::Unevaluated(_) => bug!("expected constant to be evaluated at this stage"),
125-
ConstKind::Param(_)
126-
| ConstKind::Infer(_)
127-
| ConstKind::Bound(_, _)
128-
| ConstKind::Placeholder(_)
129-
| ConstKind::Error(_) => unreachable!("{:?}", const_),
130-
},
120+
ConstantKind::Ty(const_) => unreachable!("{:?}", const_),
131121
ConstantKind::Unevaluated(ty::Unevaluated { def, substs, promoted }, ty)
132122
if fx.tcx.is_static(def.did) =>
133123
{

0 commit comments

Comments
 (0)