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

Supporting 2021-edition features #2998

Closed
nyurik opened this issue Nov 29, 2024 · 0 comments · Fixed by #3002
Closed

Supporting 2021-edition features #2998

nyurik opened this issue Nov 29, 2024 · 0 comments · Fixed by #3002

Comments

@nyurik
Copy link
Contributor

nyurik commented Nov 29, 2024

While working on #2994 to add C-string literals like c"Hello" - a feature only available in the 2021 edition, I realized that bindgen is still using 2018 edition everywhere. Moreover, bindgen has a concept of Rust versions (and which features were enabled in which version), but it has no notion of the edition - targeting 2018 syntax everywhere (essentially unaware the needed edition of the output code).

The CStr support is behind a generate_cstr flag, but that means users would have to either use the older byte array type [u8; #len] if they are currently still on 2018 but have enabled the cstr feature, or they would have to bump their edition to 2021. This does not seem like too big of a deal - CStr is a relatively recent addition, long time after 2021 edition was added.

The bigger issue is overall trend - bindgen may need to generate different code depending on the target edition.

@pvdrz pvdrz linked a pull request Nov 30, 2024 that will close this issue
@pvdrz pvdrz removed a link to a pull request Nov 30, 2024
@pvdrz pvdrz linked a pull request Nov 30, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant