diff options
| author | bors <bors@rust-lang.org> | 2024-03-01 19:06:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-01 19:06:39 +0000 |
| commit | 2dceda4f32b97f60b122f2b32491e0267ef5cc0c (patch) | |
| tree | 4989e8c8638ecb5f15eb0f2435bc8fa4dc1d634c /library/std/src | |
| parent | 17edacef07e8afc3b580ed8feead6c5e90d24a56 (diff) | |
| parent | ff22925e500e767ffcc5485d006174f7d74e21f0 (diff) | |
| download | rust-2dceda4f32b97f60b122f2b32491e0267ef5cc0c.tar.gz rust-2dceda4f32b97f60b122f2b32491e0267ef5cc0c.zip | |
Auto merge of #121859 - matthiaskrgr:rollup-i724wpm, r=matthiaskrgr
Rollup of 12 pull requests Successful merges: - #120646 (Fix incorrect suggestion for uninitialized binding in pattern) - #121416 (Improve error messages for generics with default parameters) - #121475 (Add tidy check for .stderr/.stdout files for non-existent test revisions) - #121580 (make unused_imports less assertive in test modules) - #121736 (Remove `Mutex::unlock` Function) - #121784 (Make the success arms of `if lhs || rhs` meet up in a separate block) - #121818 (CFI: Remove unused `typeid_for_fnsig`) - #121819 (Handle stashing of delayed bugs) - #121828 (Remove unused fluent messages) - #121831 (Fix typo in comment) - #121850 (Make `ZeroablePrimitive` trait unsafe.) - #121853 (normalizes-to: handle negative impls) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sync/mutex.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/library/std/src/sync/mutex.rs b/library/std/src/sync/mutex.rs index fa91f9d907a..65ff10e02d4 100644 --- a/library/std/src/sync/mutex.rs +++ b/library/std/src/sync/mutex.rs @@ -369,26 +369,6 @@ impl<T: ?Sized> Mutex<T> { } } - /// Immediately drops the guard, and consequently unlocks the mutex. - /// - /// This function is equivalent to calling [`drop`] on the guard but is more self-documenting. - /// Alternately, the guard will be automatically dropped when it goes out of scope. - /// - /// ``` - /// #![feature(mutex_unlock)] - /// - /// use std::sync::Mutex; - /// let mutex = Mutex::new(0); - /// - /// let mut guard = mutex.lock().unwrap(); - /// *guard += 20; - /// Mutex::unlock(guard); - /// ``` - #[unstable(feature = "mutex_unlock", issue = "81872")] - pub fn unlock(guard: MutexGuard<'_, T>) { - drop(guard); - } - /// Determines whether the mutex is poisoned. /// /// If another thread is active, the mutex can still become poisoned at any |
