about summary refs log tree commit diff
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2020-08-16 00:21:14 +0100
committermarmeladema <xademax@gmail.com>2020-08-16 00:21:14 +0100
commita1dfa0f230bb6dd9ca0a272d1bf884d010229be4 (patch)
treeab194083c5b2ea13f6c78f93749c0ee1bb88abd1
parent3f3250500fe152b5759c21453ba9a9129808d0d8 (diff)
downloadrust-a1dfa0f230bb6dd9ca0a272d1bf884d010229be4.tar.gz
rust-a1dfa0f230bb6dd9ca0a272d1bf884d010229be4.zip
Only measure time spent dropping the AST
-rw-r--r--src/librustc_driver/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index cc954cee907..982bccb79b4 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -348,8 +348,10 @@ pub fn run_compiler(
             queries.global_ctxt()?;
 
             // Drop AST after creating GlobalCtxt to free memory
-            let _timer = sess.prof.generic_activity("drop_ast");
-            mem::drop(queries.expansion()?.take());
+            {
+                let _timer = sess.prof.generic_activity("drop_ast");
+                mem::drop(queries.expansion()?.take());
+            }
 
             if sess.opts.debugging_opts.no_analysis || sess.opts.debugging_opts.ast_json {
                 return early_exit();