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 lifetime from pinned self in trait #6

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
//! type Output = ();
//!
//! fn poll_with_strategy<'a, S: Strategy<'a>>(
//! mut self: Pin<&'a mut Self>,
//! mut self: Pin<&mut Self>,
//! strategy: &mut S,
//! context: &mut S::Context,
//! ) -> Poll<Self::Output> {
Expand Down Expand Up @@ -220,7 +220,7 @@ macro_rules! easy_wrapper {
}

pub(crate) fn poll_with_strategy<'__strategy, __S: $crate::Strategy<'__strategy>>(
self: ::core::pin::Pin<&'__strategy mut Self>,
self: ::core::pin::Pin<&mut Self>,
strategy: &mut __S,
context: &mut __S::Context,
) -> ::core::task::Poll<$output> {
Expand Down Expand Up @@ -284,7 +284,7 @@ pub trait EventListenerFuture {
/// This function should use the `Strategy::poll` method to poll the future, and proceed
/// based on the result.
fn poll_with_strategy<'a, S: Strategy<'a>>(
self: Pin<&'a mut Self>,
self: Pin<&mut Self>,
strategy: &mut S,
context: &mut S::Context,
) -> Poll<Self::Output>;
Expand Down
8 changes: 4 additions & 4 deletions tests/easy_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn easy_wrapper_generics() {
type Output = ();

fn poll_with_strategy<'a, S: Strategy<'a>>(
self: Pin<&'a mut Self>,
self: Pin<&mut Self>,
_strategy: &mut S,
_context: &mut S::Context,
) -> Poll<Self::Output> {
Expand All @@ -41,7 +41,7 @@ fn easy_wrapper_generics() {
type Output = T;

fn poll_with_strategy<'a, S: Strategy<'a>>(
self: Pin<&'a mut Self>,
self: Pin<&mut Self>,
_strategy: &mut S,
_context: &mut S::Context,
) -> Poll<Self::Output> {
Expand All @@ -64,7 +64,7 @@ fn easy_wrapper_generics() {
type Output = &'a ();

fn poll_with_strategy<'b, S: Strategy<'b>>(
self: Pin<&'b mut Self>,
self: Pin<&mut Self>,
_strategy: &mut S,
_context: &mut S::Context,
) -> Poll<Self::Output> {
Expand Down Expand Up @@ -93,7 +93,7 @@ fn easy_wrapper_generics() {
type Output = &'a T;

fn poll_with_strategy<'b, S: Strategy<'b>>(
self: Pin<&'b mut Self>,
self: Pin<&mut Self>,
_strategy: &mut S,
_context: &mut S::Context,
) -> Poll<Self::Output> {
Expand Down