Remove impl_block module

This commit is contained in:
Aleksey Kladov 2019-11-24 21:03:24 +03:00
parent d87c16bea6
commit 191b1d238f
4 changed files with 43 additions and 55 deletions

View file

@ -5,8 +5,8 @@ use hir_expand::either::Either;
use ra_syntax::ast;
use crate::{
db::DefDatabase, Const, Enum, EnumVariant, FieldSource, Function, Import, MacroDef, Module,
ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
db::DefDatabase, Const, Enum, EnumVariant, FieldSource, Function, ImplBlock, Import, MacroDef,
Module, ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
};
pub use hir_expand::Source;
@ -108,6 +108,12 @@ impl HasSource for MacroDef {
Source { file_id: self.id.ast_id.file_id(), value: self.id.ast_id.to_node(db) }
}
}
impl HasSource for ImplBlock {
type Ast = ast::ImplBlock;
fn source(self, db: &impl DefDatabase) -> Source<ast::ImplBlock> {
self.id.source(db)
}
}
impl HasSource for Import {
type Ast = Either<ast::UseTree, ast::ExternCrateItem>;