Fix fallout in librustdoc and in tests

This commit is contained in:
Jeffrey Seyfried 2016-05-08 04:18:55 +00:00
parent abec20b177
commit 805666a4d2
6 changed files with 33 additions and 23 deletions

View file

@ -34,7 +34,6 @@ use rustc::ty;
use rustc::session::config::{self, basic_options, build_configuration, Input, Options};
use rustc::session::build_session;
use rustc_driver::{driver, abort_on_err};
use rustc::hir::lowering::{lower_crate, LoweringContext};
use rustc_resolve::MakeGlobMap;
use rustc_metadata::creader::LocalCrateReader;
use rustc_metadata::cstore::CStore;
@ -243,14 +242,16 @@ fn compile_program(input: &str, sysroot: PathBuf)
let krate = driver::assign_node_ids(&sess, krate);
let defs = RefCell::new(ast_map::collect_definitions(&krate));
LocalCrateReader::new(&sess, &cstore, &defs, &krate, &id).read_crates(&dep_graph);
let lcx = LoweringContext::new(&sess, Some(&krate), &defs);
let mut hir_forest = ast_map::Forest::new(lower_crate(&lcx, &krate), dep_graph);
let (analysis, resolutions, mut hir_forest) = {
let defs = &mut *defs.borrow_mut();
driver::lower_and_resolve(&sess, &id, defs, &krate, dep_graph, MakeGlobMap::No)
};
let arenas = ty::CtxtArenas::new();
let ast_map = ast_map::map_crate(&mut hir_forest, &defs);
abort_on_err(driver::phase_3_run_analysis_passes(
&sess, ast_map, &arenas, &id,
MakeGlobMap::No, |tcx, mir_map, analysis, _| {
&sess, ast_map, analysis, resolutions, &arenas, &id,
|tcx, mir_map, analysis, _| {
let trans = driver::phase_4_translate_to_llvm(tcx, mir_map.unwrap(), analysis);

View file

@ -14,3 +14,5 @@
fn bar /* 62#0 */() { let x /* 59#2 */ = 1; y /* 61#4 */ + x /* 59#5 */ }
fn y /* 61#0 */() { }

View file

@ -20,3 +20,5 @@ fn bar() {
let x = 1;
foo!(x)
}
fn y() {}