Skip to content

Rustdoc reports driver phase-3 errors instead of continuing #31507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,18 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
let arenas = ty::CtxtArenas::new();
let hir_map = driver::make_map(&sess, &mut hir_forest);

abort_on_err(driver::phase_3_run_analysis_passes(&sess,
let krate_and_analysis = abort_on_err(driver::phase_3_run_analysis_passes(&sess,
&cstore,
hir_map,
&arenas,
&name,
resolve::MakeGlobMap::No,
|tcx, _, analysis, _| {
|tcx, _, analysis, result| {
// Return if the driver hit an err (in `result`)
if let Err(_) = result {
return None
}

let _ignore = tcx.dep_graph.in_ignore();
let ty::CrateAnalysis { access_levels, .. } = analysis;

Expand Down Expand Up @@ -195,11 +200,17 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,

let external_paths = ctxt.external_paths.borrow_mut().take();
*analysis.external_paths.borrow_mut() = external_paths;

let map = ctxt.external_typarams.borrow_mut().take();
*analysis.external_typarams.borrow_mut() = map;

let map = ctxt.inlined.borrow_mut().take();
*analysis.inlined.borrow_mut() = map;

analysis.deref_trait_did = ctxt.deref_trait_did.get();
(krate, analysis)
}), &sess)

Some((krate, analysis))
}), &sess);

krate_and_analysis.unwrap()
}