Skip to content

docs(fast_io): audit kqueue cross-platform gates (XPL-2)#4775

Merged
oferchen merged 1 commit into
masterfrom
docs/xpl-2-kqueue-audit
May 23, 2026
Merged

docs(fast_io): audit kqueue cross-platform gates (XPL-2)#4775
oferchen merged 1 commit into
masterfrom
docs/xpl-2-kqueue-audit

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Audits the kqueue surface in fast_io (crates/fast_io/src/kqueue/mod.rs, crates/fast_io/src/kqueue_stub.rs, and the lib.rs mount + re-export site) against the project Cross-Platform conventions.
  • All eight items audited are already correctly gated: 0 CI-fatal / 0 Warning / 8 Clean. No code changes required.
  • Companion to XPL-1 (apple-fs crate, chore(apple-fs): audit + fix cross-platform compile hazards (XPL-1) #4743); same audit pattern extended to the next platform-conditional surface.

Findings (clean)

  1. lib.rs mount switch is symmetric and exhaustive (target_os = "macos" vs not(target_os = "macos")).
  2. Stub file-level #![cfg(not(target_os = "macos"))] + #![allow(dead_code)] are correct.
  3. RawFd alias compiles on every target without referencing libc (which is cfg(unix)-only in Cargo.toml).
  4. KEventFilter variants are not platform-dependent; no "gate the variant, not the impl" hazard.
  5. KEvent struct fields are pub; no platform-dependent dead-field hazard.
  6. unsafe impl Send for KqueueLoop {} lives in the macOS-only module, never compiled on Windows or musl.
  7. Test modules are correctly gated via their parent (no orphan #[cfg(unix)] tests inside ungated modules).
  8. Re-export in lib.rs:282 uses backtick-only prose, dodging the rustdoc re-export link breakage.

See docs/design/xpl-2-kqueue-audit.md for the full per-item walk plus methodology.

Test plan

  • CI: fmt+clippy passes (doc-only change).
  • CI: nextest (stable) passes.
  • CI: Windows (stable) passes.
  • CI: macOS (stable) passes.
  • CI: Linux musl (stable) passes.

Documents the cfg-gating audit for the kqueue surface in fast_io. All
eight items audited are already correctly gated (0 CI-fatal, 0 warning,
8 clean): the module mount switch is exhaustive, the stub avoids libc
on non-unix targets, RawFd is aliased per target, and the macOS-only
unsafe Send impl is scoped to the macOS module.

No code changes required.
@oferchen oferchen force-pushed the docs/xpl-2-kqueue-audit branch from fdc6af1 to 1e106de Compare May 23, 2026 02:07
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 23, 2026
@oferchen oferchen merged commit e192f50 into master May 23, 2026
9 checks passed
@oferchen oferchen deleted the docs/xpl-2-kqueue-audit branch May 28, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant