This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-21
lines changed
rustc_middle/src/ty/print Expand file tree Collapse file tree 3 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -350,4 +350,8 @@ where
350350 Ok ( ( ) )
351351 } )
352352 }
353+
354+ fn print_debug ( t : & T , fmt : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
355+ with_no_trimmed_paths ! ( Self :: print( t, fmt) )
356+ }
353357}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use crate::{Interner, TraitRef};
44
55pub trait IrPrint < T > {
66 fn print ( t : & T , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result ;
7+ fn print_debug ( t : & T , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result ;
78}
89
910macro_rules! define_display_via_print {
@@ -14,6 +15,12 @@ macro_rules! define_display_via_print {
1415 <I as IrPrint <$ty<I >>>:: print( self , fmt)
1516 }
1617 }
18+
19+ impl <I : Interner > fmt:: Debug for $ty<I > {
20+ fn fmt( & self , fmt: & mut fmt:: Formatter <' _>) -> fmt:: Result {
21+ <I as IrPrint <$ty<I >>>:: print_debug( self , fmt)
22+ }
23+ }
1724 ) *
1825 }
1926}
Original file line number Diff line number Diff line change 1- use std:: fmt;
2-
31use rustc_macros:: { HashStable_NoContext , TyDecodable , TyEncodable } ;
42
53use crate :: fold:: { FallibleTypeFolder , TypeFoldable } ;
@@ -71,25 +69,6 @@ impl<I: Interner> TraitRef<I> {
7169 }
7270}
7371
74- impl < I : Interner > fmt:: Debug for TraitRef < I > {
75- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
76- let TraitRef { def_id, args, _use_trait_ref_new_instead : ( ) } = self ;
77- let mut args = args. into_iter ( ) . peekable ( ) ;
78- write ! ( f, "{def_id:?}" ) ?;
79- if args. peek ( ) . is_some ( ) {
80- write ! ( f, "<" ) ?;
81- for ( i, arg) in args. enumerate ( ) {
82- if i > 0 {
83- write ! ( f, ", " ) ?;
84- }
85- write ! ( f, "{arg:#?}" ) ?;
86- }
87- write ! ( f, ">" ) ?;
88- }
89- Ok ( ( ) )
90- }
91- }
92-
9372// FIXME(compiler-errors): Make this into a `Lift_Generic` impl.
9473impl < I : Interner , U : Interner > Lift < U > for TraitRef < I >
9574where
You can’t perform that action at this time.
0 commit comments