# tokio-rs/tokio — codebase unpack

> Canonical page: https://codevetter.com/unpack/tokio

This is a deterministic Repo Unpack scan of tokio-rs/tokio — a structural map, not a review, security audit, or maintainer-endorsed description.

- Scanned commit: 2746c3ae26f8ac0af6023843a7f23d419c334efe (2026-10-02)
- Last upstream commit: ci: update macros_type_mismatch for Rust 1.99.0 (#8533)
- Generated by codevetter 1.15.0 on 2026-10-02
- 883 files scanned · 6.0 MB

Source inspection; upstream code and tests were not executed.

## Languages

- Rust: 808 files
- Markdown: 29 files
- TOML: 18 files
- YAML: 11 files
- JSON: 1 files

## Repository structure

- tokio/ — 578 files
- tokio-util/ — 94 files
- tokio-stream/ — 78 files
- tests-build/ — 22 files
- examples/ — 22 files
- benches/ — 19 files
- .github/ — 16 files
- tokio-test/ — 14 files

Probable source entrypoint: `Cargo.toml` (inferred from the tree, not upstream docs)

## Source layout — tokio/

- tokio/tests/ — 131 files
- tokio/CHANGELOG.md — 1 file
- tokio/Cargo.toml — 1 file
- tokio/LICENSE — 1 file

## Package

- Cargo.toml: null — 0 declared dependencies

## Structural health signals

Average score 5.7/10 across 96 files; 81 hotspots. These are deterministic review leads, not proof of a bug.

## Recent history

- 2746c3ae26f8 (2026-10-02) ci: update macros_type_mismatch for Rust 1.99.0 (#8533)
- e6e84a4d4a5e (2026-09-30) net: treat `ENOTCONN` as success in `UnixStream::shutdown` (#8526)
- e133b6fec055 (2026-09-29) task: test task builder spawn locations (#8499)
- 38631ed3de29 (2026-09-29) rt: fix spurious failure in queue `stress1` test (#8524)
- 40b877948236 (2026-09-29) sync: revert `Box::leak` usage (#8522)

## Overview

Tokio is a Rust library workspace for developers building asynchronous applications, providing task execution, operating-system I/O integration, timers, synchronization, filesystem operations, and subprocess control. Its distinctive architecture combines feature-gated APIs, current-thread and work-stealing runtimes, readiness-driven networking, and a separate blocking pool. Companion crates add procedural macros, streams, framing, cancellation, and testing utilities. This brief describes source inspected at commit 2746c3ae26f8ac0af6023843a7f23d419c334efe; it is a bounded investigation, not exhaustive coverage.

## System map

The repository is a Cargo workspace organized around a public runtime crate and companion libraries. Applications enter through Rust APIs or generated main/test wrappers; scheduler and driver implementations remain internal. State lives primarily in memory, while filesystem and subprocess APIs cross into operating-system resources. CI and documentation hosting are separate operational surfaces.
- Cargo.toml defines five public crates and five internal workspace members, with crates.io patches redirecting companion dependencies to local source. — [Cargo.toml#L1-L23](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/Cargo.toml#L1-L23)
- The tokio facade exposes feature-gated fs, process, runtime, signal, sync, task, and time modules; spawn is re-exported when rt is enabled. — [tokio/src/lib.rs#L564-L625](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/lib.rs#L564-L625)
- Builder::build selects current-thread or multi-thread construction; Runtime::block_on enters runtime context before dispatching to that scheduler. — [tokio/src/runtime/builder.rs#L1144-L1151](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L1144-L1151) [tokio/src/runtime/runtime.rs#L343-L382](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/runtime.rs#L343-L382)
- The multi-thread scheduler owns workers with transferable cores; its implementation explicitly describes work stealing and core handoff during block_in_place. — [tokio/src/runtime/scheduler/multi_thread/mod.rs#L49-L78](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/scheduler/multi_thread/mod.rs#L49-L78) [tokio/src/runtime/scheduler/multi_thread/worker.rs#L1-L5](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/scheduler/multi_thread/worker.rs#L1-L5)
- Driver::new assembles I/O, signal, clock, and timer components; disabled I/O or timer access produces explicit enable_io/enable_time panic messages. — [tokio/src/runtime/driver.rs#L47-L65](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/driver.rs#L47-L65) [tokio/src/runtime/driver.rs#L91-L117](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/driver.rs#L91-L117)
- The blocking pool handles non-async work, growing to a configured thread limit and queuing further requests; task::spawn_blocking delegates to runtime infrastructure. — [tokio/src/task/blocking.rs#L90-L104](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/task/blocking.rs#L90-L104) [tokio/src/task/blocking.rs#L220-L225](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/task/blocking.rs#L220-L225)
- Companion boundaries separate stream adapters, feature-gated utility modules, procedural runtime wrappers, and testing helpers rather than embedding them all in tokio. — [tokio-stream/src/lib.rs#L76-L117](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/lib.rs#L76-L117) [tokio-util/src/lib.rs#L25-L65](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/lib.rs#L25-L65) [tokio-macros/src/entry.rs#L468-L519](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-macros/src/entry.rs#L468-L519) [tokio-test/src/lib.rs#L12-L35](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-test/src/lib.rs#L12-L35)
- CI defines nextest and doctest commands across Windows, Linux, and macOS; Netlify builds nightly API documentation into target/doc and redirects / to /tokio. — [.github/workflows/ci.yml#L94-L133](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/ci.yml#L94-L133) [netlify.toml#L1-L19](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/netlify.toml#L1-L19)

## Feature catalog

User-facing functionality consists of composable Rust APIs rather than application routes or screens. Tokio provides execution, communication, I/O, timing, and operating-system control, with availability determined by features and targets. Companion libraries expose higher-level framing, cancellation, delayed queues, and stream composition. This catalog groups the inspected API families without claiming every public symbol was examined.
- Execution APIs include spawn, spawn_blocking, yield_now, LocalSet/spawn_local, JoinSet, JoinHandle, and AbortHandle; main/test macros generate runtime construction. — [tokio/src/task/mod.rs#L277-L320](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/task/mod.rs#L277-L320) [tokio-macros/src/entry.rs#L468-L519](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-macros/src/entry.rs#L468-L519)
- Networking exposes TCP streams/listeners/sockets, UDP, Unix sockets and FIFO pipes, Windows named pipes, and AsyncFd integration for other I/O resources. — [tokio/src/net/mod.rs#L3-L29](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/mod.rs#L3-L29) [tokio/src/net/mod.rs#L38-L64](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/mod.rs#L38-L64)
- AsyncRead and AsyncWrite define nonblocking poll interfaces; extension APIs provide operations such as write_all and flush, while filesystem APIs include whole-file writes and synchronization. — [tokio/src/io/async_read.rs#L7-L59](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/async_read.rs#L7-L59) [tokio/src/io/async_write.rs#L6-L67](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/async_write.rs#L6-L67) [tokio/src/fs/write.rs#L5-L26](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L5-L26) [tokio/src/fs/file.rs#L317-L322](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L317-L322)
- Synchronization exports broadcast, mpsc, oneshot, watch, Mutex, RwLock, Semaphore, Notify, Barrier, OnceCell, and SetOnce. — [tokio/src/sync/mod.rs#L454-L497](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/sync/mod.rs#L454-L497)
- Timing APIs include sleep/sleep_until, interval/interval_at with MissedTickBehavior, and timeout/timeout_at; Timeout polls its wrapped future before checking expiration. — [tokio/src/time/mod.rs#L99-L116](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/time/mod.rs#L99-L116) [tokio/src/time/timeout.rs#L204-L224](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/time/timeout.rs#L204-L224)
- Command supports subprocess spawning and captured output; Child exposes wait-with-output, while signal::ctrl_c provides portable notification through platform implementations. — [tokio/src/process/mod.rs#L863-L866](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L863-L866) [tokio/src/process/mod.rs#L1065-L1071](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L1065-L1071) [tokio/src/process/mod.rs#L1446-L1472](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L1446-L1472) [tokio/src/signal/ctrl_c.rs#L1-L16](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/signal/ctrl_c.rs#L1-L16)
- tokio-util provides codec, compatibility, I/O, task, and time modules; CancellationToken offers child propagation, and DelayQueue returns keyed values after deadlines. — [tokio-util/src/lib.rs#L25-L65](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/lib.rs#L25-L65) [tokio-util/src/sync/cancellation_token.rs#L204-L247](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/sync/cancellation_token.rs#L204-L247) [tokio-util/src/time/delay_queue.rs#L23-L55](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/time/delay_queue.rs#L23-L55)
- tokio-stream supplies StreamExt adapters and resource wrappers; StreamMap merges dynamically inserted streams while preserving each emitted item's source key. — [tokio-stream/src/lib.rs#L76-L117](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/lib.rs#L76-L117) [tokio-stream/src/wrappers.rs#L10-L70](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/wrappers.rs#L10-L70) [tokio-stream/src/stream_map.rs#L9-L27](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/stream_map.rs#L9-L27)

## Data flow

Inputs enter as futures, addresses, buffers, channel values, paths, or subprocess commands. Runtime handles and registered I/O state connect pending work to scheduler wakeups. Channels and codecs own intermediate memory, while files and processes connect that memory to external resources. Completion returns through Future, Stream, JoinHandle, and standard I/O result types.
- spawn accepts a Send + 'static future and output, optionally boxes the future, assigns a task ID, and submits through the current runtime handle. — [tokio/src/task/spawn.rs#L174-L191](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/task/spawn.rs#L174-L191) [tokio/src/task/spawn.rs#L207-L214](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/task/spawn.rs#L207-L214)
- String socket addresses first attempt direct SocketAddr parsing; unresolved strings are owned and resolved through std::net::ToSocketAddrs on spawn_blocking. — [tokio/src/net/addr.rs#L162-L184](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/addr.rs#L162-L184)
- PollEvented creates Registration against the current scheduler; add_source allocates ScheduledIo, registers its token with Mio, and removes allocation if registration fails. — [tokio/src/io/poll_evented.rs#L110-L124](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L110-L124) [tokio/src/runtime/io/registration.rs#L73-L80](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/io/registration.rs#L73-L80) [tokio/src/runtime/io/driver.rs#L288-L311](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/io/driver.rs#L288-L311)
- The I/O driver polls Mio events, translates readiness, updates ScheduledIo, and wakes interested tasks; socket reads then advance initialized bytes in ReadBuf. — [tokio/src/runtime/io/driver.rs#L184-L229](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/io/driver.rs#L184-L229) [tokio/src/io/poll_evented.rs#L171-L180](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L171-L180) [tokio/src/io/poll_evented.rs#L211-L224](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L211-L224)
- Bounded mpsc owns a semaphore sized to channel capacity; send awaits a permit before publishing, and ReceiverStream forwards stream polling to Receiver::poll_recv. — [tokio/src/sync/mpsc/bounded.rs#L159-L168](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/sync/mpsc/bounded.rs#L159-L168) [tokio/src/sync/mpsc/bounded.rs#L816-L823](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/sync/mpsc/bounded.rs#L816-L823) [tokio-stream/src/wrappers/mpsc_bounded.rs#L65-L70](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/wrappers/mpsc_bounded.rs#L65-L70)
- Broadcast stores each value once and clones for receivers; its rounded power-of-two ring overwrites oldest values and reports skipped messages through RecvError::Lagged. — [tokio/src/sync/broadcast.rs#L9-L19](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/sync/broadcast.rs#L9-L19) [tokio/src/sync/broadcast.rs#L32-L54](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/sync/broadcast.rs#L32-L54) [tokio/src/sync/broadcast.rs#L660-L679](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/sync/broadcast.rs#L660-L679)
- LengthDelimitedCodec parses a header, validates and adjusts its length, reserves BytesMut capacity, then splits a complete payload and resets from Data to Head. — [tokio-util/src/codec/length_delimited.rs#L504-L559](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/length_delimited.rs#L504-L559) [tokio-util/src/codec/length_delimited.rs#L564-L602](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/length_delimited.rs#L564-L602)
- Filesystem fallback moves an owned path and buffer into std::fs::write; subprocess output concurrently joins exit status with stdout/stderr reads into Vec buffers. — [tokio/src/fs/write.rs#L98-L100](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L98-L100) [tokio/src/fs/mod.rs#L320-L328](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/mod.rs#L320-L328) [tokio/src/process/mod.rs#L1446-L1472](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L1446-L1472)

## Behavior traces

Three principal flows were followed through implementation: runtime startup, TCP connection handling, and filesystem writing. Startup selects an executor and creates its drivers before running user futures. Networking follows resolution, registration, readiness, and socket operations. Filesystem writing branches between blocking and experimental io-uring execution, with additional completion boundaries for buffered File writes.
- Startup: parse_knobs removes asyncness, chooses the configured Builder flavor, applies options, then emits enable_all → build/build_local → expect → block_on. — [tokio-macros/src/entry.rs#L440-L441](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-macros/src/entry.rs#L440-L441) [tokio-macros/src/entry.rs#L468-L496](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-macros/src/entry.rs#L468-L496) [tokio-macros/src/entry.rs#L509-L519](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-macros/src/entry.rs#L509-L519)
- Multi-thread startup: build → build_threaded_runtime → Driver::new → create_blocking_pool → MultiThread::new → handle.enter → launch.launch → Runtime::from_parts. — [tokio/src/runtime/builder.rs#L1146-L1151](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L1146-L1151) [tokio/src/runtime/builder.rs#L2180-L2198](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L2180-L2198) [tokio/src/runtime/builder.rs#L2228-L2234](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L2228-L2234)
- Execution: Runtime::block_on → block_on_inner → enter → scheduler.block_on; MultiThread enters runtime context and drives the root future on the calling thread. — [tokio/src/runtime/runtime.rs#L343-L382](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/runtime.rs#L343-L382) [tokio/src/runtime/scheduler/multi_thread/mod.rs#L81-L91](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/scheduler/multi_thread/mod.rs#L81-L91)
- TCP bind: TcpListener::bind → to_socket_addrs → sequential bind_addr attempts → Mio bind → TcpListener::new → PollEvented registration; empty resolution returns InvalidInput. — [tokio/src/net/tcp/listener.rs#L102-L125](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/listener.rs#L102-L125) [tokio/src/net/tcp/listener.rs#L303-L305](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/listener.rs#L303-L305) [tokio/src/io/poll_evented.rs#L110-L124](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L110-L124)
- TCP accept: accept → Registration::async_io(READABLE) → readiness and cooperative budget → Mio accept → new_accepted; WouldBlock clears readiness, and accepted streams initially assume read/write readiness. — [tokio/src/net/tcp/listener.rs#L162-L170](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/listener.rs#L162-L170) [tokio/src/runtime/io/registration.rs#L225-L244](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/io/registration.rs#L225-L244) [tokio/src/net/tcp/stream.rs#L171-L180](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L171-L180)
- Echo flow: echo_server binds loopback, spawns a client performing write_all/read_exact, accepts and splits the server stream, copies read-to-write, then checks byte count and completion. — [tokio/tests/tcp_echo.rs#L16-L51](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/tcp_echo.rs#L16-L51) [tokio/src/net/tcp/stream.rs#L1451-L1465](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L1451-L1465) [tokio/src/io/poll_evented.rs#L171-L180](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L171-L180)
- Whole-file persistence: fs::write upgrades contents; eligible Linux builds probe io-uring Write support, otherwise write_spawn_blocking → asyncify → spawn_blocking → std::fs::write. — [tokio/src/fs/write.rs#L26-L50](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L26-L50) [tokio/src/fs/write.rs#L98-L100](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L98-L100) [tokio/src/fs/mod.rs#L320-L328](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/mod.rs#L320-L328)
- Buffered persistence: File::poll_write copies bytes and starts mandatory blocking work before returning; poll_flush joins Busy work, while sync_all first completes in-flight work and calls std.sync_all. — [tokio/src/fs/file.rs#L750-L796](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L750-L796) [tokio/src/fs/file.rs#L1146-L1169](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L1146-L1169) [tokio/src/fs/file.rs#L317-L322](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L317-L322)

## Testing signals

Tests and CI were inspected, not executed; no passing result is asserted. The inspected suites use Rust tests, tokio::test, trybuild, deterministic I/O mocks, and Loom concurrency modeling. CI defines nextest, separate doctests, Miri, stress testing, platform checks, and Linux-kernel-specific execution. Coverage observations are bounded: feature guards, target exclusions, and model limits prevent treating these definitions as exhaustive verification.
- tcp_echo uses tokio::test and real loopback sockets to verify repeated client round trips, split-stream copying, total byte count, and oneshot completion; Miri uses fewer iterations. — [tokio/tests/tcp_echo.rs#L16-L51](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/tcp_echo.rs#L16-L51)
- fs_file verifies reads, flushed writes, shutdown writes, and conversion to standard files; its suite is feature-gated and excludes WASI. — [tokio/tests/fs_file.rs#L2-L14](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/fs_file.rs#L2-L14) [tokio/tests/fs_file.rs#L26-L63](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/fs_file.rs#L26-L63) [tokio/tests/fs_file.rs#L156-L179](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/fs_file.rs#L156-L179)
- length_delimited tests use scripted framed I/O to check incomplete headers/payloads and oversized frames; separate cases verify encoding buffer growth and length-field limits. — [tokio-util/tests/length_delimited.rs#L255-L312](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/tests/length_delimited.rs#L255-L312) [tokio-util/tests/length_delimited.rs#L720-L741](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/tests/length_delimited.rs#L720-L741)
- tests-build uses trybuild pass and compile_fail fixtures for macro argument forwarding, invalid inputs, joins, and type mismatches; the harness is ignored under Miri. — [tests-build/tests/macros.rs#L1-L37](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tests-build/tests/macros.rs#L1-L37)
- Loom models scheduler shutdown races involving block_in_place; CI bounds exploration with two preemptions and 10,000 branches and conditionally selects suites by PR labels. — [tokio/src/runtime/tests/loom_multi_thread.rs#L80-L99](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/tests/loom_multi_thread.rs#L80-L99) [.github/workflows/loom.yml#L14-L17](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/loom.yml#L14-L17) [.github/workflows/loom.yml#L99-L122](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/loom.yml#L99-L122)
- Workspace CI runs nextest on three operating systems, repeats companion tests after removing local patches, and runs doctests separately; feature-powerset checks are limited to depth two. — [.github/workflows/ci.yml#L94-L133](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/ci.yml#L94-L133) [.github/workflows/ci.yml#L736-L766](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/ci.yml#L736-L766)
- CI defines Miri with strict provenance and disabled isolation; stress-test defines release compilation and Valgrind leak checking for simple_echo_tcp. — [.github/workflows/ci.yml#L411-L455](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/ci.yml#L411-L455) [.github/workflows/stress-test.yml#L22-L45](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/stress-test.yml#L22-L45)
- io-uring tests are Linux/unstable/feature-gated; CI builds filesystem and library tests for QEMU kernels, including 4.19.325, and requires a completion marker beyond failure-summary checks. — [tokio/tests/fs_uring.rs#L3-L9](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/fs_uring.rs#L3-L9) [.github/workflows/ci.yml#L1394-L1406](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/ci.yml#L1394-L1406) [.github/workflows/uring-kernel-version-test.yml#L43-L51](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/uring-kernel-version-test.yml#L43-L51) [.github/workflows/uring-kernel-version-test.yml#L119-L129](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/uring-kernel-version-test.yml#L119-L129)

## Risk map

These are source-observed contracts and explicitly identified hypotheses, not confirmed vulnerabilities. The most sensitive boundaries involve unsafe buffer access, reactor pointer lifetimes, scheduler shutdown, and externally visible filesystem/process effects. Cancellation and completion differ substantially between async tasks, blocking work, children, and buffered files. Changes to these areas require precise ownership and lifecycle reasoning beyond compilation.
- Reactor event tokens become ScheduledIo pointers through unsafe dereferencing; safety requires deregistration and exclusion of concurrent polling before those allocations can be freed. — [tokio/src/runtime/io/driver.rs#L219-L229](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/io/driver.rs#L219-L229)
- PollEvented casts uninitialized ReadBuf storage to a byte slice and assumes the returned bytes were initialized; TcpStream::poll_read_priv explicitly relies on the socket read contract. — [tokio/src/io/poll_evented.rs#L171-L180](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L171-L180) [tokio/src/io/poll_evented.rs#L215-L224](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/poll_evented.rs#L215-L224) [tokio/src/net/tcp/stream.rs#L1451-L1457](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L1451-L1457)
- Started spawn_blocking tasks cannot be aborted, and shutdown can wait indefinitely; shutdown_timeout stops waiting without cancelling the underlying work. — [tokio/src/task/blocking.rs#L106-L120](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/task/blocking.rs#L106-L120)
- fs::write forwards caller paths to create/truncate or standard filesystem operations without a repository-root policy; File write acknowledgement, flush completion, and sync_all are distinct boundaries. — [tokio/src/fs/write.rs#L64-L69](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L64-L69) [tokio/src/fs/write.rs#L98-L100](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L98-L100) [tokio/src/fs/file.rs#L774-L796](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L774-L796) [tokio/src/fs/file.rs#L317-L322](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L317-L322)
- Child drop leaves processes running by default, Unix reaping is best effort, and wait_with_output accumulates each output stream in a Vec without a limit in that implementation. — [tokio/src/process/mod.rs#L199-L223](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L199-L223) [tokio/src/process/mod.rs#L1446-L1463](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L1446-L1463)
- On Unix, registering a signal replaces its default handler for the process lifetime; dropping the listener does not restore default SIGINT termination behavior. — [tokio/src/signal/ctrl_c.rs#L18-L34](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/signal/ctrl_c.rs#L18-L34)
- Allocation hypothesis: LengthDelimitedCodec checks the wire length before applying length_adjustment, then reserves the adjusted size; configuration therefore needs review when reasoning about memory bounds. (inferred) — [tokio-util/src/codec/length_delimited.rs#L526-L559](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/length_delimited.rs#L526-L559) [tokio-util/src/codec/length_delimited.rs#L706-L717](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/length_delimited.rs#L706-L717)
- Scheduler shutdown depends on closing both OwnedTasks and the injection queue; documented races otherwise permit stranded task references, and a Loom test exercises core handoff during shutdown. — [tokio/src/runtime/scheduler/multi_thread/worker.rs#L9-L57](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/scheduler/multi_thread/worker.rs#L9-L57) [tokio/src/runtime/tests/loom_multi_thread.rs#L80-L99](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/tests/loom_multi_thread.rs#L80-L99)

## Extension points

The principal extension mechanism is Rust trait composition, supplemented by builders and adapters. Custom transports implement async I/O traits; custom protocols implement codec traits. Runtime hooks permit instrumentation, while stream wrappers and maps integrate additional event sources. Feature and platform gates define extension boundaries, and some interfaces are deliberately sealed or unstable.
- Custom transports implement AsyncRead::poll_read and AsyncWrite::poll_write/poll_flush, including arranging waker notifications when returning Pending. — [tokio/src/io/async_read.rs#L44-L59](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/async_read.rs#L44-L59) [tokio/src/io/async_write.rs#L39-L67](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/io/async_write.rs#L39-L67)
- Protocol codecs implement Decoder with Item/Error and Encoder<Item>; Decoder provides EOF handling, while Encoder writes into the framing layer's BytesMut buffer. — [tokio-util/src/codec/decoder.rs#L35-L54](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/decoder.rs#L35-L54) [tokio-util/src/codec/decoder.rs#L124-L155](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/decoder.rs#L124-L155) [tokio-util/src/codec/encoder.rs#L8-L24](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/codec/encoder.rs#L8-L24)
- Builder instrumentation stores Send + Sync thread-start callbacks; on_before_task_poll receives TaskMeta and is additionally gated by tokio_unstable. — [tokio/src/runtime/builder.rs#L768-L775](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L768-L775) [tokio/src/runtime/builder.rs#L1014-L1021](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L1014-L1021)
- TcpStream::from_std bridges externally created sockets into Mio/PollEvented; callers must provide nonblocking sockets and an entered runtime with I/O enabled. — [tokio/src/net/tcp/stream.rs#L183-L199](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L183-L199) [tokio/src/net/tcp/stream.rs#L216-L230](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L216-L230)
- ReceiverStream adapts an mpsc Receiver by forwarding poll_next to poll_recv; StreamMap accepts replacement streams by key and emits keyed Stream items. — [tokio-stream/src/wrappers/mpsc_bounded.rs#L39-L47](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/wrappers/mpsc_bounded.rs#L39-L47) [tokio-stream/src/wrappers/mpsc_bounded.rs#L65-L70](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/wrappers/mpsc_bounded.rs#L65-L70) [tokio-stream/src/stream_map.rs#L446-L453](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/stream_map.rs#L446-L453) [tokio-stream/src/stream_map.rs#L669-L682](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-stream/src/stream_map.rs#L669-L682)
- Command::spawn_with permits custom standard-process spawning while reusing child wrapping; the implementation notes this API is behind tokio_unstable. — [tokio/src/process/mod.rs#L934-L961](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/process/mod.rs#L934-L961)
- New public capability wiring belongs in crate feature tables and gated module exports; tokio-util independently maps features to Tokio dependencies and utility modules. — [tokio/Cargo.toml#L24-L92](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/Cargo.toml#L24-L92) [tokio-util/Cargo.toml#L19-L33](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/Cargo.toml#L19-L33) [tokio-util/src/lib.rs#L25-L55](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/src/lib.rs#L25-L55)
- ToSocketAddrs inherits a sealed private trait, so address resolution is not an open downstream implementation hook; inspected string implementations choose immediate parsing or blocking DNS. — [tokio/src/net/addr.rs#L19-L19](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/addr.rs#L19-L19) [tokio/src/net/addr.rs#L162-L184](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/addr.rs#L162-L184) [tokio/src/net/addr.rs#L262-L262](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/addr.rs#L262-L262)

## Contributor handoff

Begin with the owning manifest, public exports, implementation, and exact feature-gated test. Preserve scheduler, readiness, cancellation, and persistence contracts when making focused changes. Tests and CI were inspected, not executed, and the investigation is bounded rather than exhaustive. The suggested checks below are for a later authorized implementation session; this read-only investigation did not run repository code or modify files.
- Read workspace patches and owning feature tables first: local dependency substitution and empty default features materially affect which implementations and APIs are built. — [Cargo.toml#L18-L23](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/Cargo.toml#L18-L23) [tokio/Cargo.toml#L24-L42](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/Cargo.toml#L24-L42) [tokio-util/Cargo.toml#L19-L33](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-util/Cargo.toml#L19-L33)
- For startup changes, read entry::parse_knobs, Builder::build, threaded construction, and Runtime::block_on together; generated wrappers and runtime context must remain coherent. — [tokio-macros/src/entry.rs#L468-L519](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio-macros/src/entry.rs#L468-L519) [tokio/src/runtime/builder.rs#L1146-L1151](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L1146-L1151) [tokio/src/runtime/builder.rs#L2180-L2198](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/builder.rs#L2180-L2198) [tokio/src/runtime/runtime.rs#L376-L382](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/runtime.rs#L376-L382)
- For scheduler changes, preserve dual queue/task-list closure and draining order; use the existing Loom racy_shutdown scenario as a relevant lifecycle regression target. — [tokio/src/runtime/scheduler/multi_thread/worker.rs#L9-L57](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/scheduler/multi_thread/worker.rs#L9-L57) [tokio/src/runtime/tests/loom_multi_thread.rs#L80-L99](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/tests/loom_multi_thread.rs#L80-L99)
- For networking changes, preserve WouldBlock readiness clearing, accepted-stream readiness initialization, and from_std nonblocking/runtime requirements; tcp_echo is a focused integration target. — [tokio/src/runtime/io/registration.rs#L225-L244](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/runtime/io/registration.rs#L225-L244) [tokio/src/net/tcp/stream.rs#L171-L180](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L171-L180) [tokio/src/net/tcp/stream.rs#L190-L199](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/net/tcp/stream.rs#L190-L199) [tokio/tests/tcp_echo.rs#L16-L51](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/tcp_echo.rs#L16-L51)
- For filesystem changes, inspect both the blocking fallback and unstable Linux io-uring branch; retain the distinction between File::poll_write acknowledgement, flush, and sync_all. — [tokio/src/fs/write.rs#L26-L50](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/write.rs#L26-L50) [tokio/src/fs/file.rs#L774-L796](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L774-L796) [tokio/src/fs/file.rs#L1146-L1169](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L1146-L1169) [tokio/src/fs/file.rs#L317-L322](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/src/fs/file.rs#L317-L322)
- In an authorized coding session, start with cargo test -p tokio --features full --test tcp_echo or --test fs_file as appropriate; inspect file cfg guards before selecting flags. — [tokio/tests/tcp_echo.rs#L3-L9](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/tcp_echo.rs#L3-L9) [tokio/tests/fs_file.rs#L2-L14](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/tests/fs_file.rs#L2-L14) [docs/contributing/pull-requests.md#L188-L198](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/docs/contributing/pull-requests.md#L188-L198)
- Tests and CI were inspected, not executed: use the defined nextest/doctest split, trybuild harness, and bounded Loom jobs as verification plans rather than recorded passing results. — [.github/workflows/ci.yml#L119-L133](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/ci.yml#L119-L133) [tests-build/tests/macros.rs#L1-L37](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tests-build/tests/macros.rs#L1-L37) [.github/workflows/loom.yml#L14-L17](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/.github/workflows/loom.yml#L14-L17)
- Follow the documented Rust 2021 rustfmt invocation rather than cargo fmt; preserve Rust 1.85 compatibility, public documentation, regression tests, and patch/minor versioning expectations. — [docs/contributing/pull-requests.md#L132-L143](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/docs/contributing/pull-requests.md#L132-L143) [docs/contributing/pull-requests.md#L178-L208](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/docs/contributing/pull-requests.md#L178-L208) [tokio/Cargo.toml#L9-L11](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/tokio/Cargo.toml#L9-L11) [CONTRIBUTING.md#L43-L54](https://github.com/tokio-rs/tokio/blob/2746c3ae26f8ac0af6023843a7f23d419c334efe/CONTRIBUTING.md#L43-L54)

Source repository: https://github.com/tokio-rs/tokio
Full evidence corpus: https://github.com/Codevetter/codevetter/tree/main/benchmarks/repo-unpacks/tokio.json

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
