4 ms·
I've been writing Rust code for 6 years and I don't understand `Pin`/`Unpin`. At best, when using futures, I randomly wrap things in `Pin<Box<..>>`, hoping tha
by jedisct1 7y ago
I've been writing Rust code for 6 years and I don't understand `Pin`/`Unpin`.
At best, when using futures, I randomly wrap things in `Pin<Box<..>>`, hoping that the compiler might stop complaining.
- pornel 7y agoSame here. It was a clever hack to move Futures forward without (it seemed) needing changes to the language. But for the sake of simplicity, I'd prefer Rust to have some first-class language construct for self-referential structs.
- withoutboats 7y agoNo one has ever proposed a solution - first class or not - which wouldn't be significantly more invasive and infectious. Does it sound fun in code that doesn't have anything to do with futures to spend time worrying if this generic should be `T: ?Move` or not?