aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/semantics
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-13 15:16:53 +0100
committerAleksey Kladov <[email protected]>2020-07-13 15:21:02 +0100
commit693ac892f2db5db1ce7cf86db7bf6207b3515c42 (patch)
tree89272d8f03145df99fe68f0e35f8892dc4ab2c72 /crates/ra_hir/src/semantics
parent6b4cf5b7d8043469c9856f6578d282f9532d7fe0 (diff)
Don't copy-paste `impl_froms` into every crate
Diffstat (limited to 'crates/ra_hir/src/semantics')
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs
index 0e1d92fb3..42e5a1bdb 100644
--- a/crates/ra_hir/src/semantics/source_to_def.rs
+++ b/crates/ra_hir/src/semantics/source_to_def.rs
@@ -16,6 +16,7 @@ use ra_syntax::{
16 match_ast, AstNode, SyntaxNode, 16 match_ast, AstNode, SyntaxNode,
17}; 17};
18use rustc_hash::FxHashMap; 18use rustc_hash::FxHashMap;
19use stdx::impl_from;
19 20
20use crate::{db::HirDatabase, InFile, MacroDefId}; 21use crate::{db::HirDatabase, InFile, MacroDefId};
21 22
@@ -255,8 +256,7 @@ pub(crate) enum ChildContainer {
255 /// here the children generic parameters, and not, eg enum variants. 256 /// here the children generic parameters, and not, eg enum variants.
256 GenericDefId(GenericDefId), 257 GenericDefId(GenericDefId),
257} 258}
258impl_froms! { 259impl_from! {
259 ChildContainer:
260 DefWithBodyId, 260 DefWithBodyId,
261 ModuleId, 261 ModuleId,
262 TraitId, 262 TraitId,
@@ -265,6 +265,7 @@ impl_froms! {
265 VariantId, 265 VariantId,
266 TypeAliasId, 266 TypeAliasId,
267 GenericDefId 267 GenericDefId
268 for ChildContainer
268} 269}
269 270
270impl ChildContainer { 271impl ChildContainer {