File tree 1 file changed +11
-3
lines changed
collector/src/compile/execute
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> {
298
298
let tmp_eprintln_file = filepath ( data. cwd , "eprintln" ) ;
299
299
let eprintln_file = filepath ( self . output_dir , & out_file ( "eprintln" ) ) ;
300
300
301
+ #[ allow( dead_code) ]
302
+ #[ derive( serde:: Deserialize ) ]
303
+ struct RustcMessage < ' a > {
304
+ #[ serde( rename = "$message_type" ) ]
305
+ message_type : & ' a str ,
306
+ }
307
+
301
308
let mut final_file = io:: BufWriter :: new ( std:: fs:: File :: create ( & eprintln_file) ?) ;
302
309
for line in io:: BufReader :: new ( std:: fs:: File :: open ( & tmp_eprintln_file) ?) . lines ( )
303
310
{
304
311
let line = line?;
312
+
305
313
// rustc under Cargo currently ~always emits artifact
306
314
// 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 ( ) {
310
318
continue ;
311
319
}
312
320
You can’t perform that action at this time.
0 commit comments