Skip to content

Register new snapshots #14900

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

Merged
merged 1 commit into from
Jun 16, 2014
Merged
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/doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2518,8 +2518,8 @@ valid types:
trait Foo {}
trait Bar<T> {}

fn sendable_foo(f: Box<Foo:Send>) { /* ... */ }
fn shareable_bar<T: Share>(b: &Bar<T>: Share) { /* ... */ }
fn sendable_foo(f: Box<Foo + Send>) { /* ... */ }
fn shareable_bar<T: Share>(b: &Bar<T> + Share) { /* ... */ }
~~~

When no colon is specified (such as the type `~Foo`), it is inferred that the
Expand Down
14 changes: 0 additions & 14 deletions src/libcollections/bitv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,20 +842,6 @@ impl cmp::PartialEq for BitvSet {
}

impl fmt::Show for BitvSet {
#[cfg(stage0)]
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
try!(write!(fmt, r"\{"));
let mut first = true;
for n in self.iter() {
if !first {
try!(write!(fmt, ", "));
}
try!(write!(fmt, "{}", n));
first = false;
}
write!(fmt, r"\}")
}
#[cfg(not(stage0))]
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
try!(write!(fmt, "{{"));
let mut first = true;
Expand Down
12 changes: 0 additions & 12 deletions src/libcollections/smallintmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,6 @@ impl<V:Clone> SmallIntMap<V> {
}

impl<V: fmt::Show> fmt::Show for SmallIntMap<V> {
#[cfg(stage0)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, r"\{"));

for (i, (k, v)) in self.iter().enumerate() {
if i != 0 { try!(write!(f, ", ")); }
try!(write!(f, "{}: {}", k, *v));
}

write!(f, r"\}")
}
#[cfg(not(stage0))]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "{{"));

Expand Down
24 changes: 0 additions & 24 deletions src/libcollections/treemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ impl<K: PartialOrd + Ord, V: PartialOrd> PartialOrd for TreeMap<K, V> {
}

impl<K: Ord + Show, V: Show> Show for TreeMap<K, V> {
#[cfg(stage0)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, r"\{"));

for (i, (k, v)) in self.iter().enumerate() {
if i != 0 { try!(write!(f, ", ")); }
try!(write!(f, "{}: {}", *k, *v));
}

write!(f, r"\}")
}
#[cfg(not(stage0))]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "{{"));

Expand Down Expand Up @@ -586,18 +574,6 @@ impl<T: PartialOrd + Ord> PartialOrd for TreeSet<T> {
}

impl<T: Ord + Show> Show for TreeSet<T> {
#[cfg(stage0)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, r"\{"));

for (i, x) in self.iter().enumerate() {
if i != 0 { try!(write!(f, ", ")); }
try!(write!(f, "{}", *x));
}

write!(f, r"\}")
}
#[cfg(not(stage0))]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "{{"));

Expand Down
5 changes: 0 additions & 5 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,6 @@ impl Show for () {
}

impl<T: Copy + Show> Show for Cell<T> {
#[cfg(stage0)]
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, r"Cell \{ value: {} \}", self.get())
}
#[cfg(not(stage0))]
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "Cell {{ value: {} }}", self.get())
}
Expand Down
5 changes: 0 additions & 5 deletions src/libcore/fmt/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
//! these can be statically allocated and are slightly optimized for the runtime


#[cfg(stage0)]
use option::Option;

#[doc(hidden)]
pub enum Piece<'a> {
String(&'a str),
Expand All @@ -28,8 +25,6 @@ pub enum Piece<'a> {
pub struct Argument<'a> {
pub position: Position,
pub format: FormatSpec,
#[cfg(stage0)]
pub method: Option<uint>,
}

#[doc(hidden)]
Expand Down
8 changes: 0 additions & 8 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ pub trait TyVisitor {

fn visit_char(&mut self) -> bool;

#[cfg(stage0)]
fn visit_estr_box(&mut self) -> bool;
#[cfg(stage0)]
fn visit_estr_uniq(&mut self) -> bool;
fn visit_estr_slice(&mut self) -> bool;
fn visit_estr_fixed(&mut self, n: uint, sz: uint, align: uint) -> bool;

Expand All @@ -112,10 +108,6 @@ pub trait TyVisitor {
fn visit_ptr(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
fn visit_rptr(&mut self, mtbl: uint, inner: *TyDesc) -> bool;

#[cfg(stage0)]
fn visit_evec_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
#[cfg(stage0)]
fn visit_evec_uniq(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
fn visit_evec_fixed(&mut self, n: uint, sz: uint, align: uint,
mtbl: uint, inner: *TyDesc) -> bool;
Expand Down
20 changes: 0 additions & 20 deletions src/libdebug/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
true
}

#[cfg(stage0)]
fn visit_estr_box(&mut self) -> bool {
true
}

#[cfg(stage0)]
fn visit_estr_uniq(&mut self) -> bool {
false
}

fn visit_estr_slice(&mut self) -> bool {
self.align_to::<&'static str>();
if ! self.inner.visit_estr_slice() { return false; }
Expand Down Expand Up @@ -247,16 +237,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
true
}

#[cfg(stage0)]
fn visit_evec_box(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool {
true
}

#[cfg(stage0)]
fn visit_evec_uniq(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool {
false
}

fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
self.align_to::<&'static [u8]>();
if ! self.inner.visit_evec_slice(mtbl, inner) { return false; }
Expand Down
20 changes: 0 additions & 20 deletions src/libdebug/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
})
}

#[cfg(stage0)]
fn visit_estr_box(&mut self) -> bool {
false
}

#[cfg(stage0)]
fn visit_estr_uniq(&mut self) -> bool {
false
}

fn visit_estr_slice(&mut self) -> bool {
self.get::<&str>(|this, s| this.write_escaped_slice(*s))
}
Expand Down Expand Up @@ -320,16 +310,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
})
}

