@@ -7,6 +7,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_NoContext, TyDecodable, TyEn
77use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
88
99use crate :: inherent:: * ;
10+ use crate :: ir_print:: IrPrint ;
1011use crate :: lift:: Lift ;
1112use crate :: upcast:: { Upcast , UpcastFrom } ;
1213use crate :: visit:: TypeVisitableExt as _;
@@ -503,7 +504,7 @@ impl AliasTermKind {
503504/// * For a projection, this would be `<Ty as Trait<...>>::N<...>`.
504505/// * For an inherent projection, this would be `Ty::N<...>`.
505506/// * 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 ) ]
507508#[ derive_where( Copy ; I : Interner , I :: GenericArgs : Copy ) ]
508509#[ derive( TypeVisitable_Generic , TypeFoldable_Generic , Lift_Generic ) ]
509510#[ cfg_attr( feature = "nightly" , derive( TyDecodable , TyEncodable , HashStable_NoContext ) ) ]
@@ -533,10 +534,16 @@ pub struct AliasTerm<I: Interner> {
533534 pub def_id : I :: DefId ,
534535
535536 /// This field exists to prevent the creation of `AliasTerm` without using [`AliasTerm::new_from_args`].
536- #[ derive_where( skip( Debug ) ) ]
537537 _use_alias_term_new_instead : ( ) ,
538538}
539539
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+
540547impl < I : Interner > AliasTerm < I > {
541548 pub fn new_from_args < Ir : RustIr < Interner = I > > (
542549 ir : Ir ,
@@ -744,7 +751,7 @@ impl<I: Interner> ty::Binder<I, ProjectionPredicate<I>> {
744751
745752impl < I : Interner > fmt:: Debug for ProjectionPredicate < I > {
746753 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 )
748755 }
749756}
750757
0 commit comments