-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Move std::os::raw to core::os::raw #29985
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I've been wary of this in the past because although these are just type definitions it's tying libcore to C perhaps unnecessarily so. When working with libcore there's not really any notion of an OS as it should in theory only be dependent on the architecture it's being compiled for. |
Everything in this module has it’s name prefixed with And some systems do FFI into C and also want to use |
… and re-export at the old location. This is primarily motivated by rust-lang/libc#71 (to support src/liblibc), but also because why not.
Why not use |
With that argument, why does |
Namespacing/putting in a module unfortunately doesn't reduce the connection between libcore and C to me at least. With these types we're somewhat semantically tying libcore to a C compiler and OS, e.g. making the two very difficult to separate (aka the absolute core library in Rust "kinda requires" C). For example, there would no longer necessarily be a correct definition for libcore in various kernels here and there, these types would depend on what compiler you're using and what target that compiler itself has.
The lowering traits in |
libcore should be OS irrelevant, containing |
👍 @liigo , I think that line of reasoning makes a lot of sense. |
Fair enough. (And rust-lang/libc#71, which lead me to this, is not happening either anyway.) |
… and re-export at the old location.
This is primarily motivated by rust-lang/libc#71 (to support src/liblibc), but also because why not.