rust-lang/project-rfc-2229

Convert `ty::RootVariableMinCaptureList` to be a FxHashMap

Closed this issue · 1 comments

We don't take any benefit from ty::RootVariableMinCaptureList being an index map. Given the nature of how the data is stored, we had to write our function to assign an index to each capture. So instead we should just use a FxHashMap.

This will probably result in some memory and/or perf savings.

Aside: Maybe rename it? The name suggests that the data structure itself is a list but it returns lists, and isn't itself a list.

On Zulip #t-compiler it was pointed out that if the order of data matters, then we should avoid using HashMaps because otherwise, it can make compilations not reproducible.