File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
collector/src/compile/execute Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -298,15 +298,23 @@ impl<'a> Processor for ProfileProcessor<'a> {
298298 let tmp_eprintln_file = filepath ( data. cwd , "eprintln" ) ;
299299 let eprintln_file = filepath ( self . output_dir , & out_file ( "eprintln" ) ) ;
300300
301+ #[ allow( dead_code) ]
302+ #[ derive( serde:: Deserialize ) ]
303+ struct RustcMessage < ' a > {
304+ #[ serde( rename = "$message_type" ) ]
305+ message_type : & ' a str ,
306+ }
307+
301308 let mut final_file = io:: BufWriter :: new ( std:: fs:: File :: create ( & eprintln_file) ?) ;
302309 for line in io:: BufReader :: new ( std:: fs:: File :: open ( & tmp_eprintln_file) ?) . lines ( )
303310 {
304311 let line = line?;
312+
305313 // rustc under Cargo currently ~always emits artifact
306314 // messages -- which we don't want in final
307- // eprintln output. These messages generally look like:
308- // {"artifact":"/tmp/.tmpjIe45J/...","emit":"dep-info"}
309- if line. starts_with ( r#"{"artifact":"# ) {
315+ // eprintln output. These messages contain a $message_type tag since
316+ // https://github.com/rust-lang/rust/pull/115691.
317+ if serde_json :: from_str :: < RustcMessage > ( & line) . is_ok ( ) {
310318 continue ;
311319 }
312320
You can’t perform that action at this time.
0 commit comments