Add rust language editions support by nyurik · Pull Request #3000 · rust-lang/rust-bindgen (original) (raw)

Introduce a new --rust-edition parameter with allowed values 2015, 2018, 2021, and 2024. This allows different code generation depending on the language target.

In this PR, the C-string literals are now generated differently depending on the language edition (literals like c"example" are not available before 2021)

The default language edition uses logic:

In the future, it would be good to add these, if possible: