rust-lang/futures-rs
Zero-cost asynchronous programming in Rust
Healthy across the board
weakest axisPermissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 2d ago
- ✓28+ active contributors
- ✓Apache-2.0 licensed
Show all 6 evidence items →Show less
- ✓CI configured
- ✓Tests present
- ⚠Concentrated ownership — top contributor handles 61% of recent commits
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/rust-lang/futures-rs)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/rust-lang/futures-rs on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: rust-lang/futures-rs
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/rust-lang/futures-rs shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across the board
- Last commit 2d ago
- 28+ active contributors
- Apache-2.0 licensed
- CI configured
- Tests present
- ⚠ Concentrated ownership — top contributor handles 61% of recent commits
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live rust-lang/futures-rs
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/rust-lang/futures-rs.
What it runs against: a local clone of rust-lang/futures-rs — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in rust-lang/futures-rs | Confirms the artifact applies here, not a fork |
| 2 | License is still Apache-2.0 | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | Last commit ≤ 32 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of rust-lang/futures-rs. If you don't
# have one yet, run these first:
#
# git clone https://github.com/rust-lang/futures-rs.git
# cd futures-rs
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of rust-lang/futures-rs and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "rust-lang/futures-rs(\\.git)?\\b" \\
&& ok "origin remote is rust-lang/futures-rs" \\
|| miss "origin remote is not rust-lang/futures-rs (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
&& ok "license is Apache-2.0" \\
|| miss "license drift — was Apache-2.0 at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 32 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~2d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/rust-lang/futures-rs"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
futures-rs is the standard Rust library providing zero-cost abstractions for asynchronous programming, defining core traits like Future, Stream, and Sink along with combinators (join!, select!, map, filter) that enable expressive async control flow without runtime overhead. It powers async/await in Rust by providing the foundational traits and utilities that async runtimes (Tokio, async-std) and application code depend on. Workspace monorepo organized by concern: futures-core/ contains trait definitions (Future, Stream, Poll, task/waker), futures-channel/ implements mpsc and oneshot channels, futures-util/ provides combinators, futures-executor/ supplies runtime, futures-macro/ generates join!/select! macros. Each member has its own Cargo.toml, tests/, and benches/. Examples in examples/functional/ and examples/imperative/ demonstrate usage patterns.
👥Who it's for
Rust developers building async applications—library authors implementing async runtimes, backend engineers writing concurrent I/O code, and embedded systems developers targeting no_std environments. Contributors range from runtime maintainers to developers fixing async ergonomics issues.
🌱Maturity & risk
Production-ready and actively maintained. Part of the Rust project itself (lives in rust-lang org), dual-licensed Apache 2.0/MIT, requires Rust 1.71+, has comprehensive CI in .github/workflows/ci.yml, and substantial test coverage across futures-channel/tests, futures-core/tests, etc. Last commit visible in metadata suggests ongoing development.
Low risk for production use, but monorepo complexity spans 10 workspace members (futures-core, futures-channel, futures-executor, futures-io, futures-macro, futures-sink, futures-task, futures-util, futures-test, futures) with interdependencies requiring careful version coordination. Breaking changes propagate across the ecosystem—any API break in futures-core affects all downstream crates. Single logical owner (Rust org) but distributed maintenance.
Active areas of work
CI workflow in .github/workflows/ci.yml runs on commits; dependabot config (.github/dependabot.yml) tracks dependency updates; zizmor security scanning enabled (.github/zizmor.yml). CHANGELOG.md tracks releases. The codebase enforces lints (missing_debug_implementations, rust_2018_idioms, unreachable_pub, unsafe_op_in_unsafe_fn) via workspace lint config in Cargo.toml.
🚀Get running
git clone https://github.com/rust-lang/futures-rs.git
cd futures-rs
cargo build
cargo test
cargo run --example functional
cargo run --example imperative
Daily commands:
No binary to run—this is a library. Build with cargo build, run tests with cargo test (all workspaces), or run examples: cargo run --example functional or cargo run --example imperative from repo root.
🗺️Map of the codebase
- futures-core/src/future.rs: Defines the core Future trait and Poll enum—all async code depends on this API
- futures-core/src/task/mod.rs: Defines Context and Wake traits for executor integration and task scheduling
- futures-channel/src/mpsc/mod.rs: Multi-producer, single-consumer channel implementation—critical for async communication patterns
- futures-core/src/task/__internal/atomic_waker.rs: Lock-free atomic waker for efficient task notification without mutex contention
- futures-macro/src/lib.rs: Procedural macro implementation for join! and select! syntax—heavily used in async code
- Cargo.toml: Workspace configuration defining all member crates and shared lints; changes here affect all packages
🛠️How to make changes
For trait additions: edit futures-core/src/ (future.rs, stream.rs, task/mod.rs). For new channels: futures-channel/src/mpsc/mod.rs or oneshot.rs. For combinators: futures-util/src/ (separate file per combinator). For macros: futures-macro/src/. Tests: place in same member's tests/ directory, mirroring the module structure. Lint compliance: check workspace.lints in Cargo.toml before pushing.
🪤Traps & gotchas
Rust 1.71+ required: MSRV enforced in Cargo.toml, some features may not compile on older versions. no_std compatibility: requires explicit default-features = false; std features conditionally compiled with #[cfg(feature = "std")]. Workspace member interdependencies: modifying futures-core requires recompiling all dependents; version mismatches across members can cause subtle issues. Atomic waker complexity: futures-core/src/task/__internal/atomic_waker.rs uses unsafe code and lock-free algorithms—modifications need careful testing. Macro hygiene: futures-macro generates code that must work in user crates with arbitrary imports.
💡Concepts to learn
- Zero-cost abstraction — futures-rs achieves async without runtime overhead via monomorphization and compiler inlining—understanding this is critical for performance-sensitive async code
- Poll-based state machine — The Future trait uses Poll<T> (Ready or Pending) to represent async state without callbacks—this is the core abstraction underlying all async Rust code
- Waker / task notification — Executors use Waker to efficiently notify a Future when it can make progress; futures-core's atomic waker avoids mutex overhead on the hot path
- Lock-free concurrent data structures — futures-channel/src/mpsc/queue.rs uses atomic operations and compare-and-swap to implement channels without locks; essential for contention-free message passing
- Stream trait and async iteration — Stream is async's equivalent to Iterator; understanding futures-core/src/stream.rs is crucial for consuming async sequences in a composable way
- Combinator pattern (functional composition) — futures-util implements map, filter, fold, etc. on Futures and Streams, enabling expressive async pipelines without explicit state machines
- no_std / embedded compatibility — futures-rs works without std library via conditional compilation; critical for bare-metal and embedded async code
🔗Related repos
tokio-rs/tokio— Async runtime built on top of futures-rs traits; uses Future, Stream, and channel types from this repoasync-rs/async-std— Alternative async runtime; also implements futures-rs trait contracts for compatibilityrust-lang/rust— The Rust compiler itself; async/await desugars to futures-rs types, and this repo tracks Rust language evolutionsmol-rs/smol— Lightweight async runtime with minimal dependencies; composes with futures-rs primitivesrust-lang/wg-async— Working group driving async/await language features and standardization of traits in futures-rs
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive benchmarks for futures-channel MPSC operations under contention
The repo has a minimal benchmark at futures-channel/benches/sync_mpsc.rs, but it lacks benchmarks for high-contention scenarios, bounded vs unbounded channels, and throughput under various executor loads. This is critical for a zero-cost async library where performance regressions could impact thousands of downstream crates. New contributors can add realistic benchmarks comparing clone/drop overhead, backpressure handling, and multi-producer scenarios.
- [ ] Examine existing futures-channel/benches/sync_mpsc.rs to understand current benchmark structure
- [ ] Add benchmarks for high-contention multi-producer scenarios using criterion
- [ ] Add benchmarks for bounded channel capacity limits and backpressure behavior
- [ ] Add benchmarks comparing different executor configurations from futures-executor
- [ ] Update .github/workflows/ci.yml to include benchmark tracking (or create new benchmark CI job if missing)
Add missing MIRI test configuration to CI for undefined behavior detection
The codebase contains unsafe code in futures-core/src/task/__internal/atomic_waker.rs and other modules. While .github/workflows/ci.yml exists, MIRI (Rust's interpreter for detecting UB) is likely not being run in CI, which is essential for a foundational async library. A new contributor can add a dedicated MIRI job to catch potential data races and unsoundness early.
- [ ] Review .github/workflows/ci.yml to confirm MIRI is not currently configured
- [ ] Create or extend CI workflow to run 'cargo +nightly miri test' on crates containing unsafe code (futures-core, futures-executor, futures-channel)
- [ ] Document MIRI configuration in README.md under 'Testing' or 'Development' section
- [ ] Identify and fix any existing MIRI failures in unsafe code (futures-core/src/task/__internal/)
- [ ] Add MSRV-compatible MIRI setup to handle the project's minimum supported Rust version constraints
Add feature-gated no-std compatibility tests for futures-core and futures-sink
The workspace includes futures/tests/no-std but it's unclear if all core crates (futures-core, futures-sink) are properly tested under no_std conditions with varying feature combinations. This is critical since embedded and WASM users rely on these. A contributor can add targeted test harnesses that compile and validate no_std + no_alloc scenarios.
- [ ] Review futures-core/Cargo.toml and futures-sink/Cargo.toml to identify feature flags (e.g., 'std', 'alloc')
- [ ] Examine existing futures/tests/no-std to understand the test structure and reuse patterns
- [ ] Create futures-core/tests/no_std.rs and futures-sink/tests/no_std.rs with explicit cfg gates
- [ ] Add test cases validating core abstractions (Future, Stream, Sink traits) compile and work in no_std+no_alloc
- [ ] Update .github/workflows/ci.yml to run these no_std tests with '--no-default-features' flag
- [ ] Document no_std compatibility matrix in README.md or dedicated COMPATIBILITY.md file
🌿Good first issues
- Add missing Debug implementations: grep for
missing_debug_implementationswarnings in cargo clippy output across futures-channel/src/mpsc/queue.rs and futures-core/src/task/__internal/atomic_waker.rs—these are enforced by workspace lints but may have missed cases. - Expand documentation examples in futures-util/src/: many combinator methods (e.g., map, filter, fold) lack inline examples in doc comments; add runnable examples matching the style in examples/functional/src/main.rs.
- Add benchmarks for channel throughput: futures-channel/benches/sync_mpsc.rs exists but lacks comparative benchmarks for oneshot vs mpsc under contention; add new bench variants exercising different sender/receiver count ratios.
⭐Top contributors
Click to expand
Top contributors
- @taiki-e — 61 commits
- @tisonkun — 8 commits
- @paolobarbolini — 2 commits
- @cmrschwarz — 2 commits
- @brody2consult — 2 commits
📝Recent commits
Click to expand
Recent commits
d883643— Fix unsoundSendimpl forIterPinRefandIter(#3003) (paolobarbolini)2fe9302— ci: Avoid unused_features warning in cargo bench (taiki-e)a186631— ci: Use x86_64-unknown-linux-gnu{a,m,t}san for {A,M,T}SAN (taiki-e)2deff3d— ci: Apply zizmor (taiki-e)b7bfade— Revert "ci: Work around sanitizer issue on latest Linux kernel" (taiki-e)2aabddb— Revert "ci: Work around sanitizer-related regression" (taiki-e)abd433e— Sync with 0.3.32 (taiki-e)24f4dfb— Add comments on rust-version field in Cargo.toml (taiki-e)07d1361— Resolve clippy::unnecessary_map_or warning (taiki-e)25d65f3— Bump MSRV of utility crates to 1.71 (taiki-e)
🔒Security observations
The futures-rs codebase demonstrates strong security posture. This is a well-maintained core Rust async library with proper linting configurations and no apparent hardcoded secrets, injection vectors, or misconfigured infrastructure. The codebase uses multiple workspace members with clear separation of concerns. The primary security consideration is the intentional relaxation of the unsafe_op_in_unsafe_fn lint due to MSRV constraints, which is a documented and justified decision. Dependencies are not visible in the provided file structure, but the workspace lint configuration shows attention to code quality. No SQL injection, XSS, or credential exposure vectors were identified. The GitHub workflow and configuration files show standard CI/CD practices. Recommend periodic dependency audits via cargo audit and continuation of current security practices.
- Low · Missing unsafe_op_in_unsafe_fn Lint —
Cargo.toml (workspace.lints.rust section). The workspace configuration has commented out the unsafe_op_in_unsafe_fn lint with a note about MSRV compatibility. This lint is important for catching unsound unsafe code patterns. While the comment references a valid reason, this represents a relaxed safety check in a library dealing with concurrency and async primitives where unsafe code is prevalent. Fix: Re-enable unsafe_op_in_unsafe_fn lint once MSRV requirements allow (Rust 1.71+). In the interim, perform manual code reviews of all unsafe blocks, especially in futures-channel, futures-executor, and task modules.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.