Skip to content

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.

@Thomasdezeeuw
Copy link
Author

@Darksonn now that the CI is fixed, is this ok to merge?

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