Skip to content

Update to socket2 v0.6 #329

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update to socket2 v0.6 #329

wants to merge 2 commits into from

Conversation

Thomasdezeeuw
Copy link

No description provided.

@Thomasdezeeuw
Copy link
Author

CI failure is unrelated to my changes:

error: elided lifetime has a name
   --> src/fs/create_dir_all.rs:127:78
    |
127 |     fn recurse_create_dir_all<'a>(&'a self, path: &'a Path) -> LocalBoxFuture<io::Result<()>> {
    |                               -- lifetime `'a` declared here                 ^ this elided lifetime gets resolved as `'a`
    |
    = note: `-D elided-named-lifetimes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(elided_named_lifetimes)]`

@Darksonn
Copy link
Contributor

Darksonn commented Jul 7, 2025

See #330.

socket2::SockAddr::try_init(move |addr_storage, len| {
// SAFETY: socket2::SockAddrStorage contains
// libc::sockaddr_storage, so this cast is safe.
self.socketaddr.0.clone_into(&mut *addr_storage.cast());
Copy link
Contributor

Choose a reason for hiding this comment

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

We added a SockAddrStorage::view_as() method for exactly this kind of pointer cast.

Copy link
Author

Choose a reason for hiding this comment

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

I tried that as well, but SockAddr::try_init uses a raw pointer view_as uses a mutable reference. We could dereference first, then view though if you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants