LinuxCommandLibrary

cargo-msrv

Find and manage the minimum supported Rust version

TLDR

Find minimum supported Rust version

$ cargo msrv find
copy
Find using linear search
$ cargo msrv find --linear
copy
Verify current MSRV works
$ cargo msrv verify
copy
Show declared MSRV
$ cargo msrv show
copy
Set MSRV in Cargo.toml
$ cargo msrv set [1.56.0]
copy
List dependency MSRVs
$ cargo msrv list
copy
Find for specific path
$ cargo msrv --path [/path/to/project] find
copy

SYNOPSIS

cargo msrv [options] command

DESCRIPTION

cargo msrv finds and manages the Minimum Supported Rust Version (MSRV) for Rust projects. It determines the oldest Rust compiler version that can successfully build a crate by testing against available toolchains. By default it uses binary search to efficiently narrow down the compatible version range.
Maintaining an accurate MSRV is important for library authors who want to support users on older Rust versions. The tool can automatically set the `rust-version` field in Cargo.toml after finding the minimum version, and verify that the declared MSRV remains valid as the codebase evolves.

PARAMETERS

--path dir

Project directory path
--linear
Use linear search instead of binary
--min version
Minimum version to consider
--max version
Maximum version to consider
--target triple
Target platform
--manifest-path path
Path to Cargo.toml

COMMANDS

find

Discover the MSRV by testing versions
verify
Check if project works with declared MSRV
show
Display MSRV from Cargo.toml
set version
Update rust-version in Cargo.toml
list
Show MSRVs of dependencies

REQUIREMENTS

Requires rustup for toolchain management.

CAVEATS

Binary search is much faster than linear (79+ minor versions exist). Set MSRV via package.rust-version field in Cargo.toml.

SEE ALSO

cargo(1), rustup(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community