]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_privacy/lib.rs
Use the correct visibility
[rust.git] / src / librustc_privacy / lib.rs
index 3919ba13076f6d839426226056ca2e904b720314..ad70c86eb1583d9da90f6592c735ee296e522228 100644 (file)
@@ -433,10 +433,6 @@ fn predicates(&mut self) -> &mut Self {
 
     fn ty(&mut self) -> &mut Self {
         let ty = self.ev.tcx.type_of(self.item_def_id);
-        self.walk_ty(ty)
-    }
-
-    fn walk_ty(&mut self, ty: Ty<'tcx>) -> &mut Self {
         ty.visit_with(self);
         if let ty::TyFnDef(def_id, _) = ty.sty {
             if def_id == self.item_def_id {
@@ -1568,7 +1564,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
                 // where `X` is the `impl Iterator<Item=T>` itself,
                 // stored in `predicates_of`, not in the `Ty` itself.
 
-                self.check(item.id, self.inner_visibility).predicates();
+                self.check(item.id, item_visibility).predicates();
             }
             // Subitems of these items have inherited publicity
             hir::ItemConst(..) | hir::ItemStatic(..) | hir::ItemFn(..) |