about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-17 22:33:19 +0100
committerGitHub <noreply@github.com>2022-11-17 22:33:19 +0100
commit1c52c247f98fd66b11be0179b1e3f80f05b5ddfe (patch)
tree883f449bad511a40a6253b97d985999a5c1cdb61 /compiler/rustc_const_eval/src/transform
parentc9ccb0ba2853f97886bdd2b5ea1839839e5e6229 (diff)
parent20ea083d87ca46c5bea9c2d37050f3673fcb141b (diff)
downloadrust-1c52c247f98fd66b11be0179b1e3f80f05b5ddfe.tar.gz
rust-1c52c247f98fd66b11be0179b1e3f80f05b5ddfe.zip
Rollup merge of #104444 - chenyukang:yukang/fix-104390, r=compiler-errors
Fix ICE in in_operand for ty error

Fixes #104390

By the way, moving some test cases to proper directory for tidy bless.
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs6
1 files changed, 5 insertions, 1 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 d995d533ca3..8a920fbfd51 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -351,7 +351,11 @@ where
     // FIXME(valtrees): check whether const qualifs should behave the same
     // way for type and mir constants.
     let uneval = match constant.literal {
-        ConstantKind::Ty(ct) if matches!(ct.kind(), ty::ConstKind::Param(_)) => None,
+        ConstantKind::Ty(ct)
+            if matches!(ct.kind(), ty::ConstKind::Param(_) | ty::ConstKind::Error(_)) =>
+        {
+            None
+        }
         ConstantKind::Ty(c) => bug!("expected ConstKind::Param here, found {:?}", c),
         ConstantKind::Unevaluated(uv, _) => Some(uv),
         ConstantKind::Val(..) => None,