logoalt Hacker News

dubi_steinkektoday at 11:44 AM1 replyview on HN

Which stdlib collections and types should become `!Move`?


Replies

simonasktoday at 12:25 PM

None. The question is more what happens when you put a `!Move` type into, say, `Vec<T>`, because that's a collection type that regularly moves its elements to a new allocation when it grows or shrinks.

Should it be possible to construct a `Vec<T>` whose size can never change? Is there a subset of Vec's API that can be annotated with `where T: ?Move`? These are all important design questions, with the potential to break 99% of existing Rust code.