@@ -1287,7 +1287,6 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
12871287 body_owners : body_owners. into_boxed_slice ( ) ,
12881288 opaques : opaques. into_boxed_slice ( ) ,
12891289 nested_bodies : nested_bodies. into_boxed_slice ( ) ,
1290- delayed_lint_items : Box :: new ( [ ] ) ,
12911290 eiis : eiis. into_boxed_slice ( ) ,
12921291 }
12931292}
@@ -1310,19 +1309,10 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
13101309 body_owners,
13111310 opaques,
13121311 nested_bodies,
1313- mut delayed_lint_items,
13141312 eiis,
13151313 ..
13161314 } = collector;
13171315
1318- // The crate could have delayed lints too, but would not be picked up by the visitor.
1319- // The `delayed_lint_items` list is smart - it only contains items which we know from
1320- // earlier passes is guaranteed to contain lints. It's a little harder to determine that
1321- // for sure here, so we simply always add the crate to the list. If it has no lints,
1322- // we'll discover that later. The cost of this should be low, there's only one crate
1323- // after all compared to the many items we have we wouldn't want to iterate over later.
1324- delayed_lint_items. push ( CRATE_OWNER_ID ) ;
1325-
13261316 ModuleItems {
13271317 add_root : true ,
13281318 submodules : submodules. into_boxed_slice ( ) ,
@@ -1333,7 +1323,6 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
13331323 body_owners : body_owners. into_boxed_slice ( ) ,
13341324 opaques : opaques. into_boxed_slice ( ) ,
13351325 nested_bodies : nested_bodies. into_boxed_slice ( ) ,
1336- delayed_lint_items : delayed_lint_items. into_boxed_slice ( ) ,
13371326 eiis : eiis. into_boxed_slice ( ) ,
13381327 }
13391328}
@@ -1351,7 +1340,6 @@ struct ItemCollector<'tcx> {
13511340 body_owners : Vec < LocalDefId > ,
13521341 opaques : Vec < LocalDefId > ,
13531342 nested_bodies : Vec < LocalDefId > ,
1354- delayed_lint_items : Vec < OwnerId > ,
13551343 eiis : Vec < LocalDefId > ,
13561344}
13571345
@@ -1368,7 +1356,6 @@ impl<'tcx> ItemCollector<'tcx> {
13681356 body_owners : Vec :: default ( ) ,
13691357 opaques : Vec :: default ( ) ,
13701358 nested_bodies : Vec :: default ( ) ,
1371- delayed_lint_items : Vec :: default ( ) ,
13721359 eiis : Vec :: default ( ) ,
13731360 }
13741361 }
@@ -1387,9 +1374,6 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
13871374 }
13881375
13891376 self . items . push ( item. item_id ( ) ) ;
1390- if self . crate_collector && item. has_delayed_lints {
1391- self . delayed_lint_items . push ( item. item_id ( ) . owner_id ) ;
1392- }
13931377
13941378 if let ItemKind :: Static ( ..) | ItemKind :: Fn { .. } | ItemKind :: Macro ( ..) = & item. kind
13951379 && item. eii
@@ -1411,9 +1395,6 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
14111395
14121396 fn visit_foreign_item ( & mut self , item : & ' hir ForeignItem < ' hir > ) {
14131397 self . foreign_items . push ( item. foreign_item_id ( ) ) ;
1414- if self . crate_collector && item. has_delayed_lints {
1415- self . delayed_lint_items . push ( item. foreign_item_id ( ) . owner_id ) ;
1416- }
14171398 intravisit:: walk_foreign_item ( self , item)
14181399 }
14191400
@@ -1447,9 +1428,6 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
14471428 }
14481429
14491430 self . trait_items . push ( item. trait_item_id ( ) ) ;
1450- if self . crate_collector && item. has_delayed_lints {
1451- self . delayed_lint_items . push ( item. trait_item_id ( ) . owner_id ) ;
1452- }
14531431
14541432 intravisit:: walk_trait_item ( self , item)
14551433 }
@@ -1460,9 +1438,6 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
14601438 }
14611439
14621440 self . impl_items . push ( item. impl_item_id ( ) ) ;
1463- if self . crate_collector && item. has_delayed_lints {
1464- self . delayed_lint_items . push ( item. impl_item_id ( ) . owner_id ) ;
1465- }
14661441
14671442 intravisit:: walk_impl_item ( self , item)
14681443 }
0 commit comments