-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.rs
37 lines (30 loc) · 765 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! [`rustversion`] can't be used in inner attributes, so we use `cfg`s as a
//! workaround.
//!
//! See <https://github.com/rust-lang/rust/issues/54726>.
#![allow(clippy::missing_const_for_fn)]
#[cfg(feature = "msrv")]
fn main() {
v1_77();
nightly();
}
/// Enabling [`f64::round_ties_even()`].
#[cfg(feature = "msrv")]
#[rustversion::since(1.77)]
fn v1_77() {
println!("cargo:rustc-cfg=v1_77");
}
#[cfg(feature = "msrv")]
#[rustversion::before(1.77)]
fn v1_77() {}
/// Enabling various [`f64`] instructions via [`asm!`](std::arch::asm).
#[cfg(feature = "msrv")]
#[rustversion::nightly]
fn nightly() {
println!("cargo:rustc-cfg=nightly");
}
#[cfg(feature = "msrv")]
#[rustversion::not(nightly)]
fn nightly() {}
#[cfg(not(feature = "msrv"))]
fn main() {}