File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
compiler/rustc_middle/src/ty/print Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,6 @@ pub trait Printer<'tcx>: Sized {
126
126
trait_ref : Option < ty:: TraitRef < ' tcx > > ,
127
127
) -> Result < ( ) , PrintError > ;
128
128
129
- fn should_truncate ( & mut self ) -> bool {
130
- false
131
- }
132
-
133
129
// Defaults (should not be overridden):
134
130
135
131
#[ instrument( skip( self ) , level = "debug" ) ]
Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
333
333
f : impl FnOnce ( & mut Self ) -> Result < ( ) , PrintError > ,
334
334
) -> Result < ( ) , PrintError > ;
335
335
336
+ fn should_truncate ( & mut self ) -> bool {
337
+ false
338
+ }
339
+
336
340
/// Returns `true` if the region should be printed in
337
341
/// optional positions, e.g., `&'a T` or `dyn Tr + 'b`.
338
342
/// This is typically the case for all non-`'_` regions.
@@ -2295,10 +2299,6 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
2295
2299
}
2296
2300
}
2297
2301
2298
- fn should_truncate ( & mut self ) -> bool {
2299
- !self . type_length_limit . value_within_limit ( self . printed_type_count )
2300
- }
2301
-
2302
2302
fn print_dyn_existential (
2303
2303
& mut self ,
2304
2304
predicates : & ' tcx ty:: List < ty:: PolyExistentialPredicate < ' tcx > > ,
@@ -2487,6 +2487,10 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
2487
2487
Ok ( ( ) )
2488
2488
}
2489
2489
2490
+ fn should_truncate ( & mut self ) -> bool {
2491
+ !self . type_length_limit . value_within_limit ( self . printed_type_count )
2492
+ }
2493
+
2490
2494
fn should_print_region ( & self , region : ty:: Region < ' tcx > ) -> bool {
2491
2495
let highlight = self . region_highlight_mode ;
2492
2496
if highlight. region_highlighted ( region) . is_some ( ) {
You can’t perform that action at this time.
0 commit comments