about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-09 16:30:57 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-09 21:13:02 -0700
commit3f5e3af8387deb68e116228562062384d4b9cf65 (patch)
tree05de08f24df153aeca9ae620a9e8d8deb28fa768
parent66f4f558cbe1df6a3ceff6c58ed7d994bed17cd5 (diff)
downloadrust-3f5e3af8387deb68e116228562062384d4b9cf65.tar.gz
rust-3f5e3af8387deb68e116228562062384d4b9cf65.zip
Register new snapshots
-rw-r--r--src/libcore/intrinsics.rs4
-rw-r--r--src/libnative/io/net.rs2
-rw-r--r--src/librustc/util/ppaux.rs11
-rw-r--r--src/libstd/fmt/mod.rs26
-rw-r--r--src/libstd/fmt/rt.rs11
-rw-r--r--src/libstd/reflect.rs4
-rw-r--r--src/libstd/repr.rs4
-rw-r--r--src/libstd/rt/thread.rs2
-rw-r--r--src/libsyntax/parse/parser.rs6
-rw-r--r--src/libsyntax/print/pprust.rs4
-rw-r--r--src/snapshots.txt8
-rw-r--r--src/test/compile-fail/variadic-ffi.rs10
-rw-r--r--src/test/run-pass/fn-abi.rs2
-rw-r--r--src/test/run-pass/reflect-visit-type.rs4
-rw-r--r--src/test/run-pass/variadic-ffi.rs4
15 files changed, 33 insertions, 69 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index d7a277d3b6b..2828c9bdc23 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -137,7 +137,7 @@ pub trait TyVisitor {
                        sz: uint, align: uint) -> bool;
 
     fn visit_enter_enum(&mut self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         sz: uint, align: uint) -> bool;
     fn visit_enter_enum_variant(&mut self, variant: uint,
                                 disr_val: Disr,
@@ -149,7 +149,7 @@ pub trait TyVisitor {
                                 n_fields: uint,
                                 name: &str) -> bool;
     fn visit_leave_enum(&mut self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         sz: uint, align: uint) -> bool;
 
     fn visit_enter_fn(&mut self, purity: uint, proto: uint,
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs
index 63d57756e5d..218f8a4ef49 100644
--- a/src/libnative/io/net.rs
+++ b/src/libnative/io/net.rs
@@ -149,7 +149,7 @@ fn last_error() -> io::IoError {
 #[cfg(unix)]    unsafe fn close(sock: sock_t) { let _ = libc::close(sock); }
 
 fn sockname(fd: sock_t,
-            f: extern "system" unsafe fn(sock_t, *mut libc::sockaddr,
+            f: unsafe extern "system" fn(sock_t, *mut libc::sockaddr,
                                          *mut libc::socklen_t) -> libc::c_int)
     -> IoResult<ip::SocketAddr>
 {
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs
index 1808c0209b7..71ef3f87cbc 100644
--- a/src/librustc/util/ppaux.rs
+++ b/src/librustc/util/ppaux.rs
@@ -236,12 +236,7 @@ pub fn ty_to_str(cx: &ctxt, typ: t) -> ~str {
                       ident: Option<ast::Ident>,
                       sig: &ty::FnSig)
                       -> ~str {
-        let mut s = if abi == abi::Rust {
-            StrBuf::new()
-        } else {
-            StrBuf::from_owned_str(format!("extern {} ", abi.to_str()))
-        };
-
+        let mut s = StrBuf::new();
         match fn_style {
             ast::NormalFn => {}
             _ => {
@@ -250,6 +245,10 @@ pub fn ty_to_str(cx: &ctxt, typ: t) -> ~str {
             }
         };
 
+        if abi != abi::Rust {
+            s.push_str(format!("extern {} ", abi.to_str()));
+        };
+
         s.push_str("fn");
 
         match ident {
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs
index 8846fa3f6f3..7363593bacf 100644
--- a/src/libstd/fmt/mod.rs
+++ b/src/libstd/fmt/mod.rs
@@ -512,32 +512,6 @@ pub use self::num::RadixFmt;
 mod num;
 pub mod rt;
 
-#[cfg(stage0)]
-#[allow(missing_doc)]
-pub mod parse {
-    #[deriving(Eq)]
-    pub enum Alignment {
-        AlignLeft,
-        AlignRight,
-        AlignUnknown,
-    }
-
-    pub enum PluralKeyword {
-        Zero,
-        One,
-        Two,
-        Few,
-        Many,
-    }
-
-    pub enum Flag {
-        FlagSignPlus,
-        FlagSignMinus,
-        FlagAlternate,
-        FlagSignAwareZeroPad,
-    }
-}
-
 pub type Result = io::IoResult<()>;
 
 /// A struct to represent both where to emit formatting strings to and how they
diff --git a/src/libstd/fmt/rt.rs b/src/libstd/fmt/rt.rs
index 33e86a4485b..00c8661c8e3 100644
--- a/src/libstd/fmt/rt.rs
+++ b/src/libstd/fmt/rt.rs
@@ -19,15 +19,6 @@
 
 use option::Option;
 
-#[cfg(stage0)]
-pub use fmt::parse::{Alignment, AlignLeft, AlignRight, AlignUnknown};
-#[cfg(stage0)]
-pub use fmt::parse::{PluralKeyword, Zero, One, Two, Few, Many};
-#[cfg(stage0)]
-pub use fmt::parse::{Flag, FlagSignPlus, FlagSignMinus, FlagSignAwareZeroPad};
-#[cfg(stage0)]
-pub use fmt::parse::{FlagAlternate};
-
 pub enum Piece<'a> {
     String(&'a str),
     // FIXME(#8259): this shouldn't require the unit-value here
@@ -49,7 +40,6 @@ pub struct FormatSpec {
     pub width: Count,
 }
 
-#[cfg(not(stage0))]
 #[deriving(Eq)]
 pub enum Alignment {
     AlignLeft,
@@ -65,7 +55,6 @@ pub enum Position {
     ArgumentNext, ArgumentIs(uint)
 }
 
-#[cfg(not(stage0))]
 pub enum Flag {
     FlagSignPlus,
     FlagSignMinus,
diff --git a/src/libstd/reflect.rs b/src/libstd/reflect.rs
index ec7b6cfa355..02535ccee51 100644
--- a/src/libstd/reflect.rs
+++ b/src/libstd/reflect.rs
@@ -367,7 +367,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
     }
 
     fn visit_enter_enum(&mut self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         sz: uint, align: uint)
                      -> bool {
         self.align(align);
@@ -408,7 +408,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
     }
 
     fn visit_leave_enum(&mut self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         sz: uint, align: uint) -> bool {
         if ! self.inner.visit_leave_enum(n_variants, get_disr, sz, align) {
             return false;
diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs
index 35c5cbc85c3..6e47203b56c 100644
--- a/src/libstd/repr.rs
+++ b/src/libstd/repr.rs
@@ -464,7 +464,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
 
     fn visit_enter_enum(&mut self,
                         _n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         _sz: uint,
                         _align: uint) -> bool {
         let disr = unsafe {
@@ -538,7 +538,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
 
     fn visit_leave_enum(&mut self,
                         _n_variants: uint,
-                        _get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        _get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         _sz: uint,
                         _align: uint)
                         -> bool {
diff --git a/src/libstd/rt/thread.rs b/src/libstd/rt/thread.rs
index bc9a0b3460a..89d44473a94 100644
--- a/src/libstd/rt/thread.rs
+++ b/src/libstd/rt/thread.rs
@@ -294,7 +294,7 @@ mod imp {
     #[cfg(target_os = "linux")]
     fn min_stack_size(attr: *libc::pthread_attr_t) -> libc::size_t {
         use ptr::RawPtr;
-        type F = extern "C" unsafe fn(*libc::pthread_attr_t) -> libc::size_t;
+        type F = unsafe extern "C" fn(*libc::pthread_attr_t) -> libc::size_t;
         extern {
             #[linkage = "extern_weak"]
             static __pthread_get_minstack: *();
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 8f3b77dd58c..46a8960c3be 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -907,12 +907,6 @@ impl<'a> Parser<'a> {
             abi::Rust
         };
 
-        // NOTE: remove after a stage0 snapshot
-        let fn_style = match self.parse_unsafety() {
-            UnsafeFn => UnsafeFn,
-            NormalFn => fn_style,
-        };
-
         self.expect_keyword(keywords::Fn);
         let (decl, lifetimes) = self.parse_ty_fn_decl(true);
         return TyBareFn(@BareFnTy {
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 510ec2a370f..8486a8aeb35 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -2087,13 +2087,13 @@ impl<'a> State<'a> {
         if opt_sigil == Some('~') && onceness == ast::Once {
             try!(word(&mut self.s, "proc"));
         } else if opt_sigil == Some('&') {
-            try!(self.print_extern_opt_abi(opt_abi));
             try!(self.print_fn_style(fn_style));
+            try!(self.print_extern_opt_abi(opt_abi));
             try!(self.print_onceness(onceness));
         } else {
             assert!(opt_sigil.is_none());
-            try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
             try!(self.print_fn_style(fn_style));
+            try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
             try!(self.print_onceness(onceness));
             try!(word(&mut self.s, "fn"));
         }
diff --git a/src/snapshots.txt b/src/snapshots.txt
index 3dbbf47d56b..7abfee775df 100644
--- a/src/snapshots.txt
+++ b/src/snapshots.txt
@@ -1,3 +1,11 @@
+S 2014-05-09 47ecc2e
+  freebsd-x86_64 5c085972690e1f9412c3c0c7ec64f6b148fe04fd
+  linux-i386 690d2e310c025f10c54b1f2b9f32c65ea34575ed
+  linux-x86_64 b869118e628589d6546a4716c91e1a41952f294c
+  macos-i386 29a044bdd539355fde013797d600bb70c9d05009
+  macos-x86_64 b88ce60be4f70b014669103cb39c8f65814ae311
+  winnt-i386 0da39548596d0596c1c9fb98382c5225d36f4b44
+
 S 2014-05-06 24f6f26
   freebsd-x86_64 cebcfcece5676c9aea30241bf13c517ffdb37b7c
   linux-i386 e9960c7c793ff7ae87c9d30c88cfedf7e40345f7
diff --git a/src/test/compile-fail/variadic-ffi.rs b/src/test/compile-fail/variadic-ffi.rs
index d0599c2ba4b..aa58d2e08e9 100644
--- a/src/test/compile-fail/variadic-ffi.rs
+++ b/src/test/compile-fail/variadic-ffi.rs
@@ -23,13 +23,13 @@ fn main() {
         foo(); //~ ERROR: this function takes at least 2 parameters but 0 parameters were supplied
         foo(1); //~ ERROR: this function takes at least 2 parameters but 1 parameter was supplied
 
-        let x: extern "C" unsafe fn(f: int, x: u8) = foo;
-        //~^ ERROR: mismatched types: expected `extern "C" unsafe fn(int, u8)`
-        //          but found `extern "C" unsafe fn(int, u8, ...)`
+        let x: unsafe extern "C" fn(f: int, x: u8) = foo;
+        //~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8)`
+        //          but found `unsafe extern "C" fn(int, u8, ...)`
         //          (expected non-variadic fn but found variadic function)
 
-        let y: extern "C" unsafe fn(f: int, x: u8, ...) = bar;
-        //~^ ERROR: mismatched types: expected `extern "C" unsafe fn(int, u8, ...)`
+        let y: unsafe extern "C" fn(f: int, x: u8, ...) = bar;
+        //~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8, ...)`
         //          but found `extern "C" extern fn(int, u8)`
         //          (expected variadic fn but found non-variadic function)
 
diff --git a/src/test/run-pass/fn-abi.rs b/src/test/run-pass/fn-abi.rs
index 7d7c1a56030..0bbd5ecdc3f 100644
--- a/src/test/run-pass/fn-abi.rs
+++ b/src/test/run-pass/fn-abi.rs
@@ -17,5 +17,5 @@ extern {
 
 pub fn main() {
     // Will only type check if the type of _p and the decl of printf use the same ABI
-    let _p: extern unsafe fn() = printf;
+    let _p: unsafe extern fn() = printf;
 }
diff --git a/src/test/run-pass/reflect-visit-type.rs b/src/test/run-pass/reflect-visit-type.rs
index e3ad5f1e40f..a131b21957d 100644
--- a/src/test/run-pass/reflect-visit-type.rs
+++ b/src/test/run-pass/reflect-visit-type.rs
@@ -106,7 +106,7 @@ impl TyVisitor for MyVisitor {
                        _sz: uint, _align: uint) -> bool { true }
 
     fn visit_enter_enum(&mut self, _n_variants: uint,
-                        _get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        _get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         _sz: uint, _align: uint) -> bool { true }
     fn visit_enter_enum_variant(&mut self,
                                 _variant: uint,
@@ -122,7 +122,7 @@ impl TyVisitor for MyVisitor {
                                 _name: &str) -> bool { true }
     fn visit_leave_enum(&mut self,
                         _n_variants: uint,
-                        _get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
+                        _get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
                         _sz: uint, _align: uint) -> bool { true }
 
     fn visit_enter_fn(&mut self, _purity: uint, _proto: uint,
diff --git a/src/test/run-pass/variadic-ffi.rs b/src/test/run-pass/variadic-ffi.rs
index 903b76a29ce..c6a1654bfe4 100644
--- a/src/test/run-pass/variadic-ffi.rs
+++ b/src/test/run-pass/variadic-ffi.rs
@@ -41,10 +41,10 @@ pub fn main() {
         });
 
         // Make a function pointer
-        let x: extern "C" unsafe fn(*mut c_char, *c_char, ...) -> c_int = sprintf;
+        let x: unsafe extern "C" fn(*mut c_char, *c_char, ...) -> c_int = sprintf;
 
         // A function that takes a function pointer
-        unsafe fn call(p: extern "C" unsafe fn(*mut c_char, *c_char, ...) -> c_int) {
+        unsafe fn call(p: unsafe extern "C" fn(*mut c_char, *c_char, ...) -> c_int) {
             // Call with just the named parameter via fn pointer
             "Hello World\n".with_c_str(|c| {
                 check("Hello World\n", |s| p(s, c));