Skip to content

Commit 5e1b335

Browse files
authored
Unrolled build for #146904
Rollup merge of #146904 - peter-lyons-kehl:140368_data_ptr_const_fn, r=Amanieu #140368 Mutex/RwLock/ReentrantLock::data_ptr to be const fn
2 parents 3e887f5 + 819f8b0 commit 5e1b335

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

library/std/src/sync/nonpoison/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl<T: ?Sized> Mutex<T> {
373373
/// or written through after the mutex is dropped.
374374
#[unstable(feature = "mutex_data_ptr", issue = "140368")]
375375
// #[unstable(feature = "nonpoison_mutex", issue = "134645")]
376-
pub fn data_ptr(&self) -> *mut T {
376+
pub const fn data_ptr(&self) -> *mut T {
377377
self.data.get()
378378
}
379379
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ impl<T: ?Sized> RwLock<T> {
495495
/// or written through after the lock is dropped.
496496
#[unstable(feature = "rwlock_data_ptr", issue = "140368")]
497497
// #[unstable(feature = "nonpoison_rwlock", issue = "134645")]
498-
pub fn data_ptr(&self) -> *mut T {
498+
pub const fn data_ptr(&self) -> *mut T {
499499
self.data.get()
500500
}
501501
}

library/std/src/sync/poison/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ impl<T: ?Sized> Mutex<T> {
668668
/// are properly synchronized to avoid data races, and that it is not read
669669
/// or written through after the mutex is dropped.
670670
#[unstable(feature = "mutex_data_ptr", issue = "140368")]
671-
pub fn data_ptr(&self) -> *mut T {
671+
pub const fn data_ptr(&self) -> *mut T {
672672
self.data.get()
673673
}
674674
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ impl<T: ?Sized> RwLock<T> {
667667
/// are properly synchronized to avoid data races, and that it is not read
668668
/// or written through after the lock is dropped.
669669
#[unstable(feature = "rwlock_data_ptr", issue = "140368")]
670-
pub fn data_ptr(&self) -> *mut T {
670+
pub const fn data_ptr(&self) -> *mut T {
671671
self.data.get()
672672
}
673673
}

library/std/src/sync/reentrant_lock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl<T: ?Sized> ReentrantLock<T> {
355355
/// properly synchronized to avoid data races, and that it is not read
356356
/// through after the lock is dropped.
357357
#[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 {
359359
&raw const self.data
360360
}
361361

0 commit comments

Comments
 (0)