File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -486,11 +486,13 @@ crate fn run_global_ctxt(
486
486
} ;
487
487
if run {
488
488
debug ! ( "running pass {}" , p. pass. name) ;
489
- krate = ctxt . tcx . sess . time ( p. pass . name , || ( p. pass . run ) ( krate, & mut ctxt) ) ;
489
+ krate = tcx. sess . time ( p. pass . name , || ( p. pass . run ) ( krate, & mut ctxt) ) ;
490
490
}
491
491
}
492
492
493
- ctxt. sess ( ) . abort_if_errors ( ) ;
493
+ if tcx. sess . diagnostic ( ) . has_errors_or_lint_errors ( ) {
494
+ rustc_errors:: FatalError . raise ( ) ;
495
+ }
494
496
495
497
let render_options = ctxt. render_options ;
496
498
let mut cache = ctxt. cache ;
Original file line number Diff line number Diff line change 1
1
use rustc_ast as ast;
2
2
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
3
3
use rustc_data_structures:: sync:: Lrc ;
4
- use rustc_errors:: { ColorConfig , ErrorReported } ;
4
+ use rustc_errors:: { ColorConfig , ErrorReported , FatalError } ;
5
5
use rustc_hir as hir;
6
6
use rustc_hir:: def_id:: LOCAL_CRATE ;
7
7
use rustc_hir:: intravisit;
@@ -149,7 +149,9 @@ crate fn run(options: Options) -> Result<(), ErrorReported> {
149
149
150
150
collector
151
151
} ) ;
152
- compiler. session ( ) . abort_if_errors ( ) ;
152
+ if compiler. session ( ) . diagnostic ( ) . has_errors_or_lint_errors ( ) {
153
+ FatalError . raise ( ) ;
154
+ }
153
155
154
156
let unused_extern_reports = collector. unused_extern_reports . clone ( ) ;
155
157
let compiling_test_count = collector. compiling_test_count . load ( Ordering :: SeqCst ) ;
Original file line number Diff line number Diff line change @@ -775,7 +775,7 @@ fn main_options(options: config::Options) -> MainResult {
775
775
// current architecture.
776
776
let resolver = core:: create_resolver ( queries, sess) ;
777
777
778
- if sess. has_errors ( ) {
778
+ if sess. diagnostic ( ) . has_errors_or_lint_errors ( ) {
779
779
sess. fatal ( "Compilation failed, aborting rustdoc" ) ;
780
780
}
781
781
You can’t perform that action at this time.
0 commit comments