1
Fork 0

rustdoc: Move doc-reachability visiting back to cleaning

It populates `cx.cache.access_levels`, which seems to be needed during
cleaning since a bunch of tests are failing.
This commit is contained in:
Noah Lev 2021-11-19 22:00:37 -05:00
parent 6c017f071d
commit bbc3825d26
2 changed files with 6 additions and 3 deletions

View file

@ -7,6 +7,7 @@ use crate::clean::{
};
use crate::core::DocContext;
use crate::formats::item_type::ItemType;
use crate::visit_lib::LibEmbargoVisitor;
use rustc_ast as ast;
use rustc_ast::tokenstream::TokenTree;
@ -26,6 +27,11 @@ mod tests;
crate fn krate(cx: &mut DocContext<'_>) -> Crate {
let module = crate::visit_ast::RustdocVisitor::new(cx).visit();
for &cnum in cx.tcx.crates(()) {
// Analyze doc-reachability for extern items
LibEmbargoVisitor::new(cx).visit_lib(cnum);
}
// Clean the crate, translating the entire librustc_ast AST to one that is
// understood by rustdoc.
let mut module = module.clean(cx);