@@ -161,7 +161,7 @@ impl JsonEmitter {
161
161
enum EmitTyped < ' a > {
162
162
Diagnostic ( Diagnostic ) ,
163
163
Artifact ( ArtifactNotification < ' a > ) ,
164
- FutureIncompat ( FutureIncompatReport ) ,
164
+ FutureIncompat ( FutureIncompatReport < ' a > ) ,
165
165
UnusedExtern ( UnusedExterns < ' a , ' a , ' a > ) ,
166
166
}
167
167
@@ -193,13 +193,17 @@ impl Emitter for JsonEmitter {
193
193
}
194
194
195
195
fn emit_future_breakage_report ( & mut self , diags : Vec < crate :: Diagnostic > ) {
196
- let data: Vec < FutureBreakageItem > = diags
196
+ let data: Vec < FutureBreakageItem < ' _ > > = diags
197
197
. into_iter ( )
198
198
. map ( |mut diag| {
199
199
if diag. level == crate :: Level :: Allow {
200
200
diag. level = crate :: Level :: Warning ( None ) ;
201
201
}
202
- FutureBreakageItem { diagnostic : Diagnostic :: from_errors_diagnostic ( & diag, self ) }
202
+ FutureBreakageItem {
203
+ diagnostic : EmitTyped :: Diagnostic ( Diagnostic :: from_errors_diagnostic (
204
+ & diag, self ,
205
+ ) ) ,
206
+ }
203
207
} )
204
208
. collect ( ) ;
205
209
let report = FutureIncompatReport { future_incompat_report : data } ;
@@ -311,13 +315,14 @@ struct ArtifactNotification<'a> {
311
315
}
312
316
313
317
#[ 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 > ,
316
321
}
317
322
318
323
#[ derive( Serialize ) ]
319
- struct FutureIncompatReport {
320
- future_incompat_report : Vec < FutureBreakageItem > ,
324
+ struct FutureIncompatReport < ' a > {
325
+ future_incompat_report : Vec < FutureBreakageItem < ' a > > ,
321
326
}
322
327
323
328
// NOTE: Keep this in sync with the equivalent structs in rustdoc's
0 commit comments