Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Coverage Ledger — Rust (Section G)

Language project: Rust — Language Semantics, Standard Library, Process APIs, and Subprocesses (chapter: rust.md).

Scope: current stable Rust, verified as std 1.99.0 (build b940084d7, 2026-09-28) on doc.rust-lang.org — retrieved 2026-10. Covers the six Section-G areas for Rust: syntax/semantics as they bear on process lifecycle, std inventory (process/panic/thread/sync surface), process creation & termination, signals & OS interaction, subprocess management, concurrency & resource semantics.

Verification sources (with dates):

  • doc.rust-lang.org/std — module + item pages for std::process, std::panic, std::thread, std::sync::Mutex, std::io::BufWriter, std::os::unix::process, std::os::fd (build 1.99.0; retrieved 2026-10).
  • doc.rust-lang.org/reference — Behavior considered undefined, Destructors (retrieved 2026-10).
  • doc.rust-lang.org/cargo/reference/profiles.html — panic setting (retrieved 2026-10).
  • github.com/rust-lang/rust (master, retrieved 2026-10): library/std/src/rt.rs (exit 101; unique_thread_exit; stack_overflow::init()), library/std/src/sys/pal/unix/mod.rs (SIGPIPE ignore at startup; std fd sanitization), library/std/src/process.rs (Termination for Result).
  • docs.rs — signal-hook 0.4.5, ctrlc 3.5.2, tokio 1.53.2 (named/linked only; retrieved 2026-10).
  • Since-versions are only those printed on the cited doc pages; nothing is inferred.

Status definitions: documented = behavior/signature verified against a cited primary source and explained in the chapter (verified-absent APIs count as documented limitations); source-limited = a named primary source was unreachable or out of the declared source-of-record scope (missing source stated in the row); researched/not-started = not used in this ledger.

Rollup: Inventoried: 76 / Documented: 73 / Remaining: 0 / Source-limited: 3

