Skip to content
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

Tracking Issue for pin_deref_mut #86918

Open
1 of 3 tasks
jonhoo opened this issue Jul 6, 2021 · 4 comments
Open
1 of 3 tasks

Tracking Issue for pin_deref_mut #86918

jonhoo opened this issue Jul 6, 2021 · 4 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Jul 6, 2021

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<'a, P: DerefMut> Pin<&'a mut Pin<P>> {
    pub fn as_deref_mut(self) -> Pin<&'a mut P::Target> { /* .. */ }
}

Steps / History

Unresolved Questions

  • None yet.
@jonhoo jonhoo added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 6, 2021
@RalfJung
Copy link
Member

RalfJung commented Nov 7, 2022

from a Pin<P>

It's from a Pin<&'a mut Pin<P>>, right? The nesting is a bit odd. But I guess it is what comes up in practice?

@jonhoo
Copy link
Contributor Author

jonhoo commented Nov 7, 2022

Ah, yes, sorry — fixed!

@coolreader18
Copy link
Contributor

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
Copy link
Contributor Author

jonhoo commented 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants