-
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
Add Arc::into_inner
for safely discarding Arc
s without calling the destructor on the inner type.
#106854
Conversation
(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
|
@rustbot label +T-libs-api -T-libs |
Arc::into_inner
for safely discarding Arc
s without calling the destructor on the inner type.
ACP… that’s something new o.O So I should open an ACP issue? I’d just copy the bottom section from #79665 with a new render of the documentation. |
00913ca
to
2d8f4c0
Compare
Yeah that's something new we're trying out to separate the 'should we have this' discussion from the implementation review. (And to allow that discussion to happen before the implementation, in case you don't want to risk implementing something that won't be accepted.) |
Added a remark as suggested in #79665 (comment) |
r=me with commits squashed, thanks! |
…structor on the inner type. Mainly rebased and squashed from PR rust-lang#79665, furthermore includes minor changes in comments.
3eec330
to
33696fa
Compare
squashed |
@bors r+ |
Rollup of 7 pull requests Successful merges: - rust-lang#104926 (Move relationships from FulfillmentContext to Inherited) - rust-lang#106854 (Add `Arc::into_inner` for safely discarding `Arc`s without calling the destructor on the inner type.) - rust-lang#107108 (Consider doc(alias) when providing typo suggestions) - rust-lang#107186 (rustdoc: Use correct pseudo-element selector) - rust-lang#107192 (Add myself to the mailmap) - rust-lang#107195 (Fix typo in universal_regions.rs comment) - rust-lang#107203 (Suggest remove deref for type mismatch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@steffahn congratulations to this being landed and stabilizing!
Except that for the unsized types, only one call to a function will succeed, but it will not be able to return the inner value.
Maybe I'm missing something? Or maybe this discussion has already happened somewhere, excuse me for not finding it! |
ACP: rust-lang/libs-team#162
Reviving #79665.
I want to get this merged this time; this does not contain changes (apart from very minor changes in comments/docs).
See #79665 for further description of the PR. The only “unresolved” points that led to that PR being closed, AFAICT, were
Rc::into_inner
functioninto_inner
” (?)into_inner
seems fine to me; also, this PR introduces unstable API, and names can be changed later, tooI don't know if a tracking issue for the feature flag is supposed to be opened before or after this PR gets merged (if before, then I can add the issue number to theThere is a tracking issue now.#[unstable…]
attribute)I say “unresolved” in quotation marks because from my point of view, if reviewers agree, the PR can be merged immediately and as-is :-)