@@ -322,7 +322,7 @@ enum ParenthesizedGenericArgs {
322322/// `resolve_lifetime` module. Often we "fallthrough" to that code by generating
323323/// an "elided" or "underscore" lifetime name. In the future, we probably want to move
324324/// everything into HIR lowering.
325- #[ derive( Copy , Clone ) ]
325+ #[ derive( Copy , Clone , Debug ) ]
326326enum AnonymousLifetimeMode {
327327 /// For **Modern** cases, create a new anonymous region parameter
328328 /// and reference that.
@@ -715,10 +715,16 @@ impl<'a> LoweringContext<'a> {
715715 anonymous_lifetime_mode : AnonymousLifetimeMode ,
716716 op : impl FnOnce ( & mut Self ) -> R ,
717717 ) -> R {
718+ debug ! (
719+ "with_anonymous_lifetime_mode(anonymous_lifetime_mode={:?})" ,
720+ anonymous_lifetime_mode,
721+ ) ;
718722 let old_anonymous_lifetime_mode = self . anonymous_lifetime_mode ;
719723 self . anonymous_lifetime_mode = anonymous_lifetime_mode;
720724 let result = op ( self ) ;
721725 self . anonymous_lifetime_mode = old_anonymous_lifetime_mode;
726+ debug ! ( "with_anonymous_lifetime_mode: restoring anonymous_lifetime_mode={:?}" ,
727+ old_anonymous_lifetime_mode) ;
722728 result
723729 }
724730
@@ -1355,6 +1361,13 @@ impl<'a> LoweringContext<'a> {
13551361 opaque_ty_node_id : NodeId ,
13561362 lower_bounds : impl FnOnce ( & mut LoweringContext < ' _ > ) -> hir:: GenericBounds ,
13571363 ) -> hir:: TyKind {
1364+ debug ! (
1365+ "lower_opaque_impl_trait(fn_def_id={:?}, opaque_ty_node_id={:?}, span={:?})" ,
1366+ fn_def_id,
1367+ opaque_ty_node_id,
1368+ span,
1369+ ) ;
1370+
13581371 // Make sure we know that some funky desugaring has been going on here.
13591372 // This is a first: there is code in other places like for loop
13601373 // desugaring that explicitly states that we don't want to track that.
@@ -1382,6 +1395,14 @@ impl<'a> LoweringContext<'a> {
13821395 & hir_bounds,
13831396 ) ;
13841397
1398+ debug ! (
1399+ "lower_opaque_impl_trait: lifetimes={:#?}" , lifetimes,
1400+ ) ;
1401+
1402+ debug ! (
1403+ "lower_opaque_impl_trait: lifetime_defs={:#?}" , lifetime_defs,
1404+ ) ;
1405+
13851406 self . with_hir_id_owner ( opaque_ty_node_id, |lctx| {
13861407 let opaque_ty_item = hir:: OpaqueTy {
13871408 generics : hir:: Generics {
@@ -1397,7 +1418,7 @@ impl<'a> LoweringContext<'a> {
13971418 origin : hir:: OpaqueTyOrigin :: FnReturn ,
13981419 } ;
13991420
1400- trace ! ( "exist ty from impl trait def-index : {:#?}" , opaque_ty_def_index) ;
1421+ trace ! ( "lower_opaque_impl_trait : {:#?}" , opaque_ty_def_index) ;
14011422 let opaque_ty_id = lctx. generate_opaque_type (
14021423 opaque_ty_node_id,
14031424 opaque_ty_item,
@@ -1445,6 +1466,13 @@ impl<'a> LoweringContext<'a> {
14451466 parent_index : DefIndex ,
14461467 bounds : & hir:: GenericBounds ,
14471468 ) -> ( HirVec < hir:: GenericArg > , HirVec < hir:: GenericParam > ) {
1469+ debug ! (
1470+ "lifetimes_from_impl_trait_bounds(opaque_ty_id={:?}, \
1471+ parent_index={:?}, \
1472+ bounds={:#?})",
1473+ opaque_ty_id, parent_index, bounds,
1474+ ) ;
1475+
14481476 // This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
14491477 // appear in the bounds, excluding lifetimes that are created within the bounds.
14501478 // E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
@@ -2182,6 +2210,14 @@ impl<'a> LoweringContext<'a> {
21822210 fn_def_id : DefId ,
21832211 opaque_ty_node_id : NodeId ,
21842212 ) -> hir:: FunctionRetTy {
2213+ debug ! (
2214+ "lower_async_fn_ret_ty(\
2215+ output={:?}, \
2216+ fn_def_id={:?}, \
2217+ opaque_ty_node_id={:?})",
2218+ output, fn_def_id, opaque_ty_node_id,
2219+ ) ;
2220+
21852221 let span = output. span ( ) ;
21862222
21872223 let opaque_ty_span = self . mark_span_with_reason (
@@ -2264,6 +2300,8 @@ impl<'a> LoweringContext<'a> {
22642300 ) ,
22652301 ) ;
22662302
2303+ debug ! ( "lower_async_fn_ret_ty: future_bound={:#?}" , future_bound) ;
2304+
22672305 // Calculate all the lifetimes that should be captured
22682306 // by the opaque type. This should include all in-scope
22692307 // lifetime parameters, including those defined in-band.
0 commit comments