Rustfmt
This commit is contained in:
parent
e99f78af08
commit
41047de9e2
@ -214,10 +214,8 @@ pub(crate) fn get_function_name_and_sig<'tcx>(
|
||||
support_vararg: bool,
|
||||
) -> (String, Signature) {
|
||||
assert!(!inst.substs.needs_infer());
|
||||
let fn_sig = tcx.normalize_erasing_late_bound_regions(
|
||||
ParamEnv::reveal_all(),
|
||||
fn_sig_for_fn_abi(tcx, inst),
|
||||
);
|
||||
let fn_sig = tcx
|
||||
.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), fn_sig_for_fn_abi(tcx, inst));
|
||||
if fn_sig.c_variadic && !support_vararg {
|
||||
tcx.sess.span_fatal(
|
||||
tcx.def_span(inst.def_id()),
|
||||
|
24
src/base.rs
24
src/base.rs
@ -514,7 +514,11 @@ fn codegen_stmt<'tcx>(
|
||||
};
|
||||
lval.write_cvalue(fx, res);
|
||||
}
|
||||
Rvalue::Cast(CastKind::Pointer(PointerCast::ReifyFnPointer), ref operand, to_ty) => {
|
||||
Rvalue::Cast(
|
||||
CastKind::Pointer(PointerCast::ReifyFnPointer),
|
||||
ref operand,
|
||||
to_ty,
|
||||
) => {
|
||||
let from_ty = fx.monomorphize(operand.ty(&fx.mir.local_decls, fx.tcx));
|
||||
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
|
||||
match *from_ty.kind() {
|
||||
@ -535,9 +539,21 @@ fn codegen_stmt<'tcx>(
|
||||
_ => bug!("Trying to ReifyFnPointer on non FnDef {:?}", from_ty),
|
||||
}
|
||||
}
|
||||
Rvalue::Cast(CastKind::Pointer(PointerCast::UnsafeFnPointer), ref operand, to_ty)
|
||||
| Rvalue::Cast(CastKind::Pointer(PointerCast::MutToConstPointer), ref operand, to_ty)
|
||||
| Rvalue::Cast(CastKind::Pointer(PointerCast::ArrayToPointer), ref operand, to_ty) => {
|
||||
Rvalue::Cast(
|
||||
CastKind::Pointer(PointerCast::UnsafeFnPointer),
|
||||
ref operand,
|
||||
to_ty,
|
||||
)
|
||||
| Rvalue::Cast(
|
||||
CastKind::Pointer(PointerCast::MutToConstPointer),
|
||||
ref operand,
|
||||
to_ty,
|
||||
)
|
||||
| Rvalue::Cast(
|
||||
CastKind::Pointer(PointerCast::ArrayToPointer),
|
||||
ref operand,
|
||||
to_ty,
|
||||
) => {
|
||||
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
|
||||
let operand = codegen_operand(fx, operand);
|
||||
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
|
||||
|
Loading…
x
Reference in New Issue
Block a user