rustversion-msrv

Crates.iorustversion-msrv
lib.rsrustversion-msrv
version0.100.0
sourcesrc
created_at2024-05-12 17:23:41.188465
updated_at2024-07-22 00:24:56.568747
descriptionConditional compilation according manifest MSRV
homepage
repositoryhttps://github.com/robjtede/rustversion-msrv
max_upload_size
id1237674
size29,941
Rob Ede (robjtede)

documentation

README

Conditional compilation according manifest MSRV.

crates.io Documentation Version MIT or Apache 2.0 licensed
dependency status Download

Conditional compilation according manifest MSRV.

Selectors

  • #[rustversion_msrv::msrv]

    True on the call-site crate's rust-version field, i.e., its minimum supported Rust version (MSRV).

Use Cases

The motivating use case for the msrv macro in this crate is to ensure a stable compiler error output when running negative trybuild tests. Guarding your test function like this means you only need to update the .stderr files when you bump your MSRV, not (potentially) every stable release (or worse). Of course, try make sure that your CI is actually running an MSRV job in its set.

#[rustversion_msrv::msrv]
#[test]
fn trybuild() {
   // ...
}
Commit count: 170

cargo fmt