diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-10-18 15:28:23 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-10-30 20:02:14 -0400 |
| commit | 6bdb4e32067a37b339d77f7788a772356d486f72 (patch) | |
| tree | 6d8df8adc0d41c747e5967f3dcc0adbe588640a6 /compiler/rustc_errors/src/json.rs | |
| parent | 23018a55d9735afbefb19fcec91db4b53fe917d8 (diff) | |
| download | rust-6bdb4e32067a37b339d77f7788a772356d486f72.tar.gz rust-6bdb4e32067a37b339d77f7788a772356d486f72.zip | |
Some work
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
| -rw-r--r-- | compiler/rustc_errors/src/json.rs | 10 |
1 files changed, 8 insertions, 2 deletions
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<FutureBreakageItem>, +} + impl Diagnostic { fn from_errors_diagnostic(diag: &crate::Diagnostic, je: &JsonEmitter) -> Diagnostic { let sugg = diag.suggestions.iter().map(|sugg| Diagnostic { |
