Skip to content

Commit 1c18ac1

Browse files
committed
privacy: HirIdify ObsoleteVisiblePrivateTypesVisitor
1 parent 58ed683 commit 1c18ac1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc_privacy/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc::ty::{self, TyCtxt, Ty, TraitRef, TypeFoldable, GenericParamDefKind};
2121
use rustc::ty::fold::TypeVisitor;
2222
use rustc::ty::query::Providers;
2323
use rustc::ty::subst::Substs;
24-
use rustc::util::nodemap::NodeSet;
24+
use rustc::util::nodemap::HirIdSet;
2525
use rustc_data_structures::fx::FxHashSet;
2626
use rustc_data_structures::sync::Lrc;
2727
use syntax::ast::{self, DUMMY_NODE_ID, Ident};
@@ -1152,7 +1152,7 @@ struct ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx: 'a> {
11521152
access_levels: &'a AccessLevels,
11531153
in_variant: bool,
11541154
// Set of errors produced by this obsolete visitor.
1155-
old_error_set: NodeSet,
1155+
old_error_set: HirIdSet,
11561156
}
11571157

11581158
struct ObsoleteCheckTypeForPrivatenessVisitor<'a, 'b: 'a, 'tcx: 'b> {
@@ -1196,7 +1196,7 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
11961196
fn check_generic_bound(&mut self, bound: &hir::GenericBound) {
11971197
if let hir::GenericBound::Trait(ref trait_ref, _) = *bound {
11981198
if self.path_is_private_type(&trait_ref.trait_ref.path) {
1199-
self.old_error_set.insert(trait_ref.trait_ref.ref_id);
1199+
self.old_error_set.insert(trait_ref.trait_ref.hir_ref_id);
12001200
}
12011201
}
12021202
}
@@ -1452,7 +1452,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
14521452
fn visit_ty(&mut self, t: &'tcx hir::Ty) {
14531453
if let hir::TyKind::Path(hir::QPath::Resolved(_, ref path)) = t.node {
14541454
if self.path_is_private_type(path) {
1455-
self.old_error_set.insert(t.id);
1455+
self.old_error_set.insert(t.hir_id);
14561456
}
14571457
}
14581458
intravisit::walk_ty(self, t)
@@ -1596,7 +1596,7 @@ impl<'a, 'tcx> DefIdVisitor<'a, 'tcx> for SearchInterfaceForPrivateItemsVisitor<
15961596
struct PrivateItemsInPublicInterfacesVisitor<'a, 'tcx: 'a> {
15971597
tcx: TyCtxt<'a, 'tcx, 'tcx>,
15981598
has_pub_restricted: bool,
1599-
old_error_set: &'a NodeSet,
1599+
old_error_set: &'a HirIdSet,
16001600
private_crates: FxHashSet<CrateNum>
16011601
}
16021602

@@ -1608,7 +1608,7 @@ impl<'a, 'tcx> PrivateItemsInPublicInterfacesVisitor<'a, 'tcx> {
16081608
// Slow path taken only if there any errors in the crate.
16091609
for &id in self.old_error_set {
16101610
// Walk up the nodes until we find `item_id` (or we hit a root).
1611-
let mut id = id;
1611+
let mut id = self.tcx.hir().hir_to_node_id(id);
16121612
loop {
16131613
if id == item_id {
16141614
has_old_errors = true;

0 commit comments

Comments
 (0)