/// needn't) be tracked across crates.
pub source_scope_local_data: ClearCrossCrate<IndexVec<SourceScope, SourceScopeLocalData>>,
- /// Rvalues promoted from this function, such as borrows of constants.
- /// Each of them is the Body of a constant with the fn's type parameters
- /// in scope, but a separate set of locals.
- pub promoted: IndexVec<Promoted, Body<'tcx>>,
-
/// Yields type of the function, if it is a generator.
pub yield_ty: Option<Ty<'tcx>>,
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
source_scopes: IndexVec<SourceScope, SourceScopeData>,
source_scope_local_data: ClearCrossCrate<IndexVec<SourceScope, SourceScopeLocalData>>,
- promoted: IndexVec<Promoted, Body<'tcx>>,
yield_ty: Option<Ty<'tcx>>,
local_decls: LocalDecls<'tcx>,
user_type_annotations: CanonicalUserTypeAnnotations<'tcx>,
basic_blocks,
source_scopes,
source_scope_local_data,
- promoted,
yield_ty,
generator_drop: None,
generator_layout: None,
basic_blocks,
source_scopes,
source_scope_local_data,
- promoted,
yield_ty,
generator_drop,
generator_layout,
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
pub struct Static<'tcx> {
pub ty: Ty<'tcx>,
- pub kind: StaticKind,
+ pub kind: StaticKind<'tcx>,
+ pub def_id: DefId,
}
#[derive(
Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable, RustcEncodable, RustcDecodable,
)]
-pub enum StaticKind {
- Promoted(Promoted),
- Static(DefId),
+pub enum StaticKind<'tcx> {
+ Promoted(Promoted, SubstsRef<'tcx>),
+ Static,
}
impl_stable_hash_for!(struct Static<'tcx> {
ty,
- kind
+ kind,
+ def_id
});
/// The `Projection` data structure defines things of the form `base.x`, `*b` or `b[index]`.
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
match *self {
PlaceBase::Local(id) => write!(fmt, "{:?}", id),
- PlaceBase::Static(box self::Static { ty, kind: StaticKind::Static(def_id) }) => {
+ PlaceBase::Static(box self::Static { ty, kind: StaticKind::Static, def_id }) => {
write!(fmt, "({}: {:?})", ty::tls::with(|tcx| tcx.def_path_str(def_id)), ty)
}
- PlaceBase::Static(box self::Static { ty, kind: StaticKind::Promoted(promoted) }) => {
+ PlaceBase::Static(box self::Static {
+ ty, kind: StaticKind::Promoted(promoted, _), def_id: _
+ }) => {
write!(fmt, "({:?}: {:?})", promoted, ty)
}
}
basic_blocks,
source_scopes,
source_scope_local_data,
- promoted,
yield_ty,
generator_drop,
generator_layout,