Rename RegionParamDef to LifetimeParamDef

This commit is contained in:
varkor 2018-04-19 00:41:29 +01:00
parent 4bed895cab
commit 9f9d4beda6
3 changed files with 5 additions and 5 deletions

View File

@ -765,7 +765,7 @@ impl_stable_hash_for!(struct ty::GenericParamDef {
kind
});
impl_stable_hash_for!(struct ty::RegionParamDef {
impl_stable_hash_for!(struct ty::LifetimeParamDef {
pure_wrt_drop
});

View File

@ -723,7 +723,7 @@ pub struct TypeParamDef {
}
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
pub struct RegionParamDef {
pub struct LifetimeParamDef {
/// `pure_wrt_drop`, set by the (unsafe) `#[may_dangle]` attribute
/// on generic parameter `'a`, asserts data of lifetime `'a`
/// won't be accessed during the parent type's `Drop` impl.
@ -738,7 +738,7 @@ impl ty::EarlyBoundRegion {
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
pub enum GenericParamDefKind {
Lifetime(RegionParamDef),
Lifetime(LifetimeParamDef),
Type(TypeParamDef),
}
@ -751,7 +751,7 @@ pub struct GenericParamDef {
}
impl GenericParamDef {
pub fn to_lifetime(&self) -> RegionParamDef {
pub fn to_lifetime(&self) -> LifetimeParamDef {
match self.kind {
GenericParamDefKind::Lifetime(lt) => lt,
_ => bug!("cannot convert a non-lifetime to a lifetime")

View File

@ -892,7 +892,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
name: l.lifetime.name.name().as_interned_str(),
index: own_start + i as u32,
def_id: tcx.hir.local_def_id(l.lifetime.id),
kind: ty::GenericParamDefKind::Lifetime(ty::RegionParamDef {
kind: ty::GenericParamDefKind::Lifetime(ty::LifetimeParamDef {
pure_wrt_drop: l.pure_wrt_drop,
}),
}