diff --git a/futures-io/src/lib.rs b/futures-io/src/lib.rs index fe30d736b0..9e91574b74 100644 --- a/futures-io/src/lib.rs +++ b/futures-io/src/lib.rs @@ -319,8 +319,8 @@ mod if_std { /// `Interrupted`. Implementations must convert `WouldBlock` into /// `Poll::Pending` and either internally retry or convert /// `Interrupted` into another error kind. - fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, cx: &mut Context<'_>) - -> Poll>; + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) + -> Poll>; /// Tells this buffer that `amt` bytes have been consumed from the buffer, /// so they should no longer be returned in calls to [`poll_read`]. @@ -597,8 +597,8 @@ mod if_std { macro_rules! deref_async_buf_read { () => { - fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, cx: &mut Context<'_>) - -> Poll> + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) + -> Poll> { Pin::new(&mut **self.get_mut()).poll_fill_buf(cx) } @@ -622,8 +622,8 @@ mod if_std { P: DerefMut + Unpin, P::Target: AsyncBufRead, { - fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, cx: &mut Context<'_>) - -> Poll> + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) + -> Poll> { self.get_mut().as_mut().poll_fill_buf(cx) } @@ -635,8 +635,8 @@ mod if_std { macro_rules! delegate_async_buf_read_to_stdio { () => { - fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, _: &mut Context<'_>) - -> Poll> + fn poll_fill_buf(self: Pin<&mut Self>, _: &mut Context<'_>) + -> Poll> { Poll::Ready(io::BufRead::fill_buf(self.get_mut())) } diff --git a/futures-test/src/interleave_pending.rs b/futures-test/src/interleave_pending.rs index aac3bac9a0..302075a646 100644 --- a/futures-test/src/interleave_pending.rs +++ b/futures-test/src/interleave_pending.rs @@ -47,7 +47,7 @@ impl InterleavePending { /// Acquires a pinned mutable reference to the underlying I/O object that /// this adaptor is wrapping. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut T> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> { self.project().0 } @@ -56,7 +56,7 @@ impl InterleavePending { self.inner } - fn project<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut T>, &'a mut bool) { + fn project(self: Pin<&mut Self>) -> (Pin<&mut T>, &mut bool) { unsafe { let this = self.get_unchecked_mut(); (Pin::new_unchecked(&mut this.inner), &mut this.pended) @@ -185,10 +185,10 @@ impl AsyncRead for InterleavePending { } impl AsyncBufRead for InterleavePending { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, + fn poll_fill_buf( + self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { let (reader, pended) = self.project(); if *pended { let next = reader.poll_fill_buf(cx); diff --git a/futures-test/src/io/limited.rs b/futures-test/src/io/limited.rs index 5d6228d9d3..68ba674d4d 100644 --- a/futures-test/src/io/limited.rs +++ b/futures-test/src/io/limited.rs @@ -42,7 +42,7 @@ impl Limited { /// Acquires a pinned mutable reference to the underlying I/O object that /// this adaptor is wrapping. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Io> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Io> { self.io() } @@ -89,10 +89,10 @@ impl AsyncRead for Limited { } impl AsyncBufRead for Limited { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, + fn poll_fill_buf( + self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { self.io().poll_fill_buf(cx) } diff --git a/futures-util/src/future/either.rs b/futures-util/src/future/either.rs index 0414b5a6d5..5027d320fd 100644 --- a/futures-util/src/future/either.rs +++ b/futures-util/src/future/either.rs @@ -278,10 +278,10 @@ mod if_std { A: AsyncBufRead, B: AsyncBufRead, { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, + fn poll_fill_buf( + self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { unsafe { match self.get_unchecked_mut() { Either::Left(x) => Pin::new_unchecked(x).poll_fill_buf(cx), diff --git a/futures-util/src/future/flatten_stream.rs b/futures-util/src/future/flatten_stream.rs index 20703e1f71..d1108866ca 100644 --- a/futures-util/src/future/flatten_stream.rs +++ b/futures-util/src/future/flatten_stream.rs @@ -41,7 +41,7 @@ enum State { } impl State { - fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> State, Pin<&'a mut St>> { + fn get_pin_mut(self: Pin<&mut Self>) -> State, Pin<&mut St>> { // safety: data is never moved via the resulting &mut reference match unsafe { self.get_unchecked_mut() } { // safety: the future we're re-pinning here will never be moved; diff --git a/futures-util/src/future/join_all.rs b/futures-util/src/future/join_all.rs index 9512c5d8ce..9a6d82dc4f 100644 --- a/futures-util/src/future/join_all.rs +++ b/futures-util/src/future/join_all.rs @@ -23,7 +23,7 @@ impl ElemState where F: Future, { - fn pending_pin_mut<'a>(self: Pin<&'a mut Self>) -> Option> { + fn pending_pin_mut(self: Pin<&mut Self>) -> Option> { // Safety: Basic enum pin projection, no drop + optionally Unpin based // on the type of this variant match unsafe { self.get_unchecked_mut() } { diff --git a/futures-util/src/future/maybe_done.rs b/futures-util/src/future/maybe_done.rs index 3bbfb2f990..d359191bac 100644 --- a/futures-util/src/future/maybe_done.rs +++ b/futures-util/src/future/maybe_done.rs @@ -50,7 +50,7 @@ impl MaybeDone { /// future has been completed and [`take_output`](MaybeDone::take_output) /// has not yet been called. #[inline] - pub fn output_mut<'a>(self: Pin<&'a mut Self>) -> Option<&'a mut Fut::Output> { + pub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Output> { unsafe { let this = self.get_unchecked_mut(); match this { diff --git a/futures-util/src/io/allow_std.rs b/futures-util/src/io/allow_std.rs index 4e752bb1e9..63cda335e2 100644 --- a/futures-util/src/io/allow_std.rs +++ b/futures-util/src/io/allow_std.rs @@ -157,8 +157,8 @@ impl io::BufRead for AllowStdIo where T: io::BufRead { } impl AsyncBufRead for AllowStdIo where T: io::BufRead { - fn poll_fill_buf<'a>(mut self: Pin<&'a mut Self>, _: &mut Context<'_>) - -> Poll> + fn poll_fill_buf(mut self: Pin<&mut Self>, _: &mut Context<'_>) + -> Poll> { let this: *mut Self = &mut *self as *mut _; Poll::Ready(Ok(try_with_interrupt!(unsafe { &mut *this }.0.fill_buf()))) diff --git a/futures-util/src/io/buf_reader.rs b/futures-util/src/io/buf_reader.rs index a8d5e6c57f..6f7a026c1c 100644 --- a/futures-util/src/io/buf_reader.rs +++ b/futures-util/src/io/buf_reader.rs @@ -75,7 +75,7 @@ impl BufReader { /// Gets a pinned mutable reference to the underlying reader. /// /// It is inadvisable to directly read from the underlying reader. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut R> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R> { self.inner() } @@ -172,10 +172,10 @@ impl AsyncRead for BufReader { } impl AsyncBufRead for BufReader { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, + fn poll_fill_buf( + self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { let Self { inner, buf, cap, pos } = unsafe { self.get_unchecked_mut() }; let mut inner = unsafe { Pin::new_unchecked(inner) }; diff --git a/futures-util/src/io/buf_writer.rs b/futures-util/src/io/buf_writer.rs index ae8198c2bc..642d533df6 100644 --- a/futures-util/src/io/buf_writer.rs +++ b/futures-util/src/io/buf_writer.rs @@ -96,7 +96,7 @@ impl BufWriter { /// Gets a pinned mutable reference to the underlying writer. /// /// It is inadvisable to directly write to the underlying writer. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut W> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut W> { self.inner() } diff --git a/futures-util/src/io/copy_buf_into.rs b/futures-util/src/io/copy_buf_into.rs index 37b122a8d9..0eb3d07399 100644 --- a/futures-util/src/io/copy_buf_into.rs +++ b/futures-util/src/io/copy_buf_into.rs @@ -26,7 +26,7 @@ impl CopyBufInto<'_, R, W> { } impl CopyBufInto<'_, R, W> { - fn project<'b>(self: Pin<&'b mut Self>) -> (Pin<&'b mut R>, Pin<&'b mut W>, &'b mut u64) { + fn project(self: Pin<&mut Self>) -> (Pin<&mut R>, Pin<&mut W>, &mut u64) { unsafe { let this = self.get_unchecked_mut(); (Pin::new_unchecked(&mut this.reader), Pin::new(&mut *this.writer), &mut this.amt) diff --git a/futures-util/src/io/into_sink.rs b/futures-util/src/io/into_sink.rs index fdb6b85b2a..8bb8336bd6 100644 --- a/futures-util/src/io/into_sink.rs +++ b/futures-util/src/io/into_sink.rs @@ -32,7 +32,7 @@ impl> IntoSink { IntoSink { writer, buffer: None } } - fn project<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut W>, &'a mut Option>) { + fn project(self: Pin<&mut Self>) -> (Pin<&mut W>, &mut Option>) { unsafe { let this = self.get_unchecked_mut(); (Pin::new_unchecked(&mut this.writer), &mut this.buffer) diff --git a/futures-util/src/sink/buffer.rs b/futures-util/src/sink/buffer.rs index c2e7ca6d6e..a39ff9d749 100644 --- a/futures-util/src/sink/buffer.rs +++ b/futures-util/src/sink/buffer.rs @@ -42,7 +42,7 @@ impl, Item> Buffer { } /// Get a pinned mutable reference to the inner sink. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Si> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Si> { self.sink() } diff --git a/futures-util/src/sink/err_into.rs b/futures-util/src/sink/err_into.rs index 2118c409f0..b1b99a2bf7 100644 --- a/futures-util/src/sink/err_into.rs +++ b/futures-util/src/sink/err_into.rs @@ -35,7 +35,7 @@ impl SinkErrInto } /// Get a pinned mutable reference to the inner sink. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Si> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Si> { self.sink().get_pin_mut() } diff --git a/futures-util/src/sink/fanout.rs b/futures-util/src/sink/fanout.rs index 8ecf4a68c7..00d306241f 100644 --- a/futures-util/src/sink/fanout.rs +++ b/futures-util/src/sink/fanout.rs @@ -33,7 +33,7 @@ impl Fanout { } /// Get a pinned mutable reference to the inner sinks. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut Si1>, Pin<&'a mut Si2>) + pub fn get_pin_mut(self: Pin<&mut Self>) -> (Pin<&mut Si1>, Pin<&mut Si2>) where Si1: Unpin, Si2: Unpin, { let Self { sink1, sink2 } = self.get_mut(); diff --git a/futures-util/src/sink/map_err.rs b/futures-util/src/sink/map_err.rs index 1263b294ed..a7b102ca41 100644 --- a/futures-util/src/sink/map_err.rs +++ b/futures-util/src/sink/map_err.rs @@ -33,7 +33,7 @@ impl SinkMapErr { } /// Get a pinned mutable reference to the inner sink. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Si> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Si> { self.sink() } diff --git a/futures-util/src/sink/with.rs b/futures-util/src/sink/with.rs index e5a9ee5e6f..10cf3c120a 100644 --- a/futures-util/src/sink/with.rs +++ b/futures-util/src/sink/with.rs @@ -68,10 +68,7 @@ enum State { } impl State { - #[allow(clippy::wrong_self_convention)] - fn as_pin_mut<'a>( - self: Pin<&'a mut Self>, - ) -> State, Pin<&'a mut T>> { + fn get_pin_mut(self: Pin<&mut Self>) -> State, Pin<&mut T>> { unsafe { match self.get_unchecked_mut() { State::Empty => @@ -118,7 +115,7 @@ impl With } /// Get a pinned mutable reference to the inner sink. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Si> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Si> { self.sink() } @@ -134,7 +131,7 @@ impl With mut self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll> { - let buffered = match self.as_mut().state().as_pin_mut() { + let buffered = match self.as_mut().state().get_pin_mut() { State::Empty => return Poll::Ready(Ok(())), State::Process(fut) => Some(ready!(fut.poll(cx))?), State::Buffered(_) => None, diff --git a/futures-util/src/sink/with_flat_map.rs b/futures-util/src/sink/with_flat_map.rs index 6a48509613..1aa186785a 100644 --- a/futures-util/src/sink/with_flat_map.rs +++ b/futures-util/src/sink/with_flat_map.rs @@ -71,7 +71,7 @@ where } /// Get a pinned mutable reference to the inner sink. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut Si> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Si> { self.sink() } diff --git a/futures-util/src/stream/buffer_unordered.rs b/futures-util/src/stream/buffer_unordered.rs index 479a1093ef..4ade282332 100644 --- a/futures-util/src/stream/buffer_unordered.rs +++ b/futures-util/src/stream/buffer_unordered.rs @@ -81,7 +81,7 @@ where /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream().get_pin_mut() } diff --git a/futures-util/src/stream/buffered.rs b/futures-util/src/stream/buffered.rs index d63c479a6b..7b451c5ea2 100644 --- a/futures-util/src/stream/buffered.rs +++ b/futures-util/src/stream/buffered.rs @@ -76,7 +76,7 @@ where /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream().get_pin_mut() } diff --git a/futures-util/src/stream/chunks.rs b/futures-util/src/stream/chunks.rs index ff9a6a56d8..bf75bb24bf 100644 --- a/futures-util/src/stream/chunks.rs +++ b/futures-util/src/stream/chunks.rs @@ -58,7 +58,7 @@ impl Chunks where St: Stream { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream().get_pin_mut() } diff --git a/futures-util/src/stream/enumerate.rs b/futures-util/src/stream/enumerate.rs index 774dfbe1f9..c5fbdf34fe 100644 --- a/futures-util/src/stream/enumerate.rs +++ b/futures-util/src/stream/enumerate.rs @@ -46,7 +46,7 @@ impl Enumerate { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/filter.rs b/futures-util/src/stream/filter.rs index 471105a5a3..ad807da7cf 100644 --- a/futures-util/src/stream/filter.rs +++ b/futures-util/src/stream/filter.rs @@ -78,7 +78,7 @@ where St: Stream, /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/filter_map.rs b/futures-util/src/stream/filter_map.rs index 9ffcb93d76..d22cd8bd61 100644 --- a/futures-util/src/stream/filter_map.rs +++ b/futures-util/src/stream/filter_map.rs @@ -67,7 +67,7 @@ impl FilterMap /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/flatten.rs b/futures-util/src/stream/flatten.rs index df43f7e1ee..003777e78a 100644 --- a/futures-util/src/stream/flatten.rs +++ b/futures-util/src/stream/flatten.rs @@ -51,7 +51,7 @@ where St: Stream, /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/fuse.rs b/futures-util/src/stream/fuse.rs index 5ef42208fa..9e6cbe8d15 100644 --- a/futures-util/src/stream/fuse.rs +++ b/futures-util/src/stream/fuse.rs @@ -52,7 +52,7 @@ impl Fuse { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/inspect.rs b/futures-util/src/stream/inspect.rs index 90876df216..1827256a68 100644 --- a/futures-util/src/stream/inspect.rs +++ b/futures-util/src/stream/inspect.rs @@ -57,7 +57,7 @@ impl Inspect /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/into_future.rs b/futures-util/src/stream/into_future.rs index 926708db25..572556ae08 100644 --- a/futures-util/src/stream/into_future.rs +++ b/futures-util/src/stream/into_future.rs @@ -53,7 +53,7 @@ impl StreamFuture { /// implementation of `Future::poll` consumes the underlying stream during polling /// in order to return it to the caller of `Future::poll` if the stream yielded /// an element. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Option> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Option> { Pin::new(&mut self.get_mut().stream).as_pin_mut() } diff --git a/futures-util/src/stream/map.rs b/futures-util/src/stream/map.rs index 1132a6ad25..255e46ac1f 100644 --- a/futures-util/src/stream/map.rs +++ b/futures-util/src/stream/map.rs @@ -57,7 +57,7 @@ impl Map /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/peek.rs b/futures-util/src/stream/peek.rs index abdf2be9f6..636f45752d 100644 --- a/futures-util/src/stream/peek.rs +++ b/futures-util/src/stream/peek.rs @@ -51,7 +51,7 @@ impl Peekable { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream().get_pin_mut() } @@ -67,10 +67,10 @@ impl Peekable { /// /// This method polls the underlying stream and return either a reference /// to the next item if the stream is ready or passes through any errors. - pub fn peek<'a>( - mut self: Pin<&'a mut Self>, + pub fn peek( + mut self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { if self.peeked.is_some() { let this: &Self = self.into_ref().get_ref(); return Poll::Ready(this.peeked.as_ref()) diff --git a/futures-util/src/stream/select.rs b/futures-util/src/stream/select.rs index 48f8c3e408..06ea54d366 100644 --- a/futures-util/src/stream/select.rs +++ b/futures-util/src/stream/select.rs @@ -56,7 +56,7 @@ impl Select { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut St1>, Pin<&'a mut St2>) + pub fn get_pin_mut(self: Pin<&mut Self>) -> (Pin<&mut St1>, Pin<&mut St2>) where St1: Unpin, St2: Unpin, { let Self { stream1, stream2, .. } = self.get_mut(); diff --git a/futures-util/src/stream/skip.rs b/futures-util/src/stream/skip.rs index 0c12f87b35..4dd9ade020 100644 --- a/futures-util/src/stream/skip.rs +++ b/futures-util/src/stream/skip.rs @@ -46,7 +46,7 @@ impl Skip { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/skip_while.rs b/futures-util/src/stream/skip_while.rs index 5b125df1f0..440e87d0cf 100644 --- a/futures-util/src/stream/skip_while.rs +++ b/futures-util/src/stream/skip_while.rs @@ -76,7 +76,7 @@ impl SkipWhile /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/take.rs b/futures-util/src/stream/take.rs index a99975e77f..df2750836b 100644 --- a/futures-util/src/stream/take.rs +++ b/futures-util/src/stream/take.rs @@ -46,7 +46,7 @@ impl Take { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/take_while.rs b/futures-util/src/stream/take_while.rs index ac1dbe4429..1f0ba32ca1 100644 --- a/futures-util/src/stream/take_while.rs +++ b/futures-util/src/stream/take_while.rs @@ -78,7 +78,7 @@ impl TakeWhile /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/then.rs b/futures-util/src/stream/then.rs index 47a70e55f4..6dda2684b1 100644 --- a/futures-util/src/stream/then.rs +++ b/futures-util/src/stream/then.rs @@ -68,7 +68,7 @@ impl Then /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/stream/zip.rs b/futures-util/src/stream/zip.rs index e72fec00ce..be6272f962 100644 --- a/futures-util/src/stream/zip.rs +++ b/futures-util/src/stream/zip.rs @@ -57,7 +57,7 @@ impl Zip { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> (Pin<&'a mut St1>, Pin<&'a mut St2>) + pub fn get_pin_mut(self: Pin<&mut Self>) -> (Pin<&mut St1>, Pin<&mut St2>) where St1: Unpin, St2: Unpin, { let Self { stream1, stream2, .. } = self.get_mut(); diff --git a/futures-util/src/try_future/flatten_stream_sink.rs b/futures-util/src/try_future/flatten_stream_sink.rs index fc288a2b49..4fb17b46f0 100644 --- a/futures-util/src/try_future/flatten_stream_sink.rs +++ b/futures-util/src/try_future/flatten_stream_sink.rs @@ -58,7 +58,7 @@ enum State { } impl State { - fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> State, Pin<&'a mut S>> { + fn get_pin_mut(self: Pin<&mut Self>) -> State, Pin<&mut S>> { // safety: data is never moved via the resulting &mut reference match unsafe { self.get_unchecked_mut() } { // safety: the future we're re-pinning here will never be moved; diff --git a/futures-util/src/try_future/try_join_all.rs b/futures-util/src/try_future/try_join_all.rs index e7f8d3465e..ccff4b7858 100644 --- a/futures-util/src/try_future/try_join_all.rs +++ b/futures-util/src/try_future/try_join_all.rs @@ -25,7 +25,7 @@ impl ElemState where F: TryFuture, { - fn pending_pin_mut<'a>(self: Pin<&'a mut Self>) -> Option> { + fn pending_pin_mut(self: Pin<&mut Self>) -> Option> { // Safety: Basic enum pin projection, no drop + optionally Unpin based // on the type of this variant match unsafe { self.get_unchecked_mut() } { diff --git a/futures-util/src/try_stream/and_then.rs b/futures-util/src/try_stream/and_then.rs index e991d3b8a8..c500028b69 100644 --- a/futures-util/src/try_stream/and_then.rs +++ b/futures-util/src/try_stream/and_then.rs @@ -65,7 +65,7 @@ impl AndThen /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/err_into.rs b/futures-util/src/try_stream/err_into.rs index 99c1c178f1..7c5d9f7af1 100644 --- a/futures-util/src/try_stream/err_into.rs +++ b/futures-util/src/try_stream/err_into.rs @@ -43,7 +43,7 @@ impl ErrInto { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/inspect_err.rs b/futures-util/src/try_stream/inspect_err.rs index 1eb53b11b9..528cda70c6 100644 --- a/futures-util/src/try_stream/inspect_err.rs +++ b/futures-util/src/try_stream/inspect_err.rs @@ -61,7 +61,7 @@ where /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/inspect_ok.rs b/futures-util/src/try_stream/inspect_ok.rs index 262b18ebc1..04b718b7b7 100644 --- a/futures-util/src/try_stream/inspect_ok.rs +++ b/futures-util/src/try_stream/inspect_ok.rs @@ -61,7 +61,7 @@ where /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/into_async_read.rs b/futures-util/src/try_stream/into_async_read.rs index 65c5cea0f8..374299a51f 100644 --- a/futures-util/src/try_stream/into_async_read.rs +++ b/futures-util/src/try_stream/into_async_read.rs @@ -133,10 +133,10 @@ where St: TryStream + Unpin, St::Ok: AsRef<[u8]>, { - fn poll_fill_buf<'a>( - mut self: Pin<&'a mut Self>, + fn poll_fill_buf( + mut self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { while let ReadState::PendingChunk = self.state { match ready!(self.stream.try_poll_next_unpin(cx)) { Some(Ok(chunk)) => { diff --git a/futures-util/src/try_stream/into_stream.rs b/futures-util/src/try_stream/into_stream.rs index 31d95b3d80..596ec7bd0e 100644 --- a/futures-util/src/try_stream/into_stream.rs +++ b/futures-util/src/try_stream/into_stream.rs @@ -40,7 +40,7 @@ impl IntoStream { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/map_err.rs b/futures-util/src/try_stream/map_err.rs index 4ca5cb58d0..f7b7867186 100644 --- a/futures-util/src/try_stream/map_err.rs +++ b/futures-util/src/try_stream/map_err.rs @@ -55,7 +55,7 @@ impl MapErr { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/map_ok.rs b/futures-util/src/try_stream/map_ok.rs index de64b7dc34..2e82f65f98 100644 --- a/futures-util/src/try_stream/map_ok.rs +++ b/futures-util/src/try_stream/map_ok.rs @@ -55,7 +55,7 @@ impl MapOk { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/or_else.rs b/futures-util/src/try_stream/or_else.rs index 31937c2486..0fe256572d 100644 --- a/futures-util/src/try_stream/or_else.rs +++ b/futures-util/src/try_stream/or_else.rs @@ -65,7 +65,7 @@ impl OrElse /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/try_buffer_unordered.rs b/futures-util/src/try_stream/try_buffer_unordered.rs index f2ef185d42..9f9da0fbfb 100644 --- a/futures-util/src/try_stream/try_buffer_unordered.rs +++ b/futures-util/src/try_stream/try_buffer_unordered.rs @@ -60,7 +60,7 @@ impl TryBufferUnordered /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream().get_pin_mut().get_pin_mut() } diff --git a/futures-util/src/try_stream/try_filter.rs b/futures-util/src/try_stream/try_filter.rs index 7ab4891af7..f5035c13b1 100644 --- a/futures-util/src/try_stream/try_filter.rs +++ b/futures-util/src/try_stream/try_filter.rs @@ -75,7 +75,7 @@ impl TryFilter /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/try_filter_map.rs b/futures-util/src/try_stream/try_filter_map.rs index ab64d282ed..08b7aa7ce8 100644 --- a/futures-util/src/try_stream/try_filter_map.rs +++ b/futures-util/src/try_stream/try_filter_map.rs @@ -62,7 +62,7 @@ impl TryFilterMap { /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures-util/src/try_stream/try_skip_while.rs b/futures-util/src/try_stream/try_skip_while.rs index dd676c3937..6d446fcc2b 100644 --- a/futures-util/src/try_stream/try_skip_while.rs +++ b/futures-util/src/try_stream/try_skip_while.rs @@ -82,7 +82,7 @@ impl TrySkipWhile /// /// Note that care must be taken to avoid tampering with the state of the /// stream which may otherwise confuse this combinator. - pub fn get_pin_mut<'a>(self: Pin<&'a mut Self>) -> Pin<&'a mut St> { + pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut St> { self.stream() } diff --git a/futures/tests/io_buf_reader.rs b/futures/tests/io_buf_reader.rs index ad7ad325e1..cdf1517537 100644 --- a/futures/tests/io_buf_reader.rs +++ b/futures/tests/io_buf_reader.rs @@ -237,8 +237,8 @@ impl AsyncRead for MaybePending<'_> { } impl AsyncBufRead for MaybePending<'_> { - fn poll_fill_buf<'a>(mut self: Pin<&'a mut Self>, _: &mut Context<'_>) - -> Poll> + fn poll_fill_buf(mut self: Pin<&mut Self>, _: &mut Context<'_>) + -> Poll> { if self.ready_fill_buf { self.ready_fill_buf = false; @@ -340,8 +340,8 @@ impl AsyncRead for MaybePendingSeek<'_> { } impl AsyncBufRead for MaybePendingSeek<'_> { - fn poll_fill_buf<'a>(mut self: Pin<&'a mut Self>, cx: &mut Context<'_>) - -> Poll> + fn poll_fill_buf(mut self: Pin<&mut Self>, cx: &mut Context<'_>) + -> Poll> { let this: *mut Self = &mut *self as *mut _; Pin::new(&mut unsafe { &mut *this }.inner).poll_fill_buf(cx)