The println! macro has nothing to do with the error, which is
error[E0507]: cannot move out of `*p` which is behind a raw pointer
--> src/main.rs:19:33
|
19 | println!("{:#?}", unsafe { *p });
| ^^ move occurs because `*p` has type `Node`, which does not implement the `Copy` trait
Pointers do not implement Copy, so you'd be unable to derive Copy for Node. You would have to explicitly .clone() it, which would necessitate #[derive(Clone)]. Note that unless you know what you're doing, it is extremely likely that you will cause undefined behavior when dereferencing raw pointers and using unsafe. If you would like more assistance, the purpose behind your code is important and was not noted.
The reason Rust attempts to move the value *p is that it's in a block. If you had written unsafe { println!("{:#?}", *p) }; it would work, because println! automatically takes all of its arguments as references. But the unsafe block interferes with that by forcing its value to be owned.
I guess what @jhpratt wanted to say is that you can't copy out from the pointer using the deref operator. To read the pointed value you should use the std::ptr::read() function.
I did not interpreted it like that, @jhpratt said you can't derive Copy for the Node type because raw pointers are not Copy, but you can. Basically, this works: