Skip to content

Commit

Permalink
Fix some nits
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Apr 11, 2017
1 parent a384f13 commit e18c59f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/librustc/session/mod.rs
Expand Up @@ -530,11 +530,10 @@ impl Session {
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);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_driver/lib.rs
Expand Up @@ -518,7 +518,9 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
}

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(),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/intrinsic.rs
Expand Up @@ -622,8 +622,8 @@ pub fn trans_intrinsic_call<'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)
}
Expand Down

0 comments on commit e18c59f

Please sign in to comment.