@@ -7,6 +7,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_NoContext, TyDecodable, TyEn
7
7
use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
8
8
9
9
use crate :: inherent:: * ;
10
+ use crate :: ir_print:: IrPrint ;
10
11
use crate :: lift:: Lift ;
11
12
use crate :: upcast:: { Upcast , UpcastFrom } ;
12
13
use crate :: visit:: TypeVisitableExt as _;
@@ -503,7 +504,7 @@ impl AliasTermKind {
503
504
/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
504
505
/// * For an inherent projection, this would be `Ty::N<...>`.
505
506
/// * For an opaque type, there is no explicit syntax.
506
- #[ derive_where( Clone , Hash , PartialEq , Eq , Debug ; I : Interner ) ]
507
+ #[ derive_where( Clone , Hash , PartialEq , Eq ; I : Interner ) ]
507
508
#[ derive_where( Copy ; I : Interner , I :: GenericArgs : Copy ) ]
508
509
#[ derive( TypeVisitable_Generic , TypeFoldable_Generic , Lift_Generic ) ]
509
510
#[ cfg_attr( feature = "nightly" , derive( TyDecodable , TyEncodable , HashStable_NoContext ) ) ]
@@ -533,10 +534,16 @@ pub struct AliasTerm<I: Interner> {
533
534
pub def_id : I :: DefId ,
534
535
535
536
/// This field exists to prevent the creation of `AliasTerm` without using [`AliasTerm::new_from_args`].
536
- #[ derive_where( skip( Debug ) ) ]
537
537
_use_alias_term_new_instead : ( ) ,
538
538
}
539
539
540
+ impl < I : Interner > fmt:: Debug for AliasTerm < I > {
541
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
542
+ <I as IrPrint < Self > >:: print_debug ( self , f)
543
+ }
544
+ }
545
+
546
+
540
547
impl < I : Interner > AliasTerm < I > {
541
548
pub fn new_from_args < Ir : RustIr < Interner = I > > (
542
549
ir : Ir ,
@@ -744,7 +751,7 @@ impl<I: Interner> ty::Binder<I, ProjectionPredicate<I>> {
744
751
745
752
impl < I : Interner > fmt:: Debug for ProjectionPredicate < I > {
746
753
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
747
- write ! ( f , "ProjectionPredicate({:?}, {:?})" , self . projection_term , self . term )
754
+ < I as IrPrint < Self > > :: print_debug ( self , f )
748
755
}
749
756
}
750
757
0 commit comments