about summary refs log tree commit diff
path: root/src/libsync
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2014-11-06 00:05:53 -0800
committerSteven Fackler <sfackler@gmail.com>2014-11-17 07:35:51 -0800
commit3dcd2157403163789aaf21a9ab3c4d30a7c6494d (patch)
tree30cc4a448fe8380ae7107c6ea9b534a725adaec8 /src/libsync
parent0047dbe59c41b951d34ce6324f3a8c0e15d523e9 (diff)
downloadrust-3dcd2157403163789aaf21a9ab3c4d30a7c6494d.tar.gz
rust-3dcd2157403163789aaf21a9ab3c4d30a7c6494d.zip
Switch to purely namespaced enums
This breaks code that referred to variant names in the same namespace as
their enum. Reexport the variants in the old location or alter code to
refer to the new locations:

```
pub enum Foo {
    A,
    B
}

fn main() {
    let a = A;
}
```
=>
```
pub use self::Foo::{A, B};

pub enum Foo {
    A,
    B
}

fn main() {
    let a = A;
}
```
or
```
pub enum Foo {
    A,
    B
}

fn main() {
    let a = Foo::A;
}
```

[breaking-change]
Diffstat (limited to 'src/libsync')
-rw-r--r--src/libsync/comm/mod.rs4
-rw-r--r--src/libsync/comm/oneshot.rs5
-rw-r--r--src/libsync/comm/shared.rs2
-rw-r--r--src/libsync/comm/stream.rs5
-rw-r--r--src/libsync/comm/sync.rs3
-rw-r--r--src/libsync/deque.rs2
-rw-r--r--src/libsync/lock.rs2
-rw-r--r--src/libsync/mpsc_queue.rs2
-rw-r--r--src/libsync/mutex.rs1
-rw-r--r--src/libsync/raw.rs3
10 files changed, 29 insertions, 0 deletions
diff --git a/src/libsync/comm/mod.rs b/src/libsync/comm/mod.rs
index 65b3e30c2b9..2a9a19a7fa6 100644
--- a/src/libsync/comm/mod.rs
+++ b/src/libsync/comm/mod.rs
@@ -323,6 +323,10 @@
 
 use core::prelude::*;
 
+pub use self::TryRecvError::*;
+pub use self::TrySendError::*;
+use self::Flavor::*;
+
 use alloc::arc::Arc;
 use alloc::boxed::Box;
 use core::cell::Cell;
diff --git a/src/libsync/comm/oneshot.rs b/src/libsync/comm/oneshot.rs
index 447585fb2e0..5d3c59e8a79 100644
--- a/src/libsync/comm/oneshot.rs
+++ b/src/libsync/comm/oneshot.rs
@@ -32,6 +32,11 @@
 /// The one caveat to consider is that when a port sees a disconnected channel
 /// it must check for data because there is no "data plus upgrade" state.
 
+pub use self::Failure::*;
+pub use self::UpgradeResult::*;
+pub use self::SelectionResult::*;
+use self::MyUpgrade::*;
+
 use core::prelude::*;
 
 use alloc::boxed::Box;
diff --git a/src/libsync/comm/shared.rs b/src/libsync/comm/shared.rs
index a82efe76289..5ca89ea3666 100644
--- a/src/libsync/comm/shared.rs
+++ b/src/libsync/comm/shared.rs
@@ -18,6 +18,8 @@
 /// module. You'll also note that the implementation of the shared and stream
 /// channels are quite similar, and this is no coincidence!
 
+pub use self::Failure::*;
+
 use core::prelude::*;
 
 use alloc::boxed::Box;
diff --git a/src/libsync/comm/stream.rs b/src/libsync/comm/stream.rs
index 8e433c6a585..67878e3ba5a 100644
--- a/src/libsync/comm/stream.rs
+++ b/src/libsync/comm/stream.rs
@@ -17,6 +17,11 @@
 /// High level implementation details can be found in the comment of the parent
 /// module.
 
+pub use self::Failure::*;
+pub use self::UpgradeResult::*;
+pub use self::SelectionResult::*;
+use self::Message::*;
+
 use core::prelude::*;
 
 use alloc::boxed::Box;
diff --git a/src/libsync/comm/sync.rs b/src/libsync/comm/sync.rs
index 42de6f66289..27b943624d7 100644
--- a/src/libsync/comm/sync.rs
+++ b/src/libsync/comm/sync.rs
@@ -35,6 +35,9 @@
 
 use core::prelude::*;
 
+pub use self::Failure::*;
+use self::Blocker::*;
+
 use alloc::boxed::Box;
 use collections::Vec;
 use core::mem;
diff --git a/src/libsync/deque.rs b/src/libsync/deque.rs
index ae55642672d..2f5c455556c 100644
--- a/src/libsync/deque.rs
+++ b/src/libsync/deque.rs
@@ -50,6 +50,8 @@
 // FIXME: all atomic operations in this module use a SeqCst ordering. That is
 //      probably overkill
 
+pub use self::Stolen::*;
+
 use core::prelude::*;
 
 use alloc::arc::Arc;
diff --git a/src/libsync/lock.rs b/src/libsync/lock.rs
index 0ef3e77da00..d6378c2190e 100644
--- a/src/libsync/lock.rs
+++ b/src/libsync/lock.rs
@@ -21,6 +21,8 @@
 
 use core::prelude::*;
 
+use self::Inner::*;
+
 use core::cell::UnsafeCell;
 use rustrt::local::Local;
 use rustrt::task::Task;
diff --git a/src/libsync/mpsc_queue.rs b/src/libsync/mpsc_queue.rs
index 69dc2fe8e60..63379ad1d9d 100644
--- a/src/libsync/mpsc_queue.rs
+++ b/src/libsync/mpsc_queue.rs
@@ -40,6 +40,8 @@
 // http://www.1024cores.net/home/lock-free-algorithms
 //                         /queues/non-intrusive-mpsc-node-based-queue
 
+pub use self::PopResult::*;
+
 use core::prelude::*;
 
 use alloc::boxed::Box;
diff --git a/src/libsync/mutex.rs b/src/libsync/mutex.rs
index 7d191eab2d1..e05f3e1910b 100644
--- a/src/libsync/mutex.rs
+++ b/src/libsync/mutex.rs
@@ -58,6 +58,7 @@
 // it's locked or not.
 
 use core::prelude::*;
+use self::Flavor::*;
 
 use alloc::boxed::Box;
 use core::atomic;
diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs
index facf204983b..8ab21fe380f 100644
--- a/src/libsync/raw.rs
+++ b/src/libsync/raw.rs
@@ -16,6 +16,7 @@
 //! containing data.
 
 use core::prelude::*;
+use self::ReacquireOrderLock::*;
 
 use core::atomic;
 use core::finally::Finally;
@@ -619,6 +620,8 @@ impl<'a> Drop for RWLockReadGuard<'a> {
 
 #[cfg(test)]
 mod tests {
+    pub use self::RWLockMode::*;
+
     use std::prelude::*;
 
     use Arc;