@@ -370,6 +370,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
370370 /// from at least one local module, and returns `true`. If the crate defining `def_id` is
371371 /// declared with an `extern crate`, the path is guaranteed to use the `extern crate`.
372372 fn try_print_visible_def_path ( & mut self , def_id : DefId ) -> Result < bool , PrintError > {
373+ debug ! ( "try_print_visible_def_path: def_id={:?}" , def_id) ;
373374 if with_no_visible_paths ( ) {
374375 return Ok ( false ) ;
375376 }
@@ -488,7 +489,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
488489 def_id : DefId ,
489490 callers : & mut Vec < DefId > ,
490491 ) -> Result < bool , PrintError > {
491- debug ! ( "try_print_visible_def_path: def_id={:?}" , def_id) ;
492+ // debug!("try_print_visible_def_path: def_id={:?}", def_id);
492493
493494 // If `def_id` is a direct or injected extern crate, return the
494495 // path to the crate followed by the path to the item within the crate.
@@ -551,7 +552,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
551552 let visible_parent_map = self . tcx ( ) . visible_parent_map ( ( ) ) ;
552553
553554 let mut cur_def_key = self . tcx ( ) . def_key ( def_id) ;
554- debug ! ( "try_print_visible_def_path: cur_def_key={:?}" , cur_def_key) ;
555+ // debug!("try_print_visible_def_path: cur_def_key={:?}", cur_def_key);
555556
556557 // For a constructor, we want the name of its parent rather than <unnamed>.
557558 if let DefPathData :: Ctor = cur_def_key. disambiguated_data . data {
@@ -566,20 +567,21 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
566567 }
567568
568569 let Some ( visible_parent) = visible_parent_map. get ( & def_id) . cloned ( ) else {
570+ debug ! ( "try_print_visible_def_path: no visible parent for {:?}" , def_id) ;
569571 return Ok ( false ) ;
570572 } ;
571573
572574 let actual_parent = self . tcx ( ) . opt_parent ( def_id) ;
573- debug ! (
574- "try_print_visible_def_path: visible_parent={:?} actual_parent={:?}" ,
575- visible_parent, actual_parent,
576- ) ;
575+ // debug!(
576+ // "try_print_visible_def_path: visible_parent={:?} actual_parent={:?}",
577+ // visible_parent, actual_parent,
578+ // );
577579
578580 let mut data = cur_def_key. disambiguated_data . data ;
579- debug ! (
580- "try_print_visible_def_path: data={:?} visible_parent={:?} actual_parent={:?}" ,
581- data, visible_parent, actual_parent,
582- ) ;
581+ // debug!(
582+ // "try_print_visible_def_path: data={:?} visible_parent={:?} actual_parent={:?}",
583+ // data, visible_parent, actual_parent,
584+ // );
583585
584586 match data {
585587 // In order to output a path that could actually be imported (valid and visible),
@@ -616,6 +618,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
616618 DefPathData :: TypeNs ( Some ( ref mut name) ) if Some ( visible_parent) != actual_parent => {
617619 // Item might be re-exported several times, but filter for the one
618620 // that's public and whose identifier isn't `_`.
621+ debug ! (
622+ "try_print_visible_def_path: def_id={:?}, visible_parent={:?}, actual_parent={:?}" ,
623+ def_id, visible_parent, actual_parent
624+ ) ;
619625 let reexport = self
620626 . tcx ( )
621627 // FIXME(typed_def_id): Further propagate ModDefId
@@ -624,6 +630,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
624630 . filter ( |child| child. res . opt_def_id ( ) == Some ( def_id) )
625631 . find ( |child| child. vis . is_public ( ) && child. ident . name != kw:: Underscore )
626632 . map ( |child| child. ident . name ) ;
633+ debug ! ( "try_print_visible_def_path: reexport={:?}" , reexport) ;
627634
628635 if let Some ( new_name) = reexport {
629636 * name = new_name;
@@ -638,7 +645,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
638645 }
639646 _ => { }
640647 }
641- debug ! ( "try_print_visible_def_path: data={:?}" , data) ;
648+ // debug!("try_print_visible_def_path: data={:?}", data);
642649
643650 if callers. contains ( & visible_parent) {
644651 return Ok ( false ) ;
@@ -2185,7 +2192,7 @@ impl<'t> TyCtxt<'t> {
21852192 ) -> String {
21862193 let def_id = def_id. into_query_param ( ) ;
21872194 let ns = guess_def_namespace ( self , def_id) ;
2188- debug ! ( "def_path_str: def_id={:?}, ns={:?}" , def_id, ns) ;
2195+ // debug!("def_path_str: def_id={:?}, ns={:?}", def_id, ns);
21892196
21902197 FmtPrinter :: print_string ( self , ns, |cx| cx. print_def_path ( def_id, args) ) . unwrap ( )
21912198 }
0 commit comments