switch to rustversion
This commit is contained in:
parent
327ff98ea1
commit
eed864eb36
@ -9,7 +9,6 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing", "security"]
|
keywords = ["fuzzing", "testing", "security"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
build = "build.rs"
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std", "derive", "llmp_compression", "rand_trait", "fork"]
|
default = ["std", "derive", "llmp_compression", "rand_trait", "fork"]
|
||||||
@ -43,6 +42,7 @@ num_cpus = "1.0" # cpu count, for llmp example
|
|||||||
serial_test = "0.5"
|
serial_test = "0.5"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
rustversion = "1.0"
|
||||||
tuple_list = { version = "0.1.3" }
|
tuple_list = { version = "0.1.3" }
|
||||||
hashbrown = { version = "0.11", features = ["serde", "ahash-compile-time-rng"], default-features=false } # A faster hashmap, nostd compatible
|
hashbrown = { version = "0.11", features = ["serde", "ahash-compile-time-rng"], default-features=false } # A faster hashmap, nostd compatible
|
||||||
num-traits = { version = "0.2", default-features = false }
|
num-traits = { version = "0.2", default-features = false }
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
//! special handling to build and link libafl
|
|
||||||
|
|
||||||
use rustc_version::{version_meta, Channel};
|
|
||||||
|
|
||||||
#[allow(clippy::ptr_arg, clippy::upper_case_acronyms)]
|
|
||||||
fn main() {
|
|
||||||
// Set cfg flags depending on release channel
|
|
||||||
match version_meta().unwrap().channel {
|
|
||||||
Channel::Stable => {
|
|
||||||
println!("cargo:rustc-cfg=RUSTC_IS_STABLE");
|
|
||||||
}
|
|
||||||
Channel::Beta => {
|
|
||||||
println!("cargo:rustc-cfg=RUSTC_IS_BETA");
|
|
||||||
}
|
|
||||||
Channel::Nightly => {
|
|
||||||
println!("cargo:rustc-cfg=RUSTC_IS_NIGHTLY");
|
|
||||||
}
|
|
||||||
Channel::Dev => {
|
|
||||||
println!("cargo:rustc-cfg=RUSTC_IS_DEV");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ use core::any::TypeId;
|
|||||||
|
|
||||||
use xxhash_rust::xxh3::xxh3_64;
|
use xxhash_rust::xxh3::xxh3_64;
|
||||||
|
|
||||||
#[cfg(feature = "RUSTC_IS_NIGHTLY")]
|
#[rustversion::nightly]
|
||||||
/// From https://stackoverflow.com/a/60138532/7658998
|
/// From https://stackoverflow.com/a/60138532/7658998
|
||||||
const fn type_eq<T: ?Sized, U: ?Sized>() -> bool {
|
const fn type_eq<T: ?Sized, U: ?Sized>() -> bool {
|
||||||
// Helper trait. `VALUE` is false, except for the specialization of the
|
// Helper trait. `VALUE` is false, except for the specialization of the
|
||||||
@ -28,7 +28,7 @@ const fn type_eq<T: ?Sized, U: ?Sized>() -> bool {
|
|||||||
<T as TypeEq<U>>::VALUE
|
<T as TypeEq<U>>::VALUE
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "RUSTC_IS_NIGHTLY"))]
|
#[rustversion::not(nightly)]
|
||||||
const fn type_eq<T: ?Sized, U: ?Sized>() -> bool {
|
const fn type_eq<T: ?Sized, U: ?Sized>() -> bool {
|
||||||
// BEWARE! This is not unsafe, it is SUPER UNSAFE
|
// BEWARE! This is not unsafe, it is SUPER UNSAFE
|
||||||
true
|
true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user