@@ -94,6 +94,10 @@ macro_rules! define_helper {
9494 $tl. with( |c| c. set( self . 0 ) )
9595 }
9696 }
97+
98+ pub fn $name( ) -> bool {
99+ $tl. with( |c| c. get( ) )
100+ }
97101 ) +
98102 }
99103}
@@ -676,7 +680,7 @@ pub trait PrettyPrinter<'tcx>:
676680 p ! ( ")" )
677681 }
678682 ty:: FnDef ( def_id, substs) => {
679- if NO_QUERIES . with ( |q| q . get ( ) ) {
683+ if with_no_queries ( ) {
680684 p ! ( print_def_path( def_id, substs) ) ;
681685 } else {
682686 let sig = self . tcx ( ) . fn_sig ( def_id) . subst ( self . tcx ( ) , substs) ;
@@ -732,7 +736,7 @@ pub trait PrettyPrinter<'tcx>:
732736 p ! ( print_def_path( def_id, & [ ] ) ) ;
733737 }
734738 ty:: Alias ( ty:: Projection | ty:: Inherent | ty:: Weak , ref data) => {
735- if !( self . should_print_verbose ( ) || NO_QUERIES . with ( |q| q . get ( ) ) )
739+ if !( self . should_print_verbose ( ) || with_no_queries ( ) )
736740 && self . tcx ( ) . is_impl_trait_in_trait ( data. def_id )
737741 {
738742 return self . pretty_print_opaque_impl_type ( data. def_id , data. substs ) ;
@@ -779,7 +783,7 @@ pub trait PrettyPrinter<'tcx>:
779783 return Ok ( self ) ;
780784 }
781785 _ => {
782- if NO_QUERIES . with ( |q| q . get ( ) ) {
786+ if with_no_queries ( ) {
783787 p ! ( print_def_path( def_id, & [ ] ) ) ;
784788 return Ok ( self ) ;
785789 } else {
@@ -1746,7 +1750,8 @@ impl DerefMut for FmtPrinter<'_, '_> {
17461750
17471751impl < ' a , ' tcx > FmtPrinter < ' a , ' tcx > {
17481752 pub fn new ( tcx : TyCtxt < ' tcx > , ns : Namespace ) -> Self {
1749- Self :: new_with_limit ( tcx, ns, tcx. type_length_limit ( ) )
1753+ let limit = if with_no_queries ( ) { Limit :: new ( 1048576 ) } else { tcx. type_length_limit ( ) } ;
1754+ Self :: new_with_limit ( tcx, ns, limit)
17501755 }
17511756
17521757 pub fn new_with_limit ( tcx : TyCtxt < ' tcx > , ns : Namespace , type_length_limit : Limit ) -> Self {
0 commit comments