-
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
Tracking issue for RFC 2521, "Unify std::os::raw::c_void and libc::c_void via libcore" #53856
Comments
OK per what @retep998 was saying, if we can get Cargo to ensure that |
@Ericson2314 without a design of how to do that it's simply not an option. There is no ability to do that today, and it's not clear how that would be done (nor whether it's desirable). |
I'd like to work on this :) |
Move std::os::raw::c_void into libcore and re-export in libstd Implements the first part of [RFC 2521](rust-lang/rfcs#2521). cc #53856
Re-export core::ffi::c_void if it exists This is the second part of the implementation of [RFC 2521](rust-lang/rfcs#2521), replacing the definition of `c_void` in libc with a re-export of the type from `core::ffi::c_void` on builds it exists for. This uses the re-export for rustc version `1.31.0` or greater, as `1.30.x` was the current nightly when [the PR for the changes to libcore and libstd](rust-lang/rust#53910) was merged, so I'm assuming the first nightly they will appear in will be `1.31.0`; is this acceptable? cc rust-lang/rust#53856
Afaik the implementation for this is now complete and will be insta-stable from 1.31.0 |
Thanks for your PRs @IsaacWoods! I believe |
I went with 1.31.0 to make sure not to break nightly users using a 1.30.0 libstd without the change but upgrading libc, but feature detection would probably be better. I’ll send another PR when I have the chance |
Revisit work on cvoid At the recommendation of @SimonSapin [here](rust-lang/rust#53856 (comment)), I have revisited the build script to check whether `core::ffi::c_void` resolves, instead of relying on a particular `rustc` version. This allows use on `1.30.x` builds with `core::ffi::c_void`. I also noticed that `c_void` is defined twice in this crate, once in `lib.rs` and again in `switch.rs`. This instead defines `c_void` for every target except `wasm32`. As far as I can tell, this shouldn't actually change functionality on any existing targets.
Revisit work on cvoid At the recommendation of @SimonSapin [here](rust-lang/rust#53856 (comment)), I have revisited the build script to check whether `core::ffi::c_void` resolves, instead of relying on a particular `rustc` version. This allows use on `1.30.x` builds with `core::ffi::c_void`. I also noticed that `c_void` is defined twice in this crate, once in `lib.rs` and again in `switch.rs`. This instead defines `c_void` for every target except `wasm32`. As far as I can tell, this shouldn't actually change functionality on any existing targets.
I could confirm that this issue was fixed. I was able to build correctly with |
why not move all Edit: |
https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md
In some of those discussions, there was no consensus for having integer type aliases in libcore because some of them are platform-specific but libcore “should be pure”. |
This was insta-stable (with FCP) in #53910, so closing as it seems there is nothing else to track here. Feel free to reopen if there is. |
This is a tracking issue for the RFC "Unify std::os::raw::c_void and libc::c_void via libcore" (rust-lang/rfcs#2521).
Steps:
Unresolved questions:
There are none.
The text was updated successfully, but these errors were encountered: