Skip to content

Commit dbee136

Browse files
committed
Rustfmt
1 parent 5b32489 commit dbee136

File tree

4 files changed

+39
-37
lines changed

4 files changed

+39
-37
lines changed

src/base.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ pub(crate) fn codegen_fn<'tcx>(
144144

145145
if let Some(mach_compile_result) = &context.mach_compile_result {
146146
if let Some(disasm) = &mach_compile_result.disasm {
147-
crate::pretty_clif::write_ir_file(tcx, &format!("{}.vcode", tcx.symbol_name(instance).name), |file| {
148-
file.write_all(disasm.as_bytes())
149-
})
147+
crate::pretty_clif::write_ir_file(
148+
tcx,
149+
&format!("{}.vcode", tcx.symbol_name(instance).name),
150+
|file| file.write_all(disasm.as_bytes()),
151+
)
150152
}
151153
}
152154

src/constant.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ fn codegen_static_ref<'tcx>(
100100
let global_ptr = fx.bcx.ins().global_value(fx.pointer_type, local_data_id);
101101
assert!(!layout.is_unsized(), "unsized statics aren't supported");
102102
assert!(
103-
matches!(fx.bcx.func.global_values[local_data_id], GlobalValueData::Symbol { tls: false, ..}),
103+
matches!(
104+
fx.bcx.func.global_values[local_data_id],
105+
GlobalValueData::Symbol { tls: false, .. }
106+
),
104107
"tls static referenced without Rvalue::ThreadLocalRef"
105108
);
106109
CPlace::for_ptr(crate::pointer::Pointer::new(global_ptr), layout)

src/debuginfo/emit.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ impl WriterRelocate {
7474

7575
/// Perform the collected relocations to be usable for JIT usage.
7676
#[cfg(feature = "jit")]
77-
pub(super) fn relocate_for_jit(
78-
mut self,
79-
jit_module: &cranelift_jit::JITModule,
80-
) -> Vec<u8> {
77+
pub(super) fn relocate_for_jit(mut self, jit_module: &cranelift_jit::JITModule) -> Vec<u8> {
8178
use std::convert::TryInto;
8279

8380
for reloc in self.relocs.drain(..) {

src/pretty_clif.rs

+29-29
Original file line numberDiff line numberDiff line change
@@ -246,37 +246,37 @@ pub(crate) fn write_clif_file<'tcx>(
246246
context: &cranelift_codegen::Context,
247247
mut clif_comments: &CommentWriter,
248248
) {
249-
write_ir_file(tcx, &format!(
250-
"{}.{}.clif",
251-
tcx.symbol_name(instance).name,
252-
postfix
253-
), |file| {
254-
let value_ranges = isa.map(|isa| {
255-
context
256-
.build_value_labels_ranges(isa)
257-
.expect("value location ranges")
258-
});
249+
write_ir_file(
250+
tcx,
251+
&format!("{}.{}.clif", tcx.symbol_name(instance).name, postfix),
252+
|file| {
253+
let value_ranges = isa.map(|isa| {
254+
context
255+
.build_value_labels_ranges(isa)
256+
.expect("value location ranges")
257+
});
259258

260-
let mut clif = String::new();
261-
cranelift_codegen::write::decorate_function(
262-
&mut clif_comments,
263-
&mut clif,
264-
&context.func,
265-
&DisplayFunctionAnnotations {
266-
isa: Some(&*crate::build_isa(tcx.sess)),
267-
value_ranges: value_ranges.as_ref(),
268-
},
269-
)
270-
.unwrap();
259+
let mut clif = String::new();
260+
cranelift_codegen::write::decorate_function(
261+
&mut clif_comments,
262+
&mut clif,
263+
&context.func,
264+
&DisplayFunctionAnnotations {
265+
isa: Some(&*crate::build_isa(tcx.sess)),
266+
value_ranges: value_ranges.as_ref(),
267+
},
268+
)
269+
.unwrap();
271270

272-
writeln!(file, "test compile")?;
273-
writeln!(file, "set is_pic")?;
274-
writeln!(file, "set enable_simd")?;
275-
writeln!(file, "target {} haswell", crate::target_triple(tcx.sess))?;
276-
writeln!(file)?;
277-
file.write_all(clif.as_bytes())?;
278-
Ok(())
279-
});
271+
writeln!(file, "test compile")?;
272+
writeln!(file, "set is_pic")?;
273+
writeln!(file, "set enable_simd")?;
274+
writeln!(file, "target {} haswell", crate::target_triple(tcx.sess))?;
275+
writeln!(file)?;
276+
file.write_all(clif.as_bytes())?;
277+
Ok(())
278+
},
279+
);
280280
}
281281

282282
impl<M: Module> fmt::Debug for FunctionCx<'_, '_, M> {

0 commit comments

Comments
 (0)