@@ -1225,6 +1225,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
1225
1225
body_owners,
1226
1226
opaques,
1227
1227
nested_bodies,
1228
+ eiis,
1228
1229
..
1229
1230
} = collector;
1230
1231
ModuleItems {
@@ -1238,6 +1239,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
1238
1239
opaques : opaques. into_boxed_slice ( ) ,
1239
1240
nested_bodies : nested_bodies. into_boxed_slice ( ) ,
1240
1241
delayed_lint_items : Box :: new ( [ ] ) ,
1242
+ eiis : eiis. into_boxed_slice ( ) ,
1241
1243
}
1242
1244
}
1243
1245
@@ -1260,6 +1262,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
1260
1262
opaques,
1261
1263
nested_bodies,
1262
1264
mut delayed_lint_items,
1265
+ eiis,
1263
1266
..
1264
1267
} = collector;
1265
1268
@@ -1282,6 +1285,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
1282
1285
opaques : opaques. into_boxed_slice ( ) ,
1283
1286
nested_bodies : nested_bodies. into_boxed_slice ( ) ,
1284
1287
delayed_lint_items : delayed_lint_items. into_boxed_slice ( ) ,
1288
+ eiis : eiis. into_boxed_slice ( ) ,
1285
1289
}
1286
1290
}
1287
1291
@@ -1299,6 +1303,7 @@ struct ItemCollector<'tcx> {
1299
1303
opaques : Vec < LocalDefId > ,
1300
1304
nested_bodies : Vec < LocalDefId > ,
1301
1305
delayed_lint_items : Vec < OwnerId > ,
1306
+ eiis : Vec < LocalDefId > ,
1302
1307
}
1303
1308
1304
1309
impl < ' tcx > ItemCollector < ' tcx > {
@@ -1315,6 +1320,7 @@ impl<'tcx> ItemCollector<'tcx> {
1315
1320
opaques : Vec :: default ( ) ,
1316
1321
nested_bodies : Vec :: default ( ) ,
1317
1322
delayed_lint_items : Vec :: default ( ) ,
1323
+ eiis : Vec :: default ( ) ,
1318
1324
}
1319
1325
}
1320
1326
}
@@ -1336,6 +1342,12 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
1336
1342
self . delayed_lint_items . push ( item. item_id ( ) . owner_id ) ;
1337
1343
}
1338
1344
1345
+ if let ItemKind :: Static ( ..) | ItemKind :: Fn { .. } | ItemKind :: Macro ( ..) = & item. kind
1346
+ && item. eii
1347
+ {
1348
+ self . eiis . push ( item. owner_id . def_id )
1349
+ }
1350
+
1339
1351
// Items that are modules are handled here instead of in visit_mod.
1340
1352
if let ItemKind :: Mod ( _, module) = & item. kind {
1341
1353
self . submodules . push ( item. owner_id ) ;
0 commit comments