From 1ca558d0c91341cf1baf50e2c37bf145efa41df0 Mon Sep 17 00:00:00 2001 From: newpavlov Date: Fri, 5 Jul 2019 16:13:46 +0300 Subject: [PATCH 1/2] fix redox --- src/lib.rs | 2 +- src/unix/redox/mod.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2dc42702fcb7d..0f1b7daad2b0c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,7 +113,7 @@ cfg_if! { mod switch; pub use switch::*; - } else if #[cfg(unix)] { + } else if #[cfg(any(unix, target_os="redox"))] { mod fixed_width_ints; pub use fixed_width_ints::*; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 388918eb9b5dc..45edc0fd00bfa 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -35,6 +35,7 @@ pub type speed_t = u32; pub type suseconds_t = ::c_int; pub type tcflag_t = u32; pub type time_t = ::c_long; +pub enum timezone {} s! { pub struct addrinfo { From 46cee95b76facc2fccf7edc1f56fbcb2785f38b7 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Sat, 6 Jul 2019 15:56:37 +0000 Subject: [PATCH 2/2] add Copy and Clone impls --- src/unix/redox/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 45edc0fd00bfa..532bd60863dd6 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -35,7 +35,13 @@ pub type speed_t = u32; pub type suseconds_t = ::c_int; pub type tcflag_t = u32; pub type time_t = ::c_long; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { *self } +} s! { pub struct addrinfo {