diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 39b01d5102..3c891547e5 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -1070,7 +1070,7 @@ pub struct ImplBlock { pub enum ScopeDef { ModuleDef(ModuleDef), MacroDef(MacroDef), - GenericParam(u32), + GenericParam(GenericParam), ImplSelfType(ImplBlock), AdtSelfType(Adt), Local(Local), diff --git a/crates/ra_hir/src/resolve.rs b/crates/ra_hir/src/resolve.rs index 5e04ca9b6e..a029513b57 100644 --- a/crates/ra_hir/src/resolve.rs +++ b/crates/ra_hir/src/resolve.rs @@ -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) => {