Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Jan 31, 2026

We don't always re-export shared dependencies, but for hashbrown::hash_table I think it makes sense, for a few reasons:

  • The lower-level HashTable type is already part of the public API of rustc_data_structures via the ShardedHashMap type alias, and other compiler crates currently depend on being able to access its internal hash tables.
  • The Cargo.toml entry for hashbrown is non-trivial, making it harder to keep in sync and harder to move between crates as needed.
  • It's fine for other compiler crates to use hash_table specifically (with care), but they probably shouldn't be using the higher-level hashbrown::HashMap and hashbrown::HashSet types directly, because they should prefer the various map/set aliases defined by rustc_data_structures. Re-exporting only hash_table helps to discourage use of those other types.

There should be no change to compiler behaviour.

@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2026

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 31, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2026

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@Kivooeo
Copy link
Member

Kivooeo commented Jan 31, 2026

looks reasonable

r? me

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 31, 2026

📌 Commit 04e6afe has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 31, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 31, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 31, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #151886 (Skip unused_allocation lint when method takes &Box<Self>)
 - #150300 (Constify `fmt::from_fn`)
 - #151102 (Feature-gate `mut ref` patterns in struct pattern field shorthand)
 - #151866 (Reorganizing `tests/ui/issues` 10 tests [4/N] )
 - #151890 (Re-export `hashbrown::hash_table` from `rustc_data_structures`)
@rust-bors rust-bors bot merged commit d853e9e into rust-lang:main Feb 1, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Feb 1, 2026
Rollup merge of #151890 - Zalathar:hash-table, r=Kivooeo

Re-export `hashbrown::hash_table` from `rustc_data_structures`

We don't always re-export shared dependencies, but for `hashbrown::hash_table` I think it makes sense, for a few reasons:

- The lower-level `HashTable` type is already part of the public API of `rustc_data_structures` via the `ShardedHashMap` type alias, and other compiler crates currently depend on being able to access its internal hash tables.
- The `Cargo.toml` entry for `hashbrown` is non-trivial, making it harder to keep in sync and harder to move between crates as needed.
  - [And we currently aren't using `[workspace.dependencies]` for various reasons.](#146113)
- It's fine for other compiler crates to use `hash_table` specifically (with care), but they probably shouldn't be using the higher-level `hashbrown::HashMap` and `hashbrown::HashSet` types directly, because they should prefer the various map/set aliases defined by `rustc_data_structures`. Re-exporting only `hash_table` helps to discourage use of those other types.

There should be no change to compiler behaviour.
@rustbot rustbot added this to the 1.95.0 milestone Feb 1, 2026
@Zalathar Zalathar deleted the hash-table branch February 1, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants