From 6bdb4e32067a37b339d77f7788a772356d486f72 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sun, 18 Oct 2020 15:28:23 -0400 Subject: Some work --- compiler/rustc_errors/src/json.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index ddffa64f222..d57beb1148a 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -145,10 +145,11 @@ impl Emitter for JsonEmitter { } }) .collect(); + let report = FutureIncompatReport { future_incompat_report: data }; let result = if self.pretty { - writeln!(&mut self.dst, "{}", as_pretty_json(&data)) + writeln!(&mut self.dst, "{}", as_pretty_json(&report)) } else { - writeln!(&mut self.dst, "{}", as_json(&data)) + writeln!(&mut self.dst, "{}", as_json(&report)) } .and_then(|_| self.dst.flush()); if let Err(e) = result { @@ -254,6 +255,11 @@ struct FutureBreakageItem { diagnostic: Diagnostic, } +#[derive(Encodable)] +struct FutureIncompatReport { + future_incompat_report: Vec, +} + impl Diagnostic { fn from_errors_diagnostic(diag: &crate::Diagnostic, je: &JsonEmitter) -> Diagnostic { let sugg = diag.suggestions.iter().map(|sugg| Diagnostic { -- cgit 1.4.1-3-g733a5