@@ -660,7 +660,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
660660 true => { }
661661 }
662662 callers. pop ( ) ;
663- self . path_append ( |_| Ok ( ( ) ) , & DisambiguatedDefPathData { data, disambiguator : 0 } ) ?;
663+ self . path_append ( def_id , |_| Ok ( ( ) ) , & DisambiguatedDefPathData { data, disambiguator : 0 } ) ?;
664664 Ok ( true )
665665 }
666666
@@ -1352,6 +1352,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
13521352 self . path_generic_args (
13531353 |cx| {
13541354 cx. path_append (
1355+ alias_ty. def_id ,
13551356 |cx| cx. path_qualified ( alias_ty. self_ty ( ) , None ) ,
13561357 & def_key. disambiguated_data ,
13571358 )
@@ -2408,6 +2409,7 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
24082409
24092410 fn path_append (
24102411 & mut self ,
2412+ def_id : DefId ,
24112413 print_prefix : impl FnOnce ( & mut Self ) -> Result < ( ) , PrintError > ,
24122414 disambiguated_data : & DisambiguatedDefPathData ,
24132415 ) -> Result < ( ) , PrintError > {
@@ -2417,6 +2419,15 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
24172419 if let DefPathData :: ForeignMod | DefPathData :: Ctor = disambiguated_data. data {
24182420 return Ok ( ( ) ) ;
24192421 }
2422+ if let DefPathData :: Closure = disambiguated_data. data
2423+ && let Some ( hir:: CoroutineKind :: Desugared (
2424+ hir:: CoroutineDesugaring :: Async ,
2425+ hir:: CoroutineSource :: Fn ,
2426+ ) ) = self . tcx . coroutine_kind ( def_id)
2427+ {
2428+ // Skip the implicit closure in `async_function::{closure#0}`.
2429+ return Ok ( ( ) ) ;
2430+ }
24202431
24212432 let name = disambiguated_data. data . name ( ) ;
24222433 if !self . empty_path {
0 commit comments