Skip to content

Commit 3bec838

Browse files
committed
Fix optimization_fuel
1 parent dd92f61 commit 3bec838

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/session/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,10 @@ impl Session {
835835
/// We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n.
836836
/// This expends fuel if applicable, and records fuel if applicable.
837837
pub fn consider_optimizing<T: Fn() -> String>(&self, crate_name: &str, msg: T) -> bool {
838-
assert!(self.query_threads() == 1);
839838
let mut ret = true;
840839
match self.optimization_fuel_crate {
841840
Some(ref c) if c == crate_name => {
841+
assert!(self.query_threads() == 1);
842842
let fuel = self.optimization_fuel_limit.get();
843843
ret = fuel != 0;
844844
if fuel == 0 && !self.out_of_fuel.get() {
@@ -852,6 +852,7 @@ impl Session {
852852
}
853853
match self.print_fuel_crate {
854854
Some(ref c) if c == crate_name => {
855+
assert!(self.query_threads() == 1);
855856
self.print_fuel.set(self.print_fuel.get() + 1);
856857
}
857858
_ => {}

0 commit comments

Comments
 (0)