type Output = Expr<'tcx>;
fn make_mirror<'a, 'gcx>(self, cx: &mut Cx<'a, 'gcx, 'tcx>) -> Expr<'tcx> {
- let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(self.id);
- let expr_extent = cx.tcx.region_maps().node_extent(self.id);
+ let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(cx.tcx, self.id);
+ let expr_extent = cx.tcx.node_extent(self.id);
debug!("Expr::make_mirror(): id={}, span={:?}", self.id, self.span);
};
// Finally, create a destruction scope, if any.
- if let Some(extent) = cx.tcx.region_maps().opt_destruction_extent(self.id) {
+ if let Some(extent) = cx.tcx.opt_destruction_extent(self.id) {
expr = Expr {
temp_lifetime: temp_lifetime,
temp_lifetime_was_shrunk: was_shrunk,
expr: &'tcx hir::Expr)
-> Expr<'tcx> {
let expr_ty = cx.tables().expr_ty(expr);
- let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(expr.id);
+ let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(cx.tcx, expr.id);
let kind = match expr.node {
// Here comes the interesting stuff:
match dest.target_id {
hir::ScopeTarget::Block(target_id) |
hir::ScopeTarget::Loop(hir::LoopIdResult::Ok(target_id)) => ExprKind::Break {
- label: cx.tcx.region_maps().node_extent(target_id),
+ label: cx.tcx.node_extent(target_id),
value: value.to_ref(),
},
hir::ScopeTarget::Loop(hir::LoopIdResult::Err(err)) =>
match dest.target_id {
hir::ScopeTarget::Block(_) => bug!("cannot continue to blocks"),
hir::ScopeTarget::Loop(hir::LoopIdResult::Ok(loop_id)) => ExprKind::Continue {
- label: cx.tcx.region_maps().node_extent(loop_id),
+ label: cx.tcx.node_extent(loop_id),
},
hir::ScopeTarget::Loop(hir::LoopIdResult::Err(err)) =>
bug!("invalid loop id for continue: {}", err)
hir::ExprBox(ref value) => {
ExprKind::Box {
value: value.to_ref(),
- value_extents: cx.tcx.region_maps().node_extent(value.id),
+ value_extents: cx.tcx.node_extent(value.id),
}
}
hir::ExprArray(ref fields) => ExprKind::Array { fields: fields.to_ref() },
method_call: ty::MethodCall)
-> Expr<'tcx> {
let callee = cx.tables().method_map[&method_call];
- let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(expr.id);
+ let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(cx.tcx, expr.id);
Expr {
temp_lifetime: temp_lifetime,
temp_lifetime_was_shrunk: was_shrunk,
expr: &'tcx hir::Expr,
def: Def)
-> ExprKind<'tcx> {
- let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(expr.id);
+ let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(cx.tcx, expr.id);
match def {
Def::Local(def_id) => {
// FIXME we're just hard-coding the idea that the
// signature will be &self or &mut self and hence will
// have a bound region with number 0
- let region = ty::Region::ReFree(ty::FreeRegion {
- scope: Some(cx.tcx.region_maps().node_extent(body_id)),
+ let region = ty::ReFree(ty::FreeRegion {
+ scope: Some(cx.tcx.node_extent(body_id)),
bound_region: ty::BoundRegion::BrAnon(0),
});
let region = cx.tcx.mk_region(region);
PassArgs::ByRef => {
let region = cx.tcx.node_scope_region(expr.id);
let (temp_lifetime, was_shrunk) =
- cx.tcx.region_maps().temporary_scope2(expr.id);
+ cx.tcx.region_maps().temporary_scope2(cx.tcx, expr.id);
argrefs.extend(args.iter()
.map(|arg| {
let arg_ty = cx.tables().expr_ty_adjusted(arg);
// construct the complete expression `foo()` for the overloaded call,
// which will yield the &T type
- let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(expr.id);
+ let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(cx.tcx, expr.id);
let ref_kind = overloaded_operator(cx, expr, method_call, pass_args, receiver, args);
let ref_expr = Expr {
temp_lifetime: temp_lifetime,
closure_expr_id: closure_expr.id,
};
let upvar_capture = cx.tables().upvar_capture(upvar_id).unwrap();
- let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(closure_expr.id);
+ let (temp_lifetime, was_shrunk) = cx.tcx.region_maps().temporary_scope2(cx.tcx, closure_expr.id);
let var_ty = cx.tables().node_id_to_type(id_var);
let captured_var = Expr {
temp_lifetime: temp_lifetime,