diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 16:34:15 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 18:38:24 -0700 |
| commit | 57f5ac948aeb296b99785a82ffc49fafc291aad9 (patch) | |
| tree | 087bef87d54db5cf3593617998e822168053c3ce /src/libstd | |
| parent | d49b67e255db86a5df952b33f4140150fc12bf4d (diff) | |
| download | rust-57f5ac948aeb296b99785a82ffc49fafc291aad9.tar.gz rust-57f5ac948aeb296b99785a82ffc49fafc291aad9.zip | |
Test fixes and rebase conflicts, round 2
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 16 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/oneshot.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/shared.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/spsc_queue.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/stream.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/sync.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/c.rs | 6 |
9 files changed, 25 insertions, 25 deletions
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index b436e49feab..c80182ec07d 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -342,7 +342,7 @@ mod spsc_queue; /// The receiving-half of Rust's channel type. This half can only be owned by /// one task #[stable(feature = "rust1", since = "1.0.0")] -pub struct Receiver<T:Send> { +pub struct Receiver<T> { inner: UnsafeCell<Flavor<T>>, } @@ -354,14 +354,14 @@ unsafe impl<T: Send> Send for Receiver<T> { } /// whenever `next` is called, waiting for a new message, and `None` will be /// returned when the corresponding channel has hung up. #[stable(feature = "rust1", since = "1.0.0")] -pub struct Iter<'a, T:Send+'a> { +pub struct Iter<'a, T: 'a> { rx: &'a Receiver<T> } /// The sending-half of Rust's asynchronous channel type. This half can only be /// owned by one task, but it can be cloned to send to other tasks. #[stable(feature = "rust1", since = "1.0.0")] -pub struct Sender<T:Send> { +pub struct Sender<T> { inner: UnsafeCell<Flavor<T>>, } @@ -372,7 +372,7 @@ unsafe impl<T: Send> Send for Sender<T> { } /// The sending-half of Rust's synchronous channel type. This half can only be /// owned by one task, but it can be cloned to send to other tasks. #[stable(feature = "rust1", since = "1.0.0")] -pub struct SyncSender<T: Send> { +pub struct SyncSender<T> { inner: Arc<UnsafeCell<sync::Packet<T>>>, } @@ -433,7 +433,7 @@ pub enum TrySendError<T> { Disconnected(T), } -enum Flavor<T:Send> { +enum Flavor<T> { Oneshot(Arc<UnsafeCell<oneshot::Packet<T>>>), Stream(Arc<UnsafeCell<stream::Packet<T>>>), Shared(Arc<UnsafeCell<shared::Packet<T>>>), @@ -441,7 +441,7 @@ enum Flavor<T:Send> { } #[doc(hidden)] -trait UnsafeFlavor<T:Send> { +trait UnsafeFlavor<T> { fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>>; unsafe fn inner_mut<'a>(&'a self) -> &'a mut Flavor<T> { &mut *self.inner_unsafe().get() @@ -450,12 +450,12 @@ trait UnsafeFlavor<T:Send> { &*self.inner_unsafe().get() } } -impl<T:Send> UnsafeFlavor<T> for Sender<T> { +impl<T> UnsafeFlavor<T> for Sender<T> { fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>> { &self.inner } } -impl<T:Send> UnsafeFlavor<T> for Receiver<T> { +impl<T> UnsafeFlavor<T> for Receiver<T> { fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>> { &self.inner } diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 7866a85dc8f..9b6c8f4dd97 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -72,12 +72,12 @@ struct Node<T> { /// The multi-producer single-consumer structure. This is not cloneable, but it /// may be safely shared so long as it is guaranteed that there is only one /// popper at a time (many pushers are allowed). -pub struct Queue<T: Send> { +pub struct Queue<T> { head: AtomicPtr<Node<T>>, tail: UnsafeCell<*mut Node<T>>, } -unsafe impl<T:Send> Send for Queue<T> { } +unsafe impl<T: Send> Send for Queue<T> { } unsafe impl<T: Send> Sync for Queue<T> { } impl<T> Node<T> { diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs index 21f690f0ee4..c6e8d87a22e 100644 --- a/src/libstd/sync/mpsc/oneshot.rs +++ b/src/libstd/sync/mpsc/oneshot.rs @@ -54,7 +54,7 @@ const DISCONNECTED: usize = 2; // channel is disconnected OR upgraded // moves *from* a pointer, ownership of the token is transferred to // whoever changed the state. -pub struct Packet<T:Send> { +pub struct Packet<T> { // Internal state of the chan/port pair (stores the blocked task as well) state: AtomicUsize, // One-shot data slot location @@ -64,7 +64,7 @@ pub struct Packet<T:Send> { upgrade: MyUpgrade<T>, } -pub enum Failure<T:Send> { +pub enum Failure<T> { Empty, Disconnected, Upgraded(Receiver<T>), @@ -76,13 +76,13 @@ pub enum UpgradeResult { UpWoke(SignalToken), } -pub enum SelectionResult<T:Send> { +pub enum SelectionResult<T> { SelCanceled, SelUpgraded(SignalToken, Receiver<T>), SelSuccess, } -enum MyUpgrade<T:Send> { +enum MyUpgrade<T> { NothingSent, SendUsed, GoUp(Receiver<T>), diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index be973028577..5c1610bdc31 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -40,7 +40,7 @@ const MAX_STEALS: isize = 5; #[cfg(not(test))] const MAX_STEALS: isize = 1 << 20; -pub struct Packet<T: Send> { +pub struct Packet<T> { queue: mpsc::Queue<T>, cnt: AtomicIsize, // How many items are on this channel steals: isize, // How many times has a port received without blocking? diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index 278ac03cf03..c75ac130808 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -57,7 +57,7 @@ struct Node<T> { /// but it can be safely shared in an Arc if it is guaranteed that there /// is only one popper and one pusher touching the queue at any one point in /// time. -pub struct Queue<T: Send> { +pub struct Queue<T> { // consumer fields tail: UnsafeCell<*mut Node<T>>, // where to pop from tail_prev: AtomicPtr<Node<T>>, // where to pop from diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs index 25b5f6f27ba..f0363fae84f 100644 --- a/src/libstd/sync/mpsc/stream.rs +++ b/src/libstd/sync/mpsc/stream.rs @@ -39,7 +39,7 @@ const MAX_STEALS: isize = 5; #[cfg(not(test))] const MAX_STEALS: isize = 1 << 20; -pub struct Packet<T:Send> { +pub struct Packet<T> { queue: spsc::Queue<Message<T>>, // internal queue for all message cnt: AtomicIsize, // How many items are on this channel @@ -49,7 +49,7 @@ pub struct Packet<T:Send> { port_dropped: AtomicBool, // flag if the channel has been destroyed. } -pub enum Failure<T:Send> { +pub enum Failure<T> { Empty, Disconnected, Upgraded(Receiver<T>), @@ -61,7 +61,7 @@ pub enum UpgradeResult { UpWoke(SignalToken), } -pub enum SelectionResult<T:Send> { +pub enum SelectionResult<T> { SelSuccess, SelCanceled, SelUpgraded(SignalToken, Receiver<T>), @@ -69,7 +69,7 @@ pub enum SelectionResult<T:Send> { // Any message could contain an "upgrade request" to a new shared port, so the // internal queue it's a queue of T, but rather Message<T> -enum Message<T:Send> { +enum Message<T> { Data(T), GoUp(Receiver<T>), } diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 8e49edc44b6..6221ca59b54 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -47,7 +47,7 @@ use sync::mpsc::blocking::{self, WaitToken, SignalToken}; use sync::mpsc::select::StartResult::{self, Installed, Abort}; use sync::{Mutex, MutexGuard}; -pub struct Packet<T: Send> { +pub struct Packet<T> { /// Only field outside of the mutex. Just done for kicks, but mainly because /// the other shared channel already had the code implemented channels: AtomicUsize, diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 6a721aff89e..16e7f265412 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -112,7 +112,7 @@ use fmt; /// *guard += 1; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -pub struct Mutex<T: Send> { +pub struct Mutex<T> { // Note that this static mutex is in a *box*, not inlined into the struct // itself. Once a native mutex has been used once, its address can never // change (it can't be moved). This mutex type can be safely moved at any diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs index e74de595f97..99abe10c8a4 100644 --- a/src/libstd/sys/windows/c.rs +++ b/src/libstd/sys/windows/c.rs @@ -49,9 +49,9 @@ pub const ERROR_NO_MORE_FILES: libc::DWORD = 18; pub const TOKEN_READ: libc::DWORD = 0x20008; // Note that these are not actually HANDLEs, just values to pass to GetStdHandle -pub const STD_INPUT_HANDLE: libc::DWORD = -10; -pub const STD_OUTPUT_HANDLE: libc::DWORD = -11; -pub const STD_ERROR_HANDLE: libc::DWORD = -12; +pub const STD_INPUT_HANDLE: libc::DWORD = -10i32 as libc::DWORD; +pub const STD_OUTPUT_HANDLE: libc::DWORD = -11i32 as libc::DWORD; +pub const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD; #[repr(C)] #[cfg(target_arch = "x86")] |
