From df9df19507ea4573ff141d253b2e95cd5b6cd0ff Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Sun, 6 Jan 2019 01:22:52 +0100 Subject: Always calculate glob map but only for glob uses Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance. --- src/librustc_save_analysis/dump_visitor.rs | 1 - src/librustc_save_analysis/lib.rs | 2 -- 2 files changed, 3 deletions(-) (limited to 'src/librustc_save_analysis') diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 89153730917..52be67fb512 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1239,7 +1239,6 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> { // Make a comma-separated list of names of imported modules. let glob_map = &self.save_ctxt.analysis.glob_map; - let glob_map = glob_map.as_ref().unwrap(); let names = if glob_map.contains_key(&id) { glob_map.get(&id).unwrap().iter().map(|n| n.to_string()).collect() } else { diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index d5b3070372b..4b0fb686ba5 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -1122,8 +1122,6 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>( mut handler: H, ) { tcx.dep_graph.with_ignore(|| { - assert!(analysis.glob_map.is_some()); - info!("Dumping crate {}", cratename); let save_ctxt = SaveContext { -- cgit 1.4.1-3-g733a5