about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-07 00:16:58 +0000
committerbors <bors@rust-lang.org>2016-02-07 00:16:58 +0000
commit3623797ebb9674322c4cfcfb0bb7b002afe17f11 (patch)
treeaa3e64873bc596137fd8a66f549095e22e803e23 /src/libstd
parent8c604dc940c35e4ac36012aa85375250f2e6e07e (diff)
parentad73330391d7b608e6650cb83dc76d5eeb1919ed (diff)
downloadrust-3623797ebb9674322c4cfcfb0bb7b002afe17f11.tar.gz
rust-3623797ebb9674322c4cfcfb0bb7b002afe17f11.zip
Auto merge of #31440 - reem:rwlock-map-fix, r=alexcrichton
Also update the instability reason to include a note about a possible
bad interaction with condition variables on systems that allow
waiting on a RwLock guard.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sync/rwlock.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs
index 1ecc8974369..fd538d52fb2 100644
--- a/src/libstd/sync/rwlock.rs
+++ b/src/libstd/sync/rwlock.rs
@@ -454,10 +454,11 @@ impl<'rwlock, T: ?Sized> RwLockReadGuard<'rwlock, T> {
     /// assert_eq!(*y, 1);
     /// ```
     #[unstable(feature = "guard_map",
-               reason = "recently added, needs RFC for stabilization",
+               reason = "recently added, needs RFC for stabilization,
+                         questionable interaction with Condvar",
                issue = "27746")]
     pub fn map<U: ?Sized, F>(this: Self, cb: F) -> RwLockReadGuard<'rwlock, U>
-        where F: FnOnce(&'rwlock T) -> &'rwlock U
+        where F: FnOnce(&T) -> &U
     {
         let new = RwLockReadGuard {
             __lock: this.__lock,
@@ -504,10 +505,11 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
     /// assert_eq!(&**x.read().unwrap(), &[10, 2]);
     /// ```
     #[unstable(feature = "guard_map",
-               reason = "recently added, needs RFC for stabilization",
+               reason = "recently added, needs RFC for stabilization,
+                         questionable interaction with Condvar",
                issue = "27746")]
     pub fn map<U: ?Sized, F>(this: Self, cb: F) -> RwLockWriteGuard<'rwlock, U>
-        where F: FnOnce(&'rwlock mut T) -> &'rwlock mut U
+        where F: FnOnce(&mut T) -> &mut U
     {
         // Compute the new data while still owning the original lock
         // in order to correctly poison if the callback panics.