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(
1867
1867
1868
1868
#[ derive( serde:: Deserialize ) ]
1869
1869
struct CompilerMessage {
1870
+ message : String ,
1870
1871
level : String ,
1871
1872
}
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) ;
1874
1883
}
1875
1884
1876
1885
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() {
95
95
. with_status ( 101 )
96
96
. with_stderr_data ( str![ [ r#"
97
97
[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
99
99
100
100
"# ] ] )
101
101
. run ( ) ;
Original file line number Diff line number Diff line change @@ -327,12 +327,6 @@ fn pkgid_json_message_metadata_consistency() {
327
327
"reason": "compiler-message",
328
328
"...": "{...}"
329
329
},
330
- {
331
- "manifest_path": "[ROOT]/foo/Cargo.toml",
332
- "package_id": "path+[ROOTURL]/foo#0.5.0",
333
- "reason": "compiler-message",
334
- "...": "{...}"
335
- },
336
330
{
337
331
"manifest_path": "[ROOT]/foo/Cargo.toml",
338
332
"package_id": "path+[ROOTURL]/foo#0.5.0",
You can’t perform that action at this time.
0 commit comments