mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Make GenericParams::type_or_consts private
This commit is contained in:
parent
73c97e3fe0
commit
372e2d22e6
11 changed files with 239 additions and 233 deletions
|
@ -145,7 +145,7 @@ impl Generics {
|
|||
fn find_type_or_const_param(&self, param: TypeOrConstParamId) -> Option<usize> {
|
||||
if param.parent == self.def {
|
||||
let idx = param.local_id.into_raw().into_u32() as usize;
|
||||
debug_assert!(idx <= self.params.type_or_consts.len());
|
||||
debug_assert!(idx <= self.params.len_type_or_consts());
|
||||
Some(idx)
|
||||
} else {
|
||||
debug_assert_eq!(self.parent_generics().map(|it| it.def), Some(param.parent));
|
||||
|
@ -164,7 +164,7 @@ impl Generics {
|
|||
if lifetime.parent == self.def {
|
||||
let idx = lifetime.local_id.into_raw().into_u32() as usize;
|
||||
debug_assert!(idx <= self.params.lifetimes.len());
|
||||
Some(self.params.type_or_consts.len() + idx)
|
||||
Some(self.params.len_type_or_consts() + idx)
|
||||
} else {
|
||||
debug_assert_eq!(self.parent_generics().map(|it| it.def), Some(lifetime.parent));
|
||||
self.parent_generics()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue