Reviewer requested changes and test fixes
This commit is contained in:
parent
4f97338a3a
commit
185a0e51bf
|
@ -179,13 +179,13 @@ impl Session {
|
||||||
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
|
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
|
||||||
where F: FnOnce() -> T
|
where F: FnOnce() -> T
|
||||||
{
|
{
|
||||||
let count = self.err_count();
|
let old_count = self.err_count();
|
||||||
let result = f();
|
let result = f();
|
||||||
let count = self.err_count() - count;
|
let errors = self.err_count() - old_count;
|
||||||
if count == 0 {
|
if errors == 0 {
|
||||||
Ok(result)
|
Ok(result)
|
||||||
} else {
|
} else {
|
||||||
Err(count)
|
Err(errors)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
|
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ fn test_env<F>(source_string: &str,
|
||||||
ty::ctxt::create_and_enter(&sess,
|
ty::ctxt::create_and_enter(&sess,
|
||||||
&arenas,
|
&arenas,
|
||||||
def_map,
|
def_map,
|
||||||
named_region_map,
|
named_region_map.unwrap(),
|
||||||
ast_map,
|
ast_map,
|
||||||
freevars,
|
freevars,
|
||||||
region_map,
|
region_map,
|
||||||
|
|
|
@ -153,7 +153,7 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
|
||||||
&arenas,
|
&arenas,
|
||||||
&name,
|
&name,
|
||||||
resolve::MakeGlobMap::No,
|
resolve::MakeGlobMap::No,
|
||||||
|tcx, _, analysis| {
|
|tcx, _, analysis, _| {
|
||||||
let _ignore = tcx.dep_graph.in_ignore();
|
let _ignore = tcx.dep_graph.in_ignore();
|
||||||
let ty::CrateAnalysis { access_levels, .. } = analysis;
|
let ty::CrateAnalysis { access_levels, .. } = analysis;
|
||||||
|
|
||||||
|
|
|
@ -242,9 +242,9 @@ fn compile_program(input: &str, sysroot: PathBuf)
|
||||||
|
|
||||||
abort_on_err(driver::phase_3_run_analysis_passes(
|
abort_on_err(driver::phase_3_run_analysis_passes(
|
||||||
&sess, &cstore, ast_map, &arenas, &id,
|
&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);
|
let crates = tcx.sess.cstore.used_crates(LinkagePreference::RequireDynamic);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue