3 ms·
> [...] would have required all types that do want to be moveable to explicitly announce that fact (via something like `#[derive(Move)]`) [...] Isn't `Pin` eve
by cesarb 7y ago
> [...] would have required all types that do want to be moveable to explicitly announce that fact (via something like `#[derive(Move)]`) [...]
Isn't `Pin` even crazier, in that the same type can be moveable (when used outside of Pin) or not moveable (when used inside Pin)? A simple derive wouldn't be enough to capture that.
- kibwen 7y agoI wouldn't say it's crazy, or even unprecedented. Consider the reference-counted `Rc` smart pointer type, which allows a given type to act as though it were cloneable (when used inside of `Rc`) or not cloneable (when used without `Rc`). The hypothetical opt-in moveability proposal is difficult to compare directly to `Pin` because they take such different approaches to the problem, but they would both address the problem (at least, as far as I have considered it).