rustdoc: Use privacy visibility for pruning

This commit ends rustdoc's approximation of privacy and instead uses the result
of the various compiler passes instead.

Closes #9827
This commit is contained in:
Alex Crichton
2013-10-12 14:40:41 -07:00
parent a7e8957c59
commit 3d693d74b8
5 changed files with 179 additions and 100 deletions

View File

@@ -24,6 +24,7 @@ extern mod rustc;
extern mod extra;
use std::cell::Cell;
use std::local_data;
use std::rt::io::Writer;
use std::rt::io::file::FileInfo;
use std::rt::io;
@@ -73,6 +74,7 @@ static DEFAULT_PASSES: &'static [&'static str] = &[
];
local_data_key!(pub ctxtkey: @core::DocContext)
local_data_key!(pub analysiskey: core::CrateAnalysis)
type Output = (clean::Crate, ~[plugins::PluginJson]);
@@ -191,11 +193,12 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
let libs = Cell::new(matches.opt_strs("L").map(|s| Path(*s)));
let cr = Cell::new(Path(cratefile));
info2!("starting to run rustc");
let crate = do std::task::try {
let (crate, analysis) = do std::task::try {
let cr = cr.take();
core::run_core(libs.take(), &cr)
}.unwrap();
info2!("finished with rustc");
local_data::set(analysiskey, analysis);
// Process all of the crate attributes, extracting plugin metadata along
// with the passes which we are supposed to run.