region, ty::TypeAndMut { ty: expr.ty, mutbl: mutbl }),
span: expr.span,
kind: ExprKind::Borrow {
- region: *region,
+ region: region,
borrow_kind: to_borrow_kind(mutbl),
arg: expr.to_ref()
}
ty: adjusted_ty,
span: self.span,
kind: ExprKind::Borrow {
- region: *r,
+ region: r,
borrow_kind: to_borrow_kind(m),
arg: expr.to_ref(),
},
ty: cx.tcx.mk_ref(region, ty::TypeAndMut { ty: expr.ty, mutbl: m }),
span: self.span,
kind: ExprKind::Borrow {
- region: *region,
+ region: region,
borrow_kind: to_borrow_kind(m),
arg: expr.to_ref(),
},
_ => span_bug!(expr.span, "type of & not region"),
};
ExprKind::Borrow {
- region: *region,
+ region: region,
borrow_kind: to_borrow_kind(mutbl),
arg: expr.to_ref(),
}
ExprKind::Deref {
arg: Expr {
temp_lifetime: temp_lifetime,
- ty: cx.tcx.mk_ref(
- cx.tcx.mk_region(borrow.region),
+ ty: cx.tcx.mk_ref(borrow.region,
ty::TypeAndMut {
ty: var_ty,
mutbl: borrow.kind.to_mutbl_lossy()
}
PassArgs::ByRef => {
- let scope = cx.tcx.region_maps.node_extent(expr.id);
- let region = cx.tcx.mk_region(ty::ReScope(scope));
+ let region = cx.tcx.node_scope_region(expr.id);
let temp_lifetime = cx.tcx.region_maps.temporary_scope(expr.id);
argrefs.extend(
args.iter()
temp_lifetime: temp_lifetime,
ty: adjusted_ty,
span: expr.span,
- kind: ExprKind::Borrow { region: *region,
+ kind: ExprKind::Borrow { region: region,
borrow_kind: BorrowKind::Shared,
arg: arg.to_ref() }
}.to_ref()