Which three lines does this program print, in order?

from Pin and Unpin
Rust 1.98 intermediate 2 min

Which three lines does this program print, in order?

Rust
use std::marker::PhantomPinned;

struct State(&'static str, PhantomPinned);

impl Drop for State {
    fn drop(&mut self) {
        println!("drop {}", self.0);
    }
}

fn main() {
    let mut state = Box::pin(State("old", PhantomPinned));
    state.as_mut().set(State("new", PhantomPinned));
    println!("current {}", state.0);
}
Open in playground
Report an error