https://github.com/robjtede/rustversion-msrv
Conditional compilation according to rustc compiler version + MSRV support
https://github.com/robjtede/rustversion-msrv
Last synced: about 1 year ago
JSON representation
Conditional compilation according to rustc compiler version + MSRV support
- Host: GitHub
- URL: https://github.com/robjtede/rustversion-msrv
- Owner: robjtede
- License: apache-2.0
- Created: 2024-05-12T17:12:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T00:28:17.000Z (almost 2 years ago)
- Last Synced: 2025-04-11T00:12:46.695Z (about 1 year ago)
- Language: Rust
- Size: 242 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
> Conditional compilation according manifest MSRV.
[](https://crates.io/crates/rustversion-msrv)
[](https://docs.rs/rustversion-msrv/0.100.0)


[](https://deps.rs/crate/rustversion-msrv/0.100.0)

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.
```rust
#[rustversion_msrv::msrv]
#[test]
fn trybuild() {
// ...
}
```