Repository navigation
Conversation
No file of bun_sema names bun_semver. The checker has its own port of semver.Version in src/sema/resolve.rs. cargo reports the entry with its unused_dependencies lint.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. WalkthroughThe ChangesSema manifest update
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable risk from the dependency removal remains; the PR is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
Status: ready for review. How to reproduce: on main, run On this branch the same command prints no The red check: |
There was a problem hiding this comment.
LGTM, straightforward removal of an unused manifest entry.
What was reviewed:
- Searched all of
src/sema/(including the baselines, driver, and standalone sub-crates; no build.rs exists) forbun_semver— no code, cfg-gated, or test references, only the manifest line being removed. - Checked
Cargo.lock: only thebun_semadependency-list entry is dropped; thebun_semverpackage itself stays, since other crates still consume it. - Confirmed the lockfile edit matches the manifest edit, so the ninja/cargo build plan stays consistent.
Extended reasoning...
The change deletes one bun_semver.workspace = true line from src/sema/Cargo.toml and the matching entry in the bun_sema dependency list in Cargo.lock; nothing is added and no source files change. It touches no security-sensitive surface. A repo-wide search of src/sema finds no reference to bun_semver in any Rust file, sub-crate manifest, or build script, and bun_semver remains a workspace package with other consumers in Cargo.lock. The changed paths are not covered by .github/CODEOWNERS, and the bug hunt ran dry with no findings, so this is a mechanical two-line manifest cleanup safe to approve.
Behaviour change: none
Problem
bun_semalistsbun_semverunder[dependencies](src/sema/Cargo.toml:18). No file of the crate namesbun_semver.bun check- a TypeScript type checker builtin to Bun #44361 added the crate with this entry.warning: unused dependency `bun_semver`(cargo::unused_dependencies). The warning comes from cargo, not from rustc, so the workspace's deny lints do not stop the build.Fix
src/sema/Cargo.tomland the matching line fromCargo.lock.rg bun_semver src/semafinds only the manifest line. The checker compares versions with its own port ofsemver.Versioninsrc/sema/resolve.rs.bun bd,bun run rust:check-all(12 targets),cargo check --all-targetsfor the four sema crates (also--release, and with--cfg bun_debug --cfg bun_asan), andtest/cli/check/entry-points.test.ts(158 pass).Background
[dependencies]entry makes cargo build that crate first and pass it to rustc with--extern. An entry that no code names only adds an edge to the build graph.bun_semver, so the link takes the same set of rlibs.unused_dependenciesfor the whole workspace. Cargo reports nine more entries on linux. Six have a user on another target, under a build cfg, or in unit tests, and Remove dead code from bun-uws, bun-usockets, the require.extensions FFI, and unused Cargo dependencies #40294 removes the other three (Notes). That is a separate change.Downsides
baselinesfeature, and the test targets of the four sema crates. No source file changes.Notes
Why this pull request is small
This is the result of a full dead-code scan of main at bbdc5a5. 41 dead-code pull requests are open. Together they remove 58,944 lines in 1,017 files. Outside those diffs, the scan found one item that is certain: this dependency entry.
The other nine
unused_dependencieswarnings on linuxbun_ini -> bun_js_parser,bun_platform -> bun_core,bun_ptr -> scopeguardbun_resolver -> bun_zstdcfg(bun_codegen_embed)(src/resolver/node_fallbacks.rs:55).bun_wyhash -> bstrsrc/wyhash/lib.rs:1017).bun_errno -> bun_windows_sys,bun_libuv_sys -> libc,bun_libuv_sys -> strumbun_perf -> bun_syssrc/perf/lib.rs:133).What the scan covered, and what it found
Each candidate was compared with the lines that the 41 open pull requests remove.
src,packages,scripts,test,bench, generated code), comments excluded. Each definition with no other use is one of these: a test, an FFI export with a C++ user, a host function that the codegen names, a config macro thatENABLE(),USE()orHAVE()reads, or a deletion that an open pull request has..rsfiles are not compiled on linux. Each has amoddeclaration (platform, test, bench,build.rs). 16 of 609 C and C++ sources are not compiled on linux (platform, tools,#included parts). Each header has an includer, exceptv8config.h(Remove dead code from bun_runtime, bun_core, bun_ast, bun_io, and an orphaned package #40969).-Wunused-function -Wunused-member-function -Wunused-template -Wunneeded-internal-declaration -Wunused-macros -Wunused-const-variable. The build passes-Wno-unused-function. Result: 8 functions, 8 macros, 5 templates, 1 member function. Each has a user on another platform or in another translation unit, is a config macro or an include guard, or is in Remove dead code from bun-uws, bun-usockets, the require.extensions FFI, and unused Cargo dependencies #40294, Remove dead code from bun_core, bun_jsc, bun_css, react_compiler, and two C++ bindings #40367, Remove dead code from the JSC bindings, the codegen scripts, the CI scripts, bun_core, and bun_jsc #40492, Remove dead code from the JSC, WebCore, and node bindings, uWS/uSockets, SecretsLinux, and seven Rust crates #42431 or Remove dead code from the class and sink generators, JSBuffer, the bake client, bun-error, and the build scripts #43378. The exception is theWriteBarrier<T>overload ofvisitGlobalObjectMember, whichZigGlobalObject.hdocuments as the extension point of the member list.tsc --noUnusedLocalsoversrc/js: 5 diagnostics. 4 are loop bindings.#onConnectinhttp2.tshas a caller (this.#onConnect(arguments)).unused_pubwith no baseline, 3 targets: 167 items. 128 are in open pull requests (91 in Remove dead code from the Windows bunx shim, bun_sys, libuv_sys and mimalloc_sys #40172). Of the other 39, 25 are theE-prefixed errno aliases ofwindows_errno.rs, which exist so that one source compiles on both targets. The others have a user that the run does not compile, or are table entries:StoredTrace::from(cfg(bun_debug)),inflate_embedded(cfg(bun_codegen_embed)),CowSliceZ::init_dupe(unit test),host_fn_setterandhost_fn_this_value(the class generator emits them for classes that are not shared).dead_public, release profile,aarch64-unknown-linux-gnu,x86_64-pc-windows-msvcandaarch64-apple-darwin: 807 findings. 659 are fields of FFI and serialized structs, so the layout needs them. 122 are constants and enum variants of code tables, most of them in Remove dead code from the Windows bunx shim, bun_sys, libuv_sys and mimalloc_sys #40172. Of the 9 functions and 7 methods, 7 are in Remove dead code from the Windows bunx shim, bun_sys, libuv_sys and mimalloc_sys #40172, Remove dead code from the WebCore bindings and 20 Rust crates #40525 or Remove dead code from bun_jsc, bun_runtime, bun_core, and the JSC bindings #40824, 2 are thehost_fnhelpers above, and 6 have their callers undercfg(debug_assertions)orcfg(bun_debug)(dump_stack_trace,StoredTrace::capture,has_resolve_breakpoint,TaskTag::name).ArrayHashMap::unlock_pointershas two callers in source. The 5 modules, 4 type aliases and 1 re-export are visibility findings (the module is used inside its crate), stubs or aliases for other platforms, theResultalias that each crate re-exports by convention, or in open pull requests.bun_semahas no finding.--gc-sections --print-gc-sections. It drops 1,434 functions of bun's own C and C++ (sqlite and the highway target clones excluded). The names of 1,336 are on lines that open pull requests remove. The other 98 have a user on Windows or macOS, are unused copies ofstatic inlinefunctions, are--wrapshims, or are the llhttp API. It drops 153 Rust functions that map to one source location. 14 are in open pull requests. The others areconst fnused at compile time, copies of#[inline]functions, Windows path helpers, or thebtjsdebugger entry.Debugimpls and 2 areDropimpls. 24 predate Remove dead code: 49 trait impls nothing uses, across 12 crates #43664, which did not remove them. Its notes say that such candidates do not compile away, or stayed by choice. The one new block,impl Alloc for Globalinsrc/sema/table.rs, is the default of theA: Alloctype parameter.scripts/build/rust.ts, is combined withdebug_assertions, or is a documented manual switch.Tools
oven-sh/hawkat c9ca301 does not build with nightly-2026-09-15. Two imports moved:rustc_session::config::CrateTypeis nowrustc_structures::CrateType, andrustc_session::lint::Levelis nowrustc_lint_defs::Level. With those two changes it builds and the analysis completes.MORDANT_TOMLwithout thebaselineline,MORDANT_RUSTFLAGS="-A unknown_lints --cap-lints=warn".Still dead on main, not in this diff (unchanged from the notes in #43664 and #43976)
PerformanceResourceTimingcluster insrc/jsc/bindings/webcore(about 2,000 lines). The linker drops every constructor. The two globals are public, so a removal is a rewrite of the two wrappers and needs a decision.Clone for JsPosterand theJsPosterVTable::cloneslot.Display for ErrorLocationand thefilenamefield that only it reads. Each is a small refactor.Debugimpls that nothing formats. They are a debugging aid.Bun__napi_get_versioninnapi.cpp. Remove dead code from the JSC bindings, headers.h, the console builtin, and bun_jsc #40232 has the hunk under the old name of the function.<Type>Class__callshims that the class generator emits for the sevenExpect*matchers.packages/h3blastand the scripts that a person runs by hand.Tests
test/cli/check/entry-points.test.tswith the debug build: 158 pass with--timeout 120000. With the default 5 s timeout, 4 tests time out in this container under ASAN (the slowest takes 5.1 s).test/internal/source-lints/workspace-lints.test.tsandbuild-rust.test.ts: 14 pass.[policy-decision:dep] gate passed · iteration 0 · 2 files touched
passes on PR (with fix)
Dependency/toolchain change; no test proof to run.diff hotspot
gate history · 1 passed · 0 rejected · iteration 0
evidence per changed file