Coroutines, Self-Referential Structs, and Pinning 244 Main. rs Let's start from the top and make sure we have the correct imports: ch09/e-coroutines-pin/src/main. rs mod future; mod http; mod runtime; use future::{Future, Poll State}; use runtime::Waker; use std::{fmt::Write, marker::Phantom Pinned, pin::Pin }; This time, we need both the Phantom Pinned marker and Pin. The next thing we need to change is in our State0 enum. The futures we hold between states are now pinned: ch09/e-coroutines-pin/src/main. rs Wait1(Pin<Box<dyn Future<Output = String>>>), Wait2(Pin<Box<dyn Future<Output = String>>>), Next up is an important change. We need to make our coroutines !Unpin so that they can't be moved once they have been pinned. We can do this by adding a marker trait to our Coroutine0 struct: ch09/e-coroutines-pin/src/main. rs struct Coroutine0 { stack: Stack0, state: State0, _pin: Phantom Pinned, } We also need to add the Phantom Pinned marker to our new function: ch09/e-coroutines-pin/src/main. rs impl Coroutine0 { fn new()-> Self { Self { state: State0::Start, stack: Stack0::default(), _pin: Phantom Pinned, } }