rustversion
rustversion copied to clipboard
Conditional compilation according to rustc compiler version
Currently only RUSTC is used, but it may make sense to also support RUSTC_WRAPPER. Would you accept a patch that implements that?
Current rerun-if directives include just the build/build.rs file itself, but not its cousin build/rustc.rs. Shouldn't the entire build directory be used instead? That way cargo will rerun if any of...
Is there anyway to use `rustversion` in conjunction with [`cfg_if`](https://github.com/rust-lang/cfg-if)? It would nice to be able to do some if/else instead of individual blocks that have rustversion attributes on them
version: `rustversion = "1.0.14"` ```rust #[rustversion::nightly(2023-09-13)] fn main() { println!("Hello, world!"); } ``` With `nightly-2023-09-13`: ```shell cargo +nightly-2023-09-13 b Compiling rustversion v1.0.14 Compiling rust-version-test v0.1.0 (D:\git-repos\github\rust-version-test) error[E0601]: `main` function not...
According to the README, `#[rustversion::since(1.74)]` should be > True on that stable release and any later compiler, including beta and nightly. The key word in this sentence is **later**. Stable...
Building the following: ``` #[rustversion::before(2020-01-01)] fn main() { println!("Hello, world!"); } ``` fails as expected with recent nightlies (because of the missing main function in that case) but compiles just...
Hi David, Am I right that the versions come from `rustc`, not from `cargo` nor `rustup`'s default/overridden toolchain (and neither `cargo`, nor `rustup` need to be installed at all)? Otherwise...
Is it possible to have something like the following? ```rust #[rustversion::attr(since(1.40), non_exhaustive)] pub enum Error { // other items #[rustversion::before(1.40.0)] #[doc(hidden)] __nonexhaustive, } ``` I'm trying to give some support...
try to use [mirai](https://github.com/facebookexperimental/MIRAI), error messsage tell me file an issue here. ``` error: failed to run custom build command for `rustversion v1.0.17` Caused by: process didn't exit successfully: `/home/n/dev/rust/kk/target/debug/build/rustversion-4225e7e1487a3e13/build-script-build`...