-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl Arc::unwrap_or_clone
#91589
impl Arc::unwrap_or_clone
#91589
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
r? rust-lang/libs |
This seems reasonable to me, though I wonder if we should (also) have a more generic For this pr:
|
Actually, that wouldn't work. Sorry. That'd introduce a race where the object gets dropped while you're cloning it. This would only work for |
The function gets the inner value, cloning only if necessary.
80b2251
to
2b58031
Compare
OK I've added a tracking issue, and duplicated the code into |
This comment has been minimized.
This comment has been minimized.
2b58031
to
f5e6d16
Compare
@bors r+ |
📌 Commit f5e6d16 has been approved by |
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#90132 (Stabilize `-Z instrument-coverage` as `-C instrument-coverage`) - rust-lang#91589 (impl `Arc::unwrap_or_clone`) - rust-lang#93495 (kmc-solid: Fix off-by-one error in `SystemTime::now`) - rust-lang#93576 (Emit more valid HTML from rustdoc) - rust-lang#93608 (Clean up `find_library_crate`) - rust-lang#93612 (doc: use U+2212 for minus sign in integer MIN/MAX text) - rust-lang#93615 (Fix `isize` optimization in `StableHasher` for big-endian architectures) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Summary: Fixes the failure in T187825473 caused by D56339821. This diff fixes the failing github action in https://github.com/facebook/relay/actions/runs/8932140521/job/24535481318 which was caused due to the addition of an unstable API in Arc (f7b030e). I've replaced the function with it's internal implemention from the PR to ARC at rust-lang/rust#91589. Reviewed By: tyao1 Differential Revision: D56920263 fbshipit-source-id: e2d3f04921dd1e4b554ef075e258854b59764891
The function gets the inner value, cloning only if necessary. The conversation started on
irlo
. If the reviewer think the PR has potential to be merged, and does not need an RFC, then I will create the corresponding tracking issues and update the PR.Alternative names
into_inner
make_owned
make_unique
take_*
(take_inner
?)