Skip to content

Commit 41047de

Browse files
committed
Rustfmt
1 parent e99f78a commit 41047de

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

src/abi/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,8 @@ pub(crate) fn get_function_name_and_sig<'tcx>(
214214
support_vararg: bool,
215215
) -> (String, Signature) {
216216
assert!(!inst.substs.needs_infer());
217-
let fn_sig = tcx.normalize_erasing_late_bound_regions(
218-
ParamEnv::reveal_all(),
219-
fn_sig_for_fn_abi(tcx, inst),
220-
);
217+
let fn_sig = tcx
218+
.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), fn_sig_for_fn_abi(tcx, inst));
221219
if fn_sig.c_variadic && !support_vararg {
222220
tcx.sess.span_fatal(
223221
tcx.def_span(inst.def_id()),

src/base.rs

+20-4
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,11 @@ fn codegen_stmt<'tcx>(
514514
};
515515
lval.write_cvalue(fx, res);
516516
}
517-
Rvalue::Cast(CastKind::Pointer(PointerCast::ReifyFnPointer), ref operand, to_ty) => {
517+
Rvalue::Cast(
518+
CastKind::Pointer(PointerCast::ReifyFnPointer),
519+
ref operand,
520+
to_ty,
521+
) => {
518522
let from_ty = fx.monomorphize(operand.ty(&fx.mir.local_decls, fx.tcx));
519523
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
520524
match *from_ty.kind() {
@@ -535,9 +539,21 @@ fn codegen_stmt<'tcx>(
535539
_ => bug!("Trying to ReifyFnPointer on non FnDef {:?}", from_ty),
536540
}
537541
}
538-
Rvalue::Cast(CastKind::Pointer(PointerCast::UnsafeFnPointer), ref operand, to_ty)
539-
| Rvalue::Cast(CastKind::Pointer(PointerCast::MutToConstPointer), ref operand, to_ty)
540-
| Rvalue::Cast(CastKind::Pointer(PointerCast::ArrayToPointer), ref operand, to_ty) => {
542+
Rvalue::Cast(
543+
CastKind::Pointer(PointerCast::UnsafeFnPointer),
544+
ref operand,
545+
to_ty,
546+
)
547+
| Rvalue::Cast(
548+
CastKind::Pointer(PointerCast::MutToConstPointer),
549+
ref operand,
550+
to_ty,
551+
)
552+
| Rvalue::Cast(
553+
CastKind::Pointer(PointerCast::ArrayToPointer),
554+
ref operand,
555+
to_ty,
556+
) => {
541557
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
542558
let operand = codegen_operand(fx, operand);
543559
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));

0 commit comments

Comments
 (0)