Reverse impls available for Rust >=1.19
This commit is contained in:
parent
f3ffcfd61e
commit
71fe2a5534
@ -23,6 +23,12 @@ fn main() {
|
||||
println!("cargo:rustc-cfg=collections_bound");
|
||||
}
|
||||
|
||||
// core::cmp::Reverse stabilized in Rust 1.19:
|
||||
// https://doc.rust-lang.org/stable/core/cmp/struct.Reverse.html
|
||||
if minor >= 19 {
|
||||
println!("cargo:rustc-cfg=core_reverse");
|
||||
}
|
||||
|
||||
// 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 {
|
||||
|
@ -578,6 +578,7 @@ macro_rules! forwarded_impl {
|
||||
#[cfg(all(feature = "std", de_boxed_c_str))]
|
||||
forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
|
||||
|
||||
#[cfg(core_reverse)]
|
||||
forwarded_impl!((T), Reverse<T>, Reverse);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -139,6 +139,7 @@ mod lib {
|
||||
|
||||
pub use self::core::cell::{Cell, RefCell};
|
||||
pub use self::core::clone::{self, Clone};
|
||||
#[cfg(core_reverse)]
|
||||
pub use self::core::cmp::Reverse;
|
||||
pub use self::core::convert::{self, From, Into};
|
||||
pub use self::core::default::{self, Default};
|
||||
|
@ -825,6 +825,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(core_reverse)]
|
||||
impl<T> Serialize for Reverse<T>
|
||||
where
|
||||
T: Serialize,
|
||||
|
Loading…
Reference in New Issue
Block a user