Fix some nits

This commit is contained in:
Simonas Kazlauskas
2017-04-11 15:57:49 +03:00
parent a384f131cb
commit e18c59fd48
3 changed files with 7 additions and 6 deletions
+2 -3
View File
@@ -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);
}
}
+3 -1
View File
@@ -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(),
+2 -2
View File
@@ -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)
}