Skip to content

Commit 774ea80

Browse files
committed
replace GeneratorSubsts inside related types
1 parent fa7a87b commit 774ea80

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/librustc/infer/opaque_types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
912912
}
913913
}));
914914

915-
self.tcx.mk_generator(def_id, ty::GeneratorSubsts { substs }, movability)
915+
self.tcx.mk_generator(def_id, substs, movability)
916916
}
917917

918918
ty::Param(..) => {

src/librustc/mir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::ty::layout::VariantIdx;
1515
use crate::ty::print::{FmtPrinter, Printer};
1616
use crate::ty::subst::{Subst, SubstsRef};
1717
use crate::ty::{
18-
self, AdtDef, CanonicalUserTypeAnnotations, GeneratorSubsts, Region, Ty, TyCtxt,
18+
self, AdtDef, CanonicalUserTypeAnnotations, Region, Ty, TyCtxt,
1919
UserTypeAnnotationIndex,
2020
};
2121

@@ -2189,7 +2189,7 @@ pub enum AggregateKind<'tcx> {
21892189
Adt(&'tcx AdtDef, VariantIdx, SubstsRef<'tcx>, Option<UserTypeAnnotationIndex>, Option<usize>),
21902190

21912191
Closure(DefId, SubstsRef<'tcx>),
2192-
Generator(DefId, GeneratorSubsts<'tcx>, hir::GeneratorMovability),
2192+
Generator(DefId, SubstsRef<'tcx>, hir::GeneratorMovability),
21932193
}
21942194

21952195
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)]

src/librustc/traits/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ pub struct VtableImplData<'tcx, N> {
610610
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)]
611611
pub struct VtableGeneratorData<'tcx, N> {
612612
pub generator_def_id: DefId,
613-
pub substs: ty::GeneratorSubsts<'tcx>,
613+
pub substs: SubstsRef<'tcx>,
614614
/// Nested obligations. This can be non-empty if the generator
615615
/// signature contains associated types.
616616
pub nested: Vec<N>

src/librustc/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::traits;
2929
use crate::traits::{Clause, Clauses, GoalKind, Goal, Goals};
3030
use crate::ty::{self, DefIdTree, Ty, TypeAndMut};
3131
use crate::ty::{TyS, TyKind, List};
32-
use crate::ty::{AdtKind, AdtDef, GeneratorSubsts, Region, Const};
32+
use crate::ty::{AdtKind, AdtDef, Region, Const};
3333
use crate::ty::{PolyFnSig, InferTy, ParamTy, ProjectionTy, ExistentialPredicate, Predicate};
3434
use crate::ty::RegionKind;
3535
use crate::ty::{TyVar, TyVid, IntVar, IntVid, FloatVar, FloatVid, ConstVid};

src/librustc/ty/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
14101410
use SavedLocalEligibility::*;
14111411
let tcx = self.tcx;
14121412

1413-
let subst_field = |ty: Ty<'tcx>| { ty.subst(tcx, substs.substs) };
1413+
let subst_field = |ty: Ty<'tcx>| { ty.subst(tcx, substs) };
14141414

14151415
let info = tcx.generator_layout(def_id);
14161416
let (ineligible_locals, assignments) = self.generator_saved_local_eligibility(&info);
@@ -1429,7 +1429,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
14291429
.map(|local| subst_field(info.field_tys[local]))
14301430
.map(|ty| tcx.mk_maybe_uninit(ty))
14311431
.map(|ty| self.layout_of(ty));
1432-
let prefix_layouts = substs.prefix_tys(def_id, tcx)
1432+
let prefix_layouts = substs.as_generator().prefix_tys(def_id, tcx)
14331433
.map(|ty| self.layout_of(ty))
14341434
.chain(iter::once(Ok(discr_layout)))
14351435
.chain(promoted_layouts)

src/librustc/ty/print/obsolete.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use rustc::hir::def_id::DefId;
99
use rustc::mir::interpret::ConstValue;
1010
use rustc::ty::subst::SubstsRef;
11-
use rustc::ty::{self, Const, GeneratorSubsts, Instance, Ty, TyCtxt};
11+
use rustc::ty::{self, Const, Instance, Ty, TyCtxt};
1212
use rustc::{bug, hir};
1313
use std::fmt::Write;
1414
use std::iter;

src/librustc/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ impl<'tcx> TyS<'tcx> {
21102110
match self.kind {
21112111
TyKind::Adt(adt, _) => Some(adt.variant_range()),
21122112
TyKind::Generator(def_id, substs, _) =>
2113-
Some(substs.assert_generator().variant_range(def_id, tcx)),
2113+
Some(substs.as_generator().variant_range(def_id, tcx)),
21142114
_ => None,
21152115
}
21162116
}

0 commit comments

Comments
 (0)