@@ -170,7 +170,7 @@ impl PpSourceMode {
170
170
hir_map : Option < & hir_map:: Map < ' tcx > > ,
171
171
f : F )
172
172
-> A
173
- where F : FnOnce ( & PrinterSupport ) -> A
173
+ where F : FnOnce ( & dyn PrinterSupport ) -> A
174
174
{
175
175
match * self {
176
176
PpmNormal | PpmEveryBodyLoops | PpmExpanded => {
@@ -208,7 +208,7 @@ impl PpSourceMode {
208
208
id : & str ,
209
209
f : F )
210
210
-> A
211
- where F : FnOnce ( & HirPrinterSupport , & hir:: Crate ) -> A
211
+ where F : FnOnce ( & dyn HirPrinterSupport , & hir:: Crate ) -> A
212
212
{
213
213
match * self {
214
214
PpmNormal => {
@@ -265,7 +265,7 @@ trait PrinterSupport: pprust::PpAnn {
265
265
///
266
266
/// (Rust does not yet support upcasting from a trait object to
267
267
/// an object for one of its super-traits.)
268
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust:: PpAnn ;
268
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust:: PpAnn ;
269
269
}
270
270
271
271
trait HirPrinterSupport < ' hir > : pprust_hir:: PpAnn {
@@ -281,7 +281,7 @@ trait HirPrinterSupport<'hir>: pprust_hir::PpAnn {
281
281
///
282
282
/// (Rust does not yet support upcasting from a trait object to
283
283
/// an object for one of its super-traits.)
284
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust_hir:: PpAnn ;
284
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust_hir:: PpAnn ;
285
285
286
286
/// Computes an user-readable representation of a path, if possible.
287
287
fn node_path ( & self , id : ast:: NodeId ) -> Option < String > {
@@ -305,7 +305,7 @@ impl<'hir> PrinterSupport for NoAnn<'hir> {
305
305
self . sess
306
306
}
307
307
308
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust:: PpAnn {
308
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust:: PpAnn {
309
309
self
310
310
}
311
311
}
@@ -319,7 +319,7 @@ impl<'hir> HirPrinterSupport<'hir> for NoAnn<'hir> {
319
319
self . hir_map . as_ref ( )
320
320
}
321
321
322
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust_hir:: PpAnn {
322
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust_hir:: PpAnn {
323
323
self
324
324
}
325
325
}
@@ -346,7 +346,7 @@ impl<'hir> PrinterSupport for IdentifiedAnnotation<'hir> {
346
346
self . sess
347
347
}
348
348
349
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust:: PpAnn {
349
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust:: PpAnn {
350
350
self
351
351
}
352
352
}
@@ -397,7 +397,7 @@ impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
397
397
self . hir_map . as_ref ( )
398
398
}
399
399
400
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust_hir:: PpAnn {
400
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust_hir:: PpAnn {
401
401
self
402
402
}
403
403
}
@@ -458,7 +458,7 @@ impl<'a> PrinterSupport for HygieneAnnotation<'a> {
458
458
self . sess
459
459
}
460
460
461
- fn pp_ann ( & self ) -> & pprust:: PpAnn {
461
+ fn pp_ann ( & self ) -> & dyn pprust:: PpAnn {
462
462
self
463
463
}
464
464
}
@@ -496,7 +496,7 @@ impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
496
496
Some ( & self . tcx . hir )
497
497
}
498
498
499
- fn pp_ann < ' a > ( & ' a self ) -> & ' a pprust_hir:: PpAnn {
499
+ fn pp_ann < ' a > ( & ' a self ) -> & ' a dyn pprust_hir:: PpAnn {
500
500
self
501
501
}
502
502
@@ -896,7 +896,7 @@ pub fn print_after_parsing(sess: &Session,
896
896
897
897
if let PpmSource ( s) = ppm {
898
898
// Silently ignores an identified node.
899
- let out: & mut Write = & mut out;
899
+ let out: & mut dyn Write = & mut out;
900
900
s. call_with_pp_support ( sess, None , move |annotation| {
901
901
debug ! ( "pretty printing source code {:?}" , s) ;
902
902
let sess = annotation. sess ( ) ;
@@ -953,7 +953,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
953
953
match ( ppm, opt_uii) {
954
954
( PpmSource ( s) , _) => {
955
955
// Silently ignores an identified node.
956
- let out: & mut Write = & mut out;
956
+ let out: & mut dyn Write = & mut out;
957
957
s. call_with_pp_support ( sess, Some ( hir_map) , move |annotation| {
958
958
debug ! ( "pretty printing source code {:?}" , s) ;
959
959
let sess = annotation. sess ( ) ;
@@ -969,7 +969,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
969
969
}
970
970
971
971
( PpmHir ( s) , None ) => {
972
- let out: & mut Write = & mut out;
972
+ let out: & mut dyn Write = & mut out;
973
973
s. call_with_pp_support_hir ( sess,
974
974
cstore,
975
975
hir_map,
@@ -993,7 +993,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
993
993
}
994
994
995
995
( PpmHirTree ( s) , None ) => {
996
- let out: & mut Write = & mut out;
996
+ let out: & mut dyn Write = & mut out;
997
997
s. call_with_pp_support_hir ( sess,
998
998
cstore,
999
999
hir_map,
@@ -1009,7 +1009,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
1009
1009
}
1010
1010
1011
1011
( PpmHir ( s) , Some ( uii) ) => {
1012
- let out: & mut Write = & mut out;
1012
+ let out: & mut dyn Write = & mut out;
1013
1013
s. call_with_pp_support_hir ( sess,
1014
1014
cstore,
1015
1015
hir_map,
@@ -1043,7 +1043,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
1043
1043
}
1044
1044
1045
1045
( PpmHirTree ( s) , Some ( uii) ) => {
1046
- let out: & mut Write = & mut out;
1046
+ let out: & mut dyn Write = & mut out;
1047
1047
s. call_with_pp_support_hir ( sess,
1048
1048
cstore,
1049
1049
hir_map,
@@ -1137,7 +1137,7 @@ fn print_with_analysis<'tcx, 'a: 'tcx>(sess: &'a Session,
1137
1137
Some ( code) => {
1138
1138
let variants = gather_flowgraph_variants ( tcx. sess ) ;
1139
1139
1140
- let out: & mut Write = & mut out;
1140
+ let out: & mut dyn Write = & mut out;
1141
1141
1142
1142
print_flowgraph ( variants, tcx, code, mode, out)
1143
1143
}
0 commit comments