diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-19 13:23:56 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-19 13:23:56 +0000 |
commit | c0897957133dde949d9c852c49766b7d116ff6ba (patch) | |
tree | 960d42c02317050c6415b13fc74ad3c1f55f1c20 /crates/hir_def/src | |
parent | a627377949d308603bb0bd7ef627ffe8186e1788 (diff) | |
parent | 54c78c96dbe61c2f1b6ec9f83a35a8ad6f6ae4fe (diff) |
Merge #8104
8104: Rename derive-specific APIs r=jonas-schievink a=jonas-schievink
Indicate that they're derive-specific
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/lib.rs | 4 | ||||
-rw-r--r-- | crates/hir_def/src/nameres.rs | 4 | ||||
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index 50e730444..c9e07de86 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs | |||
@@ -673,7 +673,7 @@ fn macro_call_as_call_id( | |||
673 | Ok(res) | 673 | Ok(res) |
674 | } | 674 | } |
675 | 675 | ||
676 | fn item_attr_as_call_id( | 676 | fn derive_macro_as_call_id( |
677 | item_attr: &AstIdWithPath<ast::Item>, | 677 | item_attr: &AstIdWithPath<ast::Item>, |
678 | db: &dyn db::DefDatabase, | 678 | db: &dyn db::DefDatabase, |
679 | krate: CrateId, | 679 | krate: CrateId, |
@@ -685,7 +685,7 @@ fn item_attr_as_call_id( | |||
685 | .as_lazy_macro( | 685 | .as_lazy_macro( |
686 | db.upcast(), | 686 | db.upcast(), |
687 | krate, | 687 | krate, |
688 | MacroCallKind::Attr(item_attr.ast_id, last_segment.to_string()), | 688 | MacroCallKind::Derive(item_attr.ast_id, last_segment.to_string()), |
689 | ) | 689 | ) |
690 | .into(); | 690 | .into(); |
691 | Ok(res) | 691 | Ok(res) |
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 1ac326f97..0d3a0b54f 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -575,7 +575,7 @@ mod diagnostics { | |||
575 | let node = ast.to_node(db.upcast()); | 575 | let node = ast.to_node(db.upcast()); |
576 | (ast.file_id, SyntaxNodePtr::from(AstPtr::new(&node)), None) | 576 | (ast.file_id, SyntaxNodePtr::from(AstPtr::new(&node)), None) |
577 | } | 577 | } |
578 | MacroCallKind::Attr(ast, name) => { | 578 | MacroCallKind::Derive(ast, name) => { |
579 | let node = ast.to_node(db.upcast()); | 579 | let node = ast.to_node(db.upcast()); |
580 | 580 | ||
581 | // Compute the precise location of the macro name's token in the derive | 581 | // Compute the precise location of the macro name's token in the derive |
@@ -631,7 +631,7 @@ mod diagnostics { | |||
631 | let node = ast.to_node(db.upcast()); | 631 | let node = ast.to_node(db.upcast()); |
632 | (ast.file_id, SyntaxNodePtr::from(AstPtr::new(&node))) | 632 | (ast.file_id, SyntaxNodePtr::from(AstPtr::new(&node))) |
633 | } | 633 | } |
634 | MacroCallKind::Attr(ast, _) => { | 634 | MacroCallKind::Derive(ast, _) => { |
635 | let node = ast.to_node(db.upcast()); | 635 | let node = ast.to_node(db.upcast()); |
636 | (ast.file_id, SyntaxNodePtr::from(AstPtr::new(&node))) | 636 | (ast.file_id, SyntaxNodePtr::from(AstPtr::new(&node))) |
637 | } | 637 | } |
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index dcedf7766..4bcdc0fc8 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -22,7 +22,7 @@ use syntax::ast; | |||
22 | use crate::{ | 22 | use crate::{ |
23 | attr::Attrs, | 23 | attr::Attrs, |
24 | db::DefDatabase, | 24 | db::DefDatabase, |
25 | item_attr_as_call_id, | 25 | derive_macro_as_call_id, |
26 | item_scope::{ImportType, PerNsGlobImports}, | 26 | item_scope::{ImportType, PerNsGlobImports}, |
27 | item_tree::{ | 27 | item_tree::{ |
28 | self, FileItemTreeId, ItemTree, ItemTreeId, MacroCall, MacroRules, Mod, ModItem, ModKind, | 28 | self, FileItemTreeId, ItemTree, ItemTreeId, MacroCall, MacroRules, Mod, ModItem, ModKind, |
@@ -820,8 +820,8 @@ impl DefCollector<'_> { | |||
820 | true | 820 | true |
821 | }); | 821 | }); |
822 | attribute_macros.retain(|directive| { | 822 | attribute_macros.retain(|directive| { |
823 | match item_attr_as_call_id(&directive.ast_id, self.db, self.def_map.krate, |path| { | 823 | match derive_macro_as_call_id(&directive.ast_id, self.db, self.def_map.krate, |path| { |
824 | self.resolve_attribute_macro(&directive, &path) | 824 | self.resolve_derive_macro(&directive, &path) |
825 | }) { | 825 | }) { |
826 | Ok(call_id) => { | 826 | Ok(call_id) => { |
827 | resolved.push((directive.module_id, call_id, 0)); | 827 | resolved.push((directive.module_id, call_id, 0)); |
@@ -844,7 +844,7 @@ impl DefCollector<'_> { | |||
844 | res | 844 | res |
845 | } | 845 | } |
846 | 846 | ||
847 | fn resolve_attribute_macro( | 847 | fn resolve_derive_macro( |
848 | &self, | 848 | &self, |
849 | directive: &DeriveDirective, | 849 | directive: &DeriveDirective, |
850 | path: &ModPath, | 850 | path: &ModPath, |