Skip to content

Commit

Permalink
Fix optimization_fuel
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Jun 1, 2018
1 parent d6c63ec commit 9eb4f73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc/session/mod.rs
Expand Up @@ -845,10 +845,10 @@ impl Session {
/// 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() {
Expand All @@ -862,6 +862,7 @@ impl Session {
}
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);
}
_ => {}
Expand Down

0 comments on commit 9eb4f73

Please sign in to comment.