@@ -161,7 +161,7 @@ impl JsonEmitter {
161161enum EmitTyped < ' a > {
162162 Diagnostic ( Diagnostic ) ,
163163 Artifact ( ArtifactNotification < ' a > ) ,
164- FutureIncompat ( FutureIncompatReport ) ,
164+ FutureIncompat ( FutureIncompatReport < ' a > ) ,
165165 UnusedExtern ( UnusedExterns < ' a , ' a , ' a > ) ,
166166}
167167
@@ -193,13 +193,17 @@ impl Emitter for JsonEmitter {
193193 }
194194
195195 fn emit_future_breakage_report ( & mut self , diags : Vec < crate :: Diagnostic > ) {
196- let data: Vec < FutureBreakageItem > = diags
196+ let data: Vec < FutureBreakageItem < ' _ > > = diags
197197 . into_iter ( )
198198 . map ( |mut diag| {
199199 if diag. level == crate :: Level :: Allow {
200200 diag. level = crate :: Level :: Warning ( None ) ;
201201 }
202- FutureBreakageItem { diagnostic : Diagnostic :: from_errors_diagnostic ( & diag, self ) }
202+ FutureBreakageItem {
203+ diagnostic : EmitTyped :: Diagnostic ( Diagnostic :: from_errors_diagnostic (
204+ & diag, self ,
205+ ) ) ,
206+ }
203207 } )
204208 . collect ( ) ;
205209 let report = FutureIncompatReport { future_incompat_report : data } ;
@@ -311,13 +315,14 @@ struct ArtifactNotification<'a> {
311315}
312316
313317#[ derive( Serialize ) ]
314- struct FutureBreakageItem {
315- diagnostic : Diagnostic ,
318+ struct FutureBreakageItem < ' a > {
319+ // Actually Diagnostic, but we want to make sure it gets serialized with `type`.
320+ diagnostic : EmitTyped < ' a > ,
316321}
317322
318323#[ derive( Serialize ) ]
319- struct FutureIncompatReport {
320- future_incompat_report : Vec < FutureBreakageItem > ,
324+ struct FutureIncompatReport < ' a > {
325+ future_incompat_report : Vec < FutureBreakageItem < ' a > > ,
321326}
322327
323328// NOTE: Keep this in sync with the equivalent structs in rustdoc's
0 commit comments