#msrv #conditional-compilation #manifest #no-alloc #rustc-version #error

macro no-std build rustversion-msrv

Conditional compilation according manifest MSRV

2 unstable releases

0.100.0 Jul 22, 2024
0.99.16 May 12, 2024

#12 in #msrv

Download history 119/week @ 2025-03-15 111/week @ 2025-03-22 371/week @ 2025-03-29 324/week @ 2025-04-05 77/week @ 2025-04-12 197/week @ 2025-04-19 308/week @ 2025-04-26 332/week @ 2025-05-03 306/week @ 2025-05-10 222/week @ 2025-05-17 273/week @ 2025-05-24 268/week @ 2025-05-31 195/week @ 2025-06-07 197/week @ 2025-06-14 364/week @ 2025-06-21 330/week @ 2025-06-28

1,089 downloads per month
Used in actix_derive

MIT/Apache

16KB
354 lines

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() {
   // ...
}

No runtime deps