Skip to content

Commit 1930bfb

Browse files
committed
Rename GeneratorSubsts::prefix_tys to outer_tys for consistency
1 parent dafc7ee commit 1930bfb

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/librustc/ty/layout.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1340,13 +1340,13 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
13401340
// Build a prefix layout, including "promoting" all ineligible
13411341
// locals as part of the prefix. We compute the layout of all of
13421342
// these fields at once to get optimal packing.
1343-
let discr_index = substs.prefix_tys(def_id, tcx).count();
1343+
let discr_index = substs.outer_tys(def_id, tcx).count();
13441344
let promoted_tys =
13451345
ineligible_locals.iter().map(|local| subst_field(info.field_tys[local]));
1346-
let prefix_tys = substs.prefix_tys(def_id, tcx)
1346+
let outer_tys = substs.outer_tys(def_id, tcx)
13471347
.chain(iter::once(substs.discr_ty(tcx)))
13481348
.chain(promoted_tys);
1349-
let prefix_layouts = prefix_tys
1349+
let prefix_layouts = outer_tys
13501350
.map(|ty| self.layout_of(ty))
13511351
.collect::<Result<Vec<_>, _>>()?;
13521352
let prefix = self.univariant_uninterned(
@@ -2044,7 +2044,7 @@ where
20442044
if i == discr_index {
20452045
return discr_layout(discr);
20462046
}
2047-
substs.prefix_tys(def_id, tcx).nth(i).unwrap()
2047+
substs.outer_tys(def_id, tcx).nth(i).unwrap()
20482048
}
20492049
}
20502050
}

src/librustc/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl<'tcx> GeneratorSubsts<'tcx> {
558558
/// This is the types of the fields of a generator which are not stored in a
559559
/// variant.
560560
#[inline]
561-
pub fn prefix_tys(self, def_id: DefId, tcx: TyCtxt<'tcx>) -> impl Iterator<Item = Ty<'tcx>> {
561+
pub fn outer_tys(self, def_id: DefId, tcx: TyCtxt<'tcx>) -> impl Iterator<Item = Ty<'tcx>> {
562562
self.upvar_tys(def_id, tcx)
563563
}
564564
}

src/librustc_codegen_llvm/debuginfo/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ pub fn type_metadata(
690690
usage_site_span).finalize(cx)
691691
}
692692
ty::Generator(def_id, substs, _) => {
693-
let upvar_tys : Vec<_> = substs.prefix_tys(def_id, cx.tcx).map(|t| {
693+
let upvar_tys : Vec<_> = substs.outer_tys(def_id, cx.tcx).map(|t| {
694694
cx.tcx.normalize_erasing_regions(ParamEnv::reveal_all(), t)
695695
}).collect();
696696
prepare_enum_metadata(cx,

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,10 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
790790
ty::Generator(def_id, substs, _) => {
791791
// Only prefix fields (upvars and current state) are
792792
// accessible without a variant index.
793-
return match substs.prefix_tys(def_id, tcx).nth(field.index()) {
793+
return match substs.outer_tys(def_id, tcx).nth(field.index()) {
794794
Some(ty) => Ok(ty),
795795
None => Err(FieldAccessError::OutOfRange {
796-
field_count: substs.prefix_tys(def_id, tcx).count(),
796+
field_count: substs.outer_tys(def_id, tcx).count(),
797797
}),
798798
}
799799
}
@@ -1922,10 +1922,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19221922
// It doesn't make sense to look at a field beyond the prefix;
19231923
// these require a variant index, and are not initialized in
19241924
// aggregate rvalues.
1925-
match substs.prefix_tys(def_id, tcx).nth(field_index) {
1925+
match substs.outer_tys(def_id, tcx).nth(field_index) {
19261926
Some(ty) => Ok(ty),
19271927
None => Err(FieldAccessError::OutOfRange {
1928-
field_count: substs.prefix_tys(def_id, tcx).count(),
1928+
field_count: substs.outer_tys(def_id, tcx).count(),
19291929
}),
19301930
}
19311931
}

0 commit comments

Comments
 (0)