@@ -154,7 +154,7 @@ impl JsonEmitter {
154
154
enum EmitTyped < ' a > {
155
155
Diagnostic ( Diagnostic ) ,
156
156
Artifact ( ArtifactNotification < ' a > ) ,
157
- FutureIncompat ( FutureIncompatReport ) ,
157
+ FutureIncompat ( FutureIncompatReport < ' a > ) ,
158
158
UnusedExtern ( UnusedExterns < ' a , ' a , ' a > ) ,
159
159
}
160
160
@@ -186,13 +186,17 @@ impl Emitter for JsonEmitter {
186
186
}
187
187
188
188
fn emit_future_breakage_report ( & mut self , diags : Vec < crate :: Diagnostic > ) {
189
- let data: Vec < FutureBreakageItem > = diags
189
+ let data: Vec < FutureBreakageItem < ' _ > > = diags
190
190
. into_iter ( )
191
191
. map ( |mut diag| {
192
192
if diag. level == crate :: Level :: Allow {
193
193
diag. level = crate :: Level :: Warning ( None ) ;
194
194
}
195
- FutureBreakageItem { diagnostic : Diagnostic :: from_errors_diagnostic ( & diag, self ) }
195
+ FutureBreakageItem {
196
+ diagnostic : EmitTyped :: Diagnostic ( Diagnostic :: from_errors_diagnostic (
197
+ & diag, self ,
198
+ ) ) ,
199
+ }
196
200
} )
197
201
. collect ( ) ;
198
202
let report = FutureIncompatReport { future_incompat_report : data } ;
@@ -304,13 +308,14 @@ struct ArtifactNotification<'a> {
304
308
}
305
309
306
310
#[ 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 > ,
309
314
}
310
315
311
316
#[ derive( Serialize ) ]
312
- struct FutureIncompatReport {
313
- future_incompat_report : Vec < FutureBreakageItem > ,
317
+ struct FutureIncompatReport < ' a > {
318
+ future_incompat_report : Vec < FutureBreakageItem < ' a > > ,
314
319
}
315
320
316
321
// NOTE: Keep this in sync with the equivalent structs in rustdoc's
0 commit comments