Skip to content
New issue

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

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

Already on GitHub? # to your account

Win32_Networking_WinSock feature fails to build without std #3467

Closed
kosmadenis opened this issue Jan 30, 2025 · 1 comment · Fixed by #3469
Closed

Win32_Networking_WinSock feature fails to build without std #3467

kosmadenis opened this issue Jan 30, 2025 · 1 comment · Fixed by #3469
Labels
bug Something isn't working

Comments

@kosmadenis
Copy link

Summary

Reproduction: build the windows crate with Win32_Networking_WinSock feature enabled, without std:

cargo +nightly check '-Zbuild-std=core,alloc' -p windows --no-default-features --features=Win32_Networking_WinSock

This results in a bunch of failed to resolve std errors:

    Checking windows v0.59.0 (E:\windows-rs\crates\libs\windows)
error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\IN6_ADDR.rs:3:11
  |
3 | impl From<std::net::Ipv6Addr> for IN6_ADDR {
  |           ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
3 - impl From<std::net::Ipv6Addr> for IN6_ADDR {
3 + impl From<net::Ipv6Addr> for IN6_ADDR {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\IN6_ADDR.rs:4:19
  |
4 |     fn from(addr: std::net::Ipv6Addr) -> Self {
  |                   ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
4 -     fn from(addr: std::net::Ipv6Addr) -> Self {
4 +     fn from(addr: net::Ipv6Addr) -> Self {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\IN6_ADDR.rs:8:25
  |
8 | impl From<IN6_ADDR> for std::net::Ipv6Addr {
  |                         ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
8 - impl From<IN6_ADDR> for std::net::Ipv6Addr {
8 + impl From<IN6_ADDR> for net::Ipv6Addr {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\IN_ADDR.rs:3:11
  |
3 | impl From<std::net::Ipv4Addr> for IN_ADDR {
  |           ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
3 - impl From<std::net::Ipv4Addr> for IN_ADDR {
3 + impl From<net::Ipv4Addr> for IN_ADDR {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\IN_ADDR.rs:4:19
  |
4 |     fn from(addr: std::net::Ipv4Addr) -> Self {
  |                   ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
4 -     fn from(addr: std::net::Ipv4Addr) -> Self {
4 +     fn from(addr: net::Ipv4Addr) -> Self {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\IN_ADDR.rs:10:24
   |
10 | impl From<IN_ADDR> for std::net::Ipv4Addr {
   |                        ^^^ use of undeclared crate or module `std`
   |
help: consider importing this module
   |
1  + use core::net;
   |
help: if you import `net`, refer to it directly
   |
10 - impl From<IN_ADDR> for std::net::Ipv4Addr {
10 + impl From<IN_ADDR> for net::Ipv4Addr {
   |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_IN.rs:3:11
  |
3 | impl From<std::net::SocketAddrV4> for SOCKADDR_IN {
  |           ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
3 - impl From<std::net::SocketAddrV4> for SOCKADDR_IN {
3 + impl From<net::SocketAddrV4> for SOCKADDR_IN {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_IN.rs:4:19
  |
4 |     fn from(addr: std::net::SocketAddrV4) -> Self {
  |                   ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
4 -     fn from(addr: std::net::SocketAddrV4) -> Self {
4 +     fn from(addr: net::SocketAddrV4) -> Self {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_IN6.rs:3:11
  |
3 | impl From<std::net::SocketAddrV6> for SOCKADDR_IN6 {
  |           ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
3 - impl From<std::net::SocketAddrV6> for SOCKADDR_IN6 {
3 + impl From<net::SocketAddrV6> for SOCKADDR_IN6 {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_IN6.rs:4:19
  |
4 |     fn from(addr: std::net::SocketAddrV6) -> Self {
  |                   ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
4 -     fn from(addr: std::net::SocketAddrV6) -> Self {
4 +     fn from(addr: net::SocketAddrV6) -> Self {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:3:11
  |
3 | impl From<std::net::SocketAddrV4> for SOCKADDR_INET {
  |           ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
3 - impl From<std::net::SocketAddrV4> for SOCKADDR_INET {
3 + impl From<net::SocketAddrV4> for SOCKADDR_INET {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:4:19
  |
4 |     fn from(addr: std::net::SocketAddrV4) -> Self {
  |                   ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
4 -     fn from(addr: std::net::SocketAddrV4) -> Self {
4 +     fn from(addr: net::SocketAddrV4) -> Self {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:8:11
  |
8 | impl From<std::net::SocketAddrV6> for SOCKADDR_INET {
  |           ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
8 - impl From<std::net::SocketAddrV6> for SOCKADDR_INET {
8 + impl From<net::SocketAddrV6> for SOCKADDR_INET {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:9:19
  |
9 |     fn from(addr: std::net::SocketAddrV6) -> Self {
  |                   ^^^ use of undeclared crate or module `std`
  |
help: consider importing this module
  |
1 + use core::net;
  |
help: if you import `net`, refer to it directly
  |
9 -     fn from(addr: std::net::SocketAddrV6) -> Self {
9 +     fn from(addr: net::SocketAddrV6) -> Self {
  |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:13:11
   |
13 | impl From<std::net::SocketAddr> for SOCKADDR_INET {
   |           ^^^ use of undeclared crate or module `std`
   |
help: consider importing this module
   |
1  + use core::net;
   |
help: if you import `net`, refer to it directly
   |
13 - impl From<std::net::SocketAddr> for SOCKADDR_INET {
13 + impl From<net::SocketAddr> for SOCKADDR_INET {
   |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:14:19
   |
14 |     fn from(addr: std::net::SocketAddr) -> Self {
   |                   ^^^ use of undeclared crate or module `std`
   |
help: consider importing this module
   |
1  + use core::net;
   |
help: if you import `net`, refer to it directly
   |
14 -     fn from(addr: std::net::SocketAddr) -> Self {
14 +     fn from(addr: net::SocketAddr) -> Self {
   |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:16:13
   |
16 |             std::net::SocketAddr::V4(socket_addr_v4) => socket_addr_v4.into(),
   |             ^^^ use of undeclared crate or module `std`
   |
help: consider importing this enum
   |
1  + use core::net::SocketAddr;
   |
help: if you import `SocketAddr`, refer to it directly
   |
16 -             std::net::SocketAddr::V4(socket_addr_v4) => socket_addr_v4.into(),
16 +             SocketAddr::V4(socket_addr_v4) => socket_addr_v4.into(),
   |

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> crates\libs\windows\src\extensions\Win32\Networking\WinSock\SOCKADDR_INET.rs:17:13
   |
17 |             std::net::SocketAddr::V6(socket_addr_v6) => socket_addr_v6.into(),
   |             ^^^ use of undeclared crate or module `std`
   |
help: consider importing this enum
   |
1  + use core::net::SocketAddr;
   |
help: if you import `SocketAddr`, refer to it directly
   |
17 -             std::net::SocketAddr::V6(socket_addr_v6) => socket_addr_v6.into(),
17 +             SocketAddr::V6(socket_addr_v6) => socket_addr_v6.into(),
   |

For more information about this error, try `rustc --explain E0433`.
error: could not compile `windows` (lib) due to 18 previous errors

Crate manifest

Crate code

@kennykerr
Copy link
Collaborator

Fix is here: #3469

Thanks for reporting this!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants