@@ -1016,7 +1016,7 @@ impl<'a> DumpHandler<'a> {
1016
1016
}
1017
1017
}
1018
1018
1019
- fn output_file ( & self , ctx : & SaveContext < ' _ , ' _ > ) -> File {
1019
+ fn output_file ( & self , ctx : & SaveContext < ' _ , ' _ > ) -> ( File , PathBuf ) {
1020
1020
let sess = & ctx. tcx . sess ;
1021
1021
let file_name = match ctx. config . output_file {
1022
1022
Some ( ref s) => PathBuf :: from ( s) ,
@@ -1054,7 +1054,7 @@ impl<'a> DumpHandler<'a> {
1054
1054
|e| sess. fatal ( & format ! ( "Could not open {}: {}" , file_name. display( ) , e) ) ,
1055
1055
) ;
1056
1056
1057
- output_file
1057
+ ( output_file, file_name )
1058
1058
}
1059
1059
}
1060
1060
@@ -1066,13 +1066,23 @@ impl<'a> SaveHandler for DumpHandler<'a> {
1066
1066
cratename : & str ,
1067
1067
input : & ' l Input ,
1068
1068
) {
1069
- let output = & mut self . output_file ( & save_ctxt) ;
1070
- let mut dumper = JsonDumper :: new ( output, save_ctxt. config . clone ( ) ) ;
1071
- let mut visitor = DumpVisitor :: new ( save_ctxt, & mut dumper) ;
1069
+ let sess = & save_ctxt. tcx . sess ;
1070
+ let file_name = {
1071
+ let ( mut output, file_name) = self . output_file ( & save_ctxt) ;
1072
+ let mut dumper = JsonDumper :: new ( & mut output, save_ctxt. config . clone ( ) ) ;
1073
+ let mut visitor = DumpVisitor :: new ( save_ctxt, & mut dumper) ;
1072
1074
1073
- visitor. dump_crate_info ( cratename, krate) ;
1074
- visitor. dump_compilation_options ( input, cratename) ;
1075
- visit:: walk_crate ( & mut visitor, krate) ;
1075
+ visitor. dump_crate_info ( cratename, krate) ;
1076
+ visitor. dump_compilation_options ( input, cratename) ;
1077
+ visit:: walk_crate ( & mut visitor, krate) ;
1078
+
1079
+ file_name
1080
+ } ;
1081
+
1082
+ if sess. opts . debugging_opts . emit_artifact_notifications {
1083
+ sess. parse_sess . span_diagnostic
1084
+ . emit_artifact_notification ( & file_name, "save-analysis" ) ;
1085
+ }
1076
1086
}
1077
1087
}
1078
1088
0 commit comments