]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/build/expr/as_lvalue.rs
MIR: split Operand::Consume into Copy and Move.
[rust.git] / src / librustc_mir / build / expr / as_lvalue.rs
index 69d0dd992281ed86e3aec2ba18db9ef71c1a5de1..46c15ede4d923b1df09afeb54506dac90819537b 100644 (file)
@@ -70,14 +70,14 @@ fn expr_as_lvalue(&mut self,
                                      &len, Rvalue::Len(slice.clone()));
                 this.cfg.push_assign(block, source_info, // lt = idx < len
                                      &lt, Rvalue::BinaryOp(BinOp::Lt,
-                                                           Operand::Consume(Lvalue::Local(idx)),
-                                                           Operand::Consume(len.clone())));
+                                                           Operand::Copy(Lvalue::Local(idx)),
+                                                           Operand::Copy(len.clone())));
 
                 let msg = AssertMessage::BoundsCheck {
-                    len: Operand::Consume(len),
-                    index: Operand::Consume(Lvalue::Local(idx))
+                    len: Operand::Move(len),
+                    index: Operand::Copy(Lvalue::Local(idx))
                 };
-                let success = this.assert(block, Operand::Consume(lt), true,
+                let success = this.assert(block, Operand::Move(lt), true,
                                           msg, expr_span);
                 success.and(slice.index(idx))
             }