From 5106ce7bfb9f13c16fa424de9712c876a5cc813c Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Mon, 23 May 2016 10:23:36 +1200 Subject: [PATCH] save-analysis: use a function's short name --- src/librustc_save_analysis/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 8c00a569993..7dba3ef5c67 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -123,15 +123,14 @@ pub fn get_external_crates(&self) -> Vec { pub fn get_item_data(&self, item: &ast::Item) -> Option { match item.node { ast::ItemKind::Fn(ref decl, _, _, _, ref generics, _) => { - let name = self.tcx.node_path_str(item.id); - let qualname = format!("::{}", name); + let qualname = format!("::{}", self.tcx.node_path_str(item.id)); let sub_span = self.span_utils.sub_span_after_keyword(item.span, keywords::Fn); filter!(self.span_utils, sub_span, item.span, None); Some(Data::FunctionData(FunctionData { id: item.id, - name: name, + name: item.ident.to_string(), qualname: qualname, declaration: None, span: sub_span.unwrap(),