about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJames Dietz <jamesthespeedy@gmail.com>2023-06-27 17:03:21 -0400
committerJames Dietz <jamesthespeedy@gmail.com>2023-06-28 07:49:50 -0400
commitce5ed5b6ccf2095bc2cb51534e59306ba7648a43 (patch)
treec9931283d387fb4aafb2d047f9586c3cd3d1bc87
parent08fd6f719ee764cf62659ddf481e22dbfe4b8894 (diff)
downloadrust-ce5ed5b6ccf2095bc2cb51534e59306ba7648a43.tar.gz
rust-ce5ed5b6ccf2095bc2cb51534e59306ba7648a43.zip
add check for ConstKind::Value(_)
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
index a2d23425f3b..3496a06a4e0 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -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,
     };