Pin tutorial are confusing me

The central rule that makes Pin necessary is that, if your program has only a single unsafe block, then if your program does something that causes undefined behavior, then the unsafe block is at fault, no matter what. It doesn't matter how stupid the non-unsafe code is.

To see why this rule is problematic without Pin, consider what happens if you use unsafe to create a self-referential struct on the stack. When the owner of the struct moves the struct (i.e., the data gets copied over to a new memory location), then your self-referential pointers still point at the old location. If the struct unsafely uses those self-referential pointers, that's a use-after-free, which is undefined behavior. There's no way for a struct to know if you've moved it, so you can't avoid this. (Self-referential structs on the heap are completely possible without Pin, by the way.)

Now, note here that the user of the struct didn't do anything unsafe. Moving stuff you own is safe. Therefore, the unsafe code in the struct's implementation must be at fault.

How do we fix this? Well, if we force the user to write an unsafe block before they can use the struct, then there's no problem. If the user moves it, then the unsafe block that the user wrote is at fault, and there's no problem. It's not our fault anymore.

It turns out, that's all what Pin does. The main constructor Pin::new_unchecked is unsafe. The caller promises to not move the struct, and now they gain the ability to use methods that take self: Pin<&mut Self>. Tada!

So the truth is that Pin is just a tool for shifting the blame if something goes wrong.

Well, there are some convenience methods like Box::pin that let you pin something without unsafe. However, in this case, the unsafe is just in the implementation of Box::pin instead, and it is justified due to the API design of Pin making it impossible to do anything that would result in the contents being moved to a new memory location.

Point is, if you ever see a Pin<&mut Self>, then you know that someone, somewhere, has written an unsafe block that promises that this particular value is pinned. And that it would be ok to rely on this promise in your own unsafe code.