Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/std/src/sync/nonpoison/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl<T: ?Sized> Mutex<T> {
/// or written through after the mutex is dropped.
#[unstable(feature = "mutex_data_ptr", issue = "140368")]
// #[unstable(feature = "nonpoison_mutex", issue = "134645")]
pub fn data_ptr(&self) -> *mut T {
pub const fn data_ptr(&self) -> *mut T {
self.data.get()
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/nonpoison/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ impl<T: ?Sized> RwLock<T> {
/// or written through after the lock is dropped.
#[unstable(feature = "rwlock_data_ptr", issue = "140368")]
// #[unstable(feature = "nonpoison_rwlock", issue = "134645")]
pub fn data_ptr(&self) -> *mut T {
pub const fn data_ptr(&self) -> *mut T {
self.data.get()
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/poison/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ impl<T: ?Sized> Mutex<T> {
/// are properly synchronized to avoid data races, and that it is not read
/// or written through after the mutex is dropped.
#[unstable(feature = "mutex_data_ptr", issue = "140368")]
pub fn data_ptr(&self) -> *mut T {
pub const fn data_ptr(&self) -> *mut T {
self.data.get()
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/poison/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ impl<T: ?Sized> RwLock<T> {
/// are properly synchronized to avoid data races, and that it is not read
/// or written through after the lock is dropped.
#[unstable(feature = "rwlock_data_ptr", issue = "140368")]
pub fn data_ptr(&self) -> *mut T {
pub const fn data_ptr(&self) -> *mut T {
self.data.get()
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/reentrant_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl<T: ?Sized> ReentrantLock<T> {
/// properly synchronized to avoid data races, and that it is not read
/// through after the lock is dropped.
#[unstable(feature = "reentrant_lock_data_ptr", issue = "140368")]
pub fn data_ptr(&self) -> *const T {
pub const fn data_ptr(&self) -> *const T {
&raw const self.data
}

Expand Down
Loading