File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ impl<T: ?Sized> Mutex<T> {
373
373
/// or written through after the mutex is dropped.
374
374
#[ unstable( feature = "mutex_data_ptr" , issue = "140368" ) ]
375
375
// #[unstable(feature = "nonpoison_mutex", issue = "134645")]
376
- pub fn data_ptr ( & self ) -> * mut T {
376
+ pub const fn data_ptr ( & self ) -> * mut T {
377
377
self . data . get ( )
378
378
}
379
379
}
Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ impl<T: ?Sized> RwLock<T> {
495
495
/// or written through after the lock is dropped.
496
496
#[ unstable( feature = "rwlock_data_ptr" , issue = "140368" ) ]
497
497
// #[unstable(feature = "nonpoison_rwlock", issue = "134645")]
498
- pub fn data_ptr ( & self ) -> * mut T {
498
+ pub const fn data_ptr ( & self ) -> * mut T {
499
499
self . data . get ( )
500
500
}
501
501
}
Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ impl<T: ?Sized> Mutex<T> {
668
668
/// are properly synchronized to avoid data races, and that it is not read
669
669
/// or written through after the mutex is dropped.
670
670
#[ unstable( feature = "mutex_data_ptr" , issue = "140368" ) ]
671
- pub fn data_ptr ( & self ) -> * mut T {
671
+ pub const fn data_ptr ( & self ) -> * mut T {
672
672
self . data . get ( )
673
673
}
674
674
}
Original file line number Diff line number Diff line change @@ -667,7 +667,7 @@ impl<T: ?Sized> RwLock<T> {
667
667
/// are properly synchronized to avoid data races, and that it is not read
668
668
/// or written through after the lock is dropped.
669
669
#[ unstable( feature = "rwlock_data_ptr" , issue = "140368" ) ]
670
- pub fn data_ptr ( & self ) -> * mut T {
670
+ pub const fn data_ptr ( & self ) -> * mut T {
671
671
self . data . get ( )
672
672
}
673
673
}
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ impl<T: ?Sized> ReentrantLock<T> {
355
355
/// properly synchronized to avoid data races, and that it is not read
356
356
/// through after the lock is dropped.
357
357
#[ unstable( feature = "reentrant_lock_data_ptr" , issue = "140368" ) ]
358
- pub fn data_ptr ( & self ) -> * const T {
358
+ pub const fn data_ptr ( & self ) -> * const T {
359
359
& raw const self . data
360
360
}
361
361
You can’t perform that action at this time.
0 commit comments