// feature gate SIMD types in FFI, since I (huonw) am not sure the
// ABIs are handled at all correctly.
feature gate SIMD types in FFI, since I (huonw) am not sure the
ABIs are handled at all correctly.
feature gate SIMD types in FFI since I ( huonw ) am not sure the ABIs are handled at all correctly .
fn gate_simd_ffi(tcx: &ty::ctxt, decl: &hir::FnDecl, ty: &ty::BareFnTy) {
    if !tcx.sess.features.borrow().simd_ffi {
        let check = |ast_ty: &hir::Ty, ty: ty::Ty| {
            if ty.is_simd() {
                tcx.sess.span_err(ast_ty.span,
                              &format!("use of SIMD type `{}` in FFI is highly experimental and \
                                        may result in invalid code",
                                       pprust::ty_to_string(ast_ty)));
                tcx.sess.fileline_help(ast_ty.span,
                                   "add #![feature(simd_ffi)] to the crate attributes to enable");
            }
        };
        let sig = &ty.sig.0;
        for (input, ty) in decl.inputs.iter().zip(&sig.inputs) {
            check(&*input.ty, *ty)
        }
        if let hir::Return(ref ty) = decl.output {
            check(&**ty, sig.output.unwrap())
        }
    }
}
fn gate_simd_ffi ( tcx : & ty :: ctxt , decl : & hir :: FnDecl , ty : & ty :: BareFnTy ) { if ! tcx . sess . features . borrow ( ) . simd_ffi { let check = | ast_ty : & hir :: Ty , ty : ty :: Ty | { if ty . is_simd ( ) { tcx . sess . span_err ( ast_ty . span , & format ! ( " \
 " pprust ty_to_string ( ast_ty ) ) ) ; tcx . sess . fileline_help ( ast_ty . span , " " ) ; } } ; let sig = & ty . sig . 0 ; for ( input , ty ) in decl . inputs . iter ( ) . zip ( & sig . inputs ) { check ( & * input . ty , * ty ) } if let hir :: Return ( ref ty ) = decl . output { check ( & * * ty , sig . output . unwrap ( ) ) } } }
feature gate SIMD types in FFI, since I (huonw) am not sure the
ABIs are handled at all correctly.
feature gate SIMD types in FFI since I ( huonw ) am not sure the ABIs are handled at all correctly .
tcx
&ty::ctxt
decl
&hir::FnDecl
ty
&ty::BareFnTy