mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Make GenericParams::lifetimes private
This commit is contained in:
parent
be1ea4028b
commit
966798b7ba
8 changed files with 12 additions and 14 deletions
|
@ -665,7 +665,7 @@ impl Module {
|
|||
}
|
||||
let parent = impl_def.id.into();
|
||||
let generic_params = db.generic_params(parent);
|
||||
let lifetime_params = generic_params.lifetimes.iter().map(|(local_id, _)| {
|
||||
let lifetime_params = generic_params.iter_lt().map(|(local_id, _)| {
|
||||
GenericParamId::LifetimeParamId(LifetimeParamId { parent, local_id })
|
||||
});
|
||||
let type_params = generic_params
|
||||
|
@ -1540,8 +1540,7 @@ impl Adt {
|
|||
resolver
|
||||
.generic_params()
|
||||
.and_then(|gp| {
|
||||
gp.lifetimes
|
||||
.iter()
|
||||
gp.iter_lt()
|
||||
// there should only be a single lifetime
|
||||
// but `Arena` requires to use an iterator
|
||||
.nth(0)
|
||||
|
@ -3141,8 +3140,7 @@ impl GenericDef {
|
|||
pub fn lifetime_params(self, db: &dyn HirDatabase) -> Vec<LifetimeParam> {
|
||||
let generics = db.generic_params(self.into());
|
||||
generics
|
||||
.lifetimes
|
||||
.iter()
|
||||
.iter_lt()
|
||||
.map(|(local_id, _)| LifetimeParam {
|
||||
id: LifetimeParamId { parent: self.into(), local_id },
|
||||
})
|
||||
|
@ -3548,7 +3546,7 @@ pub struct LifetimeParam {
|
|||
impl LifetimeParam {
|
||||
pub fn name(self, db: &dyn HirDatabase) -> Name {
|
||||
let params = db.generic_params(self.id.parent);
|
||||
params.lifetimes[self.id.local_id].name.clone()
|
||||
params[self.id.local_id].name.clone()
|
||||
}
|
||||
|
||||
pub fn module(self, db: &dyn HirDatabase) -> Module {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue