SIGN IN SIGN UP
oven-sh / bun UNCLAIMED

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

0 0 150 Rust

collections: delete unused SortedHashMap, AutoStaticHashMap, ComptimeStringMap16 (#31541)

Dead-code sweep of `bun_collections`. None of these have any references
outside their own definitions in the Rust tree.

`cargo check --workspace` and `cargo test -p bun_collections` pass.

## Why this code exists

| Item | Zig original | Zig callers | Status |
|---|---|---|---|
| `SortedHashMap` | `src/collections/StaticHashMap.zig:342` | 0 (only
same-file tests at `:636-686`) | **dead in Zig too** |
| `SortedEntry` | none — Zig nests it as `SortedHashMap(..).Entry`
(`:346`) | 0 | **Rust-port artifact** (flattened because Rust can't nest
a generic struct def) |
| `SortedGetOrPutResult` | none — Zig nests it as
`SortedHashMap(..).GetOrPutResult` (`:486`) | 0 | **Rust-port artifact**
(flattened type alias) |
| `AutoStaticHashMap` | `src/collections/StaticHashMap.zig:8` | 0 (only
same-file test at `:572`) | **dead in Zig too** |
| `ComptimeStringMap16` | `src/collections/comptime_string_map.zig:315`;
re-export `src/bun.zig:228` | 0 | **dead in Zig too** |
| `comptime_string_map_16!` macro | none | n/a | **Rust-port artifact**
(placeholder that just `compile_error!`s) |
| `get_with_eql_list` | `comptime_string_map.zig:282` (`getWithEqlList`)
| 2 — `src/string/string.zig:926,930`
(`String.inMap`/`inMapCaseInsensitive`) | Zig callers' Rust ports use
`phf::Map` instead — `src/bun_core/string/mod.rs:647`
`in_map_case_insensitive` takes `&phf::Map` |
| `get_with_length_and_eql_list` | `comptime_string_map.zig:129` | 0
(internal helper of `getWithEqlList` only) | **dead in Zig too** |
| `get_with_eql_lowercase` | `comptime_string_map.zig:212` | 0 (internal
helper of `getASCIIICaseInsensitive` only) | **dead in Zig too** |
| `get_asciii_case_insensitive` | `comptime_string_map.zig:208`
(`getASCIIICaseInsensitive`, triple-I) | 24 — e.g.
`src/css/css_parser.zig:874`, `src/css/properties/display.zig:149` |
Rust kept the identical `get_any_case` (used in
`src/css/values/calc.rs`); other Zig callers' Rust ports use
`eql_case_insensitive_ascii` if-chains (e.g.
`src/css/properties/display.rs:136-141`). The triple-I alias was never
adopted. |
| `ArrayHashMapWithContext` | none (0 hits in `*.zig`) | n/a |
**Rust-port artifact** — Zig's `std.ArrayHashMap` already takes a
context param so no alias was needed |
| `SmallList::from_list_no_deinit` | `src/css/small_list.zig:97`
(`fromListNoDeinit`) | 0 | **dead in Zig too** |
| `SmallList::from_baby_list` | `src/css/small_list.zig:113`
(`fromBabyList`) | 0 (the `fromBabyList` hits in
`SmolStr.zig`/`baby_list.zig` are different types) | **dead in Zig too**
|
| `SmallList::from_baby_list_no_deinit` | `src/css/small_list.zig:130` |
1 — `src/bundler/linker_context/prepareCssAstsForChunk.zig:33` | Rust
port at `prepareCssAstsForChunk.rs:115-124` rebuilds element-by-element
because the Rust layouts differ (per its inline note) |
D
Dylan Conway committed
4d4cb7163324c743b8e1138dd24dfeace5abd042
Parent: ecfdaa6
Committed by GitHub <noreply@github.com> on 5/29/2026, 1:15:53 AM