Skip to content

compiler code cleanup: replace metas: HashMap with IndexVec #46876

Closed
@pnkfelix

Description

@pnkfelix

While investigating the root cause(s) of #46112 and discussing (in the #rustc IRC chat room) the use of a hashmap mapping crate-numbers to crate-metadata, @eddyb at some point exclaimed "why is that not an IndexVec?"

One word: Legacy. Big time: the metas field has been a hashmap ever since metadata::cstore was introduced, 6.5 years ago in b23ecd4 (relevant line in diff)

It should be a useful (and hopefully simple?) exercise to replace the hashmap that is now there with an IndexVec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions