This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +5
-2
lines changed Expand file tree Collapse file tree 5 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ impl Condvar {
122122 /// let condvar = Condvar::new();
123123 /// ```
124124 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
125+ #[ rustc_const_stable( feature = "const_locks" , since = "1.63.0" ) ]
125126 #[ must_use]
126127 #[ inline]
127128 pub const fn new ( ) -> Condvar {
Original file line number Diff line number Diff line change @@ -214,6 +214,7 @@ impl<T> Mutex<T> {
214214 /// let mutex = Mutex::new(0);
215215 /// ```
216216 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
217+ #[ rustc_const_stable( feature = "const_locks" , since = "1.63.0" ) ]
217218 #[ inline]
218219 pub const fn new ( t : T ) -> Mutex < T > {
219220 Mutex {
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ impl<T> RwLock<T> {
146146 /// let lock = RwLock::new(5);
147147 /// ```
148148 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
149+ #[ rustc_const_stable( feature = "const_locks" , since = "1.63.0" ) ]
149150 #[ inline]
150151 pub const fn new ( t : T ) -> RwLock < T > {
151152 RwLock {
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ unsafe impl Sync for MovableMutex {}
6262impl MovableMutex {
6363 /// Creates a new mutex.
6464 #[ inline]
65- pub fn new ( ) -> Self {
65+ pub const fn new ( ) -> Self {
6666 Self ( imp:: MovableMutex :: new ( ) )
6767 }
6868
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ pub struct MovableRwLock(imp::MovableRwLock);
7575impl MovableRwLock {
7676 /// Creates a new reader-writer lock for use.
7777 #[ inline]
78- pub fn new ( ) -> Self {
78+ pub const fn new ( ) -> Self {
7979 Self ( imp:: MovableRwLock :: new ( ) )
8080 }
8181
You can’t perform that action at this time.
0 commit comments