pub fn consider_optimizing<T: Fn() -> String>(&self, crate_name: &str, msg: T) -> bool {
        let mut ret = true;
        if let Some(ref c) = self.optimization_fuel_crate {
            if c == crate_name {
                assert_eq!(self.query_threads(), 1);
                let fuel = self.optimization_fuel_limit.get();
                ret = fuel != 0;
                if fuel == 0 && !self.out_of_fuel.get() {
                    eprintln!("optimization-fuel-exhausted: {}", msg());
                    self.out_of_fuel.set(true);
                } else if fuel > 0 {
                    self.optimization_fuel_limit.set(fuel - 1);
                }
            }
        }
        if let Some(ref c) = self.print_fuel_crate {
            if c == crate_name {
                assert_eq!(self.query_threads(), 1);
                self.print_fuel.set(self.print_fuel.get() + 1);
            }
        }
        ret
    }
/// 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.
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.
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 {
        let mut ret = true;
        if let Some(ref c) = self.optimization_fuel_crate {
            if c == crate_name {
                assert_eq!(self.query_threads(), 1);
                let fuel = self.optimization_fuel_limit.get();
                ret = fuel != 0;
                if fuel == 0 && !self.out_of_fuel.get() {
                    eprintln!("optimization-fuel-exhausted: {}", msg());
                    self.out_of_fuel.set(true);
                } else if fuel > 0 {
                    self.optimization_fuel_limit.set(fuel - 1);
                }
            }
        }
        if let Some(ref c) = self.print_fuel_crate {
            if c == crate_name {
                assert_eq!(self.query_threads(), 1);
                self.print_fuel.set(self.print_fuel.get() + 1);
            }
        }
        ret
    }
pub fn consider_optimizing < T : Fn ( ) -> String > ( & self , crate_name : & str , msg : T ) -> bool { let mut ret = true ; if let Some ( ref c ) = self . optimization_fuel_crate { if c == crate_name { assert_eq ! ( self query_threads ( ) 1 ) ; let fuel = self . optimization_fuel_limit . get ( ) ; ret = fuel != 0 ; if fuel == 0 && ! self . out_of_fuel . get ( ) { eprintln ! ( " " msg ( ) ) ; self . out_of_fuel . set ( true ) ; } else if fuel > 0 { self . optimization_fuel_limit . set ( fuel - 1 ) ; } } } if let Some ( ref c ) = self . print_fuel_crate { if c == crate_name { assert_eq ! ( self query_threads ( ) 1 ) ; self . print_fuel . set ( self . print_fuel . get ( ) + 1 ) ; } } ret }
We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n.
We want to know if we ' re allowed to do an optimization for crate foo from - z fuel = foo = n .
&self
crate_name
&str
msg
T
&self
crate_name
&str
msg
T