]> git.lizzy.rs Git - rust.git/commitdiff
Fix optimization_fuel
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Tue, 17 Apr 2018 18:09:40 +0000 (20:09 +0200)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Fri, 1 Jun 2018 12:55:55 +0000 (14:55 +0200)
src/librustc/session/mod.rs

index 8df66d8d68855b63d30b1d633bd102012739b6a5..076d56fb80842cab1c4efbe9677086fae7af1cf7 100644 (file)
@@ -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<T: Fn() -> 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<T: Fn() -> 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);
             }
             _ => {}