From e18c59fd48a8387767d44fdd4d36208dfd33f762 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Tue, 11 Apr 2017 15:57:49 +0300 Subject: [PATCH] Fix some nits --- src/librustc/session/mod.rs | 5 ++--- src/librustc_driver/lib.rs | 4 +++- src/librustc_trans/intrinsic.rs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 1be7d1afe45a8..039db3d9ee911 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -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); } } diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 1fef97d54a141..1a892b73aa5d7 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -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(), diff --git a/src/librustc_trans/intrinsic.rs b/src/librustc_trans/intrinsic.rs index b6fbc2f5ad537..7cfc28622c443 100644 --- a/src/librustc_trans/intrinsic.rs +++ b/src/librustc_trans/intrinsic.rs @@ -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) }