From 562e2ee28a4397878accfde014d68ab17d1b504a Mon Sep 17 00:00:00 2001 From: Nick Spain Date: Fri, 1 Jan 2021 14:38:23 +1100 Subject: Only log path and syntax range when processing function if source exists --- crates/rust-analyzer/src/cli/analysis_stats.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs index bfc7d7b5a..9445aec07 100644 --- a/crates/rust-analyzer/src/cli/analysis_stats.rs +++ b/crates/rust-analyzer/src/cli/analysis_stats.rs @@ -161,12 +161,12 @@ impl AnalysisStatsCmd { } let mut msg = format!("processing: {}", full_name); if verbosity.is_verbose() { - #[allow(deprecated)] - let src = f.source_old(db); - let original_file = src.file_id.original_file(db); - let path = vfs.file_path(original_file); - let syntax_range = src.value.syntax().text_range(); - format_to!(msg, " ({} {:?})", path, syntax_range); + if let Some(src) = f.source(db) { + let original_file = src.file_id.original_file(db); + let path = vfs.file_path(original_file); + let syntax_range = src.value.syntax().text_range(); + format_to!(msg, " ({} {:?})", path, syntax_range); + } } if verbosity.is_spammy() { bar.println(msg.to_string()); -- cgit v1.2.3