mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
Fix some nits
This commit is contained in:
@@ -530,11 +530,10 @@ pub fn consider_optimizing<T: Fn() -> String>(&self, crate_name: &str, msg: T) -
|
||||
Some(ref c) if c == crate_name => {
|
||||
let fuel = self.optimization_fuel_limit.get();
|
||||
ret = fuel != 0;
|
||||
if fuel == 0 && !self.out_of_fuel.get(){
|
||||
if fuel == 0 && !self.out_of_fuel.get() {
|
||||
println!("optimization-fuel-exhausted: {}", msg());
|
||||
self.out_of_fuel.set(true);
|
||||
}
|
||||
else if fuel > 0{
|
||||
} else if fuel > 0 {
|
||||
self.optimization_fuel_limit.set(fuel-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,7 +518,9 @@ fn build_controller(&mut self,
|
||||
}
|
||||
|
||||
if sess.print_fuel_crate.is_some() {
|
||||
control.compilation_done.callback = box |state| {
|
||||
let old_callback = control.compilation_done.callback;
|
||||
control.compilation_done.callback = box move |state| {
|
||||
old_callback(state);
|
||||
let sess = state.session;
|
||||
println!("Fuel used by {}: {}",
|
||||
sess.print_fuel_crate.as_ref().unwrap(),
|
||||
|
||||
@@ -622,8 +622,8 @@ fn modify_as_needed<'a, 'tcx>(bcx: &Builder<'a, 'tcx>,
|
||||
let val = bcx.extract_value(val, i);
|
||||
let lval = LvalueRef::new_sized_ty(llresult, ret_ty,
|
||||
Alignment::AbiAligned);
|
||||
let (dest, _) = lval.trans_field_ptr(bcx, i);
|
||||
bcx.store(val, dest, None);
|
||||
let (dest, align) = lval.trans_field_ptr(bcx, i);
|
||||
bcx.store(val, dest, align.to_align());
|
||||
}
|
||||
C_nil(ccx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user