@@ -254,6 +254,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
254254 /// *user* has a name for. In that case, we'll be able to map
255255 /// `fr` to a `Region<'tcx>`, and that region will be one of
256256 /// named variants.
257+ #[ tracing:: instrument( level = "trace" , skip( self ) ) ]
257258 fn give_name_from_error_region ( & self , fr : RegionVid ) -> Option < RegionName > {
258259 let error_region = self . to_error_region ( fr) ?;
259260
@@ -290,7 +291,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
290291 if free_region. bound_region . is_named ( ) {
291292 // A named region that is actually named.
292293 Some ( RegionName { name, source : RegionNameSource :: NamedFreeRegion ( span) } )
293- } else {
294+ } else if let hir :: IsAsync :: Async = tcx . asyncness ( self . mir_hir_id ( ) . owner ) {
294295 // If we spuriously thought that the region is named, we should let the
295296 // system generate a true name for error messages. Currently this can
296297 // happen if we have an elided name in an async fn for example: the
@@ -301,6 +302,8 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
301302 name,
302303 source : RegionNameSource :: AnonRegionFromAsyncFn ( span) ,
303304 } )
305+ } else {
306+ None
304307 }
305308 }
306309
@@ -362,6 +365,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
362365 /// | fn foo(x: &u32) { .. }
363366 /// ------- fully elaborated type of `x` is `&'1 u32`
364367 /// ```
368+ #[ tracing:: instrument( level = "trace" , skip( self ) ) ]
365369 fn give_name_if_anonymous_region_appears_in_arguments (
366370 & self ,
367371 fr : RegionVid ,
@@ -651,6 +655,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
651655 /// | let x = Some(&22);
652656 /// - fully elaborated type of `x` is `Option<&'1 u32>`
653657 /// ```
658+ #[ tracing:: instrument( level = "trace" , skip( self ) ) ]
654659 fn give_name_if_anonymous_region_appears_in_upvars ( & self , fr : RegionVid ) -> Option < RegionName > {
655660 let upvar_index = self . regioncx . get_upvar_index_for_region ( self . infcx . tcx , fr) ?;
656661 let ( upvar_name, upvar_span) = self . regioncx . get_upvar_name_and_span_for_region (
@@ -670,6 +675,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
670675 /// must be a closure since, in a free fn, such an argument would
671676 /// have to either also appear in an argument (if using elision)
672677 /// or be early bound (named, not in argument).
678+ #[ tracing:: instrument( level = "trace" , skip( self ) ) ]
673679 fn give_name_if_anonymous_region_appears_in_output ( & self , fr : RegionVid ) -> Option < RegionName > {
674680 let tcx = self . infcx . tcx ;
675681 let hir = tcx. hir ( ) ;
@@ -801,6 +807,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
801807 }
802808 }
803809
810+ #[ tracing:: instrument( level = "trace" , skip( self ) ) ]
804811 fn give_name_if_anonymous_region_appears_in_yield_ty (
805812 & self ,
806813 fr : RegionVid ,
0 commit comments