Skip to content

Commit cbae67a

Browse files
committed
Fix #21670
1 parent c63054d commit cbae67a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_privacy/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use rustc_front::intravisit::{self, Visitor};
3838

3939
use rustc::dep_graph::DepNode;
4040
use rustc::lint;
41+
use rustc::middle::cstore::CrateStore;
4142
use rustc::middle::def::{self, Def};
4243
use rustc::middle::def_id::DefId;
4344
use rustc::middle::privacy::{AccessLevel, AccessLevels};
@@ -498,7 +499,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
498499
let node_id = if let Some(node_id) = self.tcx.map.as_local_node_id(did) {
499500
node_id
500501
} else {
501-
if self.external_exports.contains(&did) {
502+
if self.tcx.sess.cstore.visibility(did) == hir::Public {
502503
debug!("privacy - {:?} was externally exported", did);
503504
return Allowable;
504505
}

0 commit comments

Comments
 (0)