Skip to content

Commit cb6d2bd

Browse files
committed
Fix optimization_fuel
1 parent f3dc331 commit cb6d2bd

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
@@ -845,10 +845,10 @@ impl Session {
845845
/// We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n.
846846
/// This expends fuel if applicable, and records fuel if applicable.
847847
pub fn consider_optimizing<T: Fn() -> String>(&self, crate_name: &str, msg: T) -> bool {
848-
assert!(self.query_threads() == 1);
849848
let mut ret = true;
850849
match self.optimization_fuel_crate {
851850
Some(ref c) if c == crate_name => {
851+
assert!(self.query_threads() == 1);
852852
let fuel = self.optimization_fuel_limit.get();
853853
ret = fuel != 0;
854854
if fuel == 0 && !self.out_of_fuel.get() {
@@ -862,6 +862,7 @@ impl Session {
862862
}
863863
match self.print_fuel_crate {
864864
Some(ref c) if c == crate_name => {
865+
assert!(self.query_threads() == 1);
865866
self.print_fuel.set(self.print_fuel.get() + 1);
866867
}
867868
_ => {}

0 commit comments

Comments
 (0)