From 987c8a607b7b5b12660efeb50376ccce6b17e9a6 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 4 Apr 2021 08:39:05 -0600 Subject: Use memoffset::offset_of instead of homegrown macro The homegrown macro was fine in 2016, but at some point it technically became UB. The memoffset crate does the same thing, but avoids UB when using rustc 1.51.0 or later. Fixes #1415 --- src/sys/socket/addr.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sys/socket/addr.rs') diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 1f7f4ec6..71b2c973 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -1,6 +1,7 @@ use super::sa_family_t; use crate::{Error, Result, NixPath}; use crate::errno::Errno; +use memoffset::offset_of; use std::{fmt, mem, net, ptr, slice}; use std::ffi::OsStr; use std::hash::{Hash, Hasher}; -- cgit v1.2.3