mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Don't copy-paste impl_froms
into every crate
This commit is contained in:
parent
6b4cf5b7d8
commit
693ac892f2
12 changed files with 69 additions and 106 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue