Skip to content

Register new snapshots #14073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/libnative/io/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
{
Expand Down
11 changes: 5 additions & 6 deletions src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {}
_ => {
Expand All @@ -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 {
Expand Down
26 changes: 0 additions & 26 deletions src/libstd/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions src/libstd/fmt/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,7 +40,6 @@ pub struct FormatSpec {
pub width: Count,
}

#[cfg(not(stage0))]
#[deriving(Eq)]
pub enum Alignment {
AlignLeft,
Expand All @@ -65,7 +55,6 @@ pub enum Position {
ArgumentNext, ArgumentIs(uint)
}

#[cfg(not(stage0))]
pub enum Flag {
FlagSignPlus,
FlagSignMinus,
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: *();
Expand Down
6 changes: 0 additions & 6 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
8 changes: 8 additions & 0 deletions src/snapshots.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/test/compile-fail/variadic-ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/fn-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/test/run-pass/reflect-visit-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/variadic-ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down