mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-19 18:01:05 +00:00
Fix compatibility issues with syntax and Bound
This commit is contained in:
@@ -14,6 +14,15 @@ fn main() {
|
||||
let target = env::var("TARGET").unwrap();
|
||||
let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten";
|
||||
|
||||
// std::collections::Bound was stabilized in Rust 1.17
|
||||
// but it was moved to core::ops later in Rust 1.26:
|
||||
// https://doc.rust-lang.org/core/ops/enum.Bound.html
|
||||
if minor >= 26 {
|
||||
println!("cargo:rustc-cfg=ops_bound");
|
||||
} else if minor >= 17 && cfg!(feature = "std") {
|
||||
println!("cargo:rustc-cfg=collections_bound");
|
||||
}
|
||||
|
||||
// CString::into_boxed_c_str stabilized in Rust 1.20:
|
||||
// https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_boxed_c_str
|
||||
if minor >= 20 {
|
||||
@@ -42,6 +51,12 @@ fn main() {
|
||||
println!("cargo:rustc-cfg=integer128");
|
||||
}
|
||||
|
||||
// RangeToInclusive was stabilized in Rust 1.26:
|
||||
// https://doc.rust-lang.org/std/ops/struct.RangeToInclusive.html
|
||||
if minor >= 26 {
|
||||
println!("cargo:rustc-cfg=range_to_inclusive");
|
||||
}
|
||||
|
||||
// Inclusive ranges methods stabilized in Rust 1.27:
|
||||
// https://github.com/rust-lang/rust/pull/50758
|
||||
if minor >= 27 {
|
||||
|
||||
Reference in New Issue
Block a user