@@ -18,7 +18,7 @@ use super::Lift;
1818pub type PrintError = std:: fmt:: Error ;
1919
2020pub trait Print < ' tcx , P > {
21- fn print ( & self , cx : & mut P ) -> Result < ( ) , PrintError > ;
21+ fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > ;
2222}
2323
2424/// Interface for outputting user-facing "type-system entities"
@@ -148,7 +148,7 @@ pub trait Printer<'tcx>: Sized {
148148 && args. len ( ) > parent_args. len ( )
149149 {
150150 return self . path_generic_args (
151- |cx| cx . print_def_path ( def_id, parent_args) ,
151+ |p| p . print_def_path ( def_id, parent_args) ,
152152 & args[ ..parent_args. len ( ) + 1 ] [ ..1 ] ,
153153 ) ;
154154 } else {
@@ -170,7 +170,7 @@ pub trait Printer<'tcx>: Sized {
170170 if !generics. is_own_empty ( ) && args. len ( ) >= generics. count ( ) {
171171 let args = generics. own_args_no_defaults ( self . tcx ( ) , args) ;
172172 return self . path_generic_args (
173- |cx| cx . print_def_path ( def_id, parent_args) ,
173+ |p| p . print_def_path ( def_id, parent_args) ,
174174 args,
175175 ) ;
176176 }
@@ -186,16 +186,16 @@ pub trait Printer<'tcx>: Sized {
186186 }
187187
188188 self . path_append (
189- |cx : & mut Self | {
189+ |p : & mut Self | {
190190 if trait_qualify_parent {
191191 let trait_ref = ty:: TraitRef :: new (
192- cx . tcx ( ) ,
192+ p . tcx ( ) ,
193193 parent_def_id,
194194 parent_args. iter ( ) . copied ( ) ,
195195 ) ;
196- cx . path_qualified ( trait_ref. self_ty ( ) , Some ( trait_ref) )
196+ p . path_qualified ( trait_ref. self_ty ( ) , Some ( trait_ref) )
197197 } else {
198- cx . print_def_path ( parent_def_id, parent_args)
198+ p . print_def_path ( parent_def_id, parent_args)
199199 }
200200 } ,
201201 & key. disambiguated_data ,
@@ -237,7 +237,7 @@ pub trait Printer<'tcx>: Sized {
237237 // trait-type, then fallback to a format that identifies
238238 // the module more clearly.
239239 self . path_append_impl (
240- |cx| cx . print_def_path ( parent_def_id, & [ ] ) ,
240+ |p| p . print_def_path ( parent_def_id, & [ ] ) ,
241241 & key. disambiguated_data ,
242242 self_ty,
243243 impl_trait_ref,
@@ -312,26 +312,26 @@ pub fn characteristic_def_id_of_type(ty: Ty<'_>) -> Option<DefId> {
312312}
313313
314314impl < ' tcx , P : Printer < ' tcx > > Print < ' tcx , P > for ty:: Region < ' tcx > {
315- fn print ( & self , cx : & mut P ) -> Result < ( ) , PrintError > {
316- cx . print_region ( * self )
315+ fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > {
316+ p . print_region ( * self )
317317 }
318318}
319319
320320impl < ' tcx , P : Printer < ' tcx > > Print < ' tcx , P > for Ty < ' tcx > {
321- fn print ( & self , cx : & mut P ) -> Result < ( ) , PrintError > {
322- cx . print_type ( * self )
321+ fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > {
322+ p . print_type ( * self )
323323 }
324324}
325325
326326impl < ' tcx , P : Printer < ' tcx > > Print < ' tcx , P > for & ' tcx ty:: List < ty:: PolyExistentialPredicate < ' tcx > > {
327- fn print ( & self , cx : & mut P ) -> Result < ( ) , PrintError > {
328- cx . print_dyn_existential ( self )
327+ fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > {
328+ p . print_dyn_existential ( self )
329329 }
330330}
331331
332332impl < ' tcx , P : Printer < ' tcx > > Print < ' tcx , P > for ty:: Const < ' tcx > {
333- fn print ( & self , cx : & mut P ) -> Result < ( ) , PrintError > {
334- cx . print_const ( * self )
333+ fn print ( & self , p : & mut P ) -> Result < ( ) , PrintError > {
334+ p . print_const ( * self )
335335 }
336336}
337337
@@ -351,9 +351,9 @@ where
351351{
352352 fn print ( t : & T , fmt : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
353353 ty:: tls:: with ( |tcx| {
354- let mut cx = FmtPrinter :: new ( tcx, Namespace :: TypeNS ) ;
355- tcx. lift ( * t) . expect ( "could not lift for printing" ) . print ( & mut cx ) ?;
356- fmt. write_str ( & cx . into_buffer ( ) ) ?;
354+ let mut p = FmtPrinter :: new ( tcx, Namespace :: TypeNS ) ;
355+ tcx. lift ( * t) . expect ( "could not lift for printing" ) . print ( & mut p ) ?;
356+ fmt. write_str ( & p . into_buffer ( ) ) ?;
357357 Ok ( ( ) )
358358 } )
359359 }
0 commit comments