IDLanguage/API or behaviorCanonical signatureDocumentation pathAuthoritative referenceVersion/platform scopeStatus
PL-RS-001main entry point: return type must implement Termination; no parameters; runtime wraps via lang_start—§1.1, §3.2std::process::Termination; std source rt.rsstd 1.99.0 docs; all platformsdocumented
PL-RS-002Drop scopes: reverse declaration order; parameter/temporary scopes; mem::forget/ManuallyDrop suppression is safe; types may not rely on destructors for soundness—§1.2Reference: DestructorsReference, current stabledocumented
PL-RS-003? operator: early return Err(From::from(e)) on Err; yields value on Ok; panics orthogonal to Result—§1.3std::process::Termination (Debug bound); std Result docsstable Rustdocumented
PL-RS-004UB categories in scope: data races; dangling/misaligned pointer access; invalid values—§1.7Reference: Behavior considered undefinedstable Rust (list may grow/shrink per Reference)documented
PL-RS-005UB: unwinding past a stack frame that does not allow unwinding ("C-unwind" through "C"); FFI panic boundary rule—§1.7, §3.9Reference: Behavior considered undefined (undefined.call); std panic::catch_unwindstable Rustdocumented
PL-RS-006Edition delta: before_exec made unsafe via the edition mechanism; deprecated for pre_exec (1.37.0)—§1.8, §5.7std os::unix::process::CommandExtUnix; before_exec since 1.15.0, deprecated 1.37.0documented
PL-RS-007std::process::exitpub fn exit(code: i32) -> !§2.1, §3.3std::process::exitsince 1.0.0; all platformsdocumented
PL-RS-008std::process::abortpub fn abort() -> !§2.1, §3.5std::process::abortsince 1.17.0; all platformsdocumented
PL-RS-009Current/parent PID accessorspub fn id() -> u32; pub fn parent_id() -> u32§2.1std::process::id; std::os::unix::process::parent_idid since 1.26.0 (all); parent_id since 1.27.0 (Unix)documented
PL-RS-010Termination trait and complete implementor list (!, (), ExitCode, Infallible, Result<T: Termination, E: Debug>)pub trait Termination { fn report(self) -> ExitCode; }§3.2std::process::Terminationsince 1.61.0documented
PL-RS-011ExitCode: private representation; SUCCESS/FAILURE; From<u8>; PartialEq only (no Eq/Hash/raw access); Default = SUCCESSpub struct ExitCode(/* private fields */)§2.1, §3.4std::process::ExitCodesince 1.61.0; Default since 1.75.0; exit_process nightlydocumented
PL-RS-012main returning Result: Err prints Error: {err:?} to stderr, exits ExitCode::FAILURE; Debug (not Display) bound—§3.2std source process.rs (Termination for Result); std::process::Terminationsince 1.61.0documented
PL-RS-013std::panic::set_hookpub fn set_hook(hook: Box<dyn Fn(&PanicHookInfo<'_>) + Sync + Send + 'static>)§2.2, §3.7std::panic::set_hooksince 1.10.0; panics if called from a panicking threaddocumented
PL-RS-014std::panic::take_hook: returns current hook, registers default hook in its placepub fn take_hook() -> Box<dyn Fn(&PanicHookInfo<'_>) + Sync + Send + 'static>§2.2, §3.7std::panic::take_hooksince 1.10.0documented
PL-RS-015std::panic::catch_unwind: unwinding panics only; hook ran first; payload-drop hazard; foreign-exception unspecified outcomespub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R>§2.2, §3.8std::panic::catch_unwindsince 1.9.0documented
PL-RS-016std::panic::resume_unwind: continues unwind without hook; aborts under panic="abort"pub fn resume_unwind(payload: Box<dyn Any + Send>) -> !§2.2std::panic::resume_unwindsince 1.9.0documented
PL-RS-017std::panic::panic_any: arbitrary Any + Send payload, reachable via PanicHookInfo::payloadpub fn panic_any<M: 'static + Any + Send>(msg: M) -> !§2.2std::panic::panic_anysince 1.51.0documented
PL-RS-018PanicHookInfo<'_> hook parameter type (payload + location; !Send/!Sync); nightly update_hook chain helperpub struct PanicHookInfo<'a> { /* private fields */ }§2.2, §3.7std::panic::PanicHookInfo; core::panic::PanicInfo deprecation notesince 1.81.0; update_hook nightly (panic_update_hook)documented
PL-RS-019UnwindSafe auto trait + AssertUnwindSafe wrapper for the catch_unwind boundpub auto trait UnwindSafe { }§2.2, §3.8std::panic::UnwindSafesince 1.9.0documented
PL-RS-020Mutex poisoning: lock/try_lock return Result; into_inner recovery; documented blind spots (Drop/hook-held locks, foreign exceptions)pub fn lock(&self) -> Result<MutexGuard<'_, T>, PoisonError<MutexGuard<'_, T>>>§2.4, §6.6std::sync::Mutexsince 1.0.0; into_inner 1.2.0documented
PL-RS-021thread::spawn bounds (Send + 'static), panic on OS failure; join-or-detach resource-leak notepub fn spawn<F, T>(f: F) -> JoinHandle<T> where F: FnOnce() -> T + Send + 'static, T: Send + 'static§2.3, §6.2std::thread::spawnsince 1.0.0documented
PL-RS-022JoinHandle::join surfaces thread panics as Errpub fn join(self) -> Result<T>§2.3, §6.3std::thread::JoinHandlesince 1.0.0documented
PL-RS-023JoinHandle::is_finished non-blocking check; dropping JoinHandle detaches the threadpub fn is_finished(&self) -> bool§2.3, §6.1std::thread::JoinHandleis_finished since 1.61.0; detach-on-drop 1.0.0documented
PL-RS-024Thread configuration & sizing: Builder name/stack_size/spawn (io::Result); unsafe spawn_unchecked; available_parallelism; default stack 2 MiB Tier-1; RUST_MIN_STACKpub fn spawn<F, T>(self, f: F) -> Result<JoinHandle<T>>; pub unsafe fn spawn_unchecked<F, T>(self, f: F) -> Result<JoinHandle<T>>; pub fn available_parallelism() -> Result<NonZero<usize>>§2.3, §6.2std::thread module; std::thread::Builder; std::thread::available_parallelismBuilder/spawn 1.0.0; spawn_unchecked 1.82.0; available_parallelism 1.59.0documented
PL-RS-025thread::scope + Builder::spawn_scoped: joins all unjoined scoped threads before returning; thread-local destructors may lag; panics if auto-joined threads panickedpub fn scope<'env, F, T>(f: F) -> T where F: for<'scope> FnOnce(&'scope Scope<'scope, 'env>) -> T§2.3, §6.2std::thread::scope; std::thread::Builder::spawn_scopedboth since 1.63.0documented
PL-RS-026BufWriter flush-on-drop: drop attempts flush, errors ignored; explicit flush() required for observable errors—§6.5std::io::BufWriter (Drop docs)since 1.0.0documented
PL-RS-027exit status truncation: 8 LSB on most Unix (process::exit(0x0100) → 0 on Linux, 256 on Windows); i32→wait-status exit byte—§3.3std::process::exit (Platform-specific behavior)since 1.0.0; per-platform maskingdocumented
PL-RS-028exit runs atexit handlers and ELF fini sections; concurrent Rust-exit + C-exit documented as UB (single runtime lock-mitigated; multiple runtimes unsynchronized); exit-race with other threads’ drops → coordinate shutdown—§3.3, §6.7std::process::exit (Safe interop with C code)current implementation note; since 1.0.0documented
PL-RS-029Panic strategies: Cargo panic = "unwind" | "abort"; unwind defers to target default; tests/build scripts/proc macros ignore the setting—§3.6Cargo Book: profiles.panicsCargo reference (retrieved 2026-10)documented
PL-RS-030panic="abort" consequences: no destructors, no unwinding, catch_unwind blind, but panic hook still runs; contrast process::abort (no hook)—§3.5, §3.6std::process::abort; Cargo Bookcurrent stabledocumented
PL-RS-031Default panic hook + pipeline order: registered at startup, prints to stderr, backtrace if requested; hook runs before the panic runtime (both runtimes)—§3.7std::panic::set_hooksince 1.10.0 wordingdocumented
PL-RS-032Main-thread panic → process exit code 101; docs say only “non-zero”; rt.rs anchor; payload-drop wrapped in catch_unwind—§3.10std source rt.rs; std::thread moduleimplementation anchor (master, 2026-10)documented
PL-RS-033Panic in extern "C" fn: caught at boundary, process aborted; destructors up to boundary may or may not run—§3.9std::panic::catch_unwind; Reference: Destructorsstable Rustdocumented
PL-RS-034Cleanup-per-path matrix: normal return / Err / unwind / panic=abort / exit / abort / FFI boundary × (Drop, hook, atexit, flush, status)—§1.6, §3.10std::process; std::panic; Reference: Destructorscurrent stabledocumented
PL-RS-035Runtime startup/shutdown: fd 0/1/2 sanitization; SIGPIPE set to ignore; stack-overflow guard init; single-threaded libc::exit guard—§3.1, §4.5std source rt.rs; sys/pal/unix/mod.rsUnix runtime (source anchor, master 2026-10)documented
PL-RS-036No std signal-registration/masking API — verified absence; consequences (default dispositions; graceful shutdown not expressible in std)—§4.1std::process module doc (scope statement); std doc indexstd 1.99.0documented
PL-RS-037libc-crate FFI pattern for signal registration: unsafe block, extern "C" fn handler, async-signal-safety obligations, atomic shared state—§4.3libc crate (third-party); POSIX sigaction rules via book interfaces chaptersthird-party crate; [platform Unix]documented
PL-RS-038signal-hook crate: registry/iterator/pipe signal handling (named, linked; internals not inventoried)—§4.2docs.rs/signal-hook (0.4.5)third-partysource-limited
PL-RS-039ctrlc crate: minimal Ctrl-C callback (named, linked; internals not inventoried)—§4.2docs.rs/ctrlc (3.5.2)third-partysource-limited
PL-RS-040tokio::signal / tokio::process: async signal streams + kill_on_drop (named, linked; not deeply inventoried)—§4.2, §5.4docs.rs/tokio (1.53.2)third-partysource-limited
PL-RS-041Command::new defaults: no args, inherit env/cwd, inherit stdio for spawn/status, pipes for output; PATH search when relative; “ls -l” literal caveatpub fn new<S: AsRef<OsStr>>(program: S) -> Command§5.1std::process::Commandsince 1.0.0documented
PL-RS-042Command::arg/args: literal argument passing, no shell layerpub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Command; pub fn args<I, S>(&mut self, args: I) -> &mut Command where I: IntoIterator<Item = S>, S: AsRef<OsStr>§5.1std::process::Command::arg/argssince 1.0.0documented
PL-RS-043Command::env/envs/env_remove/env_clear: explicit mappings override inheritance; removal blocks inheritancepub fn env<K, V>(&mut self, key: K, val: V) -> &mut Command where K: AsRef<OsStr>, V: AsRef<OsStr> (envs since 1.19.0)§5.1std::process::Command::env etc.1.0.0 / 1.19.0documented
PL-RS-044Command::current_dir: child cwd; relative-program ambiguity documented as platform-specific and unstablepub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Command§5.1std::process::Command::current_dirsince 1.0.0documented
PL-RS-045Command::stdin/stdout/stderr: defaults inherit (spawn/status) vs piped (output)pub fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Command (stdout/stderr symmetric)§5.1std::process::Command::stdinsince 1.0.0documented
PL-RS-046Command::spawn: documented error taxonomy (not found, permission, resources); post-start outcomes via ExitStatus, not Errpub fn spawn(&mut self) -> Result<Child>§5.1std::process::Command::spawn (§Errors)since 1.0.0documented
PL-RS-047Command::status: spawn + wait, stdio inherited; child failure is Okpub fn status(&mut self) -> Result<ExitStatus>§5.1std::process::Command::statussince 1.0.0documented
PL-RS-048Command::output: capture stdout+stderr (piped), stdin closes immediately on child read; Ok regardless of child exit/signalpub fn output(&mut self) -> Result<Output>§5.1std::process::Command::outputsince 1.0.0documented
PL-RS-049Command accessors: get_program/get_args/get_envs/get_current_dirpub fn get_program(&self) -> &OsStr; pub fn get_args(&self) -> CommandArgs<'_>; pub fn get_envs(&self) -> CommandEnvs<'_>; pub fn get_current_dir(&self) -> Option<&Path>§5.1std::process::Command (get_*)since 1.57.0; get_resolved_envs/get_env_clear nightlydocumented
PL-RS-050Platform deltas for spawn: Unix searches child env PATH (execvp fallback /bin:/usr/bin if removed); Windows pre-resolution search order; cmd.exe/.bat argument hazards + raw_arg—§5.1, §5.10std::process::Command (Platform-specific behavior); Command::arg (Windows warning)[platform Unix] / [platform Windows]documented
PL-RS-051Child struct + stream fields (Option per piped stream) + idpub struct Child { pub stdin: Option<ChildStdin>, pub stdout: Option<ChildStdout>, pub stderr: Option<ChildStderr>, /* private */ }; pub fn id(&self) -> u32§5.2std::process::Child1.0.0; id since 1.3.0documented
PL-RS-052Child::kill: SIGKILL equivalent on Unix; Ok(()) if already exited; error-kind mapping not a contractpub fn kill(&mut self) -> Result<()>§5.2std::process::Child::killsince 1.0.0documented
PL-RS-053Child::wait: closes piped stdin before waiting; idempotent after first callpub fn wait(&mut self) -> Result<ExitStatus>§5.2std::process::Child::waitsince 1.0.0documented
PL-RS-054Child::try_wait: non-blocking; reaps PID on Unix; does not drop stdin (unlike wait)pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>§5.2std::process::Child::try_waitsince 1.18.0documented
PL-RS-055Child::wait_with_output: consumes child; closes stdin; drains stdout+stderr to EOF concurrentlypub fn wait_with_output(self) -> Result<Output>§5.2std::process::Child::wait_with_outputsince 1.0.0documented
PL-RS-056Child drop: no Drop impl — no kill, no reap; zombie-exhaustion warning; no std kill_on_drop—§5.4std::process::Child (Warning)std 1.99.0 docsdocumented
PL-RS-057ChildStdin/ChildStdout/ChildStderr: Read/Write impls; AsFd/AsRawFd/IntoRawFd; From<OwnedFd> for ChildStdin (1.74.0) and reverse From<ChildStdin> for OwnedFd/Stdioimpl Write for ChildStdin (1.0.0); impl From<OwnedFd> for ChildStdin§5.8, §6.4std::process::ChildStdin1.0.0; From<OwnedFd> since 1.74.0; [platform Unix] fd traitsdocumented
PL-RS-058ExitStatus::success / code: success = zero status, signal death not success; code() None on signal death; 8-bit truncation + runtime-invented codes (255/254/127/126)pub fn success(&self) -> bool; pub fn code(&self) -> Option<i32>§5.3std::process::ExitStatussince 1.0.0; Default 1.73.0; exit_ok nightlydocumented
PL-RS-059ExitStatusExt::signal / into_raw: WIFSIGNALED→WTERMSIG mapping; raw wait-status word; shell 128+N conversion is the shell’s doingfn signal(&self) -> Option<i32>; fn into_raw(self) -> i32§5.3, §5.6std::os::unix::process::ExitStatusExtsignal/into_raw since 1.0.0; Unix onlydocumented
PL-RS-060ExitStatusExt::from_raw: builds from a wait status (not exit status); bit layout not POSIX-specified; per-OS conventions documented; ExitStatusError::from_raw(0) panicsfn from_raw(raw: i32) -> Self§5.3std::os::unix::process::ExitStatusExt::from_rawsince 1.12.0; Unix onlydocumented
PL-RS-061ExitStatusExt::core_dumped / stopped_signal / continued: WCOREDUMP / WSTOPSIG (WUNTRACED) / WIFCONTINUED (WCONTINUED)fn core_dumped(&self) -> bool; fn stopped_signal(&self) -> Option<i32>; fn continued(&self) -> bool§5.3std::os::unix::process::ExitStatusExtsince 1.58.0; Unix onlydocumented
PL-RS-062Output struct: status + raw stdout/stderr Vec<u8>; exit_ok nightlypub struct Output { pub status: ExitStatus, pub stdout: Vec<u8>, pub stderr: Vec<u8> }§5.3std::process::Outputsince 1.0.0documented
PL-RS-063Stdio: piped/inherit/null; piped-volume deadlock warning; From conversions (ChildStdin/Out/Err, File, Stdout/Stderr, OwnedFd, PipeReader/PipeWriter)pub fn piped() -> Stdio; pub fn inherit() -> Stdio; pub fn null() -> Stdio§5.5std::process::Stdiosince 1.0.0documented
PL-RS-064CommandExt::uid/gid: setuid/setgid in child; spawn fails on error; implicit setgroups(0, NULL) notefn uid(&mut self, id: u32) -> &mut Command; fn gid(&mut self, id: u32) -> &mut Command§5.7std::os::unix::process::CommandExtsince 1.0.0; Unix onlydocumented
PL-RS-065CommandExt::pre_exec: closure after fork/before exec; async-signal-safety constraints; allocating-error caveat (Error::new/Error::other); always_abort before hook; panic-format safety caveatunsafe fn pre_exec<F>(&mut self, f: F) -> &mut Command where F: FnMut() -> Result<()> + Send + Sync + 'static§5.7std::os::unix::process::CommandExt::pre_execsince 1.34.0; Unix onlydocumented
PL-RS-066CommandExt::exec: execvp replacing current process; no fork; exit-like destructor semantics; broken-state warning on errorfn exec(&mut self) -> Error§5.7std::os::unix::process::CommandExt::execsince 1.9.0; Unix onlydocumented
PL-RS-067CommandExt::arg0: argv[0] overridefn arg0<S>(&mut self, arg: S) -> &mut Command where S: AsRef<OsStr>§5.7std::os::unix::process::CommandExt::arg0since 1.45.0; Unix onlydocumented
PL-RS-068CommandExt::process_group: setpgid-in-child; signal-delivery scoping rationale (terminal SIGINT/SIGQUIT); PGID 0 = child PIDfn process_group(&mut self, pgroup: i32) -> &mut Command§4.1, §5.7std::os::unix::process::CommandExt::process_groupsince 1.64.0; Unix onlydocumented
PL-RS-069CommandExt nightly remainder + deprecated member: groups (setgroups), chroot (process_chroot), setsid (process_setsid); before_exec deprecated 1.37.0fn setsid(&mut self, setsid: bool) -> &mut Command (nightly)§5.7std::os::unix::process::CommandExtnightly-only on 1.99.0; Unix onlydocumented
PL-RS-070No timeout API on Command/Child — verified absence; standard poll+kill+wait workaround pattern; [third-party] tokio async cancellation—§5.9std::process::Child (method set); docs.rs tokiostd 1.99.0; pattern all platformsdocumented
PL-RS-071No shell by default: literal argv, structurally no quoting layer; sh -c opt-in reintroduces the injection surface—§5.10std::process::Command::arg/args (no-shell statement)current stabledocumented
PL-RS-072Zombies/orphans: std never reaps implicitly; reaping = wait/try_wait/wait_with_output; orphan reparenting on parent death—§5.4, §5.11std::process::Child (Warning)[Linux]/POSIX substratedocumented
PL-RS-073Main-thread return terminates the program; other threads’ destructors may not run; no implicit join-all—§6.1std::thread module (threading model)current stabledocumented
PL-RS-074No thread cancellation API in std; cooperative shutdown via channels/atomics — verified absence—§3.11, §6.2std::thread module item indexstd 1.99.0documented
PL-RS-075fd/handle ownership: OwnedFd / BorrowedFd lifetime model; FromRawFd::from_raw_fd unsafe ownership assertionpub trait FromRawFd { unsafe fn from_raw_fd(fd: RawFd) -> Self; }§6.4std::os::fd (OwnedFd, FromRawFd)os::fd home since 1.66.0; method since 1.1.0; [platform Unix]-familydocumented
PL-RS-076Pipe-buffer deadlock geometry: drain both streams concurrently (wait_with_output/output); wait() closes stdin; explicit stdin drop signals EOF—§5.2, §5.5std::process::Stdio (piped warning); Child::wait docscurrent stable; pipe capacity [Linux]documented

Counts: Inventoried 76 · Documented 73 · Remaining 0 · Source-limited 3 (PL-RS-038 signal-hook, PL-RS-039 ctrlc, PL-RS-040 tokio — third-party crates: named and linked per Section-G scope, but their internal signal-delivery machinery is outside the std-docs source of record; docs.rs metadata pages were reachable and are cited).

IDs are contiguous PL-RS-001…PL-RS-076, ordered by chapter section. Verified-absent surfaces (no signal API, no timeout API, no thread cancellation, no Child Drop) are counted as documented limitations, matching the ledger conventions of the part hub index.md.