]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/lib.rs
move projection mode into parameter environment
[rust.git] / src / librustc_typeck / lib.rs
index 99ee1cff7fd22ab9c2883eb49ac6346931c71c89..91dec958a161c02f3ba6a79245650b2b78c6a830 100644 (file)
 
 #![allow(non_camel_case_types)]
 
+#![feature(advanced_slice_patterns)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(conservative_impl_trait)]
-#![feature(loop_break_value)]
 #![feature(never_type)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
+#![feature(slice_patterns)]
 
 #![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
 #![cfg_attr(stage0, feature(rustc_private))]
 #![cfg_attr(stage0, feature(staged_api))]
+#![cfg_attr(stage0, feature(loop_break_value))]
 
 #[macro_use] extern crate log;
 #[macro_use] extern crate syntax;
@@ -141,11 +143,10 @@ fn require_c_abi_if_variadic(tcx: TyCtxt,
                              decl: &hir::FnDecl,
                              abi: Abi,
                              span: Span) {
-    if decl.variadic && abi != Abi::C {
+    if decl.variadic && !(abi == Abi::C || abi == Abi::Cdecl) {
         let mut err = struct_span_err!(tcx.sess, span, E0045,
-                  "variadic function must have C calling convention");
-        err.span_label(span, "variadics require C calling conventions")
-            .emit();
+                  "variadic function must have C or cdecl calling convention");
+        err.span_label(span, "variadics require C or cdecl calling convention").emit();
     }
 }
 
@@ -154,7 +155,7 @@ fn require_same_types<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                 expected: Ty<'tcx>,
                                 actual: Ty<'tcx>)
                                 -> bool {
-    tcx.infer_ctxt((), Reveal::UserFacing).enter(|ref infcx| {
+    tcx.infer_ctxt(Reveal::UserFacing).enter(|ref infcx| {
         let mut fulfill_cx = FulfillmentContext::new();
         match infcx.eq_types(false, &cause, expected, actual) {
             Ok(InferOk { obligations, .. }) => {