]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_trans/mir/constant.rs
MIR: split Operand::Consume into Copy and Move.
[rust.git] / src / librustc_trans / mir / constant.rs
index 8c013330e5bcb506dd792ee1103612da777f2adc..e38af774a51ff782105bc74c63a430ababfae4a6 100644 (file)
@@ -505,7 +505,7 @@ fn const_lvalue(&self, lvalue: &mir::Lvalue<'tcx>, span: Span)
                         (Base::Value(llprojected), llextra)
                     }
                     mir::ProjectionElem::Index(index) => {
-                        let index = &mir::Operand::Consume(mir::Lvalue::Local(index));
+                        let index = &mir::Operand::Copy(mir::Lvalue::Local(index));
                         let llindex = self.const_operand(index, span)?.llval;
 
                         let iv = if let Some(iv) = common::const_to_opt_u128(llindex, false) {
@@ -540,7 +540,8 @@ fn const_operand(&self, operand: &mir::Operand<'tcx>, span: Span)
                      -> Result<Const<'tcx>, ConstEvalErr<'tcx>> {
         debug!("const_operand({:?} @ {:?})", operand, span);
         let result = match *operand {
-            mir::Operand::Consume(ref lvalue) => {
+            mir::Operand::Copy(ref lvalue) |
+            mir::Operand::Move(ref lvalue) => {
                 Ok(self.const_lvalue(lvalue, span)?.to_const(span))
             }