@@ -1016,7 +1016,7 @@ impl<'a> DumpHandler<'a> {
10161016 }
10171017 }
10181018
1019- fn output_file ( & self , ctx : & SaveContext < ' _ , ' _ > ) -> File {
1019+ fn output_file ( & self , ctx : & SaveContext < ' _ , ' _ > ) -> ( File , PathBuf ) {
10201020 let sess = & ctx. tcx . sess ;
10211021 let file_name = match ctx. config . output_file {
10221022 Some ( ref s) => PathBuf :: from ( s) ,
@@ -1054,7 +1054,7 @@ impl<'a> DumpHandler<'a> {
10541054 |e| sess. fatal ( & format ! ( "Could not open {}: {}" , file_name. display( ) , e) ) ,
10551055 ) ;
10561056
1057- output_file
1057+ ( output_file, file_name )
10581058 }
10591059}
10601060
@@ -1066,13 +1066,23 @@ impl<'a> SaveHandler for DumpHandler<'a> {
10661066 cratename : & str ,
10671067 input : & ' l Input ,
10681068 ) {
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) ;
10721074
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+ }
10761086 }
10771087}
10781088
0 commit comments