Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 780319a

Browse files
stabilize unstable rwlock_downgrade feature
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent 5b6ceb5 commit 780319a

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

‎library/std/src/sync/nonpoison/rwlock.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
638638
///
639639
/// ```
640640
/// #![feature(nonpoison_rwlock)]
641-
/// #![feature(rwlock_downgrade)]
642641
///
643642
/// use std::sync::nonpoison::{RwLock, RwLockWriteGuard};
644643
///
@@ -657,7 +656,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
657656
///
658657
/// ```
659658
/// #![feature(nonpoison_rwlock)]
660-
/// #![feature(rwlock_downgrade)]
661659
///
662660
/// use std::sync::Arc;
663661
/// use std::sync::nonpoison::{RwLock, RwLockWriteGuard};
@@ -690,8 +688,7 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
690688
/// # let final_check = rw.read();
691689
/// # assert_eq!(*final_check, 3);
692690
/// ```
693-
#[unstable(feature = "rwlock_downgrade", issue = "128203")]
694-
// #[unstable(feature = "nonpoison_rwlock", issue = "134645")]
691+
#[unstable(feature = "nonpoison_rwlock", issue = "134645")]
695692
pub fn downgrade(s: Self) -> RwLockReadGuard<'rwlock, T> {
696693
let lock = s.lock;
697694

‎library/std/src/sync/poison/rwlock.rs‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
813813
/// `downgrade` takes ownership of the `RwLockWriteGuard` and returns a [`RwLockReadGuard`].
814814
///
815815
/// ```
816-
/// #![feature(rwlock_downgrade)]
817-
///
818816
/// use std::sync::{RwLock, RwLockWriteGuard};
819817
///
820818
/// let rw = RwLock::new(0);
@@ -831,8 +829,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
831829
/// thread calling `downgrade` and any reads it performs after downgrading.
832830
///
833831
/// ```
834-
/// #![feature(rwlock_downgrade)]
835-
///
836832
/// use std::sync::{Arc, RwLock, RwLockWriteGuard};
837833
///
838834
/// let rw = Arc::new(RwLock::new(1));
@@ -863,7 +859,7 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
863859
/// # let final_check = rw.read().unwrap();
864860
/// # assert_eq!(*final_check, 3);
865861
/// ```
866-
#[unstable(feature = "rwlock_downgrade", issue = "128203")]
862+
#[stable(feature = "rwlock_downgrade", since = "CURRENT_RUSTC_VERSION")]
867863
pub fn downgrade(s: Self) -> RwLockReadGuard<'rwlock, T> {
868864
let lock = s.lock;
869865

‎library/std/tests/sync/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(once_cell_try)]
55
#![feature(lock_value_accessors)]
66
#![feature(reentrant_lock)]
7-
#![feature(rwlock_downgrade)]
87
#![feature(std_internals)]
98
#![feature(sync_nonpoison)]
109
#![feature(nonpoison_mutex)]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /