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

Remove P: Unpin bound on impl Future for Pin #81363

Merged
merged 4 commits into from
Jul 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Link tracking issue for pin_deref_mut
  • Loading branch information
jonhoo committed Jul 6, 2021
commit cf402921222bd6b3152c6ed55c7039887d12a4c0
2 changes: 1 addition & 1 deletion library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ impl<'a, P: DerefMut> Pin<&'a mut Pin<P>> {
/// move in the future, and this method does not enable the pointee to move. "Malicious"
/// implementations of `P::DerefMut` are likewise ruled out by the contract of
/// `Pin::new_unchecked`.
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
#[unstable(feature = "pin_deref_mut", issue = "none")]
#[unstable(feature = "pin_deref_mut", issue = "86918")]
#[inline(always)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally use #[inline] and only use #[inline(always)] when really necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used #[inline(always)] because that annotation is used on both as_mut and get_mut, and so it feels like the logic that applies there would apply here, but I could be wrong. Happy to change if preferred.

pub fn as_deref_mut(self) -> Pin<&'a mut P::Target> {
// SAFETY: What we're asserting here is that going from
Expand Down