Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2f6e59d

Browse files
committed
Don't display empty future-compat report
1 parent 4621ce9 commit 2f6e59d

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

src/tools/compiletest/src/json.rs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,27 @@ pub fn extract_rendered(output: &str) -> String {
9494
if let Ok(diagnostic) = serde_json::from_str::<Diagnostic>(line) {
9595
diagnostic.rendered
9696
} else if let Ok(report) = serde_json::from_str::<FutureIncompatReport>(line) {
97-
Some(format!(
98-
"Future incompatibility report: {}",
99-
report
100-
.future_incompat_report
101-
.into_iter()
102-
.map(|item| {
103-
format!(
104-
"Future breakage date: {}, diagnostic:\n{}",
105-
item.future_breakage_date.unwrap_or_else(|| "None".to_string()),
106-
item.diagnostic
107-
.rendered
108-
.unwrap_or_else(|| "Not rendered".to_string())
109-
)
110-
})
111-
.collect::<String>()
112-
))
97+
if report.future_incompat_report.is_empty() {
98+
None
99+
} else {
100+
Some(format!(
101+
"Future incompatibility report: {}",
102+
report
103+
.future_incompat_report
104+
.into_iter()
105+
.map(|item| {
106+
format!(
107+
"Future breakage date: {}, diagnostic:\n{}",
108+
item.future_breakage_date
109+
.unwrap_or_else(|| "None".to_string()),
110+
item.diagnostic
111+
.rendered
112+
.unwrap_or_else(|| "Not rendered".to_string())
113+
)
114+
})
115+
.collect::<String>()
116+
))
117+
}
113118
} else if serde_json::from_str::<ArtifactNotification>(line).is_ok() {
114119
// Ignore the notification.
115120
None

0 commit comments

Comments
 (0)