@@ -58,6 +58,7 @@ use middle::subst::{FnSpace, TypeSpace, SelfSpace, Subst, Substs};
5858use middle:: traits;
5959use middle:: ty:: { self , RegionEscape , Ty , ToPredicate , HasTypeFlags } ;
6060use middle:: ty_fold;
61+ use require_c_abi_if_variadic;
6162use rscope:: { self , UnelidableRscope , RegionScope , ElidableRscope , ExplicitRscope ,
6263 ObjectLifetimeDefaultRscope , ShiftedRscope , BindingRscope ,
6364 ElisionFailureInfo , ElidedLifetime } ;
@@ -1574,10 +1575,7 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
15741575 }
15751576 ast:: TyParen ( ref typ) => ast_ty_to_ty ( this, rscope, & * * typ) ,
15761577 ast:: TyBareFn ( ref bf) => {
1577- if bf. decl . variadic && bf. abi != abi:: C {
1578- span_err ! ( tcx. sess, ast_ty. span, E0045 ,
1579- "variadic function must have C calling convention" ) ;
1580- }
1578+ require_c_abi_if_variadic ( tcx, & bf. decl , bf. abi , ast_ty. span ) ;
15811579 let bare_fn = ty_of_bare_fn ( this, bf. unsafety , bf. abi , & * bf. decl ) ;
15821580 tcx. mk_fn ( None , tcx. mk_bare_fn ( bare_fn) )
15831581 }
0 commit comments