|
|
|
|
|
by verdagon
692 days ago
|
|
I can imagine a Rust-like language where we have move-constructors (in TFA), and every generated Future subtype is opaque and also heap allocated for us. I think the need for Pin could then disappear, because the user would have no way to destroy it, since it's opaque and elsewhere on the heap, and therefore no way to move it (because having move-constructors implies that moving is conceptually destroying then recreating things). |
|
This has a very nice effect of allowing merging and inlining of Futures before they're executed.
It's similar to how Rust does immutability — there's no immutable memory, only immutable references.