We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d069ed4 commit febd55aCopy full SHA for febd55a
library/std/src/os/windows/net/addr.rs
@@ -41,10 +41,7 @@ pub fn sockaddr_un(path: &Path) -> io::Result<(c::sockaddr_un, c_int)> {
41
Ok((addr, len as _))
42
}
43
fn sun_path_offset(addr: &c::sockaddr_un) -> usize {
44
- // Work with an actual instance of the type since using a null pointer is UB
45
- let base = addr as *const _ as usize;
46
- let path = &addr.sun_path as *const _ as usize;
47
- path - base
+ offset_of!(c::sockaddr_un, sun_path)
48
49
#[allow(dead_code)]
50
pub struct SocketAddr {
0 commit comments