diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-01-22 13:46:52 -0500 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-01-23 11:42:15 -0500 |
| commit | ca72f9ed7065a601bd2b1ec80889ec7bad177598 (patch) | |
| tree | a4e69fcf28f766c3a4dcd4fec5be1008d9b68bb1 /src/librustdoc/lib.rs | |
| parent | 1d1010f1af1747f9fa8fbade19d9eed2260c96f1 (diff) | |
| download | rust-ca72f9ed7065a601bd2b1ec80889ec7bad177598.tar.gz rust-ca72f9ed7065a601bd2b1ec80889ec7bad177598.zip | |
Calculate self-profile strings in `Compiler::enter` instead in codegen
This avoids each tool having to separately find and call `self_profile_alloc_strings`. - Don't compute the global context if it hasn't yet been computed This avoids giving extraneous errors about unresolved names if an error occurs during parsing.
Diffstat (limited to 'src/librustdoc/lib.rs')
| -rw-r--r-- | src/librustdoc/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 19d2de58ffb..780a3b509c7 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -539,7 +539,7 @@ fn main_options(options: config::Options) -> MainResult { sess.fatal("Compilation failed, aborting rustdoc"); } - let mut global_ctxt = abort_on_err(queries.global_ctxt(), sess).take(); + let mut global_ctxt = abort_on_err(queries.global_ctxt(), sess).peek_mut(); global_ctxt.enter(|tcx| { let (mut krate, render_info, render_opts) = sess.time("run_global_ctxt", || { @@ -568,7 +568,7 @@ fn main_options(options: config::Options) -> MainResult { info!("going to format"); let (error_format, edition, debugging_options) = diag_opts; let diag = core::new_handler(error_format, None, &debugging_options); - let main_result = match output_format { + match output_format { None | Some(config::OutputFormat::Html) => sess.time("render_html", || { run_renderer::<html::render::Context<'_>>( krate, @@ -589,10 +589,7 @@ fn main_options(options: config::Options) -> MainResult { tcx, ) }), - }; - // NOTE: this is normally called in codegen, but rustdoc never goes to codegen. - tcx.alloc_self_profile_query_strings(); - main_result + } }) }) }) |
