Skip to content

Commit 676baa4

Browse files
nggcramertj
authored andcommitted
Fix compilation when "nightly" feature is enabled
1 parent c5a0369 commit 676baa4

File tree

7 files changed

+8
-6
lines changed

7 files changed

+8
-6
lines changed

futures-async-runtime/src/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<T> StableFuture for GenStableFuture<T>
2828
fn poll(self: PinMut<Self>, ctx: &mut task::Context) -> Poll<Self::Item, Self::Error> {
2929
CTX.with(|cell| {
3030
let _r = Reset::new(ctx, cell);
31-
let this: &mut Self = unsafe { PinMut::get_mut(self) };
31+
let this: &mut Self = unsafe { PinMut::get_mut_unchecked(self) };
3232
// This is an immovable generator, but since we're only accessing
3333
// it via a PinMut this is safe.
3434
match unsafe { this.0.resume() } {

futures-async-runtime/src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<U, T> StableStream for GenStableStream<U, T>
4040
fn poll_next(self: PinMut<Self>, ctx: &mut task::Context) -> Poll<Option<Self::Item>, Self::Error> {
4141
CTX.with(|cell| {
4242
let _r = Reset::new(ctx, cell);
43-
let this: &mut Self = unsafe { PinMut::get_mut(self) };
43+
let this: &mut Self = unsafe { PinMut::get_mut_unchecked(self) };
4444
if this.done { return Ok(Async::Ready(None)) }
4545
// This is an immovable generator, but since we're only accessing
4646
// it via a PinMut this is safe.

futures-core/src/future/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ if_std! {
147147
type Error = F::Error;
148148

149149
fn poll(&mut self, cx: &mut task::Context) -> Poll<Self::Item, Self::Error> {
150-
unsafe { ::core::mem::PinMut::get_mut(self.as_pin_mut()).poll(cx) }
150+
unsafe { ::core::mem::PinMut::get_mut_unchecked(self.as_pin_mut()).poll(cx) }
151151
}
152152
}
153153

futures-core/src/stream/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if_std! {
8989
type Error = S::Error;
9090

9191
fn poll_next(&mut self, cx: &mut task::Context) -> Poll<Option<Self::Item>, Self::Error> {
92-
unsafe { ::core::mem::PinMut::get_mut(self.as_pin_mut()).poll_next(cx) }
92+
unsafe { ::core::mem::PinMut::get_mut_unchecked(self.as_pin_mut()).poll_next(cx) }
9393
}
9494
}
9595

futures-stable/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if_nightly! {
8686
type Error = F::Error;
8787

8888
fn poll(self: PinMut<Self>, ctx: &mut task::Context) -> Poll<Self::Item, Self::Error> {
89-
F::poll(unsafe { PinMut::get_mut(self) }, ctx)
89+
F::poll(unsafe { PinMut::get_mut_unchecked(self) }, ctx)
9090
}
9191
}
9292

@@ -140,7 +140,7 @@ if_nightly! {
140140
type Error = S::Error;
141141

142142
fn poll_next(self: PinMut<Self>, ctx: &mut task::Context) -> Poll<Option<Self::Item>, Self::Error> {
143-
S::poll_next(unsafe { PinMut::get_mut(self) }, ctx)
143+
S::poll_next(unsafe { PinMut::get_mut_unchecked(self) }, ctx)
144144
}
145145
}
146146
}

futures/tests/async_await/pinned.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use futures::stable::block_on_stable;
22
use futures::executor::{block_on, ThreadPool};
33
use futures::prelude::*;
4+
use futures::prelude::await;
45

56
#[async]
67
fn foo() -> Result<i32, i32> {

futures/tests/async_await/smoke.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::io;
1212
use futures::Never;
1313
use futures::future::poll_fn;
1414
use futures::prelude::*;
15+
use futures::prelude::await;
1516

1617
#[async]
1718
fn foo() -> Result<i32, i32> {

0 commit comments

Comments
 (0)