-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Windows SOCKET type defined inconsistently between libc vs std::os::windows #76253
Comments
From MSVC headers:
Unfortunately this would be breaking change since that type is public. |
The types have the same representation, so I imagine if anyone is converting between the two (std vs libc) they are already using Otherwise, any code that depends on the current incorrect definition (being identical to u32/u64) should be fixed anyway. |
From what I remember back when Is crater able to actually test Windows specific changes like this yet? |
Since rust is a young language, I'd say that breaking some old incorrectly-written code is better than forcing all future as-yet-unwritten code to contain pointless workarounds like |
Could we land the changing type and revert it back to get a working compiler for testing ? |
I changed the type definition locally (8ec8939a3e11fa4953639b6794db5ecb33b444ad) and |
It looks like Rust's #[cfg(target_pointer_width = "32")]
#[doc(cfg(all()))]
#[stable(feature = "raw_ext", since = "1.1.0")]
pub type SOCKET = u32;
#[cfg(target_pointer_width = "64")]
#[doc(cfg(all()))]
#[stable(feature = "raw_ext", since = "1.1.0")]
pub type SOCKET = u64; Would it make more sense for this to be a |
Making a breaking change like this would require a crater run (that's where we test all the code on crates.io and open source code on GitHub). Unfortunately all our runners are for Linux, not Windows. |
Linking this to rust-lang/crater#149 in that case. |
For some reason official MS SDK docs likes to keep the actual definition a secret
Probably the std definition should be changed to
usize
to match the libc crate.The text was updated successfully, but these errors were encountered: