Skip to content
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

future of this crate given that c_* types have moved from std to core? #24

Open
decathorpe opened this issue Sep 23, 2022 · 2 comments
Open

Comments

@decathorpe
Copy link

decathorpe commented Sep 23, 2022

With the release of Rust 1.64.0, all c_* types have moved from std into core12, so they are now available in no_std contexts starting with this Rust version, as well. Can cty start to re-export these type definitions from core if they are available, or should dependent crates just start depending on core::ffi::* directly instead?

It also looks like the remaining *_t types (i.e. int64_t) are already translated into equivalent Rust types (i.e. i64) by bindgen (except intmax_t and uintmax_t, for whatever reason)3 - are these type aliases still useful?

Footnotes

  1. https://doc.rust-lang.org/core/ffi/index.html

  2. https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#c-compatible-ffi-types-in-core-and-alloc

  3. https://github.com/rust-lang/rust-bindgen/blob/v0.60.1/src/codegen/mod.rs#L4669-L4696

@madsmtm
Copy link

madsmtm commented Sep 23, 2022

I guess cty can be useful for people with lower MSRV - but that's about it. Maybe a new version could note the crate as deprecated (#![deprecated = "use the new `core::ffi` module instead"]) (along with the re-export)?

@decathorpe
Copy link
Author

Oh, right, I forgot about the #[deprecated] annotation. That sounds like a good solution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants