File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -1867,10 +1867,19 @@ fn on_stderr_line_inner(
18671867
18681868 #[ derive( serde:: Deserialize ) ]
18691869 struct CompilerMessage {
1870+ message : String ,
18701871 level : String ,
18711872 }
1872- if let Ok ( message) = serde_json:: from_str :: < CompilerMessage > ( compiler_message. get ( ) ) {
1873- count_diagnostic ( & message. level , options) ;
1873+
1874+ if let Ok ( msg) = serde_json:: from_str :: < CompilerMessage > ( compiler_message. get ( ) ) {
1875+ if msg. message . starts_with ( "aborting due to" )
1876+ || msg. message . ends_with ( "warning emitted" )
1877+ || msg. message . ends_with ( "warnings emitted" )
1878+ {
1879+ // Skip this line; we'll print our own summary at the end.
1880+ return Ok ( true ) ;
1881+ }
1882+ count_diagnostic ( & msg. level , options) ;
18741883 }
18751884
18761885 let msg = machine_message:: FromCompiler {
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ fn cargo_fail_with_no_stderr() {
9595 . with_status ( 101 )
9696 . with_stderr_data ( str![ [ r#"
9797[COMPILING] foo v0.5.0 ([ROOT]/foo)
98- [ERROR] could not compile `foo` (bin "foo") due to 2 previous errors
98+ [ERROR] could not compile `foo` (bin "foo") due to 1 previous error
9999
100100"# ] ] )
101101 . run ( ) ;
Original file line number Diff line number Diff line change @@ -327,12 +327,6 @@ fn pkgid_json_message_metadata_consistency() {
327327 "reason": "compiler-message",
328328 "...": "{...}"
329329 },
330- {
331- "manifest_path": "[ROOT]/foo/Cargo.toml",
332- "package_id": "path+[ROOTURL]/foo#0.5.0",
333- "reason": "compiler-message",
334- "...": "{...}"
335- },
336330 {
337331 "manifest_path": "[ROOT]/foo/Cargo.toml",
338332 "package_id": "path+[ROOTURL]/foo#0.5.0",
You can’t perform that action at this time.
0 commit comments