#[cfg(stage0)]
fn visit_evec_box(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool {
true
}

#[cfg(stage0)]
fn visit_evec_uniq(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool {
true
}

fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
self.get::<raw::Slice<()>>(|this, s| {
try!(this, this.writer.write(['&' as u8]));
Expand Down
22 changes: 11 additions & 11 deletions src/libgreen/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ use std::rt::rtio::{PausableIdleCallback, Callback};
use std::rt::exclusive::Exclusive;

/// This is the only exported function from this module.
pub fn event_loop() -> Box<EventLoop:Send> {
box BasicLoop::new() as Box<EventLoop:Send>
pub fn event_loop() -> Box<EventLoop + Send> {
box BasicLoop::new() as Box<EventLoop + Send>
}

struct BasicLoop {
work: Vec<proc():Send>, // pending work
remotes: Vec<(uint, Box<Callback:Send>)>,
work: Vec<proc(): Send>, // pending work
remotes: Vec<(uint, Box<Callback + Send>)>,
next_remote: uint,
messages: Arc<Exclusive<Vec<Message>>>,
idle: Option<Box<Callback:Send>>,
idle: Option<Box<Callback + Send>>,
idle_active: Option<Arc<atomics::AtomicBool>>,
}

Expand Down Expand Up @@ -132,22 +132,22 @@ impl EventLoop for BasicLoop {
}

// FIXME: Seems like a really weird requirement to have an event loop provide.
fn pausable_idle_callback(&mut self, cb: Box<Callback:Send>)
-> Box<PausableIdleCallback:Send> {
fn pausable_idle_callback(&mut self, cb: Box<Callback + Send>)
-> Box<PausableIdleCallback + Send> {
rtassert!(self.idle.is_none());
self.idle = Some(cb);
let a = Arc::new(atomics::AtomicBool::new(true));
self.idle_active = Some(a.clone());
box BasicPausable { active: a } as Box<PausableIdleCallback:Send>
box BasicPausable { active: a } as Box<PausableIdleCallback + Send>
}

fn remote_callback(&mut self, f: Box<Callback:Send>)
-> Box<RemoteCallback:Send> {
fn remote_callback(&mut self, f: Box<Callback + Send>)
-> Box<RemoteCallback + Send> {
let id = self.next_remote;
self.next_remote += 1;
self.remotes.push((id, f));
box BasicRemote::new(self.messages.clone(), id) as
Box<RemoteCallback:Send>
Box<RemoteCallback + Send>
}

fn io<'a>(&'a mut self) -> Option<&'a mut IoFactory> { None }
Expand Down
8 changes: 4 additions & 4 deletions src/libgreen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ macro_rules! green_start( ($f:ident) => (
/// The return value is used as the process return code. 0 on success, 101 on
/// error.
pub fn start(argc: int, argv: **u8,
event_loop_factory: fn() -> Box<rtio::EventLoop:Send>,
event_loop_factory: fn() -> Box<rtio::EventLoop + Send>,
main: proc():Send) -> int {
rt::init(argc, argv);
let mut main = Some(main);
Expand All @@ -309,7 +309,7 @@ pub fn start(argc: int, argv: **u8,
///
/// This function will not return until all schedulers in the associated pool
/// have returned.
pub fn run(event_loop_factory: fn() -> Box<rtio::EventLoop:Send>,
pub fn run(event_loop_factory: fn() -> Box<rtio::EventLoop + Send>,
main: proc():Send) -> int {
// Create a scheduler pool and spawn the main task into this pool. We will
// get notified over a channel when the main task exits.
Expand Down Expand Up @@ -340,7 +340,7 @@ pub struct PoolConfig {
pub threads: uint,
/// A factory function used to create new event loops. If this is not
/// specified then the default event loop factory is used.
pub event_loop_factory: fn() -> Box<rtio::EventLoop:Send>,
pub event_loop_factory: fn() -> Box<rtio::EventLoop + Send>,
}

impl PoolConfig {
Expand All @@ -365,7 +365,7 @@ pub struct SchedPool {
stack_pool: StackPool,
deque_pool: deque::BufferPool<Box<task::GreenTask>>,
sleepers: SleeperList,
factory: fn() -> Box<rtio::EventLoop:Send>,
factory: fn() -> Box<rtio::EventLoop + Send>,
task_state: TaskState,
tasks_done: Receiver<()>,
}
Expand Down
14 changes: 7 additions & 7 deletions src/libgreen/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub struct Scheduler {
/// A fast XorShift rng for scheduler use
rng: XorShiftRng,
/// A toggleable idle callback
idle_callback: Option<Box<PausableIdleCallback:Send>>,
idle_callback: Option<Box<PausableIdleCallback + Send>>,
/// A countdown that starts at a random value and is decremented
/// every time a yield check is performed. When it hits 0 a task
/// will yield.
Expand All @@ -100,7 +100,7 @@ pub struct Scheduler {
// destroyed before it's actually destroyed.

/// The event loop used to drive the scheduler and perform I/O
pub event_loop: Box<EventLoop:Send>,
pub event_loop: Box<EventLoop + Send>,
}

/// An indication of how hard to work on a given operation, the difference
Expand All @@ -123,7 +123,7 @@ impl Scheduler {
// * Initialization Functions

pub fn new(pool_id: uint,
event_loop: Box<EventLoop:Send>,
event_loop: Box<EventLoop + Send>,
work_queue: deque::Worker<Box<GreenTask>>,
work_queues: Vec<deque::Stealer<Box<GreenTask>>>,
sleeper_list: SleeperList,
Expand All @@ -136,7 +136,7 @@ impl Scheduler {
}

pub fn new_special(pool_id: uint,
event_loop: Box<EventLoop:Send>,
event_loop: Box<EventLoop + Send>,
work_queue: deque::Worker<Box<GreenTask>>,
work_queues: Vec<deque::Stealer<Box<GreenTask>>>,
sleeper_list: SleeperList,
Expand Down Expand Up @@ -183,7 +183,7 @@ impl Scheduler {
pub fn bootstrap(mut ~self) {

// Build an Idle callback.
let cb = box SchedRunner as Box<Callback:Send>;
let cb = box SchedRunner as Box<Callback + Send>;
self.idle_callback = Some(self.event_loop.pausable_idle_callback(cb));

// Create a task for the scheduler with an empty context.
Expand Down Expand Up @@ -231,7 +231,7 @@ impl Scheduler {
// mutable reference to the event_loop to give it the "run"
// command.
unsafe {
let event_loop: *mut Box<EventLoop:Send> = &mut self.event_loop;
let event_loop: *mut Box<EventLoop + Send> = &mut self.event_loop;
// Our scheduler must be in the task before the event loop
// is started.
stask.put_with_sched(self);
Expand Down Expand Up @@ -904,7 +904,7 @@ pub enum SchedMessage {
}

pub struct SchedHandle {
remote: Box<RemoteCallback:Send>,
remote: Box<RemoteCallback + Send>,
queue: msgq::Producer<SchedMessage>,
pub sched_id: uint
}
Expand Down
6 changes: 3 additions & 3 deletions src/liblog/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub static WARN: u32 = 2;
/// Error log level
pub static ERROR: u32 = 1;

local_data_key!(local_logger: Box<Logger:Send>)
local_data_key!(local_logger: Box<Logger + Send>)

/// A trait used to represent an interface to a task-local logger. Each task
/// can have its own custom logger which can respond to logging messages
Expand Down Expand Up @@ -226,7 +226,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
// frob the slot while we're doing the logging. This will destroy any logger
// set during logging.
let mut logger = local_logger.replace(None).unwrap_or_else(|| {
box DefaultLogger { handle: io::stderr() } as Box<Logger:Send>
box DefaultLogger { handle: io::stderr() } as Box<Logger + Send>
});
logger.log(&LogRecord {
level: LogLevel(level),
Expand All @@ -246,7 +246,7 @@ pub fn log_level() -> u32 { unsafe { LOG_LEVEL } }

/// Replaces the task-local logger with the specified logger, returning the old
/// logger.
pub fn set_logger(logger: Box<Logger:Send>) -> Option<Box<Logger:Send>> {
pub fn set_logger(logger: Box<Logger + Send>) -> Option<Box<Logger + Send>> {
local_logger.replace(Some(logger))
}

Expand Down
4 changes: 2 additions & 2 deletions src/libnative/io/file_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ impl rtio::RtioPipe for FileDesc {
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
self.inner_write(buf)
}
fn clone(&self) -> Box<rtio::RtioPipe:Send> {
box FileDesc { inner: self.inner.clone() } as Box<rtio::RtioPipe:Send>
fn clone(&self) -> Box<rtio::RtioPipe + Send> {
box FileDesc { inner: self.inner.clone() } as Box<rtio::RtioPipe + Send>
}

// Only supported on named pipes currently. Note that this doesn't have an
Expand Down
Loading