add check for ConstKind::Value(_)

This commit is contained in:
James Dietz 2023-06-27 17:03:21 -04:00
parent 08fd6f719e
commit ce5ed5b6cc

View file

@ -348,11 +348,16 @@ where
// way for type and mir constants.
let uneval = match constant.literal {
ConstantKind::Ty(ct)
if matches!(ct.kind(), ty::ConstKind::Param(_) | ty::ConstKind::Error(_)) =>
if matches!(
ct.kind(),
ty::ConstKind::Param(_) | ty::ConstKind::Error(_) | ty::ConstKind::Value(_)
) =>
{
None
}
ConstantKind::Ty(c) => bug!("expected ConstKind::Param here, found {:?}", c),
ConstantKind::Ty(c) => {
bug!("expected ConstKind::Param or ConstKind::Value here, found {:?}", c)
}
ConstantKind::Unevaluated(uv, _) => Some(uv),
ConstantKind::Val(..) => None,
};