summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_mir_build/src/build/expr/as_rvalue.rs')
-rw-r--r--compiler/rustc_mir_build/src/build/expr/as_rvalue.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
index 3742d640e..32ffb990b 100644
--- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
+++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
@@ -162,7 +162,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
[],
expr_span,
);
- let storage = this.temp(tcx.mk_mut_ptr(tcx.types.u8), expr_span);
+ let storage = this.temp(Ty::new_mut_ptr(tcx, tcx.types.u8), expr_span);
let success = this.cfg.start_new_block();
this.cfg.terminate(
block,
@@ -173,7 +173,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
destination: storage,
target: Some(success),
unwind: UnwindAction::Continue,
- from_hir_call: false,
+ call_source: CallSource::Misc,
fn_span: expr_span,
},
);
@@ -300,7 +300,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let cast_kind = mir_cast_kind(ty, expr.ty);
block.and(Rvalue::Cast(cast_kind, source, expr.ty))
}
- ExprKind::Pointer { cast, source } => {
+ ExprKind::PointerCoercion { cast, source } => {
let source = unpack!(
block = this.as_operand(
block,
@@ -310,7 +310,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
NeedsTemporary::No
)
);
- block.and(Rvalue::Cast(CastKind::Pointer(cast), source, expr.ty))
+ block.and(Rvalue::Cast(CastKind::PointerCoercion(cast), source, expr.ty))
}
ExprKind::Array { ref fields } => {
// (*) We would (maybe) be closer to codegen if we
@@ -442,7 +442,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
match upvar.kind {
ExprKind::Borrow {
borrow_kind:
- BorrowKind::Mut { allow_two_phase_borrow: false },
+ BorrowKind::Mut { kind: MutBorrowKind::Default },
arg,
} => unpack!(
block = this.limit_capture_mutability(
@@ -532,6 +532,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
| ExprKind::Break { .. }
| ExprKind::Continue { .. }
| ExprKind::Return { .. }
+ | ExprKind::Become { .. }
| ExprKind::InlineAsm { .. }
| ExprKind::PlaceTypeAscription { .. }
| ExprKind::ValueTypeAscription { .. } => {
@@ -563,7 +564,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let bool_ty = self.tcx.types.bool;
let rvalue = match op {
BinOp::Add | BinOp::Sub | BinOp::Mul if self.check_overflow && ty.is_integral() => {
- let result_tup = self.tcx.mk_tup(&[ty, bool_ty]);
+ let result_tup = Ty::new_tup(self.tcx, &[ty, bool_ty]);
let result_value = self.temp(result_tup, span);
self.cfg.push_assign(
@@ -597,7 +598,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let (unsigned_rhs, unsigned_ty) = match rhs_ty.kind() {
ty::Uint(_) => (rhs.to_copy(), rhs_ty),
ty::Int(int_width) => {
- let uint_ty = self.tcx.mk_mach_uint(int_width.to_unsigned());
+ let uint_ty = Ty::new_uint(self.tcx, int_width.to_unsigned());
let rhs_temp = self.temp(uint_ty, span);
self.cfg.push_assign(
block,
@@ -795,8 +796,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
};
let borrow_kind = match mutability {
- Mutability::Not => BorrowKind::Unique,
- Mutability::Mut => BorrowKind::Mut { allow_two_phase_borrow: false },
+ Mutability::Not => BorrowKind::Mut { kind: MutBorrowKind::ClosureCapture },
+ Mutability::Mut => BorrowKind::Mut { kind: MutBorrowKind::Default },
};
let arg_place = arg_place_builder.to_place(this);