Could collections hypothetically store keys and values inline?
Rust Internals [Unofficial]
April 24, 2026
Vorpal:
even a guarantee of not inlining doesn't give you address stability
It gives you address stability so long as you don’t mutate the HashMap.
In particular, the following three operations (in any quantity and order) wouldn’t invalidate references to heap data: moves (by a no-inlining + no-noalias guarantee), operations on a &HashMap (otherwise, stable behavior would break), coercions (basically just a combination of moves and immutable operations, listing this separately just since it feels like a bit of an edge case).
Discussion in the ATmosphere