Skip to content

Commit 3f5e3af

Browse files
committed
Register new snapshots
1 parent 66f4f55 commit 3f5e3af

File tree

15 files changed

+33
-69
lines changed

15 files changed

+33
-69
lines changed

src/libcore/intrinsics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub trait TyVisitor {
137137
sz: uint, align: uint) -> bool;
138138

139139
fn visit_enter_enum(&mut self, n_variants: uint,
140-
get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
140+
get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
141141
sz: uint, align: uint) -> bool;
142142
fn visit_enter_enum_variant(&mut self, variant: uint,
143143
disr_val: Disr,
@@ -149,7 +149,7 @@ pub trait TyVisitor {
149149
n_fields: uint,
150150
name: &str) -> bool;
151151
fn visit_leave_enum(&mut self, n_variants: uint,
152-
get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
152+
get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
153153
sz: uint, align: uint) -> bool;
154154

155155
fn visit_enter_fn(&mut self, purity: uint, proto: uint,

src/libnative/io/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn last_error() -> io::IoError {
149149
#[cfg(unix)] unsafe fn close(sock: sock_t) { let _ = libc::close(sock); }
150150

151151
fn sockname(fd: sock_t,
152-
f: extern "system" unsafe fn(sock_t, *mut libc::sockaddr,
152+
f: unsafe extern "system" fn(sock_t, *mut libc::sockaddr,
153153
*mut libc::socklen_t) -> libc::c_int)
154154
-> IoResult<ip::SocketAddr>
155155
{

src/librustc/util/ppaux.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,7 @@ pub fn ty_to_str(cx: &ctxt, typ: t) -> ~str {
236236
ident: Option<ast::Ident>,
237237
sig: &ty::FnSig)
238238
-> ~str {
239-
let mut s = if abi == abi::Rust {
240-
StrBuf::new()
241-
} else {
242-
StrBuf::from_owned_str(format!("extern {} ", abi.to_str()))
243-
};
244-
239+
let mut s = StrBuf::new();
245240
match fn_style {
246241
ast::NormalFn => {}
247242
_ => {
@@ -250,6 +245,10 @@ pub fn ty_to_str(cx: &ctxt, typ: t) -> ~str {
250245
}
251246
};
252247

248+
if abi != abi::Rust {
249+
s.push_str(format!("extern {} ", abi.to_str()));
250+
};
251+
253252
s.push_str("fn");
254253

255254
match ident {

src/libstd/fmt/mod.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -512,32 +512,6 @@ pub use self::num::RadixFmt;
512512
mod num;
513513
pub mod rt;
514514

515-
#[cfg(stage0)]
516-
#[allow(missing_doc)]
517-
pub mod parse {
518-
#[deriving(Eq)]
519-
pub enum Alignment {
520-
AlignLeft,
521-
AlignRight,
522-
AlignUnknown,
523-
}
524-
525-
pub enum PluralKeyword {
526-
Zero,
527-
One,
528-
Two,
529-
Few,
530-
Many,
531-
}
532-
533-
pub enum Flag {
534-
FlagSignPlus,
535-
FlagSignMinus,
536-
FlagAlternate,
537-
FlagSignAwareZeroPad,
538-
}
539-
}
540-
541515
pub type Result = io::IoResult<()>;
542516

543517
/// A struct to represent both where to emit formatting strings to and how they

src/libstd/fmt/rt.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919

2020
use option::Option;
2121

22-
#[cfg(stage0)]
23-
pub use fmt::parse::{Alignment, AlignLeft, AlignRight, AlignUnknown};
24-
#[cfg(stage0)]
25-
pub use fmt::parse::{PluralKeyword, Zero, One, Two, Few, Many};
26-
#[cfg(stage0)]
27-
pub use fmt::parse::{Flag, FlagSignPlus, FlagSignMinus, FlagSignAwareZeroPad};
28-
#[cfg(stage0)]
29-
pub use fmt::parse::{FlagAlternate};
30-
3122
pub enum Piece<'a> {
3223
String(&'a str),
3324
// FIXME(#8259): this shouldn't require the unit-value here
@@ -49,7 +40,6 @@ pub struct FormatSpec {
4940
pub width: Count,
5041
}
5142

52-
#[cfg(not(stage0))]
5343
#[deriving(Eq)]
5444
pub enum Alignment {
5545
AlignLeft,
@@ -65,7 +55,6 @@ pub enum Position {
6555
ArgumentNext, ArgumentIs(uint)
6656
}
6757

68-
#[cfg(not(stage0))]
6958
pub enum Flag {
7059
FlagSignPlus,
7160
FlagSignMinus,

src/libstd/reflect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
367367
}
368368

369369
fn visit_enter_enum(&mut self, n_variants: uint,
370-
get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
370+
get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
371371
sz: uint, align: uint)
372372
-> bool {
373373
self.align(align);
@@ -408,7 +408,7 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
408408
}
409409

410410
fn visit_leave_enum(&mut self, n_variants: uint,
411-
get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
411+
get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
412412
sz: uint, align: uint) -> bool {
413413
if ! self.inner.visit_leave_enum(n_variants, get_disr, sz, align) {
414414
return false;

src/libstd/repr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
464464

465465
fn visit_enter_enum(&mut self,
466466
_n_variants: uint,
467-
get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
467+
get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
468468
_sz: uint,
469469
_align: uint) -> bool {
470470
let disr = unsafe {
@@ -538,7 +538,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
538538

539539
fn visit_leave_enum(&mut self,
540540
_n_variants: uint,
541-
_get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
541+
_get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
542542
_sz: uint,
543543
_align: uint)
544544
-> bool {

src/libstd/rt/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ mod imp {
294294
#[cfg(target_os = "linux")]
295295
fn min_stack_size(attr: *libc::pthread_attr_t) -> libc::size_t {
296296
use ptr::RawPtr;
297-
type F = extern "C" unsafe fn(*libc::pthread_attr_t) -> libc::size_t;
297+
type F = unsafe extern "C" fn(*libc::pthread_attr_t) -> libc::size_t;
298298
extern {
299299
#[linkage = "extern_weak"]
300300
static __pthread_get_minstack: *();

src/libsyntax/parse/parser.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -907,12 +907,6 @@ impl<'a> Parser<'a> {
907907
abi::Rust
908908
};
909909

910-
// NOTE: remove after a stage0 snapshot
911-
let fn_style = match self.parse_unsafety() {
912-
UnsafeFn => UnsafeFn,
913-
NormalFn => fn_style,
914-
};
915-
916910
self.expect_keyword(keywords::Fn);
917911
let (decl, lifetimes) = self.parse_ty_fn_decl(true);
918912
return TyBareFn(@BareFnTy {

src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,13 +2087,13 @@ impl<'a> State<'a> {
20872087
if opt_sigil == Some('~') && onceness == ast::Once {
20882088
try!(word(&mut self.s, "proc"));
20892089
} else if opt_sigil == Some('&') {
2090-
try!(self.print_extern_opt_abi(opt_abi));
20912090
try!(self.print_fn_style(fn_style));
2091+
try!(self.print_extern_opt_abi(opt_abi));
20922092
try!(self.print_onceness(onceness));
20932093
} else {
20942094
assert!(opt_sigil.is_none());
2095-
try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
20962095
try!(self.print_fn_style(fn_style));
2096+
try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
20972097
try!(self.print_onceness(onceness));
20982098
try!(word(&mut self.s, "fn"));
20992099
}

src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2014-05-09 47ecc2e
2+
freebsd-x86_64 5c085972690e1f9412c3c0c7ec64f6b148fe04fd
3+
linux-i386 690d2e310c025f10c54b1f2b9f32c65ea34575ed
4+
linux-x86_64 b869118e628589d6546a4716c91e1a41952f294c
5+
macos-i386 29a044bdd539355fde013797d600bb70c9d05009
6+
macos-x86_64 b88ce60be4f70b014669103cb39c8f65814ae311
7+
winnt-i386 0da39548596d0596c1c9fb98382c5225d36f4b44
8+
19
S 2014-05-06 24f6f26
210
freebsd-x86_64 cebcfcece5676c9aea30241bf13c517ffdb37b7c
311
linux-i386 e9960c7c793ff7ae87c9d30c88cfedf7e40345f7

src/test/compile-fail/variadic-ffi.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ fn main() {
2323
foo(); //~ ERROR: this function takes at least 2 parameters but 0 parameters were supplied
2424
foo(1); //~ ERROR: this function takes at least 2 parameters but 1 parameter was supplied
2525

26-
let x: extern "C" unsafe fn(f: int, x: u8) = foo;
27-
//~^ ERROR: mismatched types: expected `extern "C" unsafe fn(int, u8)`
28-
// but found `extern "C" unsafe fn(int, u8, ...)`
26+
let x: unsafe extern "C" fn(f: int, x: u8) = foo;
27+
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8)`
28+
// but found `unsafe extern "C" fn(int, u8, ...)`
2929
// (expected non-variadic fn but found variadic function)
3030

31-
let y: extern "C" unsafe fn(f: int, x: u8, ...) = bar;
32-
//~^ ERROR: mismatched types: expected `extern "C" unsafe fn(int, u8, ...)`
31+
let y: unsafe extern "C" fn(f: int, x: u8, ...) = bar;
32+
//~^ ERROR: mismatched types: expected `unsafe extern "C" fn(int, u8, ...)`
3333
// but found `extern "C" extern fn(int, u8)`
3434
// (expected variadic fn but found non-variadic function)
3535

src/test/run-pass/fn-abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ extern {
1717

1818
pub fn main() {
1919
// Will only type check if the type of _p and the decl of printf use the same ABI
20-
let _p: extern unsafe fn() = printf;
20+
let _p: unsafe extern fn() = printf;
2121
}

src/test/run-pass/reflect-visit-type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl TyVisitor for MyVisitor {
106106
_sz: uint, _align: uint) -> bool { true }
107107

108108
fn visit_enter_enum(&mut self, _n_variants: uint,
109-
_get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
109+
_get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
110110
_sz: uint, _align: uint) -> bool { true }
111111
fn visit_enter_enum_variant(&mut self,
112112
_variant: uint,
@@ -122,7 +122,7 @@ impl TyVisitor for MyVisitor {
122122
_name: &str) -> bool { true }
123123
fn visit_leave_enum(&mut self,
124124
_n_variants: uint,
125-
_get_disr: extern unsafe fn(ptr: *Opaque) -> Disr,
125+
_get_disr: unsafe extern fn(ptr: *Opaque) -> Disr,
126126
_sz: uint, _align: uint) -> bool { true }
127127

128128
fn visit_enter_fn(&mut self, _purity: uint, _proto: uint,

src/test/run-pass/variadic-ffi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ pub fn main() {
4141
});
4242

4343
// Make a function pointer
44-
let x: extern "C" unsafe fn(*mut c_char, *c_char, ...) -> c_int = sprintf;
44+
let x: unsafe extern "C" fn(*mut c_char, *c_char, ...) -> c_int = sprintf;
4545

4646
// A function that takes a function pointer
47-
unsafe fn call(p: extern "C" unsafe fn(*mut c_char, *c_char, ...) -> c_int) {
47+
unsafe fn call(p: unsafe extern "C" fn(*mut c_char, *c_char, ...) -> c_int) {
4848
// Call with just the named parameter via fn pointer
4949
"Hello World\n".with_c_str(|c| {
5050
check("Hello World\n", |s| p(s, c));

0 commit comments

Comments
 (0)