From c2a63b97a80cb738f800da61c64e748994709c31 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 29 Mar 2021 17:46:33 +0200 Subject: Rename target_ty to self_ty --- crates/hir_def/src/data.rs | 6 +++--- crates/hir_def/src/item_tree.rs | 2 +- crates/hir_def/src/item_tree/lower.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/hir_def/src') diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs index 7d35d7083..214bcc648 100644 --- a/crates/hir_def/src/data.rs +++ b/crates/hir_def/src/data.rs @@ -157,7 +157,7 @@ impl TraitData { #[derive(Debug, Clone, PartialEq, Eq)] pub struct ImplData { pub target_trait: Option, - pub target_type: TypeRef, + pub self_ty: TypeRef, pub items: Vec, pub is_negative: bool, } @@ -170,7 +170,7 @@ impl ImplData { let item_tree = impl_loc.id.item_tree(db); let impl_def = &item_tree[impl_loc.id.value]; let target_trait = impl_def.target_trait.map(|id| item_tree[id].clone()); - let target_type = item_tree[impl_def.target_type].clone(); + let self_ty = item_tree[impl_def.self_ty].clone(); let is_negative = impl_def.is_negative; let module_id = impl_loc.container; let container = AssocContainerId::ImplId(id); @@ -187,7 +187,7 @@ impl ImplData { ); let items = items.into_iter().map(|(_, item)| item).collect(); - Arc::new(ImplData { target_trait, target_type, items, is_negative }) + Arc::new(ImplData { target_trait, self_ty, items, is_negative }) } } diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs index db94bb1ef..5449bbf5d 100644 --- a/crates/hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs @@ -730,7 +730,7 @@ pub struct Trait { pub struct Impl { pub generic_params: GenericParamsId, pub target_trait: Option>, - pub target_type: Idx, + pub self_ty: Idx, pub is_negative: bool, pub items: Box<[AssocItem]>, pub ast_id: FileAstId, diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs index 34af5c8d4..4b2af564e 100644 --- a/crates/hir_def/src/item_tree/lower.rs +++ b/crates/hir_def/src/item_tree/lower.rs @@ -537,7 +537,7 @@ impl Ctx { let generic_params = self.lower_generic_params_and_inner_items(GenericsOwner::Impl, impl_def); let target_trait = impl_def.trait_().map(|tr| self.lower_trait_ref(&tr)); - let target_type = self.lower_type_ref(&impl_def.self_ty()?); + let self_ty = self.lower_type_ref(&impl_def.self_ty()?); let is_negative = impl_def.excl_token().is_some(); // We cannot use `assoc_items()` here as that does not include macro calls. @@ -554,7 +554,7 @@ impl Ctx { }) .collect(); let ast_id = self.source_ast_id_map.ast_id(impl_def); - let res = Impl { generic_params, target_trait, target_type, is_negative, items, ast_id }; + let res = Impl { generic_params, target_trait, self_ty, is_negative, items, ast_id }; Some(id(self.data().impls.alloc(res))) } -- cgit v1.2.3