bun_core: delete unused MapLike trait, FieldType marker, EmbedDir#31543
Conversation
…d dead deprecated.rs helpers
|
Updated 11:05 PM PT - May 28th, 2026
❌ @dylan-conway, your commit d8e76b3 has some failures in 🧪 To try this PR locally: bunx bun-pr 31543That installs a local version of the PR into your bun-31543 --bun |
WalkthroughThis PR removes or simplifies several public APIs across core modules: the deprecated ChangesAPI Surface Cleanup and Removal
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
LGTM — pure dead-code deletion of unused port placeholders.
Extended reasoning...
Overview
Follow-up to #31536. Deletes unused Rust port placeholders from bun_core: the MapLike trait + Key/Value aliases + from_entries/from_map_like helpers, the unconstructible FieldType marker enum, the EmbedDir type alias, buffered_reader_size, auto_format_label/auto_format_label_fallback, the PathString::USE_SMALL_PATH_STRING re-export const, the now-orphaned use core::hash::Hash import, and a couple of stale port-note comments in bundler/options.rs. No logic is touched.
Verification
Grepped the full src/ tree (*.rs only) for each removed identifier. Zero references remain. The apparent hits for FieldType/from_entries in the broader grep are unrelated: Zig source files, JSValue::from_entries (different type/method), and doc comments referencing Zig's @FieldType builtin — none import or use the deleted bun_core::util items. USE_SMALL_PATH_STRING_ (the private module const with trailing underscore) remains in PathString.rs and is still used internally; only the never-read public re-export was removed.
Security risks
None. Pure deletions of code with zero callers and zero impls; no runtime behavior, auth, crypto, or I/O paths affected.
Level of scrutiny
Low. Mechanical dead-code removal in port-scaffolding modules (deprecated.rs, util.rs). The compiler is the proof here — cargo check --workspace passes, and Rust would fail the build if any of these were referenced. The bundler/options.rs change is comment-only.
Other factors
No prior reviewer comments to address. Bug-hunting system found nothing. Same shape as the already-merged #31536 (ArrayLike removal).
Follow-up to #31536 — removes the remaining unused comptime-reflection placeholders from
util.rsplus a fewbun_corestrays.cargo check --workspacepasses.Why this code exists
src/bun_core/util.zigis not@imported anywhere insrc/**/*.zig(everyutilimport points atruntime/shell/util.zig,node/util/validators.zig, etc.;bun.zigdoes not re-export it). So everything ported from that file was dead from day one.MapLiketraitMap.KV,@hasField,@FieldTypebuiltin)Key<M>/Value<M>src/bun_core/util.zig:3,7util.zig(fromMapLikecalls the@FieldTypebuiltin directly)from_entriesutil.zig:11(fromEntries)from()at:151,153, which has 0 callersfrom_map_likeutil.zig:80(fromMapLike)from()at:139FieldTypeenumutil.zig:101(afn → ?type)@FieldTypeor unrelated SQL enums@FieldType)EmbedDirEmbedDirnorEmbedKindexist in*.zigbuffered_reader_sizesrc/bun_core/deprecated.zig:47(bufferedReaderSize)auto_format_label/_fallbackdeprecated.zig:639,631src/runtime/node.zig:342,src/runtime/test_runner/expect.zig:122Display/Debuginstead of comptime format-label dispatchPathString::USE_SMALL_PATH_STRINGsrc/string/PathString.zig:12(pub const use_small_path_string)PathString.zigonly reads the file-privateuse_small_path_string_(:2); thepubre-export has no consumersAlso updates the stale port-note comment in
bundler/options.rsthat pointed at the deletedMapLike.