Skip to content

Commit

Permalink
add check for ConstKind::Value(_)
Browse files Browse the repository at this point in the history
  • Loading branch information
mj10021 committed Jun 28, 2023
1 parent 08fd6f7 commit ce5ed5b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit ce5ed5b

Please sign in to comment.