Make weak item traversal deterministic by pnkfelix · Pull Request #81393 · rust-lang/rust (original) (raw)

This PR is the one turning it into a StableMap, and the sort is necessary to normalize the order, right?

(That is: If we don't normalize the order, then we don't get the benefit of this change, right?)

To be clear: I too am saddened by the .clone(), and you might talk me into just using a different structure entirely. This seemed like the simplest fix, and if we're going to balk at doing it in this scenario, then maybe we should remove StableMap entirely and figure out a different way to discourage people from using FxHashMap?