@@ -1496,7 +1496,7 @@ impl<'a, 'tcx: 'a> SearchInterfaceForPrivateItemsVisitor<'a, 'tcx> {
14961496
14971497 fn check_def_id ( & mut self , def_id : DefId , kind : & str , descr : & dyn fmt:: Display ) -> bool {
14981498 if self . leaks_private_dep ( def_id) {
1499- self . tcx . lint_node ( lint:: builtin:: EXTERNAL_PRIVATE_DEPENDENCY ,
1499+ self . tcx . lint_node ( lint:: builtin:: EXPORTED_PRIVATE_DEPENDENCIES ,
15001500 self . item_id ,
15011501 self . span ,
15021502 & format ! ( "{} `{}` from private dependency '{}' in public \
@@ -1726,9 +1726,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Lrc<AccessLevels> {
17261726fn check_mod_privacy < ' tcx > ( tcx : TyCtxt < ' _ , ' tcx , ' tcx > , module_def_id : DefId ) {
17271727 let empty_tables = ty:: TypeckTables :: empty ( None ) ;
17281728
1729- let public_crates: FxHashSet < CrateNum > = tcx. sess . opts . extern_public . iter ( ) . flat_map ( |c| {
1730- tcx. crates ( ) . iter ( ) . find ( |& & krate| & tcx. crate_name ( krate) == c) . cloned ( )
1731- } ) . collect ( ) ;
17321729
17331730 // Check privacy of names not checked in previous compilation stages.
17341731 let mut visitor = NamePrivacyVisitor {
@@ -1765,6 +1762,11 @@ fn privacy_access_levels<'tcx>(
17651762 queries:: check_mod_privacy:: ensure ( tcx, tcx. hir ( ) . local_def_id ( module) ) ;
17661763 }
17671764
1765+ let public_crates: FxHashSet < CrateNum > = tcx. sess . opts . extern_public . iter ( ) . flat_map ( |c| {
1766+ tcx. crates ( ) . iter ( ) . find ( |& & krate| & tcx. crate_name ( krate) == c) . cloned ( )
1767+ } ) . collect ( ) ;
1768+
1769+
17681770 // Build up a set of all exported items in the AST. This is a set of all
17691771 // items which are reachable from external crates based on visibility.
17701772 let mut visitor = EmbargoVisitor {
0 commit comments