-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Feature gate: #![feature(pin_deref_mut)]
This is a tracking issue for Pin::as_deref_mut
.
The feature adds the method as_deref_mut
to Pin
, which allow a safe transformation from a Pin<&mut Pin<P>>
to a Pin<&mut P::Target>
.
Public API
impl<Ptr> Pin<Ptr> {
pub fn as_deref_mut(self: Pin<&mut Pin<Ptr>>) -> Pin<&mut Ptr::Target>
where
Ptr: DerefMut;
}
Steps / History
- To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Unresolved Questions
- None yet.
teor2345
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
RalfJung commentedon Nov 7, 2022
jonhoo commentedon Nov 7, 2022
coolreader18 commentedon Nov 16, 2023
Are there any remaining blockers on this? It's a pretty useful function for blanket impls for traits with poll methods (e.g. Future already uses it in its
impl<P> Future for Pin<P>
impl).jonhoo commentedon Nov 18, 2023
Not that I know of — given it touches the
Pin
machinery, I suspect it should go through an actual FCP, but I'll let others be the judge of that :)Pin::as_deref_mut()
stabilizes) ardaku/event_iterator#1dtolnay commentedon Jun 25, 2024
Currently this method is located in its own solitary impl block:
I'd like to consider changing it to:
Some advantages:
as_ref
andas_mut
signatures (stable since Rust 1.33)Pin::<&mut T>::as_deref_mut
vsPin::<&mut Pin<&mut T>>::as_deref_mut
thynson commentedon Jul 11, 2024
Any concern blocks this from stablization?
jonhoo commentedon Jul 15, 2024
@dtolnay I agree — that is better 👍
Pin::as_deref_mut()
#129424Rollup merge of rust-lang#129449 - coolreader18:pin-as_deref_mut-sign…
29 remaining items