Skip to content

Commit a1dfa0f

Browse files
committed
Only measure time spent dropping the AST
1 parent 3f32505 commit a1dfa0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_driver/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,10 @@ pub fn run_compiler(
348348
queries.global_ctxt()?;
349349

350350
// Drop AST after creating GlobalCtxt to free memory
351-
let _timer = sess.prof.generic_activity("drop_ast");
352-
mem::drop(queries.expansion()?.take());
351+
{
352+
let _timer = sess.prof.generic_activity("drop_ast");
353+
mem::drop(queries.expansion()?.take());
354+
}
353355

354356
if sess.opts.debugging_opts.no_analysis || sess.opts.debugging_opts.ast_json {
355357
return early_exit();

0 commit comments

Comments
 (0)