]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/passes/strip_priv_imports.rs
Rollup merge of #103842 - andrewpollack:add-fuchsia-test-script, r=tmandry
[rust.git] / src / librustdoc / passes / strip_priv_imports.rs
1 //! Strips all private import statements (use, extern crate) from a
2 //! crate.
3 use crate::clean;
4 use crate::core::DocContext;
5 use crate::fold::DocFolder;
6 use crate::passes::{ImportStripper, Pass};
7
8 pub(crate) const STRIP_PRIV_IMPORTS: Pass = Pass {
9     name: "strip-priv-imports",
10     run: strip_priv_imports,
11     description: "strips all private import statements (`use`, `extern crate`) from a crate",
12 };
13
14 pub(crate) fn strip_priv_imports(krate: clean::Crate, cx: &mut DocContext<'_>) -> clean::Crate {
15     ImportStripper { tcx: cx.tcx }.fold_crate(krate)
16 }