Skip to content

Remove dead code from bun_options_types and bun_http_types - #35152

Merged
Jarred-Sumner merged 4 commits into
mainfrom
claude/farm/5076ff2e/dead-code-options-http-types
Jul 22, 2026
Merged

Jarred-Sumner merged 4 commits into
mainfrom
claude/farm/5076ff2e/dead-code-options-http-types

Conversation

@robobun

@robobun robobun commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Dead code sweep of two small Rust crates. Every item below has zero references anywhere in src/, build/debug/codegen/, or src/codegen/ (confirmed with rg -w). None are #[no_mangle]/extern "C" or named in .classes.ts.

bun_options_types

  • jsx::Pragma::parse_package_name (jsx.rs): never called.
  • bundle_enums::LoaderOptionalExt trait + impl: never imported by any crate; LoaderOptional::from_api has no callers.
  • bundle_enums::ImportKindExt trait + impl: never imported; the only to_api() calls on ImportKind-shaped values target log::Kind::to_api, not bun_ast::ImportKind.
  • schema::api::ImportKind enum: only referenced by the ImportKindExt impl above.
  • standalone_path::BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX (cfg(windows) only): duplicate of the const in bun_standalone_graph::StandaloneModuleGraph, which all three call sites (server_body.rs, standalone_graph_jsc.rs, StandaloneModuleGraph.rs) resolve to.

bun_http_types

  • MimeTypeList::COUNT: never read. ALL.len() is available if a count is ever needed.
  • Method::Optional::contains: never called. The set.contains(Method::GET) in ServerConfig.rs is EnumSet::contains.

Also drops the sealed::Sealed impls for LoaderOptional/ImportKind (only the removed traits bounded on them), the now-unused LoaderOptional import in bundle_enums.rs, and trims three doc comments in bun_ast that pointed readers at the removed extension traits.

Verification

  • bun bd builds clean
  • bun run rust:check-all passes on all 10 targets (covers the cfg(windows) deletion)
  • Smoke tests: bundler_edgecase.test.ts, bun-serve-static.test.ts, transpiler.test.js -t jsx all pass

Net: +7 / -114.


[review] gate passed · iteration 1 · 10 files touched

fails on main (without fix)
ASAN without fix: 8 FAILED
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/internal/source-lints/removed-dead-symbols.test.ts
bun test v1.4.0 (3f4e09509)

