Reviewer requested changes and test fixes

This commit is contained in:
Nick Cameron 2016-02-01 08:43:43 +13:00
parent 4f97338a3a
commit 185a0e51bf
4 changed files with 8 additions and 8 deletions

View File

@ -179,13 +179,13 @@ impl Session {
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
where F: FnOnce() -> T
{
let count = self.err_count();
let old_count = self.err_count();
let result = f();
let count = self.err_count() - count;
if count == 0 {
let errors = self.err_count() - old_count;
if errors == 0 {
Ok(result)
} else {
Err(count)
Err(errors)
}
}
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {

View File

@ -132,7 +132,7 @@ fn test_env<F>(source_string: &str,
ty::ctxt::create_and_enter(&sess,
&arenas,
def_map,
named_region_map,
named_region_map.unwrap(),
ast_map,
freevars,
region_map,

View File

@ -153,7 +153,7 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
&arenas,
&name,
resolve::MakeGlobMap::No,
|tcx, _, analysis| {
|tcx, _, analysis, _| {
let _ignore = tcx.dep_graph.in_ignore();
let ty::CrateAnalysis { access_levels, .. } = analysis;

View File

@ -242,9 +242,9 @@ fn compile_program(input: &str, sysroot: PathBuf)
abort_on_err(driver::phase_3_run_analysis_passes(
&sess, &cstore, ast_map, &arenas, &id,
MakeGlobMap::No, |tcx, mir_map, analysis| {
MakeGlobMap::No, |tcx, mir_map, analysis, _| {
let trans = driver::phase_4_translate_to_llvm(tcx, mir_map, analysis);
let trans = driver::phase_4_translate_to_llvm(tcx, mir_map.unwrap(), analysis);
let crates = tcx.sess.cstore.used_crates(LinkagePreference::RequireDynamic);