-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Move std::os::raw into core #52839
Move std::os::raw into core #52839
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
Core is intended to be platform-independent, so I don't think doing this is a good idea per current policies. Cc @rust-lang/libs |
Is this platform-dependent? There are no |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This was discussed as part of RFC 1783 which was not accepted. |
There's a huge See also #46736. |
Previously:
I’m personally not very convinced by the arguments against this move. |
This would be the first use of #[cfg(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "s390x")),
all(target_os = "android", any(target_arch = "aarch64",
target_arch = "arm")),
all(target_os = "l4re", target_arch = "x86_64"),
all(target_os = "openbsd", target_arch = "aarch64"),
all(target_os = "fuchsia", target_arch = "aarch64")))]
pub type c_char = u8;
#[cfg(any(target_pointer_width = "32", windows))]
pub type c_long = i32; |
Ah, I didn't realize this had already been litigated so much. I'm still in favor of the move, but I'm not going to waste more of folks' cycles on an issue that has been litigated to death. |
New RFC to propose doing this for |
Move the types in
std::os::raw
intocore::os::raw
, and re-export them fromstd::os::raw
.This allows these types to be used in a no-std environment without having to use
libc
, and also addresses rust-lang/rust-bindgen#1015.There's a discussion about this on the internals forum here.