From ca1af86e7bb104533f9878f84a7a3a39e5107c30 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 21 Nov 2019 14:22:30 +0300 Subject: Use GenericParam in ScopeDef --- crates/ra_hir/src/resolve.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src/resolve.rs') diff --git a/crates/ra_hir/src/resolve.rs b/crates/ra_hir/src/resolve.rs index 5e04ca9b6..a029513b5 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) => { -- cgit v1.2.3