From 0705ea2a1cef7cd92cdd15ea12d30782c7bfb4bb Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:13:19 +0100 Subject: [PATCH] Move the has_errors check in rustdoc back to after TyCtxt is created --- src/librustdoc/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index d74dcc98cb05e..96ca96ee6bc15 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -865,11 +865,11 @@ fn main_args( } let krate = rustc_interface::passes::parse(sess); - if sess.dcx().has_errors().is_some() { - sess.dcx().fatal("Compilation failed, aborting rustdoc"); - } - rustc_interface::create_and_enter_global_ctxt(compiler, krate, |tcx| { + if sess.dcx().has_errors().is_some() { + sess.dcx().fatal("Compilation failed, aborting rustdoc"); + } + let (krate, render_opts, mut cache) = sess.time("run_global_ctxt", || { core::run_global_ctxt(tcx, show_coverage, render_options, output_format) });