@@ -322,7 +322,7 @@ enum ParenthesizedGenericArgs {
322
322
/// `resolve_lifetime` module. Often we "fallthrough" to that code by generating
323
323
/// an "elided" or "underscore" lifetime name. In the future, we probably want to move
324
324
/// everything into HIR lowering.
325
- #[ derive( Copy , Clone ) ]
325
+ #[ derive( Copy , Clone , Debug ) ]
326
326
enum AnonymousLifetimeMode {
327
327
/// For **Modern** cases, create a new anonymous region parameter
328
328
/// and reference that.
@@ -715,10 +715,16 @@ impl<'a> LoweringContext<'a> {
715
715
anonymous_lifetime_mode : AnonymousLifetimeMode ,
716
716
op : impl FnOnce ( & mut Self ) -> R ,
717
717
) -> R {
718
+ debug ! (
719
+ "with_anonymous_lifetime_mode(anonymous_lifetime_mode={:?})" ,
720
+ anonymous_lifetime_mode,
721
+ ) ;
718
722
let old_anonymous_lifetime_mode = self . anonymous_lifetime_mode ;
719
723
self . anonymous_lifetime_mode = anonymous_lifetime_mode;
720
724
let result = op ( self ) ;
721
725
self . anonymous_lifetime_mode = old_anonymous_lifetime_mode;
726
+ debug ! ( "with_anonymous_lifetime_mode: restoring anonymous_lifetime_mode={:?}" ,
727
+ old_anonymous_lifetime_mode) ;
722
728
result
723
729
}
724
730
@@ -1355,6 +1361,13 @@ impl<'a> LoweringContext<'a> {
1355
1361
opaque_ty_node_id : NodeId ,
1356
1362
lower_bounds : impl FnOnce ( & mut LoweringContext < ' _ > ) -> hir:: GenericBounds ,
1357
1363
) -> 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
+
1358
1371
// Make sure we know that some funky desugaring has been going on here.
1359
1372
// This is a first: there is code in other places like for loop
1360
1373
// desugaring that explicitly states that we don't want to track that.
@@ -1382,6 +1395,14 @@ impl<'a> LoweringContext<'a> {
1382
1395
& hir_bounds,
1383
1396
) ;
1384
1397
1398
+ debug ! (
1399
+ "lower_opaque_impl_trait: lifetimes={:#?}" , lifetimes,
1400
+ ) ;
1401
+
1402
+ debug ! (
1403
+ "lower_opaque_impl_trait: lifetime_defs={:#?}" , lifetime_defs,
1404
+ ) ;
1405
+
1385
1406
self . with_hir_id_owner ( opaque_ty_node_id, |lctx| {
1386
1407
let opaque_ty_item = hir:: OpaqueTy {
1387
1408
generics : hir:: Generics {
@@ -1397,7 +1418,7 @@ impl<'a> LoweringContext<'a> {
1397
1418
origin : hir:: OpaqueTyOrigin :: FnReturn ,
1398
1419
} ;
1399
1420
1400
- trace ! ( "exist ty from impl trait def-index : {:#?}" , opaque_ty_def_index) ;
1421
+ trace ! ( "lower_opaque_impl_trait : {:#?}" , opaque_ty_def_index) ;
1401
1422
let opaque_ty_id = lctx. generate_opaque_type (
1402
1423
opaque_ty_node_id,
1403
1424
opaque_ty_item,
@@ -1445,6 +1466,13 @@ impl<'a> LoweringContext<'a> {
1445
1466
parent_index : DefIndex ,
1446
1467
bounds : & hir:: GenericBounds ,
1447
1468
) -> ( 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
+
1448
1476
// This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
1449
1477
// appear in the bounds, excluding lifetimes that are created within the bounds.
1450
1478
// E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
@@ -2182,6 +2210,14 @@ impl<'a> LoweringContext<'a> {
2182
2210
fn_def_id : DefId ,
2183
2211
opaque_ty_node_id : NodeId ,
2184
2212
) -> 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
+
2185
2221
let span = output. span ( ) ;
2186
2222
2187
2223
let opaque_ty_span = self . mark_span_with_reason (
@@ -2264,6 +2300,8 @@ impl<'a> LoweringContext<'a> {
2264
2300
) ,
2265
2301
) ;
2266
2302
2303
+ debug ! ( "lower_async_fn_ret_ty: future_bound={:#?}" , future_bound) ;
2304
+
2267
2305
// Calculate all the lifetimes that should be captured
2268
2306
// by the opaque type. This should include all in-scope
2269
2307
// lifetime parameters, including those defined in-band.
0 commit comments