1
Fork 0

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

This commit is contained in:
bjorn3 2025-01-06 12:13:19 +01:00
parent 13738b0abe
commit 0705ea2a1c
No known key found for this signature in database

View file

@ -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)
});