Since the types in std::os::raw are not also in core, there’s no way to use them from a no-std program. Among other things, this is an issue for bindgen.
Is there a reason we should add a similar module to core (and maybe make the std types aliases for those)?
I was going to saw “but wait OsString is alloc!” but, as always, I forget it’s in std::ffi, not std::os. Those are all type aliases (except c_void which is special), so moving them to core is probably a trivial change.
Since the types in std::os::raw are not also in core, there’s no way to use them from a no-std program. Among other things, this is an issue for bindgen.
FWIW, there is a way to use it from a #[no_std] program, which is using the libc crate, or at least that's the way you used to be able to do it IIRC . That's why bindgen has two different options, one to use core, and another to add a prefix for C-types, which usually is libc.
It's not the first report about this being confusing, so a nicer solution would be really appreciated. Though that may mean more requirements for #[no_std] targets which also don't need C types? Not sure about the trade-off here.
I don't think it introduces any extra requirements since none of these are extern declarations. They just happen to have the same memory layout as the equivalent C types.