@@ -1594,7 +1594,7 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'_, 'tcx> {
1594
1594
self . effective_visibilities . effective_vis ( def_id) . copied ( )
1595
1595
}
1596
1596
1597
- fn check_item ( & mut self , id : ItemId ) {
1597
+ fn check_item ( & self , id : ItemId ) {
1598
1598
let tcx = self . tcx ;
1599
1599
let def_id = id. owner_id . def_id ;
1600
1600
let item_visibility = tcx. local_visibility ( def_id) ;
@@ -1722,7 +1722,7 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'_, 'tcx> {
1722
1722
}
1723
1723
}
1724
1724
1725
- fn check_foreign_item ( & mut self , id : ForeignItemId ) {
1725
+ fn check_foreign_item ( & self , id : ForeignItemId ) {
1726
1726
let tcx = self . tcx ;
1727
1727
let def_id = id. owner_id . def_id ;
1728
1728
let item_visibility = tcx. local_visibility ( def_id) ;
@@ -1857,13 +1857,9 @@ fn effective_visibilities(tcx: TyCtxt<'_>, (): ()) -> &EffectiveVisibilities {
1857
1857
fn check_private_in_public ( tcx : TyCtxt < ' _ > , module_def_id : LocalModDefId ) {
1858
1858
let effective_visibilities = tcx. effective_visibilities ( ( ) ) ;
1859
1859
// Check for private types in public interfaces.
1860
- let mut checker = PrivateItemsInPublicInterfacesChecker { tcx, effective_visibilities } ;
1860
+ let checker = PrivateItemsInPublicInterfacesChecker { tcx, effective_visibilities } ;
1861
1861
1862
1862
let crate_items = tcx. hir_module_items ( module_def_id) ;
1863
- for id in crate_items. free_items ( ) {
1864
- checker. check_item ( id) ;
1865
- }
1866
- for id in crate_items. foreign_items ( ) {
1867
- checker. check_foreign_item ( id) ;
1868
- }
1863
+ let _ = crate_items. par_items ( |id| Ok ( checker. check_item ( id) ) ) ;
1864
+ let _ = crate_items. par_foreign_items ( |id| Ok ( checker. check_foreign_item ( id) ) ) ;
1869
1865
}
0 commit comments