diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-10-19 11:54:09 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-10-30 20:02:15 -0400 |
| commit | 2f6e59d94126bf9d4d09fe92b18d329a1631448f (patch) | |
| tree | e864a8467603fdbac9fe65a1e43f6d598de80148 | |
| parent | 4621ce9858856389c32f890725feac489bc94ac5 (diff) | |
| download | rust-2f6e59d94126bf9d4d09fe92b18d329a1631448f.tar.gz rust-2f6e59d94126bf9d4d09fe92b18d329a1631448f.zip | |
Don't display empty future-compat report
| -rw-r--r-- | src/tools/compiletest/src/json.rs | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs index 176c3219307..19aec0ea598 100644 --- a/src/tools/compiletest/src/json.rs +++ b/src/tools/compiletest/src/json.rs @@ -94,22 +94,27 @@ pub fn extract_rendered(output: &str) -> String { if let Ok(diagnostic) = serde_json::from_str::<Diagnostic>(line) { diagnostic.rendered } else if let Ok(report) = serde_json::from_str::<FutureIncompatReport>(line) { - Some(format!( - "Future incompatibility report: {}", - report - .future_incompat_report - .into_iter() - .map(|item| { - format!( - "Future breakage date: {}, diagnostic:\n{}", - item.future_breakage_date.unwrap_or_else(|| "None".to_string()), - item.diagnostic - .rendered - .unwrap_or_else(|| "Not rendered".to_string()) - ) - }) - .collect::<String>() - )) + if report.future_incompat_report.is_empty() { + None + } else { + Some(format!( + "Future incompatibility report: {}", + report + .future_incompat_report + .into_iter() + .map(|item| { + format!( + "Future breakage date: {}, diagnostic:\n{}", + item.future_breakage_date + .unwrap_or_else(|| "None".to_string()), + item.diagnostic + .rendered + .unwrap_or_else(|| "Not rendered".to_string()) + ) + }) + .collect::<String>() + )) + } } else if serde_json::from_str::<ArtifactNotification>(line).is_ok() { // Ignore the notification. None |
