diff options
author | Aleksey Kladov <[email protected]> | 2019-06-11 16:11:17 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-06-11 16:28:51 +0100 |
commit | f6c227babdeb2d6b6888b36ddcbd8eb220240fa2 (patch) | |
tree | 525494d466f92c975d2343f54411606f388135e9 /crates | |
parent | 14b1f8763486fe7bc4a468c70fce827ae34d3d74 (diff) |
fix compilation
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index 8bb524ce3..c19976bd2 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -2,7 +2,7 @@ use std::{collections::HashSet, time::Instant, fmt::Write}; | |||
2 | 2 | ||
3 | use ra_db::SourceDatabase; | 3 | use ra_db::SourceDatabase; |
4 | use ra_batch::BatchDatabase; | 4 | use ra_batch::BatchDatabase; |
5 | use ra_hir::{Crate, ModuleDef, Ty, ImplItem}; | 5 | use ra_hir::{Crate, ModuleDef, Ty, ImplItem, HasSource}; |
6 | use ra_syntax::AstNode; | 6 | use ra_syntax::AstNode; |
7 | 7 | ||
8 | use crate::Result; | 8 | use crate::Result; |
@@ -64,10 +64,10 @@ pub fn run(verbose: bool, path: &str, only: Option<&str>) -> Result<()> { | |||
64 | let name = f.name(&db); | 64 | let name = f.name(&db); |
65 | let mut msg = format!("processing: {}", name); | 65 | let mut msg = format!("processing: {}", name); |
66 | if verbose { | 66 | if verbose { |
67 | let (file_id, source) = f.source(&db); | 67 | let src = f.source(&db); |
68 | let original_file = file_id.original_file(&db); | 68 | let original_file = src.file_id.original_file(&db); |
69 | let path = db.file_relative_path(original_file); | 69 | let path = db.file_relative_path(original_file); |
70 | let syntax_range = source.syntax().range(); | 70 | let syntax_range = src.ast.syntax().range(); |
71 | write!(msg, " ({:?} {})", path, syntax_range).unwrap(); | 71 | write!(msg, " ({:?} {})", path, syntax_range).unwrap(); |
72 | } | 72 | } |
73 | bar.set_message(&msg); | 73 | bar.set_message(&msg); |
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index 76adc7869..5785d3b26 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -16,7 +16,7 @@ pub trait HasSource { | |||
16 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<Self::Ast>; | 16 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<Self::Ast>; |
17 | } | 17 | } |
18 | 18 | ||
19 | /// NB: Module is !HasSource, becase it has two source nodes at the same time: | 19 | /// NB: Module is !HasSource, because it has two source nodes at the same time: |
20 | /// definition and declaration. | 20 | /// definition and declaration. |
21 | impl Module { | 21 | impl Module { |
22 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. | 22 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. |