X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_interface%2Finterface.rs;h=9cd9eb66cf6c1f0b304385a0ec22323790c53b0f;hb=0c366cdeaf6cfc2780bae118268eec5c675d6c43;hp=c4449945dd19d784b6ac2b21fac0c92fd278cbdc;hpb=b32dc91372abf7a9b86a8cddbe490e500aa63969;p=rust.git diff --git a/src/librustc_interface/interface.rs b/src/librustc_interface/interface.rs index c4449945dd1..9cd9eb66cf6 100644 --- a/src/librustc_interface/interface.rs +++ b/src/librustc_interface/interface.rs @@ -12,6 +12,7 @@ use rustc_data_structures::sync::Lrc; use rustc_data_structures::OnDrop; use rustc_errors::registry::Registry; +use rustc_lint::LintStore; use rustc_parse::new_parser_from_source_str; use rustc_span::edition; use rustc_span::source_map::{FileLoader, FileName, SourceMap}; @@ -36,7 +37,7 @@ pub struct Compiler { pub(crate) output_dir: Option, pub(crate) output_file: Option, pub(crate) crate_name: Option, - pub(crate) register_lints: Option>, + pub(crate) register_lints: Option>, pub(crate) override_queries: Option, &mut ty::query::Providers<'_>)>, } @@ -136,7 +137,7 @@ pub struct Config { /// /// Note that if you find a Some here you probably want to call that function in the new /// function being registered. - pub register_lints: Option>, + pub register_lints: Option>, /// This is a callback from the driver that is called just after we have populated /// the list of queries. @@ -177,11 +178,17 @@ pub fn run_compiler_in_existing_thread_pool( 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(mut config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {