Skip to content

Commit

Permalink
Move the has_errors check in rustdoc back to after TyCtxt is created
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 6, 2025
1 parent 13738b0 commit 0705ea2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
Expand Down

0 comments on commit 0705ea2

Please sign in to comment.