@@ -715,13 +715,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
715
715
p ! ( print_def_path( def_id, & [ ] ) ) ;
716
716
}
717
717
ty:: Alias ( ty:: Projection | ty:: Inherent | ty:: Weak , ref data) => {
718
- if !( self . should_print_verbose ( ) || with_no_queries ( ) )
719
- && self . tcx ( ) . is_impl_trait_in_trait ( data. def_id )
720
- {
721
- return self . pretty_print_opaque_impl_type ( data. def_id , data. args ) ;
722
- } else {
723
- p ! ( print( data) )
724
- }
718
+ p ! ( print( data) )
725
719
}
726
720
ty:: Placeholder ( placeholder) => match placeholder. bound . kind {
727
721
ty:: BoundTyKind :: Anon => p ! ( write( "{placeholder:?}" ) ) ,
@@ -3053,7 +3047,17 @@ define_print_and_forward_display! {
3053
3047
if let DefKind :: Impl { of_trait: false } = cx. tcx( ) . def_kind( cx. tcx( ) . parent( self . def_id) ) {
3054
3048
p!( pretty_print_inherent_projection( self ) )
3055
3049
} else {
3056
- p!( print_def_path( self . def_id, self . args) ) ;
3050
+ // If we're printing verbosely, or don't want to invoke queries
3051
+ // (`is_impl_trait_in_trait`), then fall back to printing the def path.
3052
+ // This is likely what you want if you're debugging the compiler anyways.
3053
+ if !( cx. should_print_verbose( ) || with_no_queries( ) )
3054
+ && cx. tcx( ) . is_impl_trait_in_trait( self . def_id)
3055
+ {
3056
+ return cx. pretty_print_opaque_impl_type( self . def_id, self . args) ;
3057
+ } else {
3058
+ p!( print_def_path( self . def_id, self . args) ) ;
3059
+ }
3060
+
3057
3061
}
3058
3062
}
3059
3063
0 commit comments