Provide try_from only on 1.34+
This commit is contained in:
parent
92e0b62c6b
commit
f249e72162
@ -69,7 +69,12 @@ fn main() {
|
||||
println!("cargo:rustc-cfg=num_nonzero");
|
||||
}
|
||||
|
||||
// TryFrom and Atomic types stabilized in Rust 1.34:
|
||||
// https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#tryfrom-and-tryinto
|
||||
// https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#library-stabilizations
|
||||
if minor >= 34 {
|
||||
println!("cargo:rustc-cfg=core_try_from");
|
||||
|
||||
// Whitelist of archs that support std::sync::atomic module. Ideally we
|
||||
// would use #[cfg(target_has_atomic = "...")] but it is not stable yet.
|
||||
// Instead this is based on rustc's src/librustc_target/spec/*.rs.
|
||||
|
@ -1,5 +1,5 @@
|
||||
pub use lib::clone::Clone;
|
||||
pub use lib::convert::{From, Into, TryFrom};
|
||||
pub use lib::convert::{From, Into};
|
||||
pub use lib::default::Default;
|
||||
pub use lib::fmt::{self, Formatter};
|
||||
pub use lib::marker::PhantomData;
|
||||
@ -11,6 +11,9 @@ pub use self::string::from_utf8_lossy;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
pub use lib::{ToString, Vec};
|
||||
|
||||
#[cfg(core_try_from)]
|
||||
pub use lib::convert::TryFrom;
|
||||
|
||||
mod string {
|
||||
use lib::*;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user