Skip to content

Update to Windows-sys v0.59 #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ features = ["all"]
libc = "0.2.172"

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52"
version = "0.59"
features = [
"Win32_Foundation",
"Win32_Networking_WinSock",
Expand Down
4 changes: 3 additions & 1 deletion src/sys/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,11 @@ pub(crate) fn unix_sockaddr(path: &Path) -> io::Result<SockAddr> {
}

storage.sun_family = crate::sys::AF_UNIX as sa_family_t;
// SAFETY: casting `[u8]` to `[i8]` is safe.
let b = unsafe { &*(bytes as *const [u8] as *const [i8]) };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a bit fragile to rely on char being i8.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this comment, will send a pr to change it to char

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// `storage` was initialized to zero above, so the path is
// already null terminated.
storage.sun_path[..bytes.len()].copy_from_slice(bytes);
storage.sun_path[..bytes.len()].copy_from_slice(b);

let base = storage as *const _ as usize;
let path = &storage.sun_path as *const _ as usize;
Expand Down