Skip to content

Commit 7261bd8

Browse files
committed
Update existing usages
1 parent 2c20c44 commit 7261bd8

File tree

30 files changed

+59
-59
lines changed

30 files changed

+59
-59
lines changed

src/librustc/infer/freshen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx> {
101101
ty::ReEmpty |
102102
ty::ReErased => {
103103
// replace all free regions with 'erased
104-
self.tcx().types.re_erased
104+
self.tcx().lifetimes.re_erased
105105
}
106106

107107
ty::ReClosureBound(..) => {

src/librustc/infer/lexical_region_resolve/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
138138
/// empty region. The `expansion` phase will grow this larger.
139139
fn construct_var_data(&self, tcx: TyCtxt<'_, '_, 'tcx>) -> LexicalRegionResolutions<'tcx> {
140140
LexicalRegionResolutions {
141-
error_region: tcx.types.re_static,
142-
values: IndexVec::from_elem_n(VarValue::Value(tcx.types.re_empty), self.num_vars())
141+
error_region: tcx.lifetimes.re_static,
142+
values: IndexVec::from_elem_n(VarValue::Value(tcx.lifetimes.re_empty), self.num_vars())
143143
}
144144
}
145145

@@ -266,7 +266,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
266266
let b_universe = self.var_infos[b_vid].universe;
267267
if let ty::RePlaceholder(p) = lub {
268268
if b_universe.cannot_name(p.universe) {
269-
lub = self.tcx().types.re_static;
269+
lub = self.tcx().lifetimes.re_static;
270270
}
271271
}
272272

@@ -348,7 +348,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
348348

349349
// otherwise, we don't know what the free region is,
350350
// so we must conservatively say the LUB is static:
351-
tcx.types.re_static
351+
tcx.lifetimes.re_static
352352
}
353353

354354
(&ReScope(a_id), &ReScope(b_id)) => {
@@ -371,7 +371,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
371371
(&RePlaceholder(..), _) | (_, &RePlaceholder(..)) => if a == b {
372372
a
373373
} else {
374-
tcx.types.re_static
374+
tcx.lifetimes.re_static
375375
},
376376
}
377377
}
@@ -598,7 +598,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
598598
for lower_bound in &lower_bounds {
599599
let effective_lower_bound = if let ty::RePlaceholder(p) = lower_bound.region {
600600
if node_universe.cannot_name(p.universe) {
601-
self.tcx().types.re_static
601+
self.tcx().lifetimes.re_static
602602
} else {
603603
lower_bound.region
604604
}

src/librustc/infer/opaque_types/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
370370
}
371371
}
372372

373-
let least_region = least_region.unwrap_or(self.tcx.types.re_static);
373+
let least_region = least_region.unwrap_or(self.tcx.lifetimes.re_static);
374374
debug!("constrain_opaque_types: least_region={:?}", least_region);
375375

376376
// Require that the type `concrete_ty` outlives
@@ -608,7 +608,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx>
608608
err.emit();
609609
}
610610
}
611-
self.tcx.types.re_empty
611+
self.tcx.lifetimes.re_empty
612612
},
613613
}
614614
}

src/librustc/middle/expr_use_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
435435

