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>;
674
674
675
675
fn wrap_return ( diag : & rustc_errors:: Handler , res : Result < ( ) , String > ) -> MainResult {
676
676
match res {
677
- Ok ( ( ) ) => Ok ( ( ) ) ,
677
+ Ok ( ( ) ) => diag . has_errors ( ) . map_or ( Ok ( ( ) ) , Err ) ,
678
678
Err ( err) => {
679
679
let reported = diag. struct_err ( & err) . emit ( ) ;
680
680
Err ( reported)
@@ -689,7 +689,7 @@ fn run_renderer<'tcx, T: formats::FormatRenderer<'tcx>>(
689
689
tcx : TyCtxt < ' tcx > ,
690
690
) -> MainResult {
691
691
match formats:: run_format :: < T > ( krate, renderopts, cache, tcx) {
692
- Ok ( _) => Ok ( ( ) ) ,
692
+ Ok ( _) => tcx . sess . has_errors ( ) . map_or ( Ok ( ( ) ) , Err ) ,
693
693
Err ( e) => {
694
694
let mut msg =
695
695
tcx. sess . struct_err ( & format ! ( "couldn't generate documentation: {}" , e. error) ) ;
You can’t perform that action at this time.
0 commit comments