-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove core ffi primitive redefinitions #4339
base: main
Are you sure you want to change the base?
Remove core ffi primitive redefinitions #4339
Conversation
Seems like the failure is related to #94501. I will look into and see if I can fix the issue. |
Turns out |
This will have to hold off until we do our next MSRV bump, which will likely be later this year. Technically the We do want this so feel free to get it ready, but for now: @rustbot blocked |
pub use core::ffi::{ | ||
c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, | ||
c_ulong, c_ulonglong, c_ushort, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could actually go a step further here; we won't want to publicly reexport these types at all anymore since users have access to core::ffi
directly, so this block can be removed. Instead,
Lines 83 to 86 in 5d549b2
pub(crate) use crate::{ | |
c_char, c_double, c_float, c_int, c_long, c_longlong, c_short, c_uchar, c_uint, | |
c_ulong, c_ulonglong, c_ushort, c_void, intptr_t, size_t, ssize_t, uintptr_t, | |
}; |
core::ffi
for our internal use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes this is a good point! I will add this right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out doing this will break the libc tests as those rely of the re-exports through libc rather than directly from core::ffi. Should I see if I can get the tests to use core::ffi instead of libc for these types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable to me 👍. It could even be a separate PR to merge sooner since the rest of this is blocked
Description
This PR removed the duplicate definitions of the c primitive types and re-exports the definitions from rust's
core::ffi
module.Closes #4257
Sources
No API changes as the definitions of c primitive types are now coming from rust's
core::ffi
module.Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI