-
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
Introduce Rc::into_inner
, as a parallel to Arc::into_inner
#109026
Conversation
r? @cuviper (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Unlike `Arc`, `Rc` doesn't have the same race condition to avoid, but maintaining an equivalent API still makes it easier to work with both `Rc` and `Arc`.
ac4bd52
to
a2341fb
Compare
@bors r+ |
Introduce `Rc::into_inner`, as a parallel to `Arc::into_inner` Unlike `Arc`, `Rc` doesn't have the same race condition to avoid, but maintaining an equivalent API still makes it easier to work with both `Rc` and `Arc`.
@bors r- please r+ prs where CI is already failing... 🙃 |
library/alloc/src/rc/tests.rs
Outdated
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One less newline will make the formatting tidy check happy :-)
@bors r=dtolnay Thanks for the fix! |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#108651 (Forbid the use of `#[target_feature]` on `main`) - rust-lang#109009 (rustdoc: use restricted Damerau-Levenshtein distance for search) - rust-lang#109026 (Introduce `Rc::into_inner`, as a parallel to `Arc::into_inner`) - rust-lang#109029 (Gate usages of `dyn*` and const closures in macros) - rust-lang#109031 (Rename `config.toml.example` to `config.example.toml`) - rust-lang#109032 (Use `TyCtxt::trait_solver_next` in some places) - rust-lang#109047 (typo) - rust-lang#109052 (Add eslint check for rustdoc-gui tester) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I just noticed that the |
On Mon, Mar 13, 2023 at 03:37:44AM -0700, Frank Steffahn wrote:
I just noticed that the `Rc::into_inner` defined in this PR introduced its own feature gate “`rc_into_inner`” instead of using “`arc_into_inner`”, too. Was that intentional?
Yes, because I didn't want this PR to precommit to stabilizing
simultaneously.
|
Okay. So does that mean the stabilization FCP in the tracking issue is only concerned with stabilizing Edit: Just noticed the sentence “shall we stabilize these” after that, which sounds like it fairly clearly refers to both, in which case, I can’t really say I’m fully understanding the procedure. Or actually… maybe the argument is simply that this makes it easier to have the option to stabilize just one of them without needing to re-label the function’s feature flag? In any case, the tracking issue should perhaps be updated to mention |
Exactly. |
Unlike
Arc
,Rc
doesn't have the same race condition to avoid, butmaintaining an equivalent API still makes it easier to work with both
Rc
andArc
.