Skip to content

Commit

Permalink
Rollup merge of rust-lang#135157 - bjorn3:fix_rustdoc_error_abort, r=…
Browse files Browse the repository at this point in the history
…jieyouxu,GuillaumeGomez

Move the has_errors check in rustdoc back to after TyCtxt is created

This was accidentally moved before TyCtxt creation by rust-lang#134302.
  • Loading branch information
matthiaskrgr authored Jan 6, 2025
2 parents d95d5aa + 0705ea2 commit 09d0472
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 09d0472

Please sign in to comment.