about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc_codegen_ssa/mir/constant.rs2
-rw-r--r--src/librustc_codegen_ssa/mir/operand.rs12
-rw-r--r--src/librustc_codegen_ssa/mir/place.rs2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/librustc_codegen_ssa/mir/constant.rs b/src/librustc_codegen_ssa/mir/constant.rs
index d06359ab0ce..181787e3985 100644
--- a/src/librustc_codegen_ssa/mir/constant.rs
+++ b/src/librustc_codegen_ssa/mir/constant.rs
@@ -14,7 +14,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         constant: &mir::Constant<'tcx>,
     ) -> Result<&'tcx ty::Const<'tcx>, ErrorHandled> {
         match constant.literal.val {
-            mir::interpret::ConstValue::Unevaluated(def_id, ref substs) => {
+            ty::ConstKind::Unevaluated(def_id, ref substs) => {
                 let substs = self.monomorphize(substs);
                 let instance = ty::Instance::resolve(
                     self.cx.tcx(), ty::ParamEnv::reveal_all(), def_id, substs,
diff --git a/src/librustc_codegen_ssa/mir/operand.rs b/src/librustc_codegen_ssa/mir/operand.rs
index ba5e47aeede..78d09f834c6 100644
--- a/src/librustc_codegen_ssa/mir/operand.rs
+++ b/src/librustc_codegen_ssa/mir/operand.rs
@@ -75,12 +75,12 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
             return OperandRef::new_zst(bx, layout);
         }
 
-        let val = match val.val {
-            ConstValue::Unevaluated(..) => bug!("unevaluated constant in `OperandRef::from_const`"),
-            ConstValue::Param(_) => bug!("encountered a ConstValue::Param in codegen"),
-            ConstValue::Infer(_) => bug!("encountered a ConstValue::Infer in codegen"),
-            ConstValue::Bound(..) => bug!("encountered a ConstValue::Bound in codegen"),
-            ConstValue::Placeholder(_) => bug!("encountered a ConstValue::Placeholder in codegen"),
+        let val_val = match val.val {
+            ty::ConstKind::Value(val_val) => val_val,
+            _ => bug!("encountered bad ConstKind in codegen"),
+        };
+
+        let val = match val_val {
             ConstValue::Scalar(x) => {
                 let scalar = match layout.abi {
                     layout::Abi::Scalar(ref x) => x,
diff --git a/src/librustc_codegen_ssa/mir/place.rs b/src/librustc_codegen_ssa/mir/place.rs
index 3e7c4ef49fb..d515f114c77 100644
--- a/src/librustc_codegen_ssa/mir/place.rs
+++ b/src/librustc_codegen_ssa/mir/place.rs
@@ -480,7 +480,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                 let layout = cx.layout_of(self.monomorphize(&ty));
                 match bx.tcx().const_eval(param_env.and(cid)) {
                     Ok(val) => match val.val {
-                        mir::interpret::ConstValue::ByRef { alloc, offset } => {
+                        ty::ConstKind::Value(mir::interpret::ConstValue::ByRef { alloc, offset }) => {
                             bx.cx().from_const_alloc(layout, alloc, offset)
                         }
                         _ => bug!("promoteds should have an allocation: {:?}", val),