From f6c227babdeb2d6b6888b36ddcbd8eb220240fa2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 11 Jun 2019 18:11:17 +0300 Subject: fix compilation --- crates/ra_cli/src/analysis_stats.rs | 8 ++++---- crates/ra_hir/src/code_model/src.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates') 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}; use ra_db::SourceDatabase; use ra_batch::BatchDatabase; -use ra_hir::{Crate, ModuleDef, Ty, ImplItem}; +use ra_hir::{Crate, ModuleDef, Ty, ImplItem, HasSource}; use ra_syntax::AstNode; use crate::Result; @@ -64,10 +64,10 @@ pub fn run(verbose: bool, path: &str, only: Option<&str>) -> Result<()> { let name = f.name(&db); let mut msg = format!("processing: {}", name); if verbose { - let (file_id, source) = f.source(&db); - let original_file = file_id.original_file(&db); + let src = f.source(&db); + let original_file = src.file_id.original_file(&db); let path = db.file_relative_path(original_file); - let syntax_range = source.syntax().range(); + let syntax_range = src.ast.syntax().range(); write!(msg, " ({:?} {})", path, syntax_range).unwrap(); } 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 { fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source; } -/// NB: Module is !HasSource, becase it has two source nodes at the same time: +/// NB: Module is !HasSource, because it has two source nodes at the same time: /// definition and declaration. impl Module { /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. -- cgit v1.2.3