Skip to content

Commit 20fa3a0

Browse files
committed
Fix Condvar typo, add public re-exports of Mapped*Guard.
1 parent 04f8630 commit 20fa3a0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: library/std/src/sync/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,17 @@ pub use core::sync::Exclusive;
165165
pub use self::barrier::{Barrier, BarrierWaitResult};
166166
#[stable(feature = "rust1", since = "1.0.0")]
167167
pub use self::condvar::{Condvar, WaitTimeoutResult};
168+
#[unstable(feature = "mapped_lock_guards", issue = "117108")]
169+
pub use self::mutex::MappedMutexGuard;
168170
#[stable(feature = "rust1", since = "1.0.0")]
169171
pub use self::mutex::{Mutex, MutexGuard};
170172
#[stable(feature = "rust1", since = "1.0.0")]
171173
#[allow(deprecated)]
172174
pub use self::once::{Once, OnceState, ONCE_INIT};
173175
#[stable(feature = "rust1", since = "1.0.0")]
174176
pub use self::poison::{LockResult, PoisonError, TryLockError, TryLockResult};
177+
#[unstable(feature = "mapped_lock_guards", issue = "117108")]
178+
pub use self::rwlock::{MappedRwLockReadGuard, MappedRwLockWriteGuard};
175179
#[stable(feature = "rust1", since = "1.0.0")]
176180
pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
177181

Diff for: library/std/src/sync/mutex.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ unsafe impl<T: ?Sized + Sync> Sync for MutexGuard<'_, T> {}
221221
/// of scope), the lock will be unlocked.
222222
///
223223
/// The main difference between `MappedMutexGuard` and [`MutexGuard`] is that the
224-
/// former cannot be used with [`CondVar`], since that
224+
/// former cannot be used with [`Condvar`], since that
225225
/// could introduce soundness issues if the locked object is modified by another
226226
/// thread while the `Mutex` is unlocked.
227227
///
@@ -233,7 +233,7 @@ unsafe impl<T: ?Sized + Sync> Sync for MutexGuard<'_, T> {}
233233
///
234234
/// [`map`]: MutexGuard::map
235235
/// [`try_map`]: MutexGuard::try_map
236-
/// [`CondVar`]: crate::sync::CondVar
236+
/// [`Condvar`]: crate::sync::Condvar
237237
#[must_use = "if unused the Mutex will immediately unlock"]
238238
#[must_not_suspend = "holding a MappedMutexGuard across suspend \
239239
points can cause deadlocks, delays, \

0 commit comments

Comments
 (0)