nits
This commit is contained in:
parent
a10dd1f340
commit
d7c77313cb
@ -117,17 +117,7 @@ pub(crate) fn codegen_constant<'tcx>(
|
|||||||
constant: &Constant<'tcx>,
|
constant: &Constant<'tcx>,
|
||||||
) -> CValue<'tcx> {
|
) -> CValue<'tcx> {
|
||||||
let (const_val, ty) = match fx.monomorphize(constant.literal) {
|
let (const_val, ty) = match fx.monomorphize(constant.literal) {
|
||||||
ConstantKind::Ty(const_) => match const_.kind() {
|
ConstantKind::Ty(const_) => unreachable!("{:?}", const_),
|
||||||
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::Unevaluated(ty::Unevaluated { def, substs, promoted }, ty)
|
ConstantKind::Unevaluated(ty::Unevaluated { def, substs, promoted }, ty)
|
||||||
if fx.tcx.is_static(def.did) =>
|
if fx.tcx.is_static(def.did) =>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user