diff --git a/Cargo.toml b/Cargo.toml index c6690d46ef..1d13d36353 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ libc = { version = "0.2.166", features = ["extra_traits"] } bitflags = "2.3.3" cfg-if = "1.0" pin-utils = { version = "0.1.0", optional = true } -memoffset = { version = "0.9", optional = true } [features] default = [] @@ -63,7 +62,7 @@ reboot = [] resource = [] sched = ["process"] signal = ["process"] -socket = ["memoffset"] +socket = [] syslog = [] term = [] time = [] diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index ac3a234704..0a2c8ceb64 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -20,7 +20,7 @@ use crate::sys::socket::addr::netlink::NetlinkAddr; use crate::sys::socket::addr::sys_control::SysControlAddr; use crate::{NixPath, Result}; use cfg_if::cfg_if; -use memoffset::offset_of; +use std::mem::offset_of; use std::convert::TryInto; use std::ffi::OsStr; use std::hash::{Hash, Hasher}; diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index 5635346eac..e441ff2e95 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -1,9 +1,3 @@ -#[cfg(all( - target_os = "linux", - target_env = "gnu", - any(target_arch = "x86_64", target_arch = "x86") -))] -use memoffset::offset_of; use nix::errno::Errno; use nix::sys::ptrace; #[cfg(linux_android)] @@ -12,6 +6,12 @@ use nix::unistd::getpid; #[cfg(linux_android)] use std::mem; +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any(target_arch = "x86_64", target_arch = "x86") +))] +use std::mem::offset_of; use crate::*;