Repository navigation
chore: delete unreachable code behind the dead-code allowlist - #8900
Merged
Merged
Conversation
A function reached only through a renamed import (use X as Y) was reported as having no callers. is_enabled_by_env, called as async_ssh_enabled, sat on the allowlist for that reason; its row is dropped.
Removes 41 functions with no production caller and no test reference, with their allowlist rows. The 10 rows held for a decision stay. into_sync_halves was the only constructor of the embedded SSH SyncReader/SyncWriter halves; connect_and_exec uses connect.rs's ChannelReader/ChannelWriter. The orphaned halves, their re-exports and tests go with it, and the docs that named them now point at connect.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The dead-code allowlist (
tools/ci/dead_code_allowlist.tsv) held 52 rows that all expire on 2026-12-10. On that date the census gate fails master. This PR clears 42 of the 52 rows. The other 10 stay, held for an owner decision.tools/ci/dead_code_census.pynow followsuse X as Yrenames, so a reference toYcounts forX. Without this,is_enabled_by_env(coreasync_ssh_transport.rs), which is reached only asasync_ssh_enabled, was reported dead. Its stale row is removed. The new test is intools/tests/test_dead_code_census.py.Rows deleted with their function
standard_idread_all_delta_opsregistered_waker_countrun_stdio_session(wholesections/stdio_session.rs),all_sessions,update_bytesreference_directory,drop_devices_enabledcached_sort_by_cmp,unlinkat_at,buffer_slice,read_into,operator_link,process_files,with_thread_countinit_tracing_with_filterset_roleread_ndx_from_carry_async,flist_stats,xattr_cache_mut,is_io_error_end_markertake_stdin,take_stdout,into_sync_halvesstrong_digestwith_negotiated_algorithms,wire_bits,drain_new_redo_indices,match_uid,match_gid,set_deletion_filter_chain,exchange_compat_flags_direct,with_crtimes,with_flag_string,as_full_mut_sliceprint_summary,run_and_extract_messages,get_groups_for_scenario,get_messages_for_scenario,version_string,get_oc_rsync_binaryTwo deletions were checked by hand because their comments described live paths:
run_stdio_sessionclaimed to serve remote-shell daemon mode (main.c:1975-1979). The live path isdaemon::run_daemon_stdio, called fromcrates/cli/src/frontend/server/daemon.rs. The deleted function was an unused duplicate.into_sync_halveswas the only constructor ofrsync_io'sSyncReader/SyncWriter.connect_and_execdoes not use them: it builds its ownChannelReader/ChannelWriterinembedded/connect.rs.Follow-on removals
Deleting
into_sync_halvesleftSyncReader,SyncWriterand theirBridgeSyncReader/BridgeSyncWriterre-exports with no production constructor. They are removed too, with:round_trip_via_channel_pump/round_trip_via_bridgehelpers and the 5wire_byte_parity_*tests, which compared the bridge against the removed pump.SyncAsyncBridge,ChunkPoolanddrain_intostay, with their tests.connect.rsstill usesChunkPoolanddrain_into.The
sync_bridge.rsmodule docs no longer describe the removed halves. Two docs pointed atinto_sync_halvesand now point atconnect.rs:docs/architecture/session-overview-ddp-async-iouring.mdanddocs/design/russh-async-native-path.md.Imports left unused by the deletions are removed (transfer
setup/compat.rs, xtaskshared/util.rs).Not covered: 10 rows held for the owner
Untouched, still expiring 2026-12-10:
fast_ioiocp/rio.rs:as_rio_buf,as_rio_buf_with_len,rio_send,rio_recv,rio_create_request_queue,rio_notifyfast_ioadaptive_dispatch.rs:pickenginedirectory/planner.rs:plan_directory_entries_parallelenginethroughput governor:current_ceiling(rope.rs),into_parts_with_rope(work_queue.rs)dead_code_census.py gate --today 2026-12-11lists exactly these 10 as expired, and nothing else.Verification
Branch head f2aa32c, on master df6f15f.
cargo fmt --all -- --check: cleancargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings: cleanx86_64-pc-windows-gnu: cleancargo nextest run --all-features --libfor every touched crate (rsync_io, batch, signature, matching, logging, apple-fs, fast_io, protocol, transfer, core, daemon, engine): 20,215 run, 20,203 passed. Aftercargo build -p bin, batch passes 148/148; its 9 failures were the missing-binary panic attest-support/src/bin_path.rs:64. The other 3 failures arersync_iossh_config_differentialcells. They compare oc's ssh_config parser against the host'sssh -G, which is OpenSSH 10.6p2 rather than the pinned 10.0p2 oracle. This change does not touch the parser. I did not rerun these 3 cells on master. After the rebase onto fix: walk a network receiver destination before mkdir #8899: fast_io + transfer --lib 4,121/4,121python3 tools/ci/dead_code_census.py gate: OK (10 rows, all allowlisted and unexpired)tools/ci/run_tools_tests.sh: 420 tests, OK (3 skipped, all pre-existing)no-placeholders, xtaskcitations,citation_drift_audit.py --ratchet,unsafe_owner_deps.py,test_seam_gate.py: OKno-binariesfails the same way on master: 7tests/protocol_handshakes/*.binfixtures, none touched here, and no workflow runs it.