]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/visit_lib.rs
Rollup merge of #92636 - compiler-errors:normalize-generator-const-expr, r=oli-obk
[rust.git] / src / librustdoc / visit_lib.rs
index 791f7ff437c8bf4e86229cbb7831cdc0abd5407b..5bcec779bc0e7d130be976f1cb17ba9d660b13ed 100644 (file)
@@ -3,9 +3,6 @@
 use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
 use rustc_middle::middle::privacy::{AccessLevel, AccessLevels};
 use rustc_middle::ty::TyCtxt;
-use rustc_span::symbol::sym;
-
-use crate::clean::{AttributesExt, NestedAttributesExt};
 
 // FIXME: this may not be exhaustive, but is sufficient for rustdocs current uses
 
@@ -39,7 +36,7 @@ impl<'a, 'tcx> LibEmbargoVisitor<'a, 'tcx> {
 
     // Updates node level and returns the updated level
     fn update(&mut self, did: DefId, level: Option<AccessLevel>) -> Option<AccessLevel> {
-        let is_hidden = self.tcx.get_attrs(did).lists(sym::doc).has_word(sym::hidden);
+        let is_hidden = self.tcx.is_doc_hidden(did);
 
         let old_level = self.access_levels.map.get(&did).cloned();
         // Accessibility levels can only grow
@@ -56,7 +53,7 @@ fn update(&mut self, did: DefId, level: Option<AccessLevel>) -> Option<AccessLev
             return;
         }
 
-        for item in self.tcx.item_children(def_id).iter() {
+        for item in self.tcx.module_children(def_id).iter() {
             if let Some(def_id) = item.res.opt_def_id() {
                 if self.tcx.def_key(def_id).parent.map_or(false, |d| d == def_id.index)
                     || item.vis.is_public()