test/internal/source-lints/removed-dead-symbols.test.ts:
69 |     const hits: string[] = [];
70 |     for (let i = 0; i < lines.length; i++) {
71 |       if (pattern.test(lines[i])) hits.push(`${rel}:${i + 1}: ${lines[i].trim()}`);
72 |     }
73 |     if (hits.length > 0) {
74 |       throw new Error(
                     ^
error: jsx::Pragma::parse_package_name was previously removed as dead code (zero workspace references) but is present again in src/options_types/jsx.rs:
  src/options_types/jsx.rs:235: pub fn parse_package_name(str: &[u8]) -> &[u8] {
If this symbol now has a real caller, delete its entry from test/internal/source-lints/removed-dead-symbols.test.ts. Otherwise, remove the dead definition.
      at <anonymous> (/workspace/bun/test/internal/source-lints/removed-dead-symbols.test.ts:74:17)
(fail) jsx::Pragma::parse_package_name stays removed from src/options_types/jsx.rs [31.01ms]
69 |     const hits: string[] = [];
70 |     for (let i =
... (truncated)

release without fix: 8 FAILED
bun test v1.4.0-canary.1 (da9816a78)

test/internal/source-lints/removed-dead-symbols.test.ts:
69 |     const hits: string[] = [];
70 |     for (let i = 0; i < lines.length; i++) {
71 |       if (pattern.test(lines[i])) hits.push(`${rel}:${i + 1}: ${lines[i].trim()}`);
72 |     }
73 |     if (hits.length > 0) {
74 |       throw new Error(
                     ^
error: jsx::Pragma::parse_package_name was previously removed as dead code (zero workspace references) but is present again in src/options_types/jsx.rs:
  src/options_types/jsx.rs:235: pub fn parse_package_name(str: &[u8]) -> &[u8] {
If this symbol now has a real caller, delete its entry from test/internal/source-lints/removed-dead-symbols.test.ts. Otherwise, remove the dead definition.
      at <anonymous> (/workspace/bun/test/internal/source-lints/removed-dead-symbols.test.ts:74:17)
(fail) jsx::Pragma::parse_package_name stays removed from src/options_types/jsx.rs [0.94ms]
69 |     const hits: string[] = [];
70 |     for (let i = 0; i < lines.length; i++) {
71 |       if (pattern.test(lines[i])) hits.push(`${rel}:${i + 1}: ${lines[i].trim()}`);
72 |     }
73 |     if (hits.length > 0) {
74 |       throw new
... (truncated)
passes on PR (with fix)
ASAN with fix: all passed
$ BUN_DEBUG_QUIET_LOGS=1 bun scripts/build.ts --profile=debug --quiet test "--reporter=junit" "--reporter-outfile=/tmp/mechgate.xml" test/internal/source-lints/removed-dead-symbols.test.ts
bun test v1.4.0 (3f4e09509)

test/internal/source-lints/removed-dead-symbols.test.ts:
(pass) jsx::Pragma::parse_package_name stays removed from src/options_types/jsx.rs [30.44ms]
(pass) bundle_enums::LoaderOptionalExt stays removed from src/options_types/bundle_enums.rs [11.32ms]
(pass) bundle_enums::ImportKindExt stays removed from src/options_types/bundle_enums.rs [9.14ms]
(pass) schema::api::ImportKind stays removed from src/options_types/schema.rs [32.09ms]
(pass) standalone_path::BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX (duplicate of bun_standalone_graph's) stays removed from src/options_types/lib.rs [13.95ms]
(pass) MimeTypeList::COUNT stays removed from src/http_types/mime_type_list_enum.rs [65.20ms]
(pass) Method::Optional::contains stays removed from src/http_types/Method.rs [13.38ms]
(pass) bun_ast::LoaderOptional stays removed from src/ast/loader.rs [19.32ms]

 8 pass
 0 fail
 8 expect() calls
Ran 8 tests across 1 file. [2.43s]
__F:0:S:0

release with fix: all passed
$ bun scripts/build.ts --profile=release
[configured] bun-profile → bun (stripped) in 684ms (unchanged)
ninja: Entering directory `/workspace/bun/build/release'
ninja: no work to do.
[build] done
bun test v1.4.0-canary.1 (3f4e09509)

test/internal/source-lints/removed-dead-symbols.test.ts:
(pass) jsx::Pragma::parse_package_name stays removed from src/options_types/jsx.rs [0.98ms]
(pass) bundle_enums::LoaderOptionalExt stays removed from src/options_types/bundle_enums.rs [0.16ms]
(pass) bundle_enums::ImportKindExt stays removed from src/options_types/bundle_enums.rs [0.31ms]
(pass) schema::api::ImportKind stays removed from src/options_types/schema.rs [0.24ms]
(pass) standalone_path::BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX (duplicate of bun_standalone_graph's) stays removed from src/options_types/lib.rs [0.12ms]
(pass) MimeTypeList::COUNT stays removed from src/http_types/mime_type_list_enum.rs [0.49ms]
(pass) Method::Optional::contains stays removed from src/http_types/Method.rs [0.27ms]
(pass) bun_ast::LoaderOptional stays removed from src/ast/loader.rs [0.14ms]

 8 pass
 0 fail
 8 expect() calls
Ran 8 tests across 1 file. [170.00ms]
__F:0:S:0
diff hotspot
src/ast/import_record.rs                           |  2 -
 src/ast/lib.rs                                     |  5 +-
 src/ast/loader.rs                                  | 22 +-----
 src/http_types/Method.rs                           | 17 -----
 src/http_types/mime_type_list_enum.rs              |  2 -
 src/options_types/bundle_enums.rs                  | 42 +----------
 src/options_types/jsx.rs                           | 23 ------
 src/options_types/lib.rs                           |  8 +-
 src/options_types/schema.rs                        | 16 ----
 .../source-lints/removed-dead-symbols.test.ts      | 85 ++++++++++++++++++++++
 10 files changed, 93 insertions(+), 129 deletions(-)

gate history · 2 passed · 1 rejected · iteration 1

evidence per changed file
file                                                     reads  edits  tests
src/ast/import_record.rs                                     2      1      0
src/ast/lib.rs                                               3      2      0
src/ast/loader.rs                                            3      2      0
src/http_types/Method.rs                                     1      1      0
src/http_types/mime_type_list_enum.rs                        1      1      0
src/options_types/bundle_enums.rs                            1      1      0
src/options_types/jsx.rs                                     1      1      0
src/options_types/lib.rs                                     1      2      0
src/options_types/schema.rs                                  1      1      0
test/internal/source-lints/removed-dead-symbols.test.ts      0      2      0

Deletes pub items with zero references anywhere in the workspace:

bun_options_types:
- jsx::Pragma::parse_package_name: never called
- bundle_enums::LoaderOptionalExt trait + impl: never imported or called
- bundle_enums::ImportKindExt trait + impl: never imported or called
- schema::api::ImportKind enum: only referenced by the ImportKindExt impl above
- standalone_path::BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX (cfg(windows)):
  duplicate of the const in bun_standalone_graph, which all callers use

bun_http_types:
- MimeTypeList::COUNT: never read
- Method::Optional::contains: never called

Also drops the sealed::Sealed impls for LoaderOptional/ImportKind (only the
removed traits bounded on them) and tidies the doc comments in bun_ast that
pointed readers at the removed extension traits.

Verified with rg across src/, build/debug/codegen/, and src/codegen/.
bun bd and bun run rust:check-all pass.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43585bd7-e60d-455c-9d4e-2882132cb442

📥 Commits

Reviewing files that changed from the base of the PR and between 47597ab and f79e101.

📒 Files selected for processing (9)
  • src/ast/import_record.rs
  • src/ast/lib.rs
  • src/ast/loader.rs
  • src/http_types/Method.rs
  • src/http_types/mime_type_list_enum.rs
  • src/options_types/bundle_enums.rs
  • src/options_types/jsx.rs
  • src/options_types/lib.rs
  • src/options_types/schema.rs

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

Changes

The pull request removes obsolete public APIs across AST, options types, HTTP method handling, MIME type lists, JSX helpers, and standalone path constants, including related schema declarations, extension traits, re-exports, and documentation references.

Public API cleanup

Layer / File(s) Summary
AST loader and import API removal
src/ast/*, src/options_types/bundle_enums.rs, src/options_types/lib.rs, src/options_types/schema.rs
Removes LoaderOptional, its conversion traits and re-exports, the ImportKind schema type and conversion trait, and related documentation references.
Options helper and path API removal
src/options_types/jsx.rs, src/options_types/lib.rs
Removes parse_package_name and BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX.
HTTP and MIME API removal
src/http_types/Method.rs, src/http_types/mime_type_list_enum.rs
Removes Optional::contains and MimeTypeList::COUNT.

Suggested reviewers: jarred-sumner


Comment @coderabbitai help to get the list of available commands.

@robobun

robobun commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator Author
Updated 2:06 PM PT - Jul 22nd, 2026

@Jarred-Sumner, your commit f79e101 is building: #78154

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — pure dead-code removal, all deletions verified unreferenced.

What was reviewed:

  • Grepped src/ for every removed symbol (parse_package_name, LoaderOptionalExt, ImportKindExt, api::ImportKind, MimeTypeList::COUNT, Optional::contains) — zero hits.
  • Confirmed BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX callers all resolve to the bun_standalone_graph copy, not the removed standalone_path one.
  • Checked that surviving imports (bun_core::strings in jsx.rs, const_format dep) are still used elsewhere in the crate.
Extended reasoning...

Overview

Deletes seven unreferenced items across bun_options_types and bun_http_types: Pragma::parse_package_name, the LoaderOptionalExt/ImportKindExt extension traits and their sealed::Sealed impls, schema::api::ImportKind, the Windows-only duplicate standalone_path::BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX, MimeTypeList::COUNT, and Method::Optional::contains. Also drops the now-dead LoaderOptional import and re-exports, and trims three doc comments in bun_ast that pointed at the removed traits. Net +7/-114, deletion-only.

Security risks

None. No runtime logic, FFI, parsing, or user-input handling is touched — every change is a removal of code with zero call sites.

Level of scrutiny

Low. This is mechanical dead-code cleanup in leaf type crates. The only real risk is accidentally deleting something with a hidden caller (FFI export, codegen consumer, cfg-gated call site). I independently verified each deletion:

  • rg -w across src/ returns zero hits for parse_package_name, LoaderOptionalExt, ImportKindExt, api::ImportKind, and MimeTypeList::COUNT.
  • All three BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX references (server_body.rs, standalone_graph_jsc.rs, StandaloneModuleGraph.rs) go through StandaloneModuleGraph::, confirming the options_types::standalone_path copy was an unused duplicate.
  • The one .contains() in ServerConfig.rs:400 operates on the destructured EnumSet<Method>, not on Optional — matches the PR's claim.
  • None of the removed items are #[no_mangle]/extern "C", so no C++ linkage can depend on them.

Other factors

  • The use bun_core::strings import in jsx.rs remains live via strings::count_char in member_list_to_components_if_different; the const_format workspace dep remains live via compile_target.rs. No newly-orphaned imports.
  • The trimmed doc comments in bun_ast accurately drop only the references to removed items; the surviving LoaderExt pointer in loader.rs is still correct.
  • Author reports rust:check-all passes on all 10 targets, which covers the cfg(windows) deletion; the Rust compiler would catch any missed reference regardless.
  • No behavioral change is possible, so no new tests are expected per REVIEW.md's dead-code guidance.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — pure dead-code removal, all seven deletions verified to have zero remaining references. The inline nit about LoaderOptional becoming orphaned is worth folding in, but it's non-blocking.

Extended reasoning...

Overview

Deletes seven unreferenced pub items across bun_options_types and bun_http_types (traits, an enum, a const, two functions), drops the now-unused Sealed impls and import, trims three doc comments in bun_ast that pointed at the removed extension traits, and adds test/internal/source-lints/removed-dead-symbols.test.ts to guard against reintroduction. Net +7/-114.

Security risks

None. Pure deletions of uncalled Rust items; no runtime code paths change. No auth/crypto/FFI/unsafe touched.

Level of scrutiny

Low. Each removal was independently spot-checked with rg -w across src/:

  • parse_package_name, LoaderOptionalExt, ImportKindExt — zero hits.
  • BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX — the surviving canonical const in bun_standalone_graph::StandaloneModuleGraph is what all three call sites (server_body.rs, standalone_graph_jsc.rs, StandaloneModuleGraph.rs) resolve to; the deleted cfg(windows) copy in options_types was never imported.
  • MimeTypeList::COUNT, Method::Optional::contains — zero hits.
  • schema::api::ImportKind — only consumer was ImportKindExt::to_api, removed in the same diff.

The PR description reports bun bd and rust:check-all (all 10 targets, covering the cfg(windows) deletion) pass, which is the load-bearing verification for a deletion-only change.

Other factors

  • The new source-lint test follows the established pattern in test/internal/source-lints/ (8 sibling files) — reads a source file and asserts a regex does not match. No new test infrastructure.
  • The one inline finding (bun_ast::LoaderOptional left orphaned after its last consumer was deleted) is a valid completeness nit per REVIEW.md's "delete dead code in the same PR that makes it dead", but it's ~10 lines of harmless unreferenced code, not a functional issue. Fine to fold in or handle as a follow-up.
  • No prior human review comments to address; CI build is in progress.

Comment thread src/ast/loader.rs
LoaderOptionalExt::from_api was the only consumer of LoaderOptional::NONE
and LoaderOptional::from_loader. With that trait gone, the struct has zero
references beyond its own definition and the crate-root re-export.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — the follow-up commit removed LoaderOptional as flagged, and all eight deleted symbols now verify as zero-reference.

What was reviewed

  • Re-grepped each removed symbol (parse_package_name, LoaderOptional{,Ext}, ImportKindExt, api::ImportKind, BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX, MimeTypeList::COUNT, Optional::contains) across src/ — no remaining references.
  • Confirmed ServerConfig.rs:400 set.contains(Method::GET) resolves to EnumSet::contains, not the removed Optional::contains.
  • Confirmed all three BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX call sites resolve to the bun_standalone_graph copy, not the removed cfg(windows) duplicate.
  • New test follows the existing test/internal/source-lints/ pattern.
Extended reasoning...

Overview

Pure dead-code deletion across two small type-only Rust crates (bun_options_types, bun_http_types) plus bun_ast, removing eight pub items with zero workspace references: jsx::Pragma::parse_package_name, LoaderOptionalExt + bun_ast::LoaderOptional, ImportKindExt + schema::api::ImportKind, a cfg(windows)-only duplicate constant, MimeTypeList::COUNT, and Method::Optional::contains. Also trims three doc comments that pointed at the removed items and drops the corresponding Sealed impls / re-exports. Adds a source-lint test guarding against reintroduction. Net +87 / -114.

Security risks

None. This is deletion-only against unreferenced Rust items in type-definition crates. No FFI symbols (verified none are #[no_mangle]/extern "C"), no runtime behavior touched, no user input handling.

Level of scrutiny

Low. The change is mechanical and self-verifying: rustc compiles the workspace across all 10 targets (rust:check-all), so any remaining reference to a deleted item would fail the build. I independently re-grepped every removed identifier across src/ and confirmed zero hits. The one non-obvious case — set.contains(Method::GET) in ServerConfig.rs — is a pattern-matched EnumSet<Method>, so it dispatches to EnumSet::contains, not the removed Optional::contains(&self, &Optional). The BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX deletion is Windows-only and the three live call sites all path through StandaloneModuleGraph::, which resolves to the canonical copy in bun_standalone_graph.

Other factors

My prior review flagged that removing LoaderOptionalExt orphaned bun_ast::LoaderOptional; the author addressed this in 3f4e095 (struct + re-export removed, entry added to the lint test), and the thread is resolved. The new removed-dead-symbols.test.ts sits alongside seven existing files in test/internal/source-lints/ and follows the same read-source-and-regex pattern. The gate evidence shows the lint test failing on main and passing on the branch. No outstanding reviewer comments.

@robobun

robobun commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

CI status: the diff itself is green. bun bd and bun run rust:check-all pass on all 10 targets, and the new source-lint test in test/internal/source-lints/removed-dead-symbols.test.ts passes.

The remaining red in builds 77945 and 77964 is unrelated to this diff:

  • test/js/node/test/parallel/test-net-connect-memleak.js fails identically on ubuntu 25.04 x64 and debian 13 x64 across both builds (FinalizationRegistry callback not firing before the setImmediate check). This PR only deletes unreferenced pub items from bun_options_types/bun_http_types/bun_ast; it doesn't touch net, sockets, or GC. Reported to main-break triage.
  • test/cli/install/bun-install.test.ts failures are GitHub API 504s on tarball fetches (api.github.com/repos/.../tarball/ - 504), a network flake.
  • test-fs-promises-file-handle-readFile.js and webview-chrome.test.ts are marked flaky (passed on retry).

Ready for review/merge.

@Jarred-Sumner
Jarred-Sumner merged commit 5999448 into main Jul 22, 2026
6 of 9 checks passed
@Jarred-Sumner
Jarred-Sumner deleted the claude/farm/5076ff2e/dead-code-options-http-types branch July 22, 2026 21:06
Comment thread src/ast/loader.rs
Comment on lines +3 to +6
//! Data-only enum + pure predicates. `to_api()` / `from_api()` / `API_NAMES`
//! live in `bun_options_types::LoaderExt` (would back-edge into the schema
//! crate). `to_mime_type` / `from_mime_type` live in `bun_http_types` (would
//! back-edge into `bun_http::MimeType`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 The PR description's robobun evidence block is stale: it uses test/internal/source-lints/removed-dead-symbols.test.ts as the entire fails-on-main/passes-on-PR gate proof and lists it as +85 in the diff hotspot ("10 files changed"), but commit f79e101 deletes that test with no stated reason — the final diff is 9 files with no test/ entry. The resolved LoaderOptional thread also says an entry was "added to removed-dead-symbols.test.ts", which is no longer true. Please either restore the test if the deletion was accidental, or update the description to drop the stale evidence block/diffstat and note why the source-lint was dropped (per REVIEW.md "Every deletion needs a stated reason or replacement" and CLAUDE.md #11).

Extended reasoning...

What the issue is

Commit f79e101 — the tip of this PR — deletes test/internal/source-lints/removed-dead-symbols.test.ts with a bare commit message ("Delete test/internal/source-lints/removed-dead-symbols.test.ts") and no stated reason. That file was added earlier in this same PR (da9816a) and extended in 3f4e095. However, the PR description was not regenerated after the deletion, so the auto-generated robobun evidence block still presents the deleted test as the only proof that the change is correct.

Where the description is now inconsistent with what ships

Four places in the PR body/timeline reference the deleted file:

  1. The fails-on-main / passes-on-PR gate — both collapsibles run removed-dead-symbols.test.ts and show its 8 assertions ("8 pass / 0 fail") as the entire "[review] gate passed" proof. Nothing in that block still exists in the final diff.
  2. The diff hotspot table — lists .../source-lints/removed-dead-symbols.test.ts | 85 +++++++... and totals "10 files changed, 93 insertions(+), 129 deletions(-)". The actual final diff (git diff 47597ab2..HEAD --shortstat) is 9 files with no test/ entry; the manually-written summary at the top of the description ("Net: +7 / -114") is closer to reality than the evidence block.
  3. The evidence-per-changed-file table — lists the test file with "0 reads / 2 edits".
  4. The resolved LoaderOptional review thread — the robobun reply says the fix "added an entry to removed-dead-symbols.test.ts", which is now false.

Step-by-step proof

  1. git log --oneline on the PR head shows, in order: 7b6eb3f (dead-code removal) → da9816a (adds the test) → 3f4e095 (removes LoaderOptional, extends the test) → f79e101 (deletes the test).
  2. ls test/internal/source-lints/ on the PR head lists dead-code-escapes.test.ts and siblings but not removed-dead-symbols.test.ts.
  3. The PR's changed-files metadata lists exactly 9 files, all under src/; git diff 47597ab2..HEAD --shortstat confirms 9 files changed.
  4. The PR description's <!-- robobun:evidence:begin --> block was generated at 3f4e095 (its build hashes are 3f4e09509) and was never regenerated after f79e101.
  5. Therefore a reviewer reading the description will conclude an 8-assertion regression guard ships with this PR when in fact no test ships at all.

Why this matters

REVIEW.md states "Every deletion needs a stated reason or replacement", and CLAUDE.md #11 says "NEVER overstate what you got done or what actually works in commits, PRs". The description currently overstates what ships: it presents test evidence for a test that isn't in the final diff. This is not a code defect — the 9 dead-code deletions themselves are correct, bun bd builds, and rust:check-all passes on all 10 targets — but the PR body materially misrepresents the artifact a reviewer is approving.

Impact

Nothing breaks at runtime if merged as-is. The risk is purely process/review: a maintainer skimming the evidence block would approve believing a regression guard exists against these symbols reappearing, when the PR actually relies on the pre-existing test/internal/source-lints/dead-code-escapes.test.ts (or nothing) instead.

How to fix

Either:

  • (a) Restore removed-dead-symbols.test.ts if f79e101 was accidental (e.g. a rebase mishap), or
  • (b) If the deletion was intentional (e.g. maintainer preferred relying on the existing dead-code-escapes.test.ts in the same directory, or decided a per-symbol source-lint isn't worth the maintenance): regenerate/edit the PR description to drop the stale robobun evidence block and diff hotspot, and add one line stating why the source-lint test was dropped. Optionally amend the resolved LoaderOptional thread reply to strike the "added an entry to removed-dead-symbols.test.ts" claim.

Anchoring this comment on src/ast/loader.rs since the deleted test file is not present in the final diff to comment on directly; the LoaderOptional entry in that test was the last thing added to it before deletion.

robobun added a commit that referenced this pull request Jul 24, 2026
Brings in #35002 (remove ~39k lines of dead Rust) and its follow-ups
(#35019, #35052, #35152, #35225, #35293, #35326). The binary-size
check compares against current main; this branch was 137 commits
behind, so it still carried the dead code main dropped and registered
as +630KB..+1.7MB on x64 while aarch64 linux showed -513KB/-601KB
(different dead-code elimination outcomes per target). This stack's
own native contribution is 19 files / +392 -45 lines; src/js is
net -977 lines (domain.ts +692 vs fast-utf8-stream.ts -856 etc).

Also: drop the hoisted pbkdf2 .bind handlers back to closures (review
nit), and take main's expectations.txt since #34741 audited the stale
ASAN entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants