aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-24 18:18:47 +0000
committerGitHub <[email protected]>2019-11-24 18:18:47 +0000
commit09389ed1d43c244352cecbd78c8685480d60157d (patch)
tree047d256c33567aa3dfb59e7986f7059bf99ffb6b /crates/ra_hir/src/code_model
parent64fc9ac9650afb04a353ba8a18381f0db83cbc82 (diff)
parent191b1d238fd1594ab74b1ab6a17dbe0430fc6b1a (diff)
Merge #2391
2391: Simplify r=matklad a=matklad bors r+ Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/code_model')
-rw-r--r--crates/ra_hir/src/code_model/src.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs
index a0e605603..a4e317c20 100644
--- a/crates/ra_hir/src/code_model/src.rs
+++ b/crates/ra_hir/src/code_model/src.rs
@@ -5,8 +5,8 @@ use hir_expand::either::Either;
5use ra_syntax::ast; 5use ra_syntax::ast;
6 6
7use crate::{ 7use crate::{
8 db::DefDatabase, Const, Enum, EnumVariant, FieldSource, Function, Import, MacroDef, Module, 8 db::DefDatabase, Const, Enum, EnumVariant, FieldSource, Function, ImplBlock, Import, MacroDef,
9 ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union, 9 Module, ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
10}; 10};
11 11
12pub use hir_expand::Source; 12pub use hir_expand::Source;
@@ -108,6 +108,12 @@ impl HasSource for MacroDef {
108 Source { file_id: self.id.ast_id.file_id(), value: self.id.ast_id.to_node(db) } 108 Source { file_id: self.id.ast_id.file_id(), value: self.id.ast_id.to_node(db) }
109 } 109 }
110} 110}
111impl HasSource for ImplBlock {
112 type Ast = ast::ImplBlock;
113 fn source(self, db: &impl DefDatabase) -> Source<ast::ImplBlock> {
114 self.id.source(db)
115 }
116}
111impl HasSource for Import { 117impl HasSource for Import {
112 type Ast = Either<ast::UseTree, ast::ExternCrateItem>; 118 type Ast = Either<ast::UseTree, ast::ExternCrateItem>;
113 119