diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 2185d22d34e43..3cb4597e2dd8c 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -179,13 +179,13 @@ impl Session { pub fn track_errors(&self, f: F) -> Result 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>(&self, sp: S, msg: &str) { diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index a662081ac2123..3389992ebb860 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -132,7 +132,7 @@ fn test_env(source_string: &str, ty::ctxt::create_and_enter(&sess, &arenas, def_map, - named_region_map, + named_region_map.unwrap(), ast_map, freevars, region_map, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 5eac358f1bf39..3e8457069d2db 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -153,7 +153,7 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec, externs: Externs, &arenas, &name, resolve::MakeGlobMap::No, - |tcx, _, analysis| { + |tcx, _, analysis, _| { let _ignore = tcx.dep_graph.in_ignore(); let ty::CrateAnalysis { access_levels, .. } = analysis; diff --git a/src/test/run-make/execution-engine/test.rs b/src/test/run-make/execution-engine/test.rs index c4d28223c1a84..3f9c81eac0b25 100644 --- a/src/test/run-make/execution-engine/test.rs +++ b/src/test/run-make/execution-engine/test.rs @@ -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);