use crate::build::expr::category::{Category, RvalueFunc};
use crate::build::{BlockAnd, BlockAndExtension, Builder};
use crate::hair::*;
-use rustc::middle::region;
-use rustc::mir::AssertKind;
-use rustc::mir::*;
-use rustc::ty::{self, Ty, UpvarSubsts};
+use rustc_middle::middle::region;
+use rustc_middle::mir::AssertKind;
+use rustc_middle::mir::*;
+use rustc_middle::ty::{self, Ty, UpvarSubsts};
use rustc_span::Span;
impl<'a, 'tcx> Builder<'a, 'tcx> {
this.cfg.push_assign(
block,
source_info,
- &is_min,
+ is_min,
Rvalue::BinaryOp(BinOp::Eq, arg.to_copy(), minval),
);
// malloc some memory of suitable type (thus far, uninitialized):
let box_ = Rvalue::NullaryOp(NullOp::Box, value.ty);
- this.cfg.push_assign(block, source_info, &Place::from(result), box_);
+ this.cfg.push_assign(block, source_info, Place::from(result), box_);
// initialize the box contents:
unpack!(
- block = this.into(
- &this.hir.tcx().mk_place_deref(Place::from(result)),
- block,
- value
- )
+ block =
+ this.into(this.hir.tcx().mk_place_deref(Place::from(result)), block, value)
);
block.and(Rvalue::Use(Operand::Move(Place::from(result))))
}
}
ExprKind::Assign { .. } | ExprKind::AssignOp { .. } => {
block = unpack!(this.stmt_expr(block, expr, None));
- block.and(this.unit_rvalue())
+ block.and(Rvalue::Use(Operand::Constant(box Constant {
+ span: expr_span,
+ user_ty: None,
+ literal: ty::Const::zero_sized(this.hir.tcx(), this.hir.tcx().types.unit),
+ })))
}
ExprKind::Yield { .. }
| ExprKind::Literal { .. }
| ExprKind::Break { .. }
| ExprKind::Continue { .. }
| ExprKind::Return { .. }
- | ExprKind::InlineAsm { .. }
+ | ExprKind::LlvmInlineAsm { .. }
| ExprKind::PlaceTypeAscription { .. }
| ExprKind::ValueTypeAscription { .. } => {
// these do not have corresponding `Rvalue` variants,
self.cfg.push_assign(
block,
source_info,
- &result_value,
+ result_value,
Rvalue::CheckedBinaryOp(op, lhs, rhs),
);
let val_fld = Field::new(0);
self.cfg.push_assign(
block,
source_info,
- &is_zero,
+ is_zero,
Rvalue::BinaryOp(BinOp::Eq, rhs.to_copy(), zero),
);
self.cfg.push_assign(
block,
source_info,
- &is_neg_1,
+ is_neg_1,
Rvalue::BinaryOp(BinOp::Eq, rhs.to_copy(), neg_1),
);
self.cfg.push_assign(
block,
source_info,
- &is_min,
+ is_min,
Rvalue::BinaryOp(BinOp::Eq, lhs.to_copy(), min),
);
self.cfg.push_assign(
block,
source_info,
- &of,
+ of,
Rvalue::BinaryOp(BinOp::BitAnd, is_neg_1, is_min),
);
this.cfg.push_assign(
block,
source_info,
- &Place::from(temp),
+ Place::from(temp),
Rvalue::Ref(this.hir.tcx().lifetimes.re_erased, borrow_kind, arg_place),
);