Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upstd `c_void` and libc `c_void` are different types #31536
Comments
This comment has been minimized.
This comment has been minimized.
|
This is an unresolved question in the design of libc, and it's mostly a libc-specific issue, so I'm going to close in favor of rust-lang/libc#180 Which is to say that the current setup is indeed intentional, and in light of rust-lang/rfcs#1415 if |
alexcrichton
closed this
Feb 10, 2016
This comment has been minimized.
This comment has been minimized.
|
libc bindings desperately need a single source of truth. Can |
This comment has been minimized.
This comment has been minimized.
|
std depending on in-tree libc only enables conflicts between different versions of libc. |
This comment has been minimized.
This comment has been minimized.
|
As long as you insist this is a libc bug only, we can't have a nice solution. Can you point me to why we cannot define these types in some subcrate of libstd? |
This comment has been minimized.
This comment has been minimized.
|
We've avoided having these types in libcore, and this basically has to be a libc change as Do you have a concrete plan of action in mind though that affects libstd? |
This comment has been minimized.
This comment has been minimized.
|
yes, c_void is stable, but it can move to libcore. |
This comment has been minimized.
This comment has been minimized.
|
The libs team decided recently that due to how libcore stabilization and interoperability with libstd works we need to be quite careful about stabilizing items in libcore. We also agreed that there needs to be motivation for moving an item to libcore as opposed to simply "this works currently". I would personally not view this as strong enough motivation as to me the If you'd like to have a discussion about moving |
alexcrichton
reopened this
Feb 10, 2016
This comment has been minimized.
This comment has been minimized.
|
Perhaps whenever |
This comment has been minimized.
This comment has been minimized.
|
An std-using crate could easily wind up using no_std libc. |
This comment has been minimized.
This comment has been minimized.
|
I think there is a good case for moving these types into libcore to support FFI with freestanding C code which does not use a libc. This is mainly relevant for embedded and/or kernel code, which will be using no_std and will not be able to use the libc crate. This will also help with removing libstd's dependency on libc on Windows, since most remaining uses of libc in libstd/sys/windows are just the basic C types. |
steveklabnik
added
the
A-libs
label
Feb 15, 2016
This comment has been minimized.
This comment has been minimized.
|
Related internals discussion: https://internals.rust-lang.org/t/solve-std-os-raw-c-void/3268 |
klutzy
referenced this issue
Mar 31, 2016
Closed
`std::os::windows::io::RawHandle` exposes `libc::HANDLE` #24450
This comment has been minimized.
This comment has been minimized.
|
I left some thoughts on the internals discussion. |
nbigaouette-eai
added a commit
to nbigaouette-eai/rust
that referenced
this issue
Mar 8, 2017
steveklabnik
added
T-libs
and removed
A-libs
labels
Mar 24, 2017
Mark-Simulacrum
added
the
C-bug
label
Jul 24, 2017
This comment has been minimized.
This comment has been minimized.
|
New RFC to propose fixing this through |
This comment has been minimized.
This comment has been minimized.
|
The RFC was merged, implemented, so this should be closed, probably. |
This comment has been minimized.
This comment has been minimized.
|
Indeed! |
bluss commentedFeb 10, 2016
Using libc v0.2.7 and rustc 1.8.0-nightly (34af2de 2016-02-05)
These must be compatible, otherwise we cause incompatibilities in the ecosystem.