Repository navigation
Conversation
Seven pub items have no user on any target: - bun_sys: O::NOATIME, O::NOFOLLOW_ANY, posix::s_isdir, the Windows umask, and the Windows UTIME_NOW - bun_errno: the Linux and Android posix::mode_t alias - bun_libuv_sys: UvHandle::data Lower the two unused_pub counts in mordant-baseline.toml to match.
|
Updated 6:27 AM PT - Oct 17th, 2026
❌ @robobun, your commit 72d96eb has 2 failures in
🧪 To try this PR locally: bunx bun-pr 45698That installs a local version of the PR into your bun-45698 --bun |
|
Status: withdrawn.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThis change removes selected platform-specific declarations from the system and errno modules, removes ChangesAPI cleanup
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
|
Two open PRs call
Neither PR changes the definition. If this PR lands first, each of them stops compiling after a merge with main. Two ways out:
|
|
Closing this pull request. I did not check the removed items against the other open pull requests before I opened it. That check now shows that six of the seven items have a user in an open pull request:
Main has no merge queue. #45749 and #44937 merge with this branch without a text conflict, so each would stop compiling on main after this one merged. The seventh item, The check: the Rust lines that each of the 5,637 open pull requests adds against its merge base with main, searched for the seven names. |
Problem
pubitems inbun_sys,bun_errnoandbun_libuv_syshave no user on any target:O::NOATIME,O::NOFOLLOW_ANY,posix::s_isdir, the Windowsumask, the WindowsUTIME_NOW, the Linux and Androidposix::mode_talias, andUvHandle::data.dead_codelint exemptspubitems. Theunused_publint of themordantjob reports them, butmordant-baseline.tomlallows the 160 findings that predate the job.Fix
unused_pubcounts inmordant-baseline.toml. The Notes give each proof.cfgfor another platform holds.bun run rust:check-all(12 targets),cargo check --workspace --all-targets,bun run rust:mordant,cargo fmt --all --check,bun bd, and three test files with the debug build (Notes).Background
pubfn, const, static, type alias and trait method#[deprecated]in a scratch tree.--force-warn deprecatedthen prints every use. Visibility does not change, so names resolve as in the real build.Downsides
rgoversrc/,packages/,scripts/,test/andbuild/debug/codegen/, andcargo checkfor 12 targets.Behaviour change: none
Notes
Removed, by file
src/sys/lib.rsO::NOATIME, threecfgvariants. No Rust code names it. The comment above the Windows variant named a bit-test inopenat_windows_implthat is gone. The comment now names onlyO::PATH, which that function still tests.O::NOFOLLOW_ANY, twocfgvariants, and its comment. No Rust code names it.posix::s_isdir. No caller.s_islnkbeside it has callers and stays.UTIME_NOW, thecfg(windows)variant.bun_sys::cre-exports the constant only undercfg(unix). The one reader,from_nowinsrc/runtime/node/time_like.rs, iscfg(not(windows)).umaskinwindows_impl. The one caller,exec_modeinsrc/install/bin.rs, iscfg(not(windows)).src/errno/lib.rsposix::mode_t, the Linux and Android alias. The one import,bun_sys::posix::mode_tinsrc/spawn_sys/posix_spawn.rs, iscfg(target_os = "macos"). All other code useslibc::mode_t.src/libuv_sys/libuv.rsUvHandle::data. A default trait method with no caller and no override. Callers read thedatafield or callget_data.mordant-baseline.tomlunused_pub:src/sys/lib.rs55 to 48 andunused_pub:src/libuv_sys/libuv.rs41 to 40. These are the values thatbun run rust:mordant:baselinewrites on this branch. That command also lowers onegeneric_body_not_genericcount that this diff does not cause, so that line is not in this diff.bun_sysdefinitions. It does not count themode_talias, which a glob re-export reaches.Base
git merge-treemerges them without a conflict. Every check below ran on this base.Method
#[deprecated(note = "DC#<id>")] #[allow(dc_live_<id>)]in front of each item, in a scratch state of the tree.--force-warn deprecatedlists each use with its site, also a use inside another marked item.--force-warn unknown_lintsprintsdc_live_<id>once for each marked item that survivescfgstripping. That tells an item that a target does not compile apart from an item that the target compiles and never uses.pubfns, consts, statics, type aliases and trait methods. 220,321 uses on linux. 158 items have no use on linux, windows or macOS (#[no_mangle]and other exported items count as used). 111 are in open dead-code pull requests.unused_pubcounts ofmordant-baseline.tomlfor 17 of its 22 files. Three of the other five files hold types, which pass 2 covers.pubtypes and foreign items. 32 have no use. 28 are in open dead-code pull requests. Three libuv declarations lose their last user only when Remove dead code from bun_core, the JSC bindings, the debugger, and 24 other crates #41385 merges. The last one,SliceIteratorinbun_clap, has unit tests.pubfields. A field that no other crate accesses becamepub(crate), and rustc then reported 86 never-read fields on linux. 36 are in open dead-code pull requests. None of the other 50 is in this diff (see the leads).CowSlice::init_dupe,simdutf::Status::TOO_SHORT,__IsFreeze::IS_FREEZE(it also makes a static assertion fail on purpose).UV_ENOTSUP,UV_ENODATA(posix),O::EVTONLY.host_fn_setter,host_fn_this_value, and theJsClass::estimated_sizedefault.inflate_embedded,inflate_embedded_nul.Tag::fchownat.Eenum (see the leads).Tests, debug build (all with
--timeout 180000, the ASAN build is slow)test/js/bun/io/bun-write.test.js: 106 pass, 0 fail.test/cli/install/bun-lockb.test.ts: 66 pass, 0 fail.test/js/node/fs/fs.test.ts: 612 pass, 3 fail, 8 skip. The three failures are thereaddir(path, {recursive: true}) should work x 100tests. Each has its own 10 s limit, and each also fails when it runs alone. One recursivereaddiroftest/js/nodereturns the same 6,758 entries on this debug build and on the installed release build (1.4.3-canary). It takes 12 times (sync) to 37 times (async) longer on the debug build of this machine. The installed release build passes the three tests in 1.2 s to 2.3 s. I did not build the merge base to compare.Leads, not in this diff
src/errno/windows_errno.rs: 24 aliases such asE::E2BIGandE::ECONNRESEThave no user. The comment of the table says that it exists so that cross-platform source compiles on Windows. Remove dead code from the WebCore bindings and 20 Rust crates #40525 removes four entries of that table. The owner of the table decides.pubfields that need an owner decision:ReactiveInstruction.effects(14 stores, no read),FunctionSignature.return_type,InstrumentationConfig.gatingandExternalFunctionConfig.sourceinbun_react_compiler.JsDoc.start,JsDoc.end,Finished.stepandFinished.indexinbun_sema. 16 fields of the lint AST and rule API.WatchItemandLineOffsetTable(read throughMultiArrayList), four backing-storage fields (OutputFile.owned_src_path_text,ParseResult.source_contents_backing,HTTPResponseMetadata.owned_buf,AsyncModule.ast_alloc_state), andDumpStackTraceOptions.skip_*(read on macOS and Windows).Open dead-code pull requests
Omodule, and Remove dead code from bun_core, the JSC bindings, the debugger, and 24 other crates #41385 removes other methods ofUvHandle.no test proof · iteration 0 · the description declares no behaviour change, so there is no failing test to prove; the existing suite in CI is the check