@@ -10,7 +10,7 @@ pub use self::stream_yield::*;
10
10
use futures_core:: future:: Future ;
11
11
use futures_core:: stream:: Stream ;
12
12
use std:: future:: { self , get_task_context, set_task_context} ;
13
- use std:: marker:: { PhantomData , PhantomPinned } ;
13
+ use std:: marker:: PhantomData ;
14
14
use std:: ops:: { Generator , GeneratorState } ;
15
15
use std:: pin:: Pin ;
16
16
use std:: task:: { Context , Poll } ;
@@ -23,7 +23,7 @@ pub fn from_generator<U, T>(x: T) -> impl Stream<Item = U>
23
23
where
24
24
T : Generator < Yield = Poll < U > , Return = ( ) > ,
25
25
{
26
- GenStream { gen : x, done : false , _phantom : PhantomData , _pin : PhantomPinned }
26
+ GenStream { gen : x, done : false , _phantom : PhantomData }
27
27
}
28
28
29
29
/// 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 = ()>> {
35
35
// because it is possible to call `next` after `next` returns `None` in many iterators.
36
36
done : bool ,
37
37
_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 ,
41
38
}
42
39
43
40
impl < U , T : Generator < Yield = Poll < U > , Return = ( ) > > Stream for GenStream < U , T > {
0 commit comments