core-foundation-rs icon indicating copy to clipboard operation
core-foundation-rs copied to clipboard

core-foundation-sys: Enable `no_std` environment

Open michaelwright235 opened this issue 1 year ago • 6 comments

Since the purpose of this crate is the bindings to an external library and they're pretty much complete, we can see that the only thing we use in libstd are the pointer types and std::cmp. In fact they're defined in libcore and then exported through libstd. I doubt that we will ever need any libstd only stuff such as heap allocation, vectors, hashmaps, etc. I propose making core-foundation-sys a no_std crate. It maybe useful in some rare situations. For instance, windows-sys crate (Microsoft's official Rust bindings) is no_std and it can be used for writing kernel drivers.

michaelwright235 avatar Jul 03 '23 20:07 michaelwright235

I think we should have an actual use case otherwise it doesn't seem worth increasing the MSRV for.

jrmuizel avatar Jul 04 '23 01:07 jrmuizel

Maybe it's acceptable because core-foundation that depends on this crate already has minimum Rust version of 1.64.0 (using of std::ffi::Cstr).

michaelwright235 avatar Jul 04 '23 09:07 michaelwright235

Hmm, it looks like this import has been added a couple of years ago, but rust docs says it was added in 1.64.0

michaelwright235 avatar Jul 04 '23 09:07 michaelwright235

:umbrella: The latest upstream changes (presumably b009c87f2da0038bb474800cd88597843e5dbdae) made this pull request unmergeable. Please resolve the merge conflicts.

bors-servo avatar Jul 25 '23 02:07 bors-servo