@@ -154,7 +154,7 @@ impl JsonEmitter {
154154enum EmitTyped < ' a > {
155155 Diagnostic ( Diagnostic ) ,
156156 Artifact ( ArtifactNotification < ' a > ) ,
157- FutureIncompat ( FutureIncompatReport ) ,
157+ FutureIncompat ( FutureIncompatReport < ' a > ) ,
158158 UnusedExtern ( UnusedExterns < ' a , ' a , ' a > ) ,
159159}
160160
@@ -186,13 +186,17 @@ impl Emitter for JsonEmitter {
186186 }
187187
188188 fn emit_future_breakage_report ( & mut self , diags : Vec < crate :: Diagnostic > ) {
189- let data: Vec < FutureBreakageItem > = diags
189+ let data: Vec < FutureBreakageItem < ' _ > > = diags
190190 . into_iter ( )
191191 . map ( |mut diag| {
192192 if diag. level == crate :: Level :: Allow {
193193 diag. level = crate :: Level :: Warning ( None ) ;
194194 }
195- FutureBreakageItem { diagnostic : Diagnostic :: from_errors_diagnostic ( & diag, self ) }
195+ FutureBreakageItem {
196+ diagnostic : EmitTyped :: Diagnostic ( Diagnostic :: from_errors_diagnostic (
197+ & diag, self ,
198+ ) ) ,
199+ }
196200 } )
197201 . collect ( ) ;
198202 let report = FutureIncompatReport { future_incompat_report : data } ;
@@ -304,13 +308,14 @@ struct ArtifactNotification<'a> {
304308}
305309
306310#[ derive( Serialize ) ]
307- struct FutureBreakageItem {
308- diagnostic : Diagnostic ,
311+ struct FutureBreakageItem < ' a > {
312+ // Actually Diagnostic, but we want to make sure it gets serialized with `type`.
313+ diagnostic : EmitTyped < ' a > ,
309314}
310315
311316#[ derive( Serialize ) ]
312- struct FutureIncompatReport {
313- future_incompat_report : Vec < FutureBreakageItem > ,
317+ struct FutureIncompatReport < ' a > {
318+ future_incompat_report : Vec < FutureBreakageItem < ' a > > ,
314319}
315320
316321// NOTE: Keep this in sync with the equivalent structs in rustdoc's
0 commit comments