Skip to content

Commit 6bd92ef

Browse files
committed
Rustfmt
1 parent 04e580f commit 6bd92ef

File tree

8 files changed

+61
-36
lines changed

8 files changed

+61
-36
lines changed

Diff for: example/std_example.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,10 @@ unsafe fn test_simd() {
241241
let (zero0, zero1) = std::mem::transmute::<_, (u64, u64)>(x);
242242
assert_eq!((zero0, zero1), (0, 0));
243243
assert_eq!(std::mem::transmute::<_, [u16; 8]>(or), [7, 7, 7, 7, 7, 7, 7, 7]);
244-
assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_eq), [
245-
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
246-
]);
244+
assert_eq!(
245+
std::mem::transmute::<_, [u16; 8]>(cmp_eq),
246+
[0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff]
247+
);
247248
assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_lt), [0, 0, 0, 0, 0, 0, 0, 0]);
248249

249250
test_mm_slli_si128();

Diff for: src/cast.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ pub(crate) fn clif_int_or_float_cast(
9696
},
9797
);
9898

99-
fx.lib_call(&name, vec![AbiParam::new(from_ty)], vec![AbiParam::new(types::I128)], &[
100-
from,
101-
])[0]
99+
fx.lib_call(
100+
&name,
101+
vec![AbiParam::new(from_ty)],
102+
vec![AbiParam::new(types::I128)],
103+
&[from],
104+
)[0]
102105
} else if to_ty == types::I8 || to_ty == types::I16 {
103106
// FIXME implement fcvt_to_*int_sat.i8/i16
104107
let val = if to_signed {

Diff for: src/debuginfo/object.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,19 @@ impl WriteDebugInfo for ObjectProduct {
7373
}
7474
};
7575
self.object
76-
.add_relocation(from.0, Relocation {
77-
offset: u64::from(reloc.offset),
78-
symbol,
79-
flags: RelocationFlags::Generic {
80-
kind: reloc.kind,
81-
encoding: RelocationEncoding::Generic,
82-
size: reloc.size * 8,
76+
.add_relocation(
77+
from.0,
78+
Relocation {
79+
offset: u64::from(reloc.offset),
80+
symbol,
81+
flags: RelocationFlags::Generic {
82+
kind: reloc.kind,
83+
encoding: RelocationEncoding::Generic,
84+
size: reloc.size * 8,
85+
},
86+
addend: i64::try_from(symbol_offset).unwrap() + reloc.addend,
8387
},
84-
addend: i64::try_from(symbol_offset).unwrap() + reloc.addend,
85-
})
88+
)
8689
.unwrap();
8790
}
8891
}

Diff for: src/driver/jit.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,15 @@ fn codegen_shim<'tcx>(
342342
let instance_ptr = Box::into_raw(Box::new(inst));
343343

344344
let jit_fn = module
345-
.declare_function("__clif_jit_fn", Linkage::Import, &Signature {
346-
call_conv: module.target_config().default_call_conv,
347-
params: vec![AbiParam::new(pointer_type), AbiParam::new(pointer_type)],
348-
returns: vec![AbiParam::new(pointer_type)],
349-
})
345+
.declare_function(
346+
"__clif_jit_fn",
347+
Linkage::Import,
348+
&Signature {
349+
call_conv: module.target_config().default_call_conv,
350+
params: vec![AbiParam::new(pointer_type), AbiParam::new(pointer_type)],
351+
returns: vec![AbiParam::new(pointer_type)],
352+
},
353+
)
350354
.unwrap();
351355

352356
let context = cached_context;

Diff for: src/inline_asm.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -875,11 +875,15 @@ fn call_inline_asm<'tcx>(
875875

876876
let inline_asm_func = fx
877877
.module
878-
.declare_function(asm_name, Linkage::Import, &Signature {
879-
call_conv: CallConv::SystemV,
880-
params: vec![AbiParam::new(fx.pointer_type)],
881-
returns: vec![],
882-
})
878+
.declare_function(
879+
asm_name,
880+
Linkage::Import,
881+
&Signature {
882+
call_conv: CallConv::SystemV,
883+
params: vec![AbiParam::new(fx.pointer_type)],
884+
returns: vec![],
885+
},
886+
)
883887
.unwrap();
884888
let inline_asm_func = fx.module.declare_func_in_func(inline_asm_func, fx.bcx.func);
885889
if fx.clif_comments.enabled() {

Diff for: src/intrinsics/simd.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,12 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
558558
(sym::simd_round, types::F64) => "round",
559559
_ => unreachable!("{:?}", intrinsic),
560560
};
561-
fx.lib_call(name, vec![AbiParam::new(lane_ty)], vec![AbiParam::new(lane_ty)], &[
562-
lane,
563-
])[0]
561+
fx.lib_call(
562+
name,
563+
vec![AbiParam::new(lane_ty)],
564+
vec![AbiParam::new(lane_ty)],
565+
&[lane],
566+
)[0]
564567
});
565568
}
566569

Diff for: src/main_shim.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ pub(crate) fn maybe_create_entry_wrapper(
1515
is_primary_cgu: bool,
1616
) {
1717
let (main_def_id, sigpipe) = match tcx.entry_fn(()) {
18-
Some((def_id, entry_ty)) => (def_id, match entry_ty {
19-
EntryFnType::Main { sigpipe } => sigpipe,
20-
}),
18+
Some((def_id, entry_ty)) => (
19+
def_id,
20+
match entry_ty {
21+
EntryFnType::Main { sigpipe } => sigpipe,
22+
},
23+
),
2124
None => return,
2225
};
2326

Diff for: src/trap.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ use crate::prelude::*;
55
fn codegen_print(fx: &mut FunctionCx<'_, '_, '_>, msg: &str) {
66
let puts = fx
77
.module
8-
.declare_function("puts", Linkage::Import, &Signature {
9-
call_conv: fx.target_config.default_call_conv,
10-
params: vec![AbiParam::new(fx.pointer_type)],
11-
returns: vec![AbiParam::new(types::I32)],
12-
})
8+
.declare_function(
9+
"puts",
10+
Linkage::Import,
11+
&Signature {
12+
call_conv: fx.target_config.default_call_conv,
13+
params: vec![AbiParam::new(fx.pointer_type)],
14+
returns: vec![AbiParam::new(types::I32)],
15+
},
16+
)
1317
.unwrap();
1418
let puts = fx.module.declare_func_in_func(puts, &mut fx.bcx.func);
1519
if fx.clif_comments.enabled() {

0 commit comments

Comments
 (0)