Skip to content

Commit a0cdbd1

Browse files
committed
Rustfmt
1 parent 38585b3 commit a0cdbd1

File tree

5 files changed

+26
-28
lines changed

5 files changed

+26
-28
lines changed

src/bin/cg_clif.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ extern crate rustc_interface;
66
extern crate rustc_session;
77
extern crate rustc_target;
88

9-
use std::panic;
109
use std::lazy::SyncLazy;
10+
use std::panic;
1111

1212
use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry};
1313
use rustc_interface::interface;

src/driver/aot.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ pub(crate) fn run_aot(
291291
};
292292

293293
// FIXME handle `-Ctarget-cpu=native`
294-
let target_cpu = tcx.sess.opts.cg.target_cpu.as_ref().unwrap_or(&tcx.sess.target.cpu).to_owned();
294+
let target_cpu =
295+
tcx.sess.opts.cg.target_cpu.as_ref().unwrap_or(&tcx.sess.target.cpu).to_owned();
295296
Box::new((
296297
CodegenResults {
297298
modules,

src/driver/jit.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ thread_local! {
2626
}
2727

2828
/// The Sender owned by the rustc thread
29-
static GLOBAL_MESSAGE_SENDER: SyncOnceCell<Mutex<mpsc::Sender<UnsafeMessage>>> = SyncOnceCell::new();
29+
static GLOBAL_MESSAGE_SENDER: SyncOnceCell<Mutex<mpsc::Sender<UnsafeMessage>>> =
30+
SyncOnceCell::new();
3031

3132
/// A message that is sent from the jitted runtime to the rustc thread.
3233
/// Senders are responsible for upholding `Send` semantics.
@@ -195,23 +196,25 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
195196
// lazy JIT compilation request - compile requested instance and return pointer to result
196197
UnsafeMessage::JitFn { instance_ptr, trampoline_ptr, tx } => {
197198
tx.send(jit_fn(instance_ptr, trampoline_ptr))
198-
.expect("jitted runtime hung up before response to lazy JIT request was sent");
199+
.expect("jitted runtime hung up before response to lazy JIT request was sent");
199200
}
200201
}
201202
}
202203
}
203204

204205
#[no_mangle]
205-
extern "C" fn __clif_jit_fn(instance_ptr: *const Instance<'static>, trampoline_ptr: *const u8) -> *const u8 {
206+
extern "C" fn __clif_jit_fn(
207+
instance_ptr: *const Instance<'static>,
208+
trampoline_ptr: *const u8,
209+
) -> *const u8 {
206210
// send the JIT request to the rustc thread, with a channel for the response
207211
let (tx, rx) = mpsc::channel();
208212
UnsafeMessage::JitFn { instance_ptr, trampoline_ptr, tx }
209213
.send()
210214
.expect("rustc thread hung up before lazy JIT request was sent");
211215

212216
// block on JIT compilation result
213-
rx.recv()
214-
.expect("rustc thread hung up before responding to sent lazy JIT request")
217+
rx.recv().expect("rustc thread hung up before responding to sent lazy JIT request")
215218
}
216219

217220
fn jit_fn(instance_ptr: *const Instance<'static>, trampoline_ptr: *const u8) -> *const u8 {

src/intrinsics/llvm.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,30 +148,28 @@ fn llvm_add_sub<'tcx>(
148148
ret: CPlace<'tcx>,
149149
cb_in: Value,
150150
a: CValue<'tcx>,
151-
b: CValue<'tcx>
151+
b: CValue<'tcx>,
152152
) {
153-
assert_eq!(a.layout().ty, fx.tcx.types.u64, "llvm.x86.addcarry.64/llvm.x86.subborrow.64 second operand must be u64");
154-
assert_eq!(b.layout().ty, fx.tcx.types.u64, "llvm.x86.addcarry.64/llvm.x86.subborrow.64 third operand must be u64");
153+
assert_eq!(
154+
a.layout().ty,
155+
fx.tcx.types.u64,
156+
"llvm.x86.addcarry.64/llvm.x86.subborrow.64 second operand must be u64"
157+
);
158+
assert_eq!(
159+
b.layout().ty,
160+
fx.tcx.types.u64,
161+
"llvm.x86.addcarry.64/llvm.x86.subborrow.64 third operand must be u64"
162+
);
155163

156164
// c + carry -> c + first intermediate carry or borrow respectively
157-
let int0 = crate::num::codegen_checked_int_binop(
158-
fx,
159-
bin_op,
160-
a,
161-
b,
162-
);
165+
let int0 = crate::num::codegen_checked_int_binop(fx, bin_op, a, b);
163166
let c = int0.value_field(fx, mir::Field::new(0));
164167
let cb0 = int0.value_field(fx, mir::Field::new(1)).load_scalar(fx);
165168

166169
// c + carry -> c + second intermediate carry or borrow respectively
167170
let cb_in_as_u64 = fx.bcx.ins().uextend(types::I64, cb_in);
168171
let cb_in_as_u64 = CValue::by_val(cb_in_as_u64, fx.layout_of(fx.tcx.types.u64));
169-
let int1 = crate::num::codegen_checked_int_binop(
170-
fx,
171-
bin_op,
172-
c,
173-
cb_in_as_u64,
174-
);
172+
let int1 = crate::num::codegen_checked_int_binop(fx, bin_op, c, cb_in_as_u64);
175173
let (c, cb1) = int1.load_scalar_pair(fx);
176174

177175
// carry0 | carry1 -> carry or borrow respectively

src/vtable.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,8 @@ pub(crate) fn get_vtable<'tcx>(
6969
trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
7070
) -> Value {
7171
let alloc_id = fx.tcx.vtable_allocation(ty, trait_ref);
72-
let data_id = data_id_for_alloc_id(
73-
&mut fx.constants_cx,
74-
&mut *fx.module,
75-
alloc_id,
76-
Mutability::Not,
77-
);
72+
let data_id =
73+
data_id_for_alloc_id(&mut fx.constants_cx, &mut *fx.module, alloc_id, Mutability::Not);
7874
let local_data_id = fx.module.declare_data_in_func(data_id, &mut fx.bcx.func);
7975
if fx.clif_comments.enabled() {
8076
fx.add_comment(local_data_id, format!("vtable: {:?}", alloc_id));

0 commit comments

Comments
 (0)