File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -674,7 +674,7 @@ type MainResult = Result<(), ErrorGuaranteed>;
674674
675675fn wrap_return ( diag : & rustc_errors:: Handler , res : Result < ( ) , String > ) -> MainResult {
676676 match res {
677- Ok ( ( ) ) => Ok ( ( ) ) ,
677+ Ok ( ( ) ) => diag . has_errors ( ) . map_or ( Ok ( ( ) ) , Err ) ,
678678 Err ( err) => {
679679 let reported = diag. struct_err ( & err) . emit ( ) ;
680680 Err ( reported)
@@ -689,7 +689,7 @@ fn run_renderer<'tcx, T: formats::FormatRenderer<'tcx>>(
689689 tcx : TyCtxt < ' tcx > ,
690690) -> MainResult {
691691 match formats:: run_format :: < T > ( krate, renderopts, cache, tcx) {
692- Ok ( _) => Ok ( ( ) ) ,
692+ Ok ( _) => tcx . sess . has_errors ( ) . map_or ( Ok ( ( ) ) , Err ) ,
693693 Err ( e) => {
694694 let mut msg =
695695 tcx. sess . struct_err ( & format ! ( "couldn't generate documentation: {}" , e. error) ) ;
You can’t perform that action at this time.
0 commit comments