aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-21 11:22:30 +0000
committerAleksey Kladov <[email protected]>2019-11-21 11:22:30 +0000
commitca1af86e7bb104533f9878f84a7a3a39e5107c30 (patch)
tree8a9bd47b3fe348d5ce7d6b670f99e2379761e594
parent1312c57d342730690a0181c53f82bb3e281114ff (diff)
Use GenericParam in ScopeDef
-rw-r--r--crates/ra_hir/src/code_model.rs2
-rw-r--r--crates/ra_hir/src/resolve.rs12
2 files changed, 10 insertions, 4 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 39b01d510..3c891547e 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -1070,7 +1070,7 @@ pub struct ImplBlock {
1070pub enum ScopeDef { 1070pub enum ScopeDef {
1071 ModuleDef(ModuleDef), 1071 ModuleDef(ModuleDef),
1072 MacroDef(MacroDef), 1072 MacroDef(MacroDef),
1073 GenericParam(u32), 1073 GenericParam(GenericParam),
1074 ImplSelfType(ImplBlock), 1074 ImplSelfType(ImplBlock),
1075 AdtSelfType(Adt), 1075 AdtSelfType(Adt),
1076 Local(Local), 1076 Local(Local),
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::{
19 code_model::Crate, 19 code_model::Crate,
20 db::HirDatabase, 20 db::HirDatabase,
21 expr::{ExprScopes, PatId, ScopeId}, 21 expr::{ExprScopes, PatId, ScopeId},
22 DefWithBody, GenericDef, Local, MacroDef, PerNs, ScopeDef, 22 DefWithBody, GenericDef, GenericParam, Local, MacroDef, PerNs, ScopeDef,
23}; 23};
24 24
25#[derive(Debug, Clone, Default)] 25#[derive(Debug, Clone, Default)]
@@ -447,9 +447,15 @@ impl Scope {
447 }); 447 });
448 } 448 }
449 } 449 }
450 Scope::GenericParams { params, .. } => { 450 Scope::GenericParams { params, def } => {
451 for param in params.params.iter() { 451 for param in params.params.iter() {
452 f(param.name.clone(), ScopeDef::GenericParam(param.idx)) 452 f(
453 param.name.clone(),
454 ScopeDef::GenericParam(GenericParam {
455 parent: (*def).into(),
456 idx: param.idx,
457 }),
458 )
453 } 459 }
454 } 460 }
455 Scope::ImplBlockScope(i) => { 461 Scope::ImplBlockScope(i) => {