diff options
author | Aleksey Kladov <[email protected]> | 2020-07-13 15:16:53 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-13 15:21:02 +0100 |
commit | 693ac892f2db5db1ce7cf86db7bf6207b3515c42 (patch) | |
tree | 89272d8f03145df99fe68f0e35f8892dc4ab2c72 /crates/ra_hir/src/semantics | |
parent | 6b4cf5b7d8043469c9856f6578d282f9532d7fe0 (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.rs | 5 |
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 | }; |
18 | use rustc_hash::FxHashMap; | 18 | use rustc_hash::FxHashMap; |
19 | use stdx::impl_from; | ||
19 | 20 | ||
20 | use crate::{db::HirDatabase, InFile, MacroDefId}; | 21 | use 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 | } |
258 | impl_froms! { | 259 | impl_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 | ||
270 | impl ChildContainer { | 271 | impl ChildContainer { |