Crates.io | rustversion-msrv |
lib.rs | rustversion-msrv |
version | 0.100.0 |
source | src |
created_at | 2024-05-12 17:23:41.188465 |
updated_at | 2024-07-22 00:24:56.568747 |
description | Conditional compilation according manifest MSRV |
homepage | |
repository | https://github.com/robjtede/rustversion-msrv |
max_upload_size | |
id | 1237674 |
size | 29,941 |
Conditional compilation according manifest MSRV.
Conditional compilation according manifest MSRV.
#[rustversion_msrv::msrv]
True on the call-site crate's rust-version
field, i.e., its minimum supported Rust
version (MSRV).
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() {
// ...
}