Uh oh!
There was an error while loading. Please reload this page.
Add data_ptr method to Mutex and RwLock - #140369
Merged
Merged
Conversation
rustbot
commented
Apr 27, 2025
Collaborator
tgross35
commented
Apr 27, 2025
Member
This seems fine to me, but libs-api didn't specify an exact API so I'll ask them to review. r? @Amanieu |
4 tasks
Amanieu
commented
May 19, 2025
Member
Can you add this for Also add a sentence to the docs saying that you are responsible for ensuring that accesses to the data are synchronized properly. |
This comment has been minimized.
This comment has been minimized.
jplatteforce-pushed
the
mutex-rwlock-data-ptr
branch
from
May 21, 2025 06:07
e9bc1d1 to
20589bdCompareContributorAuthor
I wasn't previously familiar with the unstable Do you have any comments about the unresolved questions? |
Amanieu
commented
May 26, 2025
Member
@bors r+ |
bors
commented
May 26, 2025
Collaborator
bors added a commit
that referenced
this pull request
May 27, 2025
Add data_ptr method to Mutex and RwLock Implementation of #140368 / rust-lang/libs-team#531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
bors
commented
May 27, 2025
Collaborator
bors
commented
May 27, 2025
Collaborator
💥 Test timed out |
rust-log-analyzer
commented
May 27, 2025
Collaborator
tgross35
commented
May 28, 2025
Member
tgross35 added a commit
to tgross35/rust
that referenced
this pull request
May 28, 2025
…manieu Add data_ptr method to Mutex and RwLock Implementation of rust-lang#140368 / rust-lang/libs-team#531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
bors added a commit
that referenced
this pull request
May 28, 2025
Rollup of 8 pull requests Successful merges: - #140369 (Add data_ptr method to Mutex and RwLock) - #140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - #141404 (Improve intrinsic handling in cg_ssa) - #141407 (Refactor the two-phase check for impls and impl items) - #141411 (rustdoc: linking to a local proc macro no longer warns) - #141548 (consider glob imports in cfg suggestion) - #141627 (Drop-build cleanups) - #141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
jhpratt added a commit
to jhpratt/rust
that referenced
this pull request
May 28, 2025
…manieu Add data_ptr method to Mutex and RwLock Implementation of rust-lang#140368 / rust-lang/libs-team#531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
bors added a commit
that referenced
this pull request
May 28, 2025
Rollup of 8 pull requests Successful merges: - #140369 (Add data_ptr method to Mutex and RwLock) - #140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - #141404 (Improve intrinsic handling in cg_ssa) - #141407 (Refactor the two-phase check for impls and impl items) - #141411 (rustdoc: linking to a local proc macro no longer warns) - #141548 (consider glob imports in cfg suggestion) - #141627 (Drop-build cleanups) - #141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
bors added a commit
that referenced
this pull request
May 28, 2025
Rollup of 7 pull requests Successful merges: - #140369 (Add data_ptr method to Mutex and RwLock) - #140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`) - #141404 (Improve intrinsic handling in cg_ssa) - #141411 (rustdoc: linking to a local proc macro no longer warns) - #141548 (consider glob imports in cfg suggestion) - #141627 (Drop-build cleanups) - #141670 (Fix ICE in tokenstream with contracts from parser recovery) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit
that referenced
this pull request
May 28, 2025
Rollup merge of #140369 - jplatte:mutex-rwlock-data-ptr, r=Amanieu Add data_ptr method to Mutex and RwLock Implementation of #140368 / rust-lang/libs-team#531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
github-actionsBot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
May 30, 2025
…manieu Add data_ptr method to Mutex and RwLock Implementation of rust-lang#140368 / rust-lang/libs-team#531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of #140368 / rust-lang/libs-team#531.
I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course.
Unresolved questions:
LockResultor not?*mut Tlike existing APIs (Cell::as_ptr/MaybeUninit::as[_mut]_ptr/Vec::as_ptr/ ...) or be more precise and returnNonNull<T>?