]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/lib.rs
Auto merge of #27032 - Gankro:tarpl, r=aturon,acrichto,arielb,pnkfelix,nrc,nmatsakis...
[rust.git] / src / librustc_typeck / lib.rs
index 4260791e38458ab9aa8a503e917358be710cd5ca..9c0e121e156f9ea3259e68516b517587d4035050 100644 (file)
@@ -176,6 +176,16 @@ fn lookup_full_def(tcx: &ty::ctxt, sp: Span, id: ast::NodeId) -> def::Def {
     }
 }
 
+fn require_c_abi_if_variadic(tcx: &ty::ctxt,
+                             decl: &ast::FnDecl,
+                             abi: abi::Abi,
+                             span: Span) {
+    if decl.variadic && abi != abi::C {
+        span_err!(tcx.sess, span, E0045,
+                  "variadic function must have C calling convention");
+    }
+}
+
 fn require_same_types<'a, 'tcx, M>(tcx: &ty::ctxt<'tcx>,
                                    maybe_infcx: Option<&infer::InferCtxt<'a, 'tcx>>,
                                    t1_is_expected: bool,