Skip to content

Commit e18c59f

Browse files
committed
Fix some nits
1 parent a384f13 commit e18c59f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/librustc/session/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,10 @@ impl Session {
530530
Some(ref c) if c == crate_name => {
531531
let fuel = self.optimization_fuel_limit.get();
532532
ret = fuel != 0;
533-
if fuel == 0 && !self.out_of_fuel.get(){
533+
if fuel == 0 && !self.out_of_fuel.get() {
534534
println!("optimization-fuel-exhausted: {}", msg());
535535
self.out_of_fuel.set(true);
536-
}
537-
else if fuel > 0{
536+
} else if fuel > 0 {
538537
self.optimization_fuel_limit.set(fuel-1);
539538
}
540539
}

src/librustc_driver/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
518518
}
519519

520520
if sess.print_fuel_crate.is_some() {
521-
control.compilation_done.callback = box |state| {
521+
let old_callback = control.compilation_done.callback;
522+
control.compilation_done.callback = box move |state| {
523+
old_callback(state);
522524
let sess = state.session;
523525
println!("Fuel used by {}: {}",
524526
sess.print_fuel_crate.as_ref().unwrap(),

src/librustc_trans/intrinsic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ pub fn trans_intrinsic_call<'a, 'tcx>(bcx: &Builder<'a, 'tcx>,
622622
let val = bcx.extract_value(val, i);
623623
let lval = LvalueRef::new_sized_ty(llresult, ret_ty,
624624
Alignment::AbiAligned);
625-
let (dest, _) = lval.trans_field_ptr(bcx, i);
626-
bcx.store(val, dest, None);
625+
let (dest, align) = lval.trans_field_ptr(bcx, i);
626+
bcx.store(val, dest, align.to_align());
627627
}
628628
C_nil(ccx)
629629
}

0 commit comments

Comments
 (0)