@@ -1246,6 +1246,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
1246
1246
foreign_items,
1247
1247
body_owners,
1248
1248
opaques,
1249
+ nested_bodies,
1249
1250
..
1250
1251
} = collector;
1251
1252
ModuleItems {
@@ -1256,6 +1257,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
1256
1257
foreign_items : foreign_items. into_boxed_slice ( ) ,
1257
1258
body_owners : body_owners. into_boxed_slice ( ) ,
1258
1259
opaques : opaques. into_boxed_slice ( ) ,
1260
+ nested_bodies : nested_bodies. into_boxed_slice ( ) ,
1259
1261
}
1260
1262
}
1261
1263
@@ -1276,6 +1278,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
1276
1278
foreign_items,
1277
1279
body_owners,
1278
1280
opaques,
1281
+ nested_bodies,
1279
1282
..
1280
1283
} = collector;
1281
1284
@@ -1287,6 +1290,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
1287
1290
foreign_items : foreign_items. into_boxed_slice ( ) ,
1288
1291
body_owners : body_owners. into_boxed_slice ( ) ,
1289
1292
opaques : opaques. into_boxed_slice ( ) ,
1293
+ nested_bodies : nested_bodies. into_boxed_slice ( ) ,
1290
1294
}
1291
1295
}
1292
1296
@@ -1302,6 +1306,7 @@ struct ItemCollector<'tcx> {
1302
1306
foreign_items : Vec < ForeignItemId > ,
1303
1307
body_owners : Vec < LocalDefId > ,
1304
1308
opaques : Vec < LocalDefId > ,
1309
+ nested_bodies : Vec < LocalDefId > ,
1305
1310
}
1306
1311
1307
1312
impl < ' tcx > ItemCollector < ' tcx > {
@@ -1316,6 +1321,7 @@ impl<'tcx> ItemCollector<'tcx> {
1316
1321
foreign_items : Vec :: default ( ) ,
1317
1322
body_owners : Vec :: default ( ) ,
1318
1323
opaques : Vec :: default ( ) ,
1324
+ nested_bodies : Vec :: default ( ) ,
1319
1325
}
1320
1326
}
1321
1327
}
@@ -1358,6 +1364,7 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
1358
1364
1359
1365
fn visit_inline_const ( & mut self , c : & ' hir ConstBlock ) {
1360
1366
self . body_owners . push ( c. def_id ) ;
1367
+ self . nested_bodies . push ( c. def_id ) ;
1361
1368
intravisit:: walk_inline_const ( self , c)
1362
1369
}
1363
1370
@@ -1369,6 +1376,7 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
1369
1376
fn visit_expr ( & mut self , ex : & ' hir Expr < ' hir > ) {
1370
1377
if let ExprKind :: Closure ( closure) = ex. kind {
1371
1378
self . body_owners . push ( closure. def_id ) ;
1379
+ self . nested_bodies . push ( closure. def_id ) ;
1372
1380
}
1373
1381
intravisit:: walk_expr ( self , ex)
1374
1382
}
0 commit comments