Skip to content

Commit 6412bbd

Browse files
committed
Remove the _pin field from GenStream
1 parent 2b82bdd commit 6412bbd

File tree

1 file changed

+2
-5
lines changed
  • futures-util/src/async_stream

1 file changed

+2
-5
lines changed

futures-util/src/async_stream/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub use self::stream_yield::*;
1010
use futures_core::future::Future;
1111
use futures_core::stream::Stream;
1212
use std::future::{self, get_task_context, set_task_context};
13-
use std::marker::{PhantomData, PhantomPinned};
13+
use std::marker::PhantomData;
1414
use std::ops::{Generator, GeneratorState};
1515
use std::pin::Pin;
1616
use std::task::{Context, Poll};
@@ -23,7 +23,7 @@ pub fn from_generator<U, T>(x: T) -> impl Stream<Item = U>
2323
where
2424
T: Generator<Yield = Poll<U>, Return = ()>,
2525
{
26-
GenStream { gen: x, done: false, _phantom: PhantomData, _pin: PhantomPinned }
26+
GenStream { gen: x, done: false, _phantom: PhantomData }
2727
}
2828

2929
/// A wrapper around generators used to implement `Stream` for `async`/`await` code.
@@ -35,9 +35,6 @@ struct GenStream<U, T: Generator<Yield = Poll<U>, Return = ()>> {
3535
// because it is possible to call `next` after `next` returns `None` in many iterators.
3636
done: bool,
3737
_phantom: PhantomData<U>,
38-
// We rely on the fact that async/await streams are immovable in order to create
39-
// self-referential borrows in the underlying generator.
40-
_pin: PhantomPinned,
4138
}
4239

4340
impl<U, T: Generator<Yield = Poll<U>, Return = ()>> Stream for GenStream<U, T> {

0 commit comments

Comments
 (0)