ccx.tn().val_to_string(llretptr));
let (fn_abi, fn_sig) = match callee_ty.sty {
- ty::TyBareFn(_, ref fn_ty) => (fn_ty.abi, &fn_ty.sig),
+ ty::TyFnDef(_, ref fn_ty) |
+ ty::TyFnPtr(ref fn_ty) => (fn_ty.abi, &fn_ty.sig),
_ => ccx.sess().bug("trans_native_call called on non-function type")
};
let fn_sig = ccx.tcx().erase_late_bound_regions(fn_sig);
abi => {
let ty = ccx.tcx().node_id_to_type(foreign_item.id);
match ty.sty {
- ty::TyBareFn(_, bft) => gate_simd_ffi(ccx.tcx(), &decl, bft),
+ ty::TyFnDef(_, bft) |
+ ty::TyFnPtr(bft) => gate_simd_ffi(ccx.tcx(), &decl, bft),
_ => ccx.tcx().sess.span_bug(foreign_item.span,
"foreign fn's sty isn't a bare_fn_ty?")
}
let tys = foreign_types_for_fn_ty(ccx, t);
let llfn_ty = lltype_for_fn_from_foreign_types(ccx, &tys);
let cconv = match t.sty {
- ty::TyBareFn(_, ref fn_ty) => {
+ ty::TyFnDef(_, ref fn_ty) | ty::TyFnPtr(ref fn_ty) => {
llvm_calling_convention(ccx, fn_ty.abi)
}
_ => panic!("expected bare fn in decl_rust_fn_with_foreign_abi")
let t = ccx.tcx().node_id_to_type(node_id);
let cconv = match t.sty {
- ty::TyBareFn(_, ref fn_ty) => {
+ ty::TyFnDef(_, ref fn_ty) | ty::TyFnPtr(ref fn_ty) => {
llvm_calling_convention(ccx, fn_ty.abi)
}
_ => panic!("expected bare fn in register_rust_fn_with_foreign_abi")
// Compute the type that the function would have if it were just a
// normal Rust function. This will be the type of the wrappee fn.
match t.sty {
- ty::TyBareFn(_, ref f) => {
+ ty::TyFnDef(_, ref f) | ty::TyFnPtr(ref f)=> {
assert!(f.abi != Abi::Rust);
assert!(f.abi != Abi::RustIntrinsic);
assert!(f.abi != Abi::PlatformIntrinsic);
fn foreign_types_for_fn_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
ty: Ty<'tcx>) -> ForeignTypes<'tcx> {
let fn_sig = match ty.sty {
- ty::TyBareFn(_, ref fn_ty) => &fn_ty.sig,
+ ty::TyFnDef(_, ref fn_ty) | ty::TyFnPtr(ref fn_ty) => &fn_ty.sig,
_ => ccx.sess().bug("foreign_types_for_fn_ty called on non-function type")
};
let fn_sig = ccx.tcx().erase_late_bound_regions(fn_sig);