436436
hir::ExprKind::Match(ref discr, ref arms, _) => {
437437
let discr_cmt = Rc::new(return_if_err!(self.mc.cat_expr(&discr)));
438-
let r = self.tcx().types.re_empty;
438+
let r = self.tcx().lifetimes.re_empty;
439439
self.borrow_expr(&discr, r, ty::ImmBorrow, MatchDiscriminant);
440440

441441
// treatment of the discriminant is handled while walking the arms.

src/librustc/middle/mem_categorization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
966966
// we can promote to a constant, otherwise equal to enclosing temp
967967
// lifetime.
968968
let re = if promotable {
969-
self.tcx.types.re_static
969+
self.tcx.lifetimes.re_static
970970
} else {
971971
self.temporary_scope(hir_id.local_id)
972972
};

src/librustc/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
787787
(None, Some(t_a)) => {
788788
select.infcx().register_region_obligation_with_cause(
789789
t_a,
790-
select.infcx().tcx.types.re_static,
790+
select.infcx().tcx.lifetimes.re_static,
791791
&dummy_cause,
792792
);
793793
}

src/librustc/traits/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'a, 'b, 'gcx, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'gcx,
359359
// `for<'a> T: 'a where 'a not in T`, which we can treat as
360360
// `T: 'static`.
361361
Some(t_a) => {
362-
let r_static = self.selcx.tcx().types.re_static;
362+
let r_static = self.selcx.tcx().lifetimes.re_static;
363363
if self.register_region_obligations {
364364
self.selcx.infcx().register_region_obligation_with_cause(
365365
t_a,

src/librustc/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ fn vtable_methods<'a, 'tcx>(
10101010
let substs = trait_ref.map_bound(|trait_ref|
10111011
InternalSubsts::for_item(tcx, def_id, |param, _|
10121012
match param.kind {
1013-
GenericParamDefKind::Lifetime => tcx.types.re_erased.into(),
1013+
GenericParamDefKind::Lifetime => tcx.lifetimes.re_erased.into(),
10141014
GenericParamDefKind::Type { .. } |
10151015
GenericParamDefKind::Const => {
10161016
trait_ref.substs[param.index as usize]

src/librustc/ty/erase_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for RegionEraserVisitor<'a, 'gcx, 't
6767
// whenever a substitution occurs.
6868
match *r {
6969
ty::ReLateBound(..) => r,
70-
_ => self.tcx.types.re_erased
70+
_ => self.tcx.lifetimes.re_erased
7171
}
7272
}
7373
}

src/librustc/ty/fold.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
624624
pub fn erase_late_bound_regions<T>(self, value: &Binder<T>) -> T
625625
where T : TypeFoldable<'tcx>
626626
{
627-
self.replace_late_bound_regions(value, |_| self.types.re_erased).0
627+
self.replace_late_bound_regions(value, |_| self.lifetimes.re_erased).0
628628
}
629629

630630
/// Rewrite any late-bound regions so that they are anonymous. Region numbers are

src/librustc/ty/layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
16751675
let ptr_ty = if this.ty.is_unsafe_ptr() {
16761676
tcx.mk_mut_ptr(nil)
16771677
} else {
1678-
tcx.mk_mut_ref(tcx.types.re_static, nil)
1678+
tcx.mk_mut_ref(tcx.lifetimes.re_static, nil)
16791679
};
16801680
return cx.layout_of(ptr_ty).map_same(|mut ptr_layout| {
16811681
ptr_layout.ty = this.ty;
@@ -1688,7 +1688,7 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
16881688
ty::Str => tcx.types.usize,
16891689
ty::Dynamic(_, _) => {
16901690
tcx.mk_imm_ref(
1691-
tcx.types.re_static,
1691+
tcx.lifetimes.re_static,
16921692
tcx.mk_array(tcx.types.usize, 3),
16931693
)
16941694
/* FIXME: use actual fn pointers

src/librustc/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
601601
pub fn empty_substs_for_def_id(self, item_def_id: DefId) -> SubstsRef<'tcx> {
602602
InternalSubsts::for_item(self, item_def_id, |param, _| {
603603
match param.kind {
604-
GenericParamDefKind::Lifetime => self.types.re_erased.into(),
604+
GenericParamDefKind::Lifetime => self.lifetimes.re_erased.into(),
605605
GenericParamDefKind::Type { .. } => {
606606
bug!("empty_substs_for_def_id: {:?} has type parameters", item_def_id)
607607
}

src/librustc_borrowck/borrowck/gather_loans/lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
110110
}
111111
Categorization::StaticItem |
112112
Categorization::Deref(_, mc::UnsafePtr(..)) => {
113-
self.bccx.tcx.types.re_static
113+
self.bccx.tcx.lifetimes.re_static
114114
}
115115
Categorization::Deref(_, mc::BorrowedPtr(_, r)) => {
116116
r

src/librustc_codegen_ssa/mir/rvalue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
371371
(bx, OperandRef {
372372
val,
373373
layout: self.cx.layout_of(self.cx.tcx().mk_ref(
374-
self.cx.tcx().types.re_erased,
374+
self.cx.tcx().lifetimes.re_erased,
375375
ty::TypeAndMut { ty, mutbl: bk.to_mutbl_lossy() }
376376
)),
377377
})

src/librustc_mir/borrow_check/nll/type_check/relate_tys.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, '_, 'tcx> {
7171
let origin = NLLRegionVariableOrigin::Existential;
7272
self.infcx.next_nll_region_var(origin)
7373
} else {
74-
self.infcx.tcx.types.re_erased
74+
self.infcx.tcx.lifetimes.re_erased
7575
}
7676
}
7777

@@ -82,7 +82,7 @@ impl TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, '_, 'tcx> {
8282
if let Some(borrowck_context) = &mut self.borrowck_context {
8383
borrowck_context.constraints.placeholder_region(self.infcx, placeholder)
8484
} else {
85-
self.infcx.tcx.types.re_erased
85+
self.infcx.tcx.lifetimes.re_erased
8686
}
8787
}
8888

src/librustc_mir/borrow_check/nll/universal_regions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl<'tcx> UniversalRegions<'tcx> {
224224
closure_base_def_id: DefId,
225225
) -> IndexVec<RegionVid, ty::Region<'tcx>> {
226226
let mut region_mapping = IndexVec::with_capacity(expected_num_vars);
227-
region_mapping.push(tcx.types.re_static);
227+
region_mapping.push(tcx.lifetimes.re_static);
228228
tcx.for_each_free_region(&closure_substs, |fr| {
229229
region_mapping.push(fr);
230230
});
@@ -542,7 +542,7 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
542542
DefiningTy::FnDef(_, substs) | DefiningTy::Const(_, substs) => substs,
543543
};
544544

545-
let global_mapping = iter::once((gcx.types.re_static, fr_static));
545+
let global_mapping = iter::once((gcx.lifetimes.re_static, fr_static));
546546
let subst_mapping = identity_substs
547547
.regions()
548548
.zip(fr_substs.regions().map(|r| r.to_region_vid()));

src/librustc_mir/build/expr/as_rvalue.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
7474
BorrowKind::Shared => unpack!(block = this.as_read_only_place(block, arg)),
7575
_ => unpack!(block = this.as_place(block, arg)),
7676
};
77-
block.and(Rvalue::Ref(this.hir.tcx().types.re_erased, borrow_kind, arg_place))
77+
block.and(Rvalue::Ref(this.hir.tcx().lifetimes.re_erased, borrow_kind, arg_place))
7878
}
7979
ExprKind::Binary { op, lhs, rhs } => {
8080
let lhs = unpack!(block = this.as_operand(block, scope, lhs));
@@ -572,7 +572,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
572572
block,
573573
source_info,
574574
&Place::Base(PlaceBase::Local(temp)),
575-
Rvalue::Ref(this.hir.tcx().types.re_erased, borrow_kind, arg_place),
575+
Rvalue::Ref(this.hir.tcx().lifetimes.re_erased, borrow_kind, arg_place),
576576
);
577577

578578
// In constants, temp_lifetime is None. We should not need to drop

src/librustc_mir/build/matches/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
12951295

12961296
all_fake_borrows.into_iter().map(|matched_place| {
12971297
let fake_borrow_deref_ty = matched_place.ty(&self.local_decls, tcx).ty;
1298-
let fake_borrow_ty = tcx.mk_imm_ref(tcx.types.re_erased, fake_borrow_deref_ty);
1298+
let fake_borrow_ty = tcx.mk_imm_ref(tcx.lifetimes.re_erased, fake_borrow_deref_ty);
12991299
let fake_borrow_temp = self.local_decls.push(
13001300
LocalDecl::new_temp(fake_borrow_ty, temp_span)
13011301
);
@@ -1443,7 +1443,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
14431443
debug!("Entering guard building context: {:?}", guard_frame);
14441444
self.guard_context.push(guard_frame);
14451445

1446-
let re_erased = tcx.types.re_erased;
1446+
let re_erased = tcx.lifetimes.re_erased;
14471447
let scrutinee_source_info = self.source_info(scrutinee_span);
14481448
for &(place, temp) in fake_borrows {
14491449
let borrow = Rvalue::Ref(
@@ -1607,7 +1607,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
16071607
// Assign each of the bindings. Since we are binding for a
16081608
// guard expression, this will never trigger moves out of the
16091609
// candidate.
1610-
let re_erased = self.hir.tcx().types.re_erased;
1610+
let re_erased = self.hir.tcx().lifetimes.re_erased;
16111611
for binding in bindings {
16121612
let source_info = self.source_info(binding.span);
16131613

@@ -1659,7 +1659,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
16591659
) where 'tcx: 'b {
16601660
debug!("bind_matched_candidate_for_arm_body(block={:?})", block);
16611661

1662-
let re_erased = self.hir.tcx().types.re_erased;
1662+
let re_erased = self.hir.tcx().lifetimes.re_erased;
16631663
// Assign each of the bindings. This may trigger moves out of the candidate.
16641664
for binding in bindings {
16651665
let source_info = self.source_info(binding.span);
@@ -1735,7 +1735,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
17351735
// This variable isn't mutated but has a name, so has to be
17361736
// immutable to avoid the unused mut lint.
17371737
mutability: Mutability::Not,
1738-
ty: tcx.mk_imm_ref(tcx.types.re_erased, var_ty),
1738+
ty: tcx.mk_imm_ref(tcx.lifetimes.re_erased, var_ty),
17391739
user_ty: UserTypeProjections::none(),
17401740
name: Some(name),
17411741
source_info,

src/librustc_mir/build/matches/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
307307
let (mty, method) = self.hir.trait_method(eq_def_id, "eq", ty, &[ty.into()]);
308308
let method = self.hir.tcx().mk_const(method);
309309

310-
let re_erased = self.hir.tcx().types.re_erased;
310+
let re_erased = self.hir.tcx().lifetimes.re_erased;
311311
// take the argument by reference
312312
let tam = ty::TypeAndMut {
313313
ty,

src/librustc_mir/hair/cx/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn apply_adjustment<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
141141
// then an unsafe coercion.
142142
expr = Expr {
143143
temp_lifetime,
144-
ty: cx.tcx.mk_ref(cx.tcx.types.re_erased,
144+
ty: cx.tcx.mk_ref(cx.tcx.lifetimes.re_erased,
145145
ty::TypeAndMut {
146146
ty: expr.ty,
147147
mutbl: m,

src/librustc_mir/monomorphize/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ fn create_mono_items_for_default_impls<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
11491149

11501150
let substs = InternalSubsts::for_item(tcx, method.def_id, |param, _| {
11511151
match param.kind {
1152-
GenericParamDefKind::Lifetime => tcx.types.re_erased.into(),
1152+
GenericParamDefKind::Lifetime => tcx.lifetimes.re_erased.into(),
11531153
GenericParamDefKind::Type { .. } |
11541154
GenericParamDefKind::Const => {
11551155
trait_ref.substs[param.index as usize]

src/librustc_mir/shim.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
465465

466466
let ref_loc = self.make_place(
467467
Mutability::Not,
468-
tcx.mk_ref(tcx.types.re_erased, ty::TypeAndMut {
468+
tcx.mk_ref(tcx.lifetimes.re_erased, ty::TypeAndMut {
469469
ty,
470470
mutbl: hir::Mutability::MutImmutable,
471471
})
@@ -475,7 +475,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
475475
let statement = self.make_statement(
476476
StatementKind::Assign(
477477
ref_loc.clone(),
478-
box Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, src)
478+
box Rvalue::Ref(tcx.lifetimes.re_erased, BorrowKind::Shared, src)
479479
)
480480
);
481481

@@ -734,7 +734,7 @@ fn build_call_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
734734
// let rcvr = &mut rcvr;
735735
let ref_rcvr = local_decls.push(temp_decl(
736736
Mutability::Not,
737-
tcx.mk_ref(tcx.types.re_erased, ty::TypeAndMut {
737+
tcx.mk_ref(tcx.lifetimes.re_erased, ty::TypeAndMut {
738738
ty: sig.inputs()[0],
739739
mutbl: hir::Mutability::MutMutable
740740
}),
@@ -747,7 +747,7 @@ fn build_call_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
747747
source_info,
748748
kind: StatementKind::Assign(
749749
Place::Base(PlaceBase::Local(ref_rcvr)),
750-
box Rvalue::Ref(tcx.types.re_erased, borrow_kind, rcvr_l)
750+
box Rvalue::Ref(tcx.lifetimes.re_erased, borrow_kind, rcvr_l)
751751
)
752752
});
753753
Operand::Move(Place::Base(PlaceBase::Local(ref_rcvr)))

src/librustc_mir/transform/erase_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for EraseRegionsVisitor<'a, 'tcx> {
2929
}
3030

3131
fn visit_region(&mut self, region: &mut ty::Region<'tcx>, _: Location) {
32-
*region = self.tcx.types.re_erased;
32+
*region = self.tcx.lifetimes.re_erased;
3333
}
3434

3535
fn visit_const(&mut self, constant: &mut &'tcx ty::Const<'tcx>, _: Location) {

src/librustc_mir/transform/inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> {
458458
let dest = if dest_needs_borrow(&destination.0) {
459459
debug!("Creating temp for return destination");
460460
let dest = Rvalue::Ref(
461-
self.tcx.types.re_erased,
461+
self.tcx.lifetimes.re_erased,
462462
BorrowKind::Mut { allow_two_phase_borrow: false },
463463
destination.0);
464464

0 commit comments

Comments
 (0)