diff options
| author | Josef Reinhard Brandl <mail@josefbrandl.de> | 2018-06-23 13:32:53 +0200 |
|---|---|---|
| committer | Josef Reinhard Brandl <mail@josefbrandl.de> | 2018-06-23 18:29:56 +0200 |
| commit | 3bcb85ee658e7a5362f5e381c337f07381f916dc (patch) | |
| tree | 2b081a664a10700167ee929b579ec2fa6700ef6e /src/libstd/future.rs | |
| parent | 56e8f29dbe89f2109cacc8eb5e92ea3de32eefb9 (diff) | |
| download | rust-3bcb85ee658e7a5362f5e381c337f07381f916dc.tar.gz rust-3bcb85ee658e7a5362f5e381c337f07381f916dc.zip | |
`PinMut`: Add safe `get_mut` and rename unsafe fns to `get_mut_unchecked` and `map_unchecked`
Diffstat (limited to 'src/libstd/future.rs')
| -rw-r--r-- | src/libstd/future.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 2da775fdc94..c1cc36f3b41 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -43,7 +43,7 @@ impl<T: Generator<Yield = ()>> !Unpin for GenFuture<T> {} impl<T: Generator<Yield = ()>> Future for GenFuture<T> { type Output = T::Return; fn poll(self: PinMut<Self>, cx: &mut task::Context) -> Poll<Self::Output> { - set_task_cx(cx, || match unsafe { PinMut::get_mut(self).0.resume() } { + set_task_cx(cx, || match unsafe { PinMut::get_mut_unchecked(self).0.resume() } { GeneratorState::Yielded(()) => Poll::Pending, GeneratorState::Complete(x) => Poll::Ready(x), }) |
