diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-01-22 23:49:57 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-01-26 09:29:28 -0800 |
| commit | cb343c33acf0f9833d8d6eb637234acf4321976b (patch) | |
| tree | e8f94b5bd4fac82b36d1ea8efa37e8690e8229eb /src/libstd/sync | |
| parent | 4b3c35509b7bd75c0b4712bb45440955d997ae75 (diff) | |
| download | rust-cb343c33acf0f9833d8d6eb637234acf4321976b.tar.gz rust-cb343c33acf0f9833d8d6eb637234acf4321976b.zip | |
Fix warnings during tests
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/semaphore.rs | 24 |
2 files changed, 22 insertions, 4 deletions
diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index d743cbb1890..5aa4ce81b8a 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -789,7 +789,7 @@ mod tests { fn fmt_debug_handle() { let (_, rx) = channel::<i32>(); let sel = Select::new(); - let mut handle = sel.handle(&rx); + let handle = sel.handle(&rx); assert_eq!(format!("{:?}", handle), "Handle { .. }"); } } diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index ac5ce298c5c..dd76444d3ae 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -12,9 +12,6 @@ reason = "the interaction between semaphores and the acquisition/release \ of resources is currently unclear", issue = "27798")] -#![rustc_deprecated(since = "1.7.0", - reason = "easily confused with system semaphores and not \ - used enough to pull its weight")] #![allow(deprecated)] use ops::Drop; @@ -49,6 +46,13 @@ use sync::{Mutex, Condvar}; /// // Release our initially acquired resource /// sem.release(); /// ``` +#[rustc_deprecated(since = "1.7.0", + reason = "easily confused with system semaphores and not \ + used enough to pull its weight")] +#[unstable(feature = "semaphore", + reason = "the interaction between semaphores and the acquisition/release \ + of resources is currently unclear", + issue = "27798")] pub struct Semaphore { lock: Mutex<isize>, cvar: Condvar, @@ -56,10 +60,24 @@ pub struct Semaphore { /// An RAII guard which will release a resource acquired from a semaphore when /// dropped. +#[rustc_deprecated(since = "1.7.0", + reason = "easily confused with system semaphores and not \ + used enough to pull its weight")] +#[unstable(feature = "semaphore", + reason = "the interaction between semaphores and the acquisition/release \ + of resources is currently unclear", + issue = "27798")] pub struct SemaphoreGuard<'a> { sem: &'a Semaphore, } +#[rustc_deprecated(since = "1.7.0", + reason = "easily confused with system semaphores and not \ + used enough to pull its weight")] +#[unstable(feature = "semaphore", + reason = "the interaction between semaphores and the acquisition/release \ + of resources is currently unclear", + issue = "27798")] impl Semaphore { /// Creates a new semaphore with the initial count specified. /// |
