Skip to content

Commit ce5ed5b

Browse files
committed
add check for ConstKind::Value(_)
1 parent 08fd6f7 commit ce5ed5b

File tree

1 file changed

+7
-2
lines changed
  • compiler/rustc_const_eval/src/transform/check_consts

1 file changed

+7
-2
lines changed

compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,16 @@ where
348348
// way for type and mir constants.
349349
let uneval = match constant.literal {
350350
ConstantKind::Ty(ct)
351-
if matches!(ct.kind(), ty::ConstKind::Param(_) | ty::ConstKind::Error(_)) =>
351+
if matches!(
352+
ct.kind(),
353+
ty::ConstKind::Param(_) | ty::ConstKind::Error(_) | ty::ConstKind::Value(_)
354+
) =>
352355
{
353356
None
354357
}
355-
ConstantKind::Ty(c) => bug!("expected ConstKind::Param here, found {:?}", c),
358+
ConstantKind::Ty(c) => {
359+
bug!("expected ConstKind::Param or ConstKind::Value here, found {:?}", c)
360+
}
356361
ConstantKind::Unevaluated(uv, _) => Some(uv),
357362
ConstantKind::Val(..) => None,
358363
};

0 commit comments

Comments
 (0)