@@ -474,7 +474,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
474474 // path to the crate followed by the path to the item within the crate.
475475 if let Some ( cnum) = def_id. as_crate_root ( ) {
476476 if cnum == LOCAL_CRATE {
477- self . path_crate ( cnum) ?;
477+ self . print_crate_name ( cnum) ?;
478478 return Ok ( true ) ;
479479 }
480480
@@ -498,7 +498,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
498498 // or avoid ending up with `ExternCrateSource::Extern`,
499499 // for the injected `std`/`core`.
500500 if span. is_dummy ( ) {
501- self . path_crate ( cnum) ?;
501+ self . print_crate_name ( cnum) ?;
502502 return Ok ( true ) ;
503503 }
504504
@@ -512,13 +512,13 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
512512 return Ok ( true ) ;
513513 }
514514 ( ExternCrateSource :: Path , LOCAL_CRATE ) => {
515- self . path_crate ( cnum) ?;
515+ self . print_crate_name ( cnum) ?;
516516 return Ok ( true ) ;
517517 }
518518 _ => { }
519519 } ,
520520 None => {
521- self . path_crate ( cnum) ?;
521+ self . print_crate_name ( cnum) ?;
522522 return Ok ( true ) ;
523523 }
524524 }
@@ -628,7 +628,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
628628 return Ok ( false ) ;
629629 }
630630 callers. push ( visible_parent) ;
631- // HACK(eddyb) this bypasses `path_append `'s prefix printing to avoid
631+ // HACK(eddyb) this bypasses `print_path_with_simple `'s prefix printing to avoid
632632 // knowing ahead of time whether the entire path will succeed or not.
633633 // To support printers that do not implement `PrettyPrinter`, a `Vec` or
634634 // linked list on the stack would need to be built, before any printing.
@@ -637,7 +637,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
637637 true => { }
638638 }
639639 callers. pop ( ) ;
640- self . path_append ( |_| Ok ( ( ) ) , & DisambiguatedDefPathData { data, disambiguator : 0 } ) ?;
640+ self . print_path_with_simple (
641+ |_| Ok ( ( ) ) ,
642+ & DisambiguatedDefPathData { data, disambiguator : 0 } ,
643+ ) ?;
641644 Ok ( true )
642645 }
643646
@@ -1312,10 +1315,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
13121315 alias_ty : ty:: AliasTerm < ' tcx > ,
13131316 ) -> Result < ( ) , PrintError > {
13141317 let def_key = self . tcx ( ) . def_key ( alias_ty. def_id ) ;
1315- self . path_generic_args (
1318+ self . print_path_with_generic_args (
13161319 |p| {
1317- p. path_append (
1318- |p| p. path_qualified ( alias_ty. self_ty ( ) , None ) ,
1320+ p. print_path_with_simple (
1321+ |p| p. print_path_with_qualified ( alias_ty. self_ty ( ) , None ) ,
13191322 & def_key. disambiguated_data ,
13201323 )
13211324 } ,
@@ -1400,7 +1403,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
14001403 }
14011404 }
14021405
1403- // HACK(eddyb) this duplicates `FmtPrinter`'s `path_generic_args `,
1406+ // HACK(eddyb) this duplicates `FmtPrinter`'s `print_path_with_generic_args `,
14041407 // in order to place the projections inside the `<...>`.
14051408 if !resugared {
14061409 let principal_with_self =
@@ -2234,7 +2237,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
22342237
22352238 self . print_def_path ( parent_def_id, & [ ] ) ?;
22362239
2237- // HACK(eddyb) copy of `path_append ` to avoid
2240+ // HACK(eddyb) copy of `print_path_with_simple ` to avoid
22382241 // constructing a `DisambiguatedDefPathData`.
22392242 if !self . empty_path {
22402243 write ! ( self , "::" ) ?;
@@ -2310,7 +2313,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
23102313 self . pretty_print_const ( ct, false )
23112314 }
23122315
2313- fn path_crate ( & mut self , cnum : CrateNum ) -> Result < ( ) , PrintError > {
2316+ fn print_crate_name ( & mut self , cnum : CrateNum ) -> Result < ( ) , PrintError > {
23142317 self . empty_path = true ;
23152318 if cnum == LOCAL_CRATE {
23162319 if self . tcx . sess . at_least_rust_2018 ( ) {
@@ -2327,7 +2330,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
23272330 Ok ( ( ) )
23282331 }
23292332
2330- fn path_qualified (
2333+ fn print_path_with_qualified (
23312334 & mut self ,
23322335 self_ty : Ty < ' tcx > ,
23332336 trait_ref : Option < ty:: TraitRef < ' tcx > > ,
@@ -2337,7 +2340,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
23372340 Ok ( ( ) )
23382341 }
23392342
2340- fn path_append_impl (
2343+ fn print_path_with_impl (
23412344 & mut self ,
23422345 print_prefix : impl FnOnce ( & mut Self ) -> Result < ( ) , PrintError > ,
23432346 self_ty : Ty < ' tcx > ,
@@ -2359,7 +2362,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
23592362 Ok ( ( ) )
23602363 }
23612364
2362- fn path_append (
2365+ fn print_path_with_simple (
23632366 & mut self ,
23642367 print_prefix : impl FnOnce ( & mut Self ) -> Result < ( ) , PrintError > ,
23652368 disambiguated_data : & DisambiguatedDefPathData ,
@@ -2390,7 +2393,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
23902393 Ok ( ( ) )
23912394 }
23922395
2393- fn path_generic_args (
2396+ fn print_path_with_generic_args (
23942397 & mut self ,
23952398 print_prefix : impl FnOnce ( & mut Self ) -> Result < ( ) , PrintError > ,
23962399 args : & [ GenericArg < ' tcx > ] ,
@@ -3229,7 +3232,7 @@ define_print! {
32293232 // The args don't contain the self ty (as it has been erased) but the corresp.
32303233 // generics do as the trait always has a self ty param. We need to offset.
32313234 let args = & self . args[ p. tcx( ) . generics_of( self . def_id) . parent_count - 1 ..] ;
3232- p. path_generic_args ( |p| write!( p, "{name}" ) , args) ?;
3235+ p. print_path_with_generic_args ( |p| write!( p, "{name}" ) , args) ?;
32333236 write!( p, " = " ) ?;
32343237 self . term. print( p) ?;
32353238 }
0 commit comments