@@ -518,7 +518,8 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
518
518
-> CompileController < ' a > {
519
519
let mut control = CompileController :: basic ( ) ;
520
520
521
- control. keep_ast = sess. opts . debugging_opts . keep_ast || save_analysis ( sess) ;
521
+ control. keep_ast = sess. opts . debugging_opts . keep_ast ;
522
+ control. continue_parse_after_error = sess. opts . debugging_opts . continue_parse_after_error ;
522
523
523
524
if let Some ( ( ppm, opt_uii) ) = parse_pretty ( sess, matches) {
524
525
if ppm. needs_ast_map ( & opt_uii) {
@@ -574,19 +575,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
574
575
}
575
576
576
577
if save_analysis ( sess) {
577
- control. after_analysis . callback = box |state| {
578
- time ( state. session . time_passes ( ) , "save analysis" , || {
579
- save:: process_crate ( state. tcx . unwrap ( ) ,
580
- state. expanded_crate . unwrap ( ) ,
581
- state. analysis . unwrap ( ) ,
582
- state. crate_name . unwrap ( ) ,
583
- None ,
584
- DumpHandler :: new ( state. out_dir ,
585
- state. crate_name . unwrap ( ) ) )
586
- } ) ;
587
- } ;
588
- control. after_analysis . run_callback_on_error = true ;
589
- control. make_glob_map = resolve:: MakeGlobMap :: Yes ;
578
+ enable_save_analysis ( & mut control) ;
590
579
}
591
580
592
581
if sess. print_fuel_crate . is_some ( ) {
@@ -603,6 +592,23 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
603
592
}
604
593
}
605
594
595
+ pub fn enable_save_analysis ( control : & mut CompileController ) {
596
+ control. keep_ast = true ;
597
+ control. after_analysis . callback = box |state| {
598
+ time ( state. session . time_passes ( ) , "save analysis" , || {
599
+ save:: process_crate ( state. tcx . unwrap ( ) ,
600
+ state. expanded_crate . unwrap ( ) ,
601
+ state. analysis . unwrap ( ) ,
602
+ state. crate_name . unwrap ( ) ,
603
+ None ,
604
+ DumpHandler :: new ( state. out_dir ,
605
+ state. crate_name . unwrap ( ) ) )
606
+ } ) ;
607
+ } ;
608
+ control. after_analysis . run_callback_on_error = true ;
609
+ control. make_glob_map = resolve:: MakeGlobMap :: Yes ;
610
+ }
611
+
606
612
fn save_analysis ( sess : & Session ) -> bool {
607
613
sess. opts . debugging_opts . save_analysis
608
614
}
@@ -1215,7 +1221,7 @@ pub fn diagnostics_registry() -> errors::registry::Registry {
1215
1221
Registry :: new ( & all_errors)
1216
1222
}
1217
1223
1218
- fn get_args ( ) -> Vec < String > {
1224
+ pub fn get_args ( ) -> Vec < String > {
1219
1225
env:: args_os ( ) . enumerate ( )
1220
1226
. map ( |( i, arg) | arg. into_string ( ) . unwrap_or_else ( |arg| {
1221
1227
early_error ( ErrorOutputType :: default ( ) ,
0 commit comments