, docs.rs builds documentation for a default
list of five targets.
Starting on 2026-05-01, docs.rs will instead build documentation for only
the default target unless additional targets are requested explicitly.
This is the next step in a change we first introduced in 2020, when docs.rs
added support for opting into fewer build targets. Most crates do not compile
different code for different targets, so building fewer targets by default is a
better fit for most releases. It also reduces build times and saves resources on
docs.rs.
This change only affects:
- new releases
- rebuilds of old releases
:
CODE [package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
How do I build documentation for additional targets?
[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"How do I build documentation for additional targets?
If your crate needs documentation to be built for more than the default target,
define the full list explicitly in your Cargo.toml:
[package.metadata.docs.rs]
targets = [
"x86_64-unknown-linux-gnu"
"x86_64-apple-darwin"
"x86_64-pc-windows-msvc"
"i686-unknown-linux-gnu"
"i686-pc-windows-msvc"
]When targets is set, docs.rs will build documentation for exactly those
targets.
docs.rs still supports any target available in the Rust toolchain. Only the
default behavior is changing.
SOCIAL SHARE CARD GENERATOR