mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Use GenericParam in ScopeDef
This commit is contained in:
parent
1312c57d34
commit
ca1af86e7b
2 changed files with 10 additions and 4 deletions
|
@ -1070,7 +1070,7 @@ pub struct ImplBlock {
|
|||
pub enum ScopeDef {
|
||||
ModuleDef(ModuleDef),
|
||||
MacroDef(MacroDef),
|
||||
GenericParam(u32),
|
||||
GenericParam(GenericParam),
|
||||
ImplSelfType(ImplBlock),
|
||||
AdtSelfType(Adt),
|
||||
Local(Local),
|
||||
|
|
|
@ -19,7 +19,7 @@ use crate::{
|
|||
code_model::Crate,
|
||||
db::HirDatabase,
|
||||
expr::{ExprScopes, PatId, ScopeId},
|
||||
DefWithBody, GenericDef, Local, MacroDef, PerNs, ScopeDef,
|
||||
DefWithBody, GenericDef, GenericParam, Local, MacroDef, PerNs, ScopeDef,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
|
@ -447,9 +447,15 @@ impl Scope {
|
|||
});
|
||||
}
|
||||
}
|
||||
Scope::GenericParams { params, .. } => {
|
||||
Scope::GenericParams { params, def } => {
|
||||
for param in params.params.iter() {
|
||||
f(param.name.clone(), ScopeDef::GenericParam(param.idx))
|
||||
f(
|
||||
param.name.clone(),
|
||||
ScopeDef::GenericParam(GenericParam {
|
||||
parent: (*def).into(),
|
||||
idx: param.idx,
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
Scope::ImplBlockScope(i) => {
|
||||
|
|
Loading…
Reference in a new issue