Rvalue::BinaryOp(BinOp::Eq, arg.clone(), minval));
let err = ConstMathErr::Overflow(Op::Neg);
- block = this.assert(block, Operand::Consume(is_min), false,
+ block = this.assert(block, Operand::Move(is_min), false,
AssertMessage::Math(err), expr_span);
}
block.and(Rvalue::UnaryOp(op, arg))
// initialize the box contents:
unpack!(block = this.into(&Lvalue::Local(result).deref(), block, value));
- block.and(Rvalue::Use(Operand::Consume(Lvalue::Local(result))))
+ block.and(Rvalue::Use(Operand::Move(Lvalue::Local(result))))
}
ExprKind::Cast { source } => {
let source = this.hir.mirror(source);
.zip(field_types.into_iter())
.map(|(n, ty)| match fields_map.get(&n) {
Some(v) => v.clone(),
- None => Operand::Consume(base.clone().field(n, ty))
+ None => this.consume_by_copy_or_move(base.clone().field(n, ty))
})
.collect()
} else {
}
});
- block = self.assert(block, Operand::Consume(of), false,
+ block = self.assert(block, Operand::Move(of), false,
AssertMessage::Math(err), span);
- block.and(Rvalue::Use(Operand::Consume(val)))
+ block.and(Rvalue::Use(Operand::Move(val)))
} else {
if ty.is_integral() && (op == BinOp::Div || op == BinOp::Rem) {
// Checking division and remainder is more complex, since we 1. always check
self.cfg.push_assign(block, source_info, &is_zero,
Rvalue::BinaryOp(BinOp::Eq, rhs.clone(), zero));
- block = self.assert(block, Operand::Consume(is_zero), false,
+ block = self.assert(block, Operand::Move(is_zero), false,
AssertMessage::Math(zero_err), span);
// We only need to check for the overflow in one case:
self.cfg.push_assign(block, source_info, &is_min,
Rvalue::BinaryOp(BinOp::Eq, lhs.clone(), min));
- let is_neg_1 = Operand::Consume(is_neg_1);
- let is_min = Operand::Consume(is_min);
+ let is_neg_1 = Operand::Move(is_neg_1);
+ let is_min = Operand::Move(is_min);
self.cfg.push_assign(block, source_info, &of,
Rvalue::BinaryOp(BinOp::BitAnd, is_neg_1, is_min));
- block = self.assert(block, Operand::Consume(of), false,
+ block = self.assert(block, Operand::Move(of), false,
AssertMessage::Math(overflow_err), span);
}
}