We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e72ea1d commit 0669379Copy full SHA for 0669379
src/librustdoc/lib.rs
@@ -674,7 +674,7 @@ type MainResult = Result<(), ErrorGuaranteed>;
674
675
fn wrap_return(diag: &rustc_errors::Handler, res: Result<(), String>) -> MainResult {
676
match res {
677
- Ok(()) => Ok(()),
+ Ok(()) => diag.has_errors().map_or(Ok(()), Err),
678
Err(err) => {
679
let reported = diag.struct_err(&err).emit();
680
Err(reported)
@@ -689,7 +689,7 @@ fn run_renderer<'tcx, T: formats::FormatRenderer<'tcx>>(
689
tcx: TyCtxt<'tcx>,
690
) -> MainResult {
691
match formats::run_format::<T>(krate, renderopts, cache, tcx) {
692
- Ok(_) => Ok(()),
+ Ok(_) => tcx.sess.has_errors().map_or(Ok(()), Err),
693
Err(e) => {
694
let mut msg =
695
tcx.sess.struct_err(&format!("couldn't generate documentation: {}", e.error));
0 commit comments