Improving our example 4-pinning to the rescue 245 } The last thing we need to change is the poll method. Let's start with the function signature: ch09/e-coroutines-pin/src/main. rs fn poll(self: Pin<&mut Self>, waker: &Waker)-> Poll State<Self::Output> The easiest way I found to change our code was to simply define a new variable at the very top of the function called this, which replaces self everywhere in the function body. I won't go through every line since the change is so trivial, but after the first line, it's a simple search and replace everywhere self was used earlier, and change it to this : ch09/e-coroutines-pin/src/main. rs let this = unsafe { self. get_unchecked_mut() }; loop { match this. state { State0::Start => { // initialize stack (hoist declarations-no stack yet) this. stack. buffer = Some(String::from("\n BUFFER:\n----\n")); this. stack. writer = Some( this. stack. buffer. as_mut(). unwrap()); //----Code you actually wrote---- println!("Program starting");... The important line here was let this = unsafe { self. get_unchecked_mut() };. Here, we had to use unsafe since the pinned value is !Unpin because of the marker trait we added. Getting to the pinned value is unsafe since there is no way for Rust to guarantee that we won't move the pinned value. The nice thing about this is that if we encounter any such problems later, we know we can search for the places where we used unsafe and that the problem must be there.