about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/interpret/operand.rs
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-09-10 19:43:53 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-09-20 08:22:35 +0200
commit2a00dda90258576e3adf5ecae0437a8fe6fadbcf (patch)
tree76363ded70d38d49b3b250a625a6f586733c30e1 /compiler/rustc_mir/src/interpret/operand.rs
parent255a4c58f5863ed41c2e68792799125c6c676575 (diff)
downloadrust-2a00dda90258576e3adf5ecae0437a8fe6fadbcf.tar.gz
rust-2a00dda90258576e3adf5ecae0437a8fe6fadbcf.zip
miri: correctly deal with `ConstKind::Bound`
Diffstat (limited to 'compiler/rustc_mir/src/interpret/operand.rs')
-rw-r--r--compiler/rustc_mir/src/interpret/operand.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_mir/src/interpret/operand.rs b/compiler/rustc_mir/src/interpret/operand.rs
index 57245696e57..136a2699d20 100644
--- a/compiler/rustc_mir/src/interpret/operand.rs
+++ b/compiler/rustc_mir/src/interpret/operand.rs
@@ -549,7 +549,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         };
         // Early-return cases.
         let val_val = match val.val {
-            ty::ConstKind::Param(_) => throw_inval!(TooGeneric),
+            ty::ConstKind::Param(_) | ty::ConstKind::Bound(..) => throw_inval!(TooGeneric),
             ty::ConstKind::Error(_) => throw_inval!(TypeckError(ErrorReported)),
             ty::ConstKind::Unevaluated(def, substs, promoted) => {
                 let instance = self.resolve(def.did, substs)?;
@@ -561,9 +561,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                 // happening.
                 return Ok(self.const_eval(GlobalId { instance, promoted }, val.ty)?);
             }
-            ty::ConstKind::Infer(..)
-            | ty::ConstKind::Bound(..)
-            | ty::ConstKind::Placeholder(..) => {
+            ty::ConstKind::Infer(..) | ty::ConstKind::Placeholder(..) => {
                 span_bug!(self.cur_span(), "const_to_op: Unexpected ConstKind {:?}", val)
             }
             ty::ConstKind::Value(val_val) => val_val,