aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/data.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-05 17:13:57 +0100
committerGitHub <[email protected]>2020-05-05 17:13:57 +0100
commit58f64313fdbb215b29cceb843e06d2c1541d9f56 (patch)
tree0c95a20510f832ec5f208a1ede39f8aad8ffcd86 /crates/ra_hir_def/src/data.rs
parent756e91732b7a92d9156f5c1d8ffcaf5155cf4680 (diff)
parent92665358cd98913e3fef8294e1889cc0bb919e3f (diff)
Merge #4321
4321: Rename ImplItem to AssocItem r=matklad a=edwin0cheng Related discussion: https://github.com/rust-analyzer/rust-analyzer/pull/4283#discussion_r419352265 Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/data.rs')
-rw-r--r--crates/ra_hir_def/src/data.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs
index 2dbae04d3..e7eb2bb11 100644
--- a/crates/ra_hir_def/src/data.rs
+++ b/crates/ra_hir_def/src/data.rs
@@ -9,7 +9,7 @@ use hir_expand::{
9}; 9};
10use ra_prof::profile; 10use ra_prof::profile;
11use ra_syntax::ast::{ 11use ra_syntax::ast::{
12 self, AstNode, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner, TypeBoundsOwner, 12 self, AssocItem, AstNode, ModuleItemOwner, NameOwner, TypeAscriptionOwner, TypeBoundsOwner,
13 VisibilityOwner, 13 VisibilityOwner,
14}; 14};
15 15
@@ -164,7 +164,7 @@ impl TraitData {
164 items.extend(collect_items( 164 items.extend(collect_items(
165 db, 165 db,
166 &mut expander, 166 &mut expander,
167 item_list.impl_items(), 167 item_list.assoc_items(),
168 src.file_id, 168 src.file_id,
169 container, 169 container,
170 )); 170 ));
@@ -219,7 +219,7 @@ impl ImplData {
219 if let Some(item_list) = src.value.item_list() { 219 if let Some(item_list) = src.value.item_list() {
220 let mut expander = Expander::new(db, impl_loc.ast_id.file_id, module_id); 220 let mut expander = Expander::new(db, impl_loc.ast_id.file_id, module_id);
221 items.extend( 221 items.extend(
222 collect_items(db, &mut expander, item_list.impl_items(), src.file_id, container) 222 collect_items(db, &mut expander, item_list.assoc_items(), src.file_id, container)
223 .into_iter() 223 .into_iter()
224 .map(|(_, item)| item), 224 .map(|(_, item)| item),
225 ); 225 );
@@ -304,7 +304,7 @@ fn collect_items_in_macro(
304 let mut res = collect_items( 304 let mut res = collect_items(
305 db, 305 db,
306 expander, 306 expander,
307 items.value.items().filter_map(|it| ImplItem::cast(it.syntax().clone())), 307 items.value.items().filter_map(|it| AssocItem::cast(it.syntax().clone())),
308 items.file_id, 308 items.file_id,
309 container, 309 container,
310 ); 310 );
@@ -325,15 +325,15 @@ fn collect_items_in_macro(
325fn collect_items( 325fn collect_items(
326 db: &dyn DefDatabase, 326 db: &dyn DefDatabase,
327 expander: &mut Expander, 327 expander: &mut Expander,
328 impl_items: impl Iterator<Item = ImplItem>, 328 assoc_items: impl Iterator<Item = AssocItem>,
329 file_id: crate::HirFileId, 329 file_id: crate::HirFileId,
330 container: AssocContainerId, 330 container: AssocContainerId,
331) -> Vec<(Name, AssocItemId)> { 331) -> Vec<(Name, AssocItemId)> {
332 let items = db.ast_id_map(file_id); 332 let items = db.ast_id_map(file_id);
333 333
334 impl_items 334 assoc_items
335 .filter_map(|item_node| match item_node { 335 .filter_map(|item_node| match item_node {
336 ast::ImplItem::FnDef(it) => { 336 ast::AssocItem::FnDef(it) => {
337 let name = it.name().map_or_else(Name::missing, |it| it.as_name()); 337 let name = it.name().map_or_else(Name::missing, |it| it.as_name());
338 if !expander.is_cfg_enabled(&it) { 338 if !expander.is_cfg_enabled(&it) {
339 return None; 339 return None;
@@ -342,13 +342,13 @@ fn collect_items(
342 .intern(db); 342 .intern(db);
343 Some((name, def.into())) 343 Some((name, def.into()))
344 } 344 }
345 ast::ImplItem::ConstDef(it) => { 345 ast::AssocItem::ConstDef(it) => {
346 let name = it.name().map_or_else(Name::missing, |it| it.as_name()); 346 let name = it.name().map_or_else(Name::missing, |it| it.as_name());
347 let def = ConstLoc { container, ast_id: AstId::new(file_id, items.ast_id(&it)) } 347 let def = ConstLoc { container, ast_id: AstId::new(file_id, items.ast_id(&it)) }
348 .intern(db); 348 .intern(db);
349 Some((name, def.into())) 349 Some((name, def.into()))
350 } 350 }
351 ast::ImplItem::TypeAliasDef(it) => { 351 ast::AssocItem::TypeAliasDef(it) => {
352 let name = it.name().map_or_else(Name::missing, |it| it.as_name()); 352 let name = it.name().map_or_else(Name::missing, |it| it.as_name());
353 let def = 353 let def =
354 TypeAliasLoc { container, ast_id: AstId::new(file_id, items.ast_id(&it)) } 354 TypeAliasLoc { container, ast_id: AstId::new(file_id, items.ast_id(&it)) }