From 9eb4f7329b130cca7a8850a93534197aa6af3657 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20K=C3=A5re=20Alsaker?= Date: Tue, 17 Apr 2018 20:09:40 +0200 Subject: [PATCH] Fix optimization_fuel --- src/librustc/session/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 8df66d8d688..076d56fb808 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -845,10 +845,10 @@ pub fn print_perf_stats(&self) { /// We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n. /// This expends fuel if applicable, and records fuel if applicable. pub fn consider_optimizing String>(&self, crate_name: &str, msg: T) -> bool { - assert!(self.query_threads() == 1); let mut ret = true; match self.optimization_fuel_crate { Some(ref c) if c == crate_name => { + assert!(self.query_threads() == 1); let fuel = self.optimization_fuel_limit.get(); ret = fuel != 0; if fuel == 0 && !self.out_of_fuel.get() { @@ -862,6 +862,7 @@ pub fn consider_optimizing String>(&self, crate_name: &str, msg: T) - } match self.print_fuel_crate { Some(ref c) if c == crate_name => { + assert!(self.query_threads() == 1); self.print_fuel.set(self.print_fuel.get() + 1); } _ => {} -- 2.44.0