@@ -265,7 +265,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
265265
266266 fn pretty_print_in_binder < T > ( & mut self , value : & ty:: Binder < ' tcx , T > ) -> Result < ( ) , PrintError >
267267 where
268- T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
268+ T : Print < Self > + TypeFoldable < TyCtxt < ' tcx > > ,
269269 {
270270 value. as_ref ( ) . skip_binder ( ) . print ( self )
271271 }
@@ -285,7 +285,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
285285 /// Prints comma-separated elements.
286286 fn comma_sep < T > ( & mut self , mut elems : impl Iterator < Item = T > ) -> Result < ( ) , PrintError >
287287 where
288- T : Print < ' tcx , Self > ,
288+ T : Print < Self > ,
289289 {
290290 if let Some ( first) = elems. next ( ) {
291291 first. print ( self ) ?;
@@ -2484,7 +2484,7 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
24842484
24852485 fn pretty_print_in_binder < T > ( & mut self , value : & ty:: Binder < ' tcx , T > ) -> Result < ( ) , PrintError >
24862486 where
2487- T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
2487+ T : Print < Self > + TypeFoldable < TyCtxt < ' tcx > > ,
24882488 {
24892489 self . wrap_binder ( value, WrapBinderMode :: ForAll , |new_value, this| new_value. print ( this) )
24902490 }
@@ -2940,18 +2940,18 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
29402940 }
29412941}
29422942
2943- impl < ' tcx , T , P : PrettyPrinter < ' tcx > > Print < ' tcx , P > for ty:: Binder < ' tcx , T >
2943+ impl < ' tcx , T , P : PrettyPrinter < ' tcx > > Print < P > for ty:: Binder < ' tcx , T >
29442944where
2945- T : Print < ' tcx , P > + TypeFoldable < TyCtxt < ' tcx > > ,
2945+ T : Print < P > + TypeFoldable < TyCtxt < ' tcx > > ,
29462946{
29472947 fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > {
29482948 p. pretty_print_in_binder ( self )
29492949 }
29502950}
29512951
2952- impl < ' tcx , T , P : PrettyPrinter < ' tcx > > Print < ' tcx , P > for ty:: OutlivesPredicate < ' tcx , T >
2952+ impl < ' tcx , T , P : PrettyPrinter < ' tcx > > Print < P > for ty:: OutlivesPredicate < ' tcx , T >
29532953where
2954- T : Print < ' tcx , P > ,
2954+ T : Print < P > ,
29552955{
29562956 fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > {
29572957 self . 0 . print ( p) ?;
@@ -2970,7 +2970,7 @@ pub struct TraitRefPrintOnlyTraitPath<'tcx>(ty::TraitRef<'tcx>);
29702970impl < ' tcx > rustc_errors:: IntoDiagArg for TraitRefPrintOnlyTraitPath < ' tcx > {
29712971 fn into_diag_arg ( self , path : & mut Option < std:: path:: PathBuf > ) -> rustc_errors:: DiagArgValue {
29722972 ty:: tls:: with ( |tcx| {
2973- let trait_ref = tcx. short_string ( self , path) ;
2973+ let trait_ref = tcx. short_string ( tcx . lift ( self ) , path) ;
29742974 rustc_errors:: DiagArgValue :: Str ( std:: borrow:: Cow :: Owned ( trait_ref) )
29752975 } )
29762976 }
@@ -2990,7 +2990,7 @@ pub struct TraitRefPrintSugared<'tcx>(ty::TraitRef<'tcx>);
29902990impl < ' tcx > rustc_errors:: IntoDiagArg for TraitRefPrintSugared < ' tcx > {
29912991 fn into_diag_arg ( self , path : & mut Option < std:: path:: PathBuf > ) -> rustc_errors:: DiagArgValue {
29922992 ty:: tls:: with ( |tcx| {
2993- let trait_ref = tcx. short_string ( self , path) ;
2993+ let trait_ref = tcx. short_string ( tcx . lift ( self ) , path) ;
29942994 rustc_errors:: DiagArgValue :: Str ( std:: borrow:: Cow :: Owned ( trait_ref) )
29952995 } )
29962996 }
@@ -3108,7 +3108,7 @@ macro_rules! forward_display_to_print {
31083108
31093109macro_rules! define_print {
31103110 ( ( $self: ident, $p: ident) : $( $ty: ty $print: block) +) => {
3111- $( impl <' tcx, P : PrettyPrinter <' tcx>> Print <' tcx , P > for $ty {
3111+ $( impl <' tcx, P : PrettyPrinter <' tcx>> Print <P > for $ty {
31123112 fn print( & $self, $p: & mut P ) -> Result <( ) , PrintError > {
31133113 let _: ( ) = $print;
31143114 Ok ( ( ) )
0 commit comments