From 693ac892f2db5db1ce7cf86db7bf6207b3515c42 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 13 Jul 2020 16:16:53 +0200 Subject: Don't copy-paste `impl_froms` into every crate --- crates/ra_hir/src/semantics/source_to_def.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/semantics') 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::{ match_ast, AstNode, SyntaxNode, }; use rustc_hash::FxHashMap; +use stdx::impl_from; use crate::{db::HirDatabase, InFile, MacroDefId}; @@ -255,8 +256,7 @@ pub(crate) enum ChildContainer { /// here the children generic parameters, and not, eg enum variants. GenericDefId(GenericDefId), } -impl_froms! { - ChildContainer: +impl_from! { DefWithBodyId, ModuleId, TraitId, @@ -265,6 +265,7 @@ impl_froms! { VariantId, TypeAliasId, GenericDefId + for ChildContainer } impl ChildContainer { -- cgit v1.2.3