Repository navigation
Conversation
Delete the field Parsed.has_choice of the glob matcher, which is assigned and never read, and the @gamut none arm of define_colorspace!, which no invocation matches.
|
Updated 11:23 AM PT - Oct 20th, 2026
✅ @robobun, your commit 6c32571f56fae4c80b3729d3dc2c2701abe87127 passed in 🧪 To try this PR locally: bunx bun-pr 46196That installs a local version of the PR into your bun-46196 --bun |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe changes remove a no-op colorspace macro arm and the private glob parser field ChangesColorspace macro
Glob parser metadata
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
LGTM — a four-line dead-code deletion with no behavior change.
What was reviewed:
Parsed::has_choicein src/glob/matcher.rs: grepped the repo for.has_choicereads — none; the localhas_choicestill feedshas_groupandis_decided_at_onceon the same lines, so matching is unchanged.- The
@ gamut nonearm ofdefine_colorspace!in src/css/values/color.rs: the macro is file-local and all 14 invocations useunbounded,boundedorhsl_hwb, so the arm was unreachable; a futuregamut = nonewould now be a compile error rather than a silent no-op impl, which is the safer failure. - Checked for size/layout assertions on
Parsed(embedded inOnce<Parsed>andOption<Parsed>) — none exist, and the struct is crate-private.
Extended reasoning...
The change deletes a write-only bool field from the private glob Parsed struct (declaration, initializer, final store) and an unreachable arm of the file-local define_colorspace! macro; no lines are added. It touches no security-sensitive surface. Approval rests on the grep showing no reader of the field and no gamut = none invocation anywhere in the repo, and on the diff being purely subtractive with the existing glob and css test suites covering the affected code paths. Neither file is covered by CODEOWNERS and there are no third-party objections on the PR.
|
Status: ready for review. CI is green: Buildkite build 129528 passed, 181 of 181 jobs. How to check each deletion on
Verified on ea6a2c7 plus this commit:
The one red check, |
Behaviour change: none
Problem
Parsed.has_choiceinsrc/glob/matcher.rsis declared, set tofalse, assigned once and never read. It came withbun lint,bun fmt: the first run, oxlint's order, Prettier's Tailwind plugin, native JavaScript plugins, a fasterBun.Glob#45043.(@gamut none ...)ofdefine_colorspace!insrc/css/values/color.rsis never matched. The 14 invocations passunbounded,boundedorhsl_hwb.dead_codecounts an assignment as a use, andunused_macro_rulesis not enabled (Cargo.toml:217,:228).Fix
#[deprecated]on it, rustc lists two uses, and both are writes. The local variablehas_choicestays and still feedshas_groupandis_decided_at_once.bun bd,bun run rust:check-all(12 targets),test/js/bun/glob/match.test.ts,test/js/bun/css/color.test.ts(Notes).Background
define_colorspace!generates a color type. Each@gamutarm generates theColorGamutimpl for one kind of gamut.Downsides
Notes
Why this run is small
Found dead in this run, and left alone
getWebSocketConstructor(webcore/JSWebSocket.cpp,JSWebSocket.h). It lost its last caller in WebSocket: real closing handshake, one failure path,wsrewritten on native transports (consolidates the open WebSocket PRs) #45223. Remove dead code from JSWebSocket, ArrayBuffer::alloc, and Subprocess #46140 deletes it.PackageManager.total_scripts(Deduplicate package manager and CLI command helpers #32022, install: remove every unsafe from src/install #40284)Result.import_kindofbun_resolver(Resolve bare undici to the installed package, keep the shim as fallback #36102, compile: resolve bare specifiers from embedded modules against the embedded node_modules tree #44135, Real lifetimes for Source, import records and resolver results #44493, Compile TypeScript to machine code ahead of time:bun build --compile --aot#45631)Connection.going_awayof the HTTP/2 engine (node:http2: validate inbound ALTSVC and ORIGIN frames on the client like node #42391)ResolvedConfig.parser_nameofbun_lint(bun check: fix errors lost since #45800, and 9 to 37% faster #46001 edits the file)WTFTimer.repeatandDebugOptions.editor: assigned and never read, in the last Zig tree too. The removal changes a signature or the bunfig parser, so it is not a plain deletion.toJSNewlyCreatedoverloads and 21 integer converters inJSDOMConvertNumbers.cpp, which the linker drops. Their last callers are functions that Remove dead code from the WebCore bindings, the JSSink codegen, and two Rust helpers #39929 and Remove dead code from the WebCore bindings and 20 Rust crates #40525 delete.PerformanceResourceTimingand its helpers (about 1,800 lines in 14 files).performance.markResourceTiming()is an empty stub andPerformanceResourceTiming::createhas no caller, so no instance can exist. The class is still a global thatperf_hooksexports. This needs a decision.Held: the
ENABLE(WEB_CRYPTO)guardssrc/jsc/bindings/root.h:86definesENABLE_WEB_CRYPTOto 1 outside every#if. 212#if ENABLE(WEB_CRYPTO)guards test it, in 182 files ofsrc/jsc/bindings/webcryptoand inwebcore/SerializedScriptValue.cpp. None has an#else.__LINE__masked, theclang -Eoutput of the 721 entries of the debugcompile_commands.jsonis the same before and after.#ifwhose whole condition isENABLE(WEB_CRYPTO), delete that line and its matching#endif. Delete a blank line only where the removal leaves two together, or one at the end of the file.webcrypto/JsonWebKey.cppbehind the guard. Without the define, that file compiles to nothing.USE(OPENSSL)andHAVE(RSA_PSS)stay, because WebKit still has them.Verification
mainat ea6a2c7 plus this commit.bun bd(debug, ASAN) builds and links.bun run rust:check-all: 12 ok, 0 failed, 0 skipped.cargo fmt --all --check: clean.test/js/bun/glob/match.test.ts(574 pass),test/js/bun/glob/proto.test.ts(4 pass, 1 skip),test/cli/lint/glob.test.ts(63 pass),test/js/bun/css/color.test.ts(1022 pass, 1 skip). No failure.test/js/bun/glob/scan.test.ts: 200 pass, 6 fail. The six tests compare a scan of the whole checkout with thefast-globpackage. Each has a fixed limit of 30 s, which the debug build does not meet on this machine. The release build 1.4.3 needs 2 to 6 s for each. The change deletes a field that nothing reads.-W unused_macro_rulesreports the macro arm onmainand nothing incolor.rsafter the change.Open pull requests
matcher.rsorcolor.rs. 25 of them merge cleanly withmain, and the same 25 merge cleanly with this branch. No head gets a new conflict file.has_choiceor ofgamut = none, and no head deletes one of these 4 lines.How the candidates were found
--gc-sections --print-gc-sections. The linker drops 376 first-party C and C++ functions and 3,342 Rust functions. Open pull requests already delete 179 of the C++ functions. The other 197 are template instances, code for Windows or macOS, or macro output, exceptgetWebSocketConstructor.-Wunused-function -Wunused-member-function -Wunused-template -Wunused-macrosover 608 files and the 71 unified sources.#[deprecated]. Onecargo check --workspacethen lists every use (183,184). This foundhas_choice.-W unused_macro_rulesfound the macro arm.-W unused_crate_dependencies,tsc --noUnusedLocalson the 15 TypeScript projects, and a name index over all tracked sources. Two more searches looked for files that nothing names and for prototypes with no definition.Self-review
getWebSocketConstructor.