Skip to content

Crates to avoid

Crates that were once defaults but are unmaintained, replaced by the standard library, or superseded here, with the replacement for each and a cargo-deny config that enforces it.

Crates that show up in older codebases, tutorials, and LLM output, grouped by why they should not go into new code. Advisory IDs link to the RustSec advisory database; cargo deny check flags every crate in the unmaintained table automatically. Status is as of November 2026.

Maintained, but not the default

These are actively maintained and safe to depend on. The other crate pages choose differently for concrete reasons, and new code should follow those choices unless a dependency forces otherwise.

Crate Status Default here
chrono Maintained, regular 0.4 releases jiff
time Maintained, regular 0.3 releases jiff
ring 0.17 Maintained; the 2025 unmaintained advisory (RUSTSEC-2025-0007) was withdrawn aws-lc-rs
openssl, native-tls Maintained bindings to the platform TLS library rustls

chrono and time. Neither models IANA time zones as a first-class type: chrono needs chrono-tz for named zones and time handles fixed offsets only. Both represent calendar arithmetic (“add one month”) through separate APIs from absolute durations. jiff puts time zones, DST-safe arithmetic, and calendar spans in one type system. Keep chrono or time where a dependency’s public API uses their types, and convert at that boundary.

ring. rustls, tokio-rustls, and reqwest all default to aws-lc-rs, and rustls’s default post-quantum key exchange (X25519MLKEM768) and its fips feature are available only with aws-lc-rs. Adding ring alongside it means two crypto libraries in the binary and, for rustls and jsonwebtoken, a provider panic at startup. Versions of ring before 0.17 are unmaintained (RUSTSEC-2025-0010) and should be upgraded wherever they appear.

openssl and native-tls. On Linux these link the host’s OpenSSL, so TLS behavior and patch level follow the base image rather than Cargo.lock, and static or musl builds need OpenSSL built for the target. rustls compiles in and is versioned with the rest of the dependency tree. Keep native-tls only where the operating system’s TLS stack is a requirement, such as honoring an enterprise trust policy on Windows or macOS.

Replaced by the standard library

Crate Replacement Stable since
lazy_static std::sync::LazyLock 1.80
once_cell std::sync::OnceLock, std::sync::LazyLock, std::cell::OnceCell 1.70, 1.80
async-trait async fn in traits 1.75
atty std::io::IsTerminal 1.70
num_cpus std::thread::available_parallelism 1.59
use std::sync::LazyLock;

static USER_AGENT: LazyLock<String> =
    LazyLock::new(|| format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")));

atty is also unmaintained and unsound (RUSTSEC-2024-0375, RUSTSEC-2021-0145). The others are maintained and still appear transitively, which is harmless; the point is not to add them directly.

Unmaintained or discontinued

Each of these has a RustSec advisory, a deprecation notice from its maintainers, or both.

bincode 3.0.0 is a tombstone release whose library is a single compile_error!; the maintainers consider 1.3.3 complete. A bincode = "1" dependency still builds, but new formats should pick an alternative, and data persisted with bincode needs a migration plan rather than an upgrade.

For YAML, prefer TOML or JSON for configuration the service owns. YAML input from Kubernetes manifests or CI files still needs a parser; serde-saphyr is built on the pure-Rust saphyr parser, and serde_norway is a maintained fork of serde_yaml with a drop-in API.

Pre-1.0 HTTP stack

hyper 0.14, http 0.2, and the crates built on them (axum before 0.7, reqwest before 0.12, tonic before 0.12) are a separate dependency tree from hyper 1.x. Types such as http::Request and HeaderMap from the two http versions are distinct and do not convert implicitly, so a single crate on the old stack forces a second copy of hyper, http, and h2 into the build. cargo tree -d -e normal lists the duplicates; upgrade or replace whatever pulls in the 0.x versions.

Enforcing it in CI

cargo deny checks the resolved dependency graph, including transitive crates, against the RustSec database and an explicit ban list. Put this deny.toml at the workspace root:

[advisories]
unmaintained = "all"
unsound = "all"
yanked = "deny"

[bans]
multiple-versions = "warn"
deny = [
  { crate = "ring", reason = "aws-lc-rs is the only crypto backend", use-instead = "aws-lc-rs" },
  { crate = "openssl", reason = "TLS uses rustls", use-instead = "rustls" },
  { crate = "native-tls", reason = "TLS uses rustls", use-instead = "rustls" },
]
cargo install cargo-deny --locked
cargo deny check advisories bans

The advisories table fails the build on every crate in the unmaintained table above. The bans table covers the crypto and TLS choices, which no advisory would flag. The combined Cargo.toml passes all three bans.

A ban applies to transitive dependencies too, which is why chrono, time, once_cell, and lazy_static are not in the list: the stack on these pages already pulls them in transitively (chrono through tracing-ndjson, time through jsonwebtoken’s PEM support, once_cell through rustls and dashmap, lazy_static through prometheus and tracing-subscriber). That is harmless. Keep them out of [dependencies] in code review. When a banned crate is unavoidable behind a specific dependency, scope the exception with wrappers, which permits the crate only when the named parents pull it in.

Type to search…

↑↓ navigate↵ selectEsc close