]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_interface/interface.rs
Split `rustc_mir::{build, hair, lints}` into their own crate
[rust.git] / src / librustc_interface / interface.rs
index c4449945dd19d784b6ac2b21fac0c92fd278cbdc..d00875f6fee88f50f03d119205e8bdda4233a53f 100644 (file)
@@ -177,11 +177,17 @@ pub fn run_compiler_in_existing_thread_pool<R>(
         override_queries: config.override_queries,
     };
 
-    let _sess_abort_error = OnDrop(|| {
-        compiler.sess.diagnostic().print_error_count(registry);
-    });
+    let r = {
+        let _sess_abort_error = OnDrop(|| {
+            compiler.sess.diagnostic().print_error_count(registry);
+        });
 
-    f(&compiler)
+        f(&compiler)
+    };
+
+    let prof = compiler.sess.prof.clone();
+    prof.generic_activity("drop_compiler").run(move || drop(compiler));
+    r
 }
 
 pub fn run_compiler<R: Send>(mut config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {