aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_hir/src/code_model.rs7
-rw-r--r--crates/ra_hir/src/from_id.rs2
2 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index a9615a3b7..034fb7cfa 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -778,8 +778,7 @@ impl GenericDef {
778 778
779#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] 779#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
780pub struct Local { 780pub struct Local {
781 // TODO: ID, 781 pub(crate) parent: DefWithBodyId,
782 pub(crate) parent: DefWithBody,
783 pub(crate) pat_id: PatId, 782 pub(crate) pat_id: PatId,
784} 783}
785 784
@@ -808,11 +807,11 @@ impl Local {
808 } 807 }
809 808
810 pub fn parent(self, _db: &impl HirDatabase) -> DefWithBody { 809 pub fn parent(self, _db: &impl HirDatabase) -> DefWithBody {
811 self.parent 810 self.parent.into()
812 } 811 }
813 812
814 pub fn module(self, db: &impl HirDatabase) -> Module { 813 pub fn module(self, db: &impl HirDatabase) -> Module {
815 self.parent.module(db) 814 self.parent(db).module(db)
816 } 815 }
817 816
818 pub fn ty(self, db: &impl HirDatabase) -> Type { 817 pub fn ty(self, db: &impl HirDatabase) -> Type {
diff --git a/crates/ra_hir/src/from_id.rs b/crates/ra_hir/src/from_id.rs
index 88540fbf2..cbfa91d6c 100644
--- a/crates/ra_hir/src/from_id.rs
+++ b/crates/ra_hir/src/from_id.rs
@@ -225,6 +225,6 @@ impl From<AssocItem> for GenericDefId {
225 225
226impl From<(DefWithBodyId, PatId)> for Local { 226impl From<(DefWithBodyId, PatId)> for Local {
227 fn from((parent, pat_id): (DefWithBodyId, PatId)) -> Self { 227 fn from((parent, pat_id): (DefWithBodyId, PatId)) -> Self {
228 Local { parent: parent.into(), pat_id } 228 Local { parent, pat_id }
229 } 229 }
230} 230}