@@ -86,6 +86,13 @@ pub fn extract_rendered(output: &str) -> String {
86
86
if line. starts_with ( '{' ) {
87
87
if let Ok ( diagnostic) = serde_json:: from_str :: < Diagnostic > ( line) {
88
88
diagnostic. rendered
89
+ } else if let Ok ( report) = serde_json:: from_str :: < FutureIncompatReport > ( line) {
90
+ Some ( format ! ( "Future incompatibility report: {}" ,
91
+ report. future_incompat_report. into_iter( ) . map( |item| {
92
+ format!( "Future breakage date: {}, diagnostic:\n {}" ,
93
+ item. future_breakage_date. unwrap_or_else( || "None" . to_string( ) ) ,
94
+ item. diagnostic. rendered. unwrap_or_else( || "Not rendered" . to_string( ) ) )
95
+ } ) . collect:: <String >( ) ) )
89
96
} else if serde_json:: from_str :: < ArtifactNotification > ( line) . is_ok ( ) {
90
97
// Ignore the notification.
91
98
None
@@ -105,14 +112,10 @@ pub fn extract_rendered(output: &str) -> String {
105
112
}
106
113
107
114
pub fn parse_output ( file_name : & str , output : & str , proc_res : & ProcRes ) -> Vec < Error > {
108
- let lines = output. lines ( ) ;
109
- let last_line = lines. next_back ( ) ;
110
- lines. flat_map ( |line| parse_line ( file_name, line, output, proc_res, false ) ) . chain (
111
- last_line. into_iter ( ) . flat_map ( |line| parse_line ( file_name, line, output, proc_res, true ) )
112
- ) . collect ( )
115
+ output. lines ( ) . flat_map ( |line| parse_line ( file_name, line, output, proc_res) ) . collect ( )
113
116
}
114
117
115
- fn parse_line ( file_name : & str , line : & str , output : & str , proc_res : & ProcRes , last_line : bool ) -> Vec < Error > {
118
+ fn parse_line ( file_name : & str , line : & str , output : & str , proc_res : & ProcRes ) -> Vec < Error > {
116
119
// The compiler sometimes intermingles non-JSON stuff into the
117
120
// output. This hack just skips over such lines. Yuck.
118
121
if line. starts_with ( '{' ) {
0 commit comments