about summary refs log tree commit diff
path: root/src/libcore/future
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2018-09-14 17:40:52 -0700
committerTaylor Cramer <cramertj@google.com>2018-09-17 16:31:33 -0700
commit3ec1810e329bb9dfa0cf0686bdc13558771785d2 (patch)
treebb9f39ea9e7c740e1b8635f77868b3948a1e5b99 /src/libcore/future
parent974bdc80fe3214159dc30e0bbb76694900e613c0 (diff)
downloadrust-3ec1810e329bb9dfa0cf0686bdc13558771785d2.tar.gz
rust-3ec1810e329bb9dfa0cf0686bdc13558771785d2.zip
Cleanup and fix method resolution issue
Diffstat (limited to 'src/libcore/future')
-rw-r--r--src/libcore/future/future.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcore/future/future.rs b/src/libcore/future/future.rs
index 6cf1925000e..f4b5cf95e37 100644
--- a/src/libcore/future/future.rs
+++ b/src/libcore/future/future.rs
@@ -104,14 +104,14 @@ impl<'a, F: ?Sized + Future + Unpin> Future for &'a mut F {
     }
 }
 
-impl<P, F> Future for Pin<P> where
-    P: ops::DerefMut<Target = F> + Unpin,
-    F: Future + ?Sized,
+impl<P> Future for Pin<P>
+where
+    P: ops::DerefMut,
+    P::Target: Future,
 {
-    type Output = F::Output;
+    type Output = <<P as ops::Deref>::Target as Future>::Output;
 
-    fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context) -> Poll<Self::Output> {
-        let pin: Pin<&mut F> = Pin::as_mut(&mut *self);
-        F::poll(pin, cx)
+    fn poll(self: Pin<&mut Self>, cx: &mut task::Context) -> Poll<Self::Output> {
+        Pin::get_mut(self).as_mut().poll(cx)
     }
 }