Rename RegionParamDef to LifetimeParamDef
This commit is contained in:
parent
4bed895cab
commit
9f9d4beda6
@ -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
|
||||
});
|
||||
|
||||
|
@ -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")
|
||||
|
@ -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,
|
||||
}),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user