From 5eed709ae2cf4bbd4803d26fc9f5a0216e419735 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Thu, 17 Sep 2026 05:59:16 +0000 Subject: [PATCH 1/3] Remove dead code from bun_css, bun_semver, and the re-export lists of 10 crates Delete six trait impls that no target uses: DeepClone and CssEql for the arena ArrayList and for bun_ast::Loc (plus the eql_list helper), PartialCmp for CSSInteger, and Slicable for ExternalString. Trim 24 names that no other crate imports from the pub use lists of bun_dotenv, bun_ini, bun_install, bun_js_parser_jsc, bun_paths, bun_spawn_sys, bun_tcc_sys, bun_threading, bun_uws_sys and bun_watcher. Four bun_ini structs lose their only outside path and become pub(crate). --- src/css/generics.rs | 52 --------------------------- src/dotenv/lib.rs | 4 +-- src/ini/lib.rs | 13 +++---- src/install/isolated_install/Store.rs | 2 +- src/js_parser_jsc/lib.rs | 3 +- src/paths/lib.rs | 7 ++-- src/semver/lib.rs | 6 ---- src/spawn_sys/lib.rs | 4 +-- src/tcc_sys/lib.rs | 4 +-- src/threading/lib.rs | 2 +- src/uws_sys/lib.rs | 2 +- src/watcher/lib.rs | 6 ++-- 12 files changed, 20 insertions(+), 85 deletions(-) diff --git a/src/css/generics.rs b/src/css/generics.rs index 784d58f40c80..d24be4a927e1 100644 --- a/src/css/generics.rs +++ b/src/css/generics.rs @@ -94,18 +94,6 @@ impl<'bump, T: DeepClone<'bump>> DeepClone<'bump> for &'bump [T] { } } -impl<'bump, T: DeepClone<'bump>> DeepClone<'bump> for ArrayList<'bump, T> { - #[inline] - fn deep_clone(&self, bump: &'bump Arena) -> Self { - // PERF: element-wise deep_clone — profile if hot. - let mut out = ArrayList::with_capacity_in(self.len(), bump); - for item in self.iter() { - out.push(item.deep_clone(bump)); - } - out - } -} - impl<'bump, T: DeepClone<'bump>> DeepClone<'bump> for Vec { #[inline] fn deep_clone(&self, bump: &'bump Arena) -> Self { @@ -165,13 +153,6 @@ impl<'bump, T: DeepClone<'bump>> DeepClone<'bump> for Box { } } -impl<'bump> DeepClone<'bump> for bun_ast::Loc { - #[inline] - fn deep_clone(&self, _bump: &'bump Arena) -> Self { - *self - } -} - // ─────────────────────────────────────────────────────────────────────────────── // Eql // ─────────────────────────────────────────────────────────────────────────────── @@ -195,19 +176,6 @@ pub(crate) fn eql(lhs: &T, rhs: &T) -> bool { lhs.eql(rhs) } -fn eql_list(lhs: &ArrayList<'_, T>, rhs: &ArrayList<'_, T>) -> bool { - if lhs.len() != rhs.len() { - return false; - } - debug_assert_eq!(lhs.len(), rhs.len()); - for (left, right) in lhs.iter().zip(rhs.iter()) { - if !left.eql(right) { - return false; - } - } - true -} - // Blanket / base impls. impl CssEql for Option { @@ -242,13 +210,6 @@ impl CssEql for [T] { } } -impl<'bump, T: CssEql> CssEql for ArrayList<'bump, T> { - #[inline] - fn eql(&self, other: &Self) -> bool { - eql_list(self, other) - } -} - impl CssEql for Vec { #[inline] fn eql(&self, other: &Self) -> bool { @@ -340,13 +301,6 @@ impl CssEql for VendorPrefix { } } -impl CssEql for bun_ast::Loc { - #[inline] - fn eql(&self, other: &Self) -> bool { - self.start == other.start - } -} - impl CssEql for () { #[inline] fn eql(&self, _other: &Self) -> bool { @@ -1574,12 +1528,6 @@ impl PartialCmp for f32 { partial_cmp_f32(*self, *rhs) } } -impl PartialCmp for CSSInteger { - #[inline] - fn partial_cmp(&self, rhs: &Self) -> Option { - Some(Ord::cmp(self, rhs)) - } -} // ─────────────────────────────────────────────────────────────────────────────── // Zero / MulF32 / TryAdd — numeric protocol traits used by `DimensionPercentage` diff --git a/src/dotenv/lib.rs b/src/dotenv/lib.rs index 9ab5e16b7b4e..503f6fe1cb5a 100644 --- a/src/dotenv/lib.rs +++ b/src/dotenv/lib.rs @@ -7,8 +7,8 @@ pub mod no_proxy; pub use error::{Error, Result}; pub use env_loader::{ - DirEntryKeys, DirEntryProbe, DotEnvBehavior, DotEnvFileSuffix, HAS_NO_CLEAR_SCREEN_CLI_FLAG, - HashTable, HashTableValue, INSTANCE, Loader, Map, NullDelimitedEnvMap, S3Credentials, instance, + DirEntryKeys, DotEnvBehavior, DotEnvFileSuffix, HAS_NO_CLEAR_SCREEN_CLI_FLAG, HashTable, + HashTableValue, INSTANCE, Loader, Map, NullDelimitedEnvMap, S3Credentials, instance, set_instance, }; diff --git a/src/ini/lib.rs b/src/ini/lib.rs index a9de2636cb6b..76f1a5ecbb6d 100644 --- a/src/ini/lib.rs +++ b/src/ini/lib.rs @@ -120,10 +120,7 @@ bun_core::comptime_string_map! { }; } -pub use draft::{ - ConfigIterator, Parser, RegistryAuth, ScopeItem, ScopeIterator, ToStringFormatter, - apply_registry_auth, load_npmrc, load_npmrc_config, -}; +pub use draft::{Parser, RegistryAuth, apply_registry_auth, load_npmrc, load_npmrc_config}; mod draft { @@ -956,7 +953,7 @@ mod draft { // ToStringFormatter // ────────────────────────────────────────────────────────────────────────── - pub struct ToStringFormatter<'a> { + pub(crate) struct ToStringFormatter<'a> { pub(crate) d: &'a ExprData, } @@ -1004,7 +1001,7 @@ mod draft { // ConfigIterator // ────────────────────────────────────────────────────────────────────────── - pub struct ConfigIterator<'a> { + pub(crate) struct ConfigIterator<'a> { pub(crate) config: &'a E::Object, pub(crate) log: &'a mut Log, @@ -1176,7 +1173,7 @@ mod draft { // ScopeIterator // ────────────────────────────────────────────────────────────────────────── - pub struct ScopeIterator<'a> { + pub(crate) struct ScopeIterator<'a> { pub(crate) config: &'a E::Object, pub(crate) source: &'a Source, pub(crate) log: &'a mut Log, @@ -1185,7 +1182,7 @@ mod draft { pub(crate) count: bool, } - pub struct ScopeItem { + pub(crate) struct ScopeItem { pub(crate) scope: Box<[u8]>, pub(crate) registry: NpmRegistry, } diff --git a/src/install/isolated_install/Store.rs b/src/install/isolated_install/Store.rs index 9ae9d1c16780..563ab720d774 100644 --- a/src/install/isolated_install/Store.rs +++ b/src/install/isolated_install/Store.rs @@ -601,7 +601,7 @@ pub mod entry { } pub(crate) use entry::EntryColumns; -pub use entry::{Entry, StoreKeyFormatter, fmt_store_key}; +pub use entry::{Entry, fmt_store_key}; // ────────────────────────────────────────────────────────────────────────── // Node diff --git a/src/js_parser_jsc/lib.rs b/src/js_parser_jsc/lib.rs index 31cfb03c2335..74a4a72b11a1 100644 --- a/src/js_parser_jsc/lib.rs +++ b/src/js_parser_jsc/lib.rs @@ -12,6 +12,5 @@ pub mod expr_jsc; // callers can write `bun_js_parser_jsc::Expr` / `expr.to_js(global)` without // also depending on `bun_js_parser` directly. pub use expr_jsc::{ - ExprJsc, data_to_js, expr_to_js, string_to_js, to_js_error, toml_datetime_to_js, - value_string_to_js, + ExprJsc, data_to_js, expr_to_js, string_to_js, to_js_error, value_string_to_js, }; diff --git a/src/paths/lib.rs b/src/paths/lib.rs index 0e2178022408..f8ef59356d88 100644 --- a/src/paths/lib.rs +++ b/src/paths/lib.rs @@ -332,13 +332,13 @@ pub mod path_buffer_pool; // or out-param redesign. The `_buf`-suffixed fns (explicit `&mut [u8]` param) // compile; the convenience wrappers don't yet. Gate the module; expose Platform. pub mod resolve_path; -pub use resolve_path::{Platform, PlatformT, platform}; +pub use resolve_path::{Platform, platform}; pub mod component_iterator; pub use component_iterator::{ Component, ComponentIterator, MakePathStep, PathFormat, make_path_with, }; pub mod classify; -pub use classify::{RelPathFacts, classify_rel_t}; +pub use classify::classify_rel_t; // Crate-root re-exports for the path-mutation helpers so `#[cfg(windows)]` // install paths can call // `bun_paths::dangerously_convert_path_to_posix_in_place(..)` directly. @@ -347,7 +347,6 @@ pub use resolve_path::{ dirname_w, is_drive_letter, is_drive_letter_t, is_sep_any, is_sep_any_t, is_sep_native, is_sep_native_t, join_abs_string_buf, join_abs_string_buf_z, path_to_posix_buf, relative_to_common_path_buf, slashes_to_posix_in_place, slashes_to_windows_in_place, - windows_volume_name_len, }; // Re-export the pool *type* at crate root so `bun_paths::os_path_buffer_pool::get()` // resolves on both targets (= `WPathBuffer` pool on Windows, `PathBuffer` on @@ -426,7 +425,7 @@ pub fn dirname(p: &[u8]) -> Option<&[u8]> { } #[path = "EnvPath.rs"] pub mod env_path; -pub use env_path::{EnvPath, EnvPathInput, PathComponentBuilder}; +pub use env_path::EnvPath; // ────────────────────────────────────────────────────────────────────────── // Windows path-prefix constants — relocated from diff --git a/src/semver/lib.rs b/src/semver/lib.rs index 1bcba91768da..a7c31ff6af82 100644 --- a/src/semver/lib.rs +++ b/src/semver/lib.rs @@ -32,12 +32,6 @@ impl Slicable for crate::semver_string::String { crate::semver_string::String::slice(self, buf) } } -impl Slicable for crate::external_string::ExternalString { - #[inline] - fn slice<'a>(&'a self, buf: &'a [u8]) -> &'a [u8] { - crate::external_string::ExternalString::slice(self, buf) - } -} /// Alias so callers can name `bun_semver::string::Formatter` etc. pub use crate::semver_string as string; diff --git a/src/spawn_sys/lib.rs b/src/spawn_sys/lib.rs index ef83467c37d3..abe5f9c912c8 100644 --- a/src/spawn_sys/lib.rs +++ b/src/spawn_sys/lib.rs @@ -189,6 +189,6 @@ pub use spawn_process::spawn_process_posix; #[cfg(windows)] pub use spawn_process::uv_getrusage; pub use spawn_process::{ - Dup2, ExtraPipe, FdT, IoCounters, PidFdType, PidT, PosixSpawnOptions, PosixSpawnResult, - PosixStdio, Rusage, RusageFields, StdioKind, WinRusage, WinTimeval, rusage_zeroed, + Dup2, ExtraPipe, PidFdType, PidT, PosixSpawnOptions, PosixSpawnResult, PosixStdio, Rusage, + RusageFields, StdioKind, rusage_zeroed, }; diff --git a/src/tcc_sys/lib.rs b/src/tcc_sys/lib.rs index 58593e1e124e..8eeb1d8596ae 100644 --- a/src/tcc_sys/lib.rs +++ b/src/tcc_sys/lib.rs @@ -1,6 +1,4 @@ #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] #![warn(unused_must_use)] pub mod tcc; -pub use tcc::{ - Config, ConfigErr, Error, ErrorFunc, OutputFormat, State, Symbol, TCCErrorFunc, TCCState, -}; +pub use tcc::{Config, ConfigErr, Error, OutputFormat, State, Symbol}; diff --git a/src/threading/lib.rs b/src/threading/lib.rs index b3af867af395..358de89b7e67 100644 --- a/src/threading/lib.rs +++ b/src/threading/lib.rs @@ -30,7 +30,7 @@ pub use condition::{Condition, Condvar}; /// `Futex` re-exported as a capitalized module alias so callers can write /// `Futex::wait`, `Futex::wake`, `Futex::Deadline`. pub use futex as Futex; -pub use guarded::{Guarded, GuardedLock}; +pub use guarded::Guarded; pub use mutex::{Mutex, MutexGuard}; pub use reset_event::ResetEvent; pub use rwlock::RwLock; diff --git a/src/uws_sys/lib.rs b/src/uws_sys/lib.rs index ad9170bca813..dd0702ee6c5c 100644 --- a/src/uws_sys/lib.rs +++ b/src/uws_sys/lib.rs @@ -478,7 +478,7 @@ pub use socket::{ pub use internal_loop_data::InternalLoopData; #[cfg(windows)] pub use loop_::WindowsLoop; -pub use loop_::{Loop, NOW_NS_UNKNOWN, PosixLoop}; +pub use loop_::{Loop, NOW_NS_UNKNOWN}; pub use socket_kind::SocketKind; #[cfg(windows)] pub use timer::Timer; diff --git a/src/watcher/lib.rs b/src/watcher/lib.rs index 76619cf6836e..04d4ca921ba1 100644 --- a/src/watcher/lib.rs +++ b/src/watcher/lib.rs @@ -35,7 +35,7 @@ pub use error::{Error, Result}; pub use WatchItemKind as Kind; pub use watcher_impl::{ - AnyResolveWatcher, ChangedFilePath, Event, FdOwnership, HashType, MAX_COUNT, - MAX_EVICTION_COUNT, Op, PackageJSON, REQUIRES_FILE_DESCRIPTORS, WATCH_OPEN_FLAGS, WatchEvent, - WatchItem, WatchItemColumns, WatchItemIndex, WatchItemKind, WatchList, Watcher, WatcherContext, + AnyResolveWatcher, ChangedFilePath, Event, FdOwnership, HashType, MAX_COUNT, Op, PackageJSON, + REQUIRES_FILE_DESCRIPTORS, WATCH_OPEN_FLAGS, WatchEvent, WatchItemColumns, WatchItemKind, + WatchList, Watcher, WatcherContext, }; From 8819708ed35022c06f0edca09726eb89453ca51d Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Thu, 17 Sep 2026 06:22:22 +0000 Subject: [PATCH 2/3] ci: retrigger From ae7797c39cb9dff564724852428e34f8c9bfe95d Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Fri, 25 Sep 2026 20:42:42 +0000 Subject: [PATCH 3/3] spawn_sys: delete the non-unix FdT alias that nothing uses Every use of FdT is in cfg(unix) code. The crate-root re-export was the only thing that named the non-unix alias, and that re-export is gone. The comment on the bun_windows_sys dependency named the removed IoCounters re-export. It now names the alias in spawn_process.rs. --- src/spawn_sys/Cargo.toml | 2 +- src/spawn_sys/spawn_process.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spawn_sys/Cargo.toml b/src/spawn_sys/Cargo.toml index 5552599afeea..03e02092fc0b 100644 --- a/src/spawn_sys/Cargo.toml +++ b/src/spawn_sys/Cargo.toml @@ -16,7 +16,7 @@ libc.workspace = true bun_analytics.workspace = true bun_core.workspace = true bun_sys.workspace = true -bun_windows_sys.workspace = true # tier-0 no_std leaf; unconditional like bun_sys/bun_core do — keeps the IoCounters alias valid on non-Windows so the flat re-export in lib.rs stays un-cfg'd +bun_windows_sys.workspace = true # tier-0 no_std leaf, unconditional like bun_sys/bun_core: the un-cfg'd IoCounters alias in spawn_process.rs must resolve on non-Windows enumset.workspace = true strum.workspace = true diff --git a/src/spawn_sys/spawn_process.rs b/src/spawn_sys/spawn_process.rs index 189deb7f0a84..0de81dcb9f60 100644 --- a/src/spawn_sys/spawn_process.rs +++ b/src/spawn_sys/spawn_process.rs @@ -35,8 +35,6 @@ pub type PidT = bun_libuv_sys::uv_pid_t; #[cfg(unix)] pub type FdT = libc::c_int; -#[cfg(not(unix))] -pub type FdT = i32; #[cfg(any(target_os = "linux", target_os = "android"))] pub type PidFdType = FdT;