PackageTrack
Sign in Get early access

bindgen

Automatically generates Rust FFI bindings to C and C++ libraries.

0.72.1 365M downloads/mo #309 most downloaded on crates.io rust-lang/rust-bindgen

What this package is like to depend on

Last release 11 months ago

31 Aug 2025

Ships fairly regularly

a new release about every 2 months

Some releases are documented

notes for 58 of 120 stable releases

5 versions withdrawn

withdrawn after publishing

12 years old

126 releases · first in 2014

1 release in the last 12 months

see the full history below

Release timeline

126 releases · Nov 2014 to Aug 2025
2015 2017 2019 2021 2023 2025
Release Pre-release Withdrawn

Releases

latest 60 of 126
  1. 0.72.1 31 Aug 2025
    Release notes

    This is just 0.72.0 with a fix for a breaking change in clang (see #3264 and related).

    Full Changelog: v0.72.0...v0.72.1

    Open source →
  2. 0.72.0 08 Jun 2025
    Release notes

    Added

    • Report enums in ParseCallbacks.
    • Refactor item_name method to use ItemInfo struct.
    • Add callback to modify contents of macro
    • Discovery callbacks for functions and methods.
    • Options to generate uncallable C++ functions.
    • Provide option to get real virtual fn receiver.

    Changed

    • Generate bindings compatible with current rustc version by default.

    Removed

    • Remove unused which-rustfmt feature
    • Remove warning for opaque forward declarations

    Fixed

    • More sophisticated handling of the triple in rust_to_clang_target
    • Rename *-apple-ios-sim to ...simulator
    • Fix OpenCL vectors that use "ext_vector_type".
    • Fix union layout when it contains 0 sized array.
    • Avoid crashing on variadic unions without layout information.
    • Distinguish char16_t.
    • Fix bugs in --clang-macro-fallback
    • Add missed unsafe in the raw_set_bit function
    • Use link_name for dynamic library loading
    • Add "gen" to list of rust keywords in 'rust_mangle'
    • Use appropriate rustfmt --format ... param

    Full Changelog: v0.71.1...v0.72.0

    Open source →
    Release notes

    Added

    • Report enums in ParseCallbacks.
    • Refactor item_name method to use ItemInfo struct.
    • Add callback to modify contents of macro
    • Discovery callbacks for functions and methods.
    • Options to generate uncallable C++ functions.
    • Provide option to get real virtual fn receiver.

    Changed

    • Generate bindings compatible with current rustc version by default.

    Removed

    • Remove unused which-rustfmt feature
    • Remove warning for opaque forward declarations

    Fixed

    • More sophisticated handling of the triple in rust_to_clang_target
    • Rename *-apple-ios-sim to ...simulator
    • Fix OpenCL vectors that use "ext_vector_type".
    • Fix union layout when it contains 0 sized array.
    • Avoid crashing on variadic unions without layout information.
    • Distinguish char16_t.
    • Fix bugs in --clang-macro-fallback
    • Add missed unsafe in the raw_set_bit function
    • Use link_name for dynamic library loading
    • Add "gen" to list of rust keywords in 'rust_mangle'
    • Use appropriate rustfmt --format ... param
    Open source →
  3. 0.71.1 09 Dec 2024
    Release notes

    We are happy to announce a new release of bindgen 🎉

    Changelog

    Fixed

    • Fix --version and --generate-shell-completions (#3040)

    Upgrade bindgen

    Upgrade to this release by updating your Cargo.toml:

    bindgen = "0.71.1"

    Install bindgen-cli

    Install prebuild binaries using cargo binstall

    Just run

    cargo binstall bindgen-cli

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.71.1/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.71.1

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum

    Compile and install binaries from source

    Just run

    cargo install bindgen-cli

    Friends

    Thanks to everyone who contributed to this release!

    • Christian Poveda
    • Jan Alexander Steffens (heftig)

    Contributing

    Want to join us? Check out our CONTRIBUTING.md and take a look
    at some of these issues:

    Want to help improve our documentation? Check out the issues labeled "docs".

    Found a bug with bindgen? File an issue here.

    Open source →
    Release notes

    Fixed

    • Fix --version and --generate-shell-completions (#3040)
    Open source →
  4. 0.71.0 06 Dec 2024
    Release notes

    We are happy to announce a new release of bindgen 🎉

    Changelog

    Added

    • Add the ParseCallbacks::new_item_found callback to expose the original and final name of structs, unions and enums (#2658).
    • Add the field_type_name field to FieldInfo to expose the name of the type of a field (#2863)
    • Add support for custom attributes with the --with-attribute-custom flag (#2866)
    • Allow setting --rust-target to any Rust version supported by bindgen (#2993)
    • Use c-string literals if the --generate-cstr flag is used for Rust targets after 1.77 under the 2021 edition (#2996)
    • Add the --rust-edition flag which allows to select which Rust edition to target. (#3002, #3013)
    • Use unsafe extern instead of extern in blocks for any Rust target after 1.82. (#3015)

    Changed

    • The --wrap-static-fns related options no longer require the experimental feature or flag (#2928)
    • Use the Display implementation instead of the Debug one for BindgenError in bindgen-cli (#3005)

    Removed

    • Dropped support for any Clang versions strictly lower than 9.0 (#2932)
    • Dropped support for any Rust version strictly lower than 1.33 (#2993)

    Fixed

    • Represent opaque types in a FFI-safe way (#2880)
    • Use the underlying type of any atomic type instead of panicking (#2920)
    • Use the right characters for newlines on windows (#2923)
    • Inlined namespaces are properly recognized now (#2950)
    • Unsafe calls to libloading are now wrapped in unsafe blocks when using dynamic loading (#2961)
    • The ParseCallbacks::field_visibility callback is now called for newtypes as well (#2967)
    • Gate the use of the addr_of and addr_of_mut macros under the 1.51 rust version (#2988)

    Upgrade bindgen

    Upgrade to this release by updating your Cargo.toml:

    bindgen = "0.71.0"

    Install bindgen-cli

    Install prebuild binaries using cargo binstall

    Just run

    cargo binstall bindgen-cli

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.71.0/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.71.0

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum

    Compile and install binaries from source

    Just run

    cargo install bindgen-cli

    Friends

    Thanks to everyone who contributed to this release!

    • Brian Ward
    • Christiaan Biesterbosch
    • Christian Poveda
    • David Tolnay
    • Emilio Cobos Álvarez
    • Enes
    • George Bateman
    • John Baublitz
    • Jonathan Schwender
    • Jubilee Young
    • Martin Kröning
    • Maxence Younsi
    • Miguel Ojeda
    • Mossa
    • myyrakle
    • Nik Konyuchenko
    • Valentin
    • Yuri Astrakhan
    • Zhang Jingqiang

    Contributing

    Want to join us? Check out our CONTRIBUTING.md and take a look
    at some of these issues:

    Want to help improve our documentation? Check out the issues labeled "docs".

    Found a bug with bindgen? File an issue here.

    Open source →
    Release notes

    Added

    • Add the ParseCallbacks::new_item_found callback to expose the original and final name of structs, unions and enums (#2658).
    • Add the field_type_name field to FieldInfo to expose the name of the type of a field (#2863)
    • Add support for custom attributes with the --with-attribute-custom flag (#2866)
    • Allow setting --rust-target to any Rust version supported by bindgen (#2993)
    • Use c-string literals if the --generate-cstr flag is used for Rust targets after 1.77 under the 2021 edition (#2996)
    • Add the --rust-edition flag which allows to select which Rust edition to target. (#3002, #3013)
    • Use unsafe extern instead of extern in blocks for any Rust target after 1.82. (#3015)

    Changed

    • The --wrap-static-fns related options no longer require the experimental feature or flag (#2928)
    • Use the Display implementation instead of the Debug one for BindgenError in bindgen-cli (#3005)

    Removed

    • Dropped support for any Clang versions strictly lower than 9.0 (#2932)
    • Dropped support for any Rust version strictly lower than 1.33 (#2993)

    Fixed

    • Represent opaque types in a FFI-safe way (#2880)
    • Use the underlying type of any atomic type instead of panicking (#2920)
    • Use the right characters for newlines on windows (#2923)
    • Inlined namespaces are properly recognized now (#2950)
    • Unsafe calls to libloading are now wrapped in unsafe blocks when using dynamic loading (#2961)
    • The ParseCallbacks::field_visibility callback is now called for newtypes as well (#2967)
    • Gate the use of the addr_of and addr_of_mut macros under the 1.51 rust version (#2988)
    Open source →
  5. 0.70.1 20 Aug 2024
    Release notes

    Install bindgen-cli 0.70.1

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.70.1/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.70.1

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum
    Open source →
    Release notes

    Added

    Changed

    Removed

    Fixed

    • Fix regression where the const layout tests were triggering the unnecessary_operation and identity_op clippy warnings.

    Security

    Open source →
  6. 0.70.0 16 Aug 2024
    Release notes

    Install bindgen-cli 0.70.0

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.70.0/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.70.0

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum
    Open source →
    Release notes

    Added

    • Add target mappings for riscv64imac and riscv32imafc.
    • Add a complex macro fallback API (#2779).
    • Add option to use DST structs for flexible arrays (--flexarray-dst, #2772).
    • Add option to dynamically load variables (#2812).
    • Add option in CLI to use rustified non-exhaustive enums (--rustified-non-exhaustive-enum, #2847).
    • Add field_type_name to FieldInfo.

    Changed

    • Remove which and lazy-static dependencies (#2809, #2817).
    • Generate compile-time layout tests (#2787).
    • Print bindgen-cli errors to stderr instead of stdout (#2840)

    Removed

    Fixed

    • Fix --formatter=prettyplease not working in bindgen-cli by adding prettyplease feature and enabling it by default for bindgen-cli (#2789) .
    • Fix --allowlist-item so anonymous enums are no longer ignored (#2827).
    • Use clang_getFileLocation instead of clang_getSpellingLocation to fix clang-trunk (#2824).
    • Fix generated constants: f64::INFINITY, f64::NEG_ INFINITY, f64::NAN (#2854).

    Security

    Open source →
  7. 0.69.5 08 Oct 2024
    Release notes

    Install bindgen-cli 0.69.5

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.5/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.69.5

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum
    Open source →
  8. 0.69.4 04 Feb 2024
    Release notes

    Install bindgen-cli 0.69.4

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.4/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.69.4

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz macOS Apple Silicon checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz macOS Intel checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz Linux x64 checksum
    Open source →
    Release notes

    Added

    Changed

    • Allow older itertools. (#2745)

    Removed

    Fixed

    Security

    Open source →
  9. 0.69.3 04 Feb 2024
    Release notes

    Install bindgen-cli 0.69.3

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.3/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.69.3

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz macOS Apple Silicon checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz macOS Intel checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz Linux x64 checksum
    Open source →
    Release notes

    Added

    • Added blocklist_var (#2731)
    • Stabilized thiscall_abi (#2661)

    Changed

    • Use CR consistently on windows (#2698)
    • Replaced peeking_take_while by itertools (#2724)

    Removed

    Fixed

    • Try to avoid repr(packed) for explicitly aligned types when not needed (#2734)
    • Improved destructor handling on Windows (#2663)
    • Support Float16 (#2667)
    • Fix alignment contribution from bitfields (#2680)
    • Fixed msrv build.

    Security

    • Updated shlex dependency (RUSTSEC-2024-0006)
    Open source →
  10. 0.69.2 13 Jan 2024
    Release notes

    Install bindgen-cli 0.69.2

    Install prebuilt binaries via shell script

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.2/bindgen-cli-installer.sh | sh

    Download bindgen-cli 0.69.2

    File Platform Checksum
    bindgen-cli-aarch64-apple-darwin.tar.xz macOS Apple Silicon checksum
    bindgen-cli-x86_64-apple-darwin.tar.xz macOS Intel checksum
    bindgen-cli-x86_64-unknown-linux-gnu.tar.xz Linux x64 checksum
    Open source →
    Release notes

    Added

    Changed

    Removed

    Fixed

    • Fixed generation of extern "C" blocks with llvm 18+. See #2689.

    Security

    Open source →
  11. 0.69.1 02 Nov 2023
    Release notes

    Fixed

    • Allow to run bindgen -v without an input header argument.
    Open source →
  12. 0.69.0 01 Nov 2023
    Release notes

    Added

    • Added the ParseCallbacks::header_file callback which runs on every filename passed to Builder::header.
    • Added the CargoCallbacks::new constructor which emits a cargo-rerun line for every input header file by default.
    • Added the CargoCallbacks::rerun_on_header_files method to configure whether a cargo-rerun line should be emitted for every input header file.

    Changed

    • The --wrap-static-fns feature was updated so function types that has no argument use void as its sole argument.
    • CargoCallbacks is no longer a unit-like struct and the CargoCallbacks constant was added to mitigate the breaking nature of this change. This constant has been marked as deprecated and users will have to use the new CargoCallbacks::new method in the future.

    Removed

    Fixed

    • Allow compiling bindgen-cli with a static libclang.
    • Emit an opaque integer type for pointer types that don't have the same size as the target's pointer size.
    • Avoid escaping Objective-C method names unless they are Self, self, crate or super.

    Security

    Open source →
  13. 0.68.1 06 Sep 2023
    Release notes

    Fixed

    • Fixed errors on the windows artifact build process.
    Open source →
  14. 0.68.0 06 Sep 2023 withdrawn
    Release notes

    Added

    • The system ABI is now supported as an option for the --override-abi flag.
    • The allowlist_item method and the --allowlist-item flag have been included to filter items regardless or their kind.
    • Include installers as release artifacts on Github.

    Changed

    • The Clone implementation for _BindgenUnionField has been changed to pass the incorrect_clone_impl_on_copy_type Clippy lint.
    • The c_unwind ABI can be used without a feature gate for any Rust target version equal to or greater than 1.71. This comes as a result of the ABI being stabilised (in Rust 1.71).
    • Formatting changes when using prettyplease as a formatter due to a new prettyplease version.
    • Avoid generating invalid CStr constants when using the --generate-cstr option.

    Removed

    • The extra_assert and extra_assert_eq macros are no longer exported.

    Fixed

    • Bindgen no longer panics when parsing an objective-C header that includes a Rust keyword that cannot be a raw identifier, such as: self, crate, super or Self.
    Open source →
  15. 0.66.1 19 Jun 2023
    Release notes

    Removed

    • Revert source order sorting (#2543) due to correctness regressions #2558.
    Open source →
  16. 0.66.0 14 Jun 2023
    Release notes

    Added

    • Added the --generate-cstr CLI flag to generate string constants as &CStr instead of &[u8]. (Requires Rust 1.59 or higher.)
    • Added the --generate-shell-completions CLI flag to generate completions for different shells.
    • The --wrap-static-fns option can now wrap va_list functions as variadic functions with the experimental ParseCallbacks::wrap_as_variadic_fn method.
    • Add target mappings for riscv32imc and riscv32imac.
    • Add the ParseCallbacks::field_visibility method to modify field visibility.

    Changed

    • Non-UTF-8 string constants are now generated as references (&[u8; SIZE]) instead of arrays ([u8; SIZE]) to match UTF-8 strings.
    • Wrappers for static functions that return void no longer contain a return statement and only call the static function instead.
    • The --wrap-static-fns option no longer emits wrappers for static variadic functions.
    • Depfiles generated with --depfile or Builder::depfile will now properly generate module names and paths that include spaces by escaping them. To make the escaping clear and consistent, backslashes are also escaped.
    • Updated bitflags dependency to 2.2.1. This changes the API of CodegenConfig.
    • Prettyplease formatting is gated by an optional, enabled by default Cargo feature when depending on bindgen as a library.
    • Items are now parsed in the order they appear in source files. This may result in auto-generated _bindgen_* names having a different index.
    • Use default visibility for padding fields: Previously, padding fields were always public. Now, they follow the default visibility for the type they are in.
    • Compute visibility of bitfield unit based on actual field visibility: A bitfield unit field and its related functions now have their visibility determined based on the most private between the default visibility and the actual visibility of the bitfields within the unit.

    Removed

    • Remove redundant Cargo features, which were all implicit:

      • bindgen-cli: env_logger and log removed in favor of logging
      • bindgen (lib):
        • log removed in favor of logging
        • which removed in favor of which-logging
        • annotate-snippets removed in favor of experimental
    • Prettyplease is available as a Formatter variant now.

    Open source →
  17. 0.65.1 10 Apr 2023
    Release notes

    Fixed

    • The Builder::rustfmt_bindings method was added back and tagged as deprecated instead of being removed.
    • Broken documentation links were fixed.
    Open source →
  18. 0.65.0 10 Apr 2023 withdrawn
    Release notes

    Added

    • Added the Builder::default_visibility method and the --default-visibility flag to set the default visibility of fields. (#2338)
    • Added the --formatter CLI flag with the values none, rustfmt and prettyplease to select which tool will be used to format the bindings. The default value is rustfmt. (#2453)
    • Added the Builder::formatter method and the Formatter type to select which tool will be used to format the bindings. (#2453)
    • Added the Builder::emit_diagnostics method and the --emit-diagnostics flag to enable emission of diagnostic messages under the experimental feature. (#2436)
    • Added support for the "efiapi" calling convention (#2490).
    • Added the ParseCallbacks::read_env_var method which runs everytime bindgen reads and environment variable. (#2400)
    • Added the ParseCallbacks::generated_link_name_override method which allow overriding the link name of items. (#2425)
    • Add support for C enums when generating code while using the --wrap-static-fns feature. (#2415)

    Changed

    • Static functions with no arguments use void as their single argument instead of having no arguments when the --wrap-static-fns flag is used. (#2443)
    • The source file generated when the --wrap-static-fns flag is enabled now contains #include directives with all the input headers and all the source code added with the header_contents method. (#2447)
    • The source file generated when the --wrap-static-fns flag no longer uses asm labeling and the link name of static wrapper functions is allowed to be mangled. (#2448)
    • The documentation of the generated type aliases now matches the comments of their typedef counterparts instead of using the comments of the aliased types. (#2463)
    • The Builder::rustfmt_bindings methods and the --no-rustfmt-bindings flag are now deprecated in favor of the formatter API. (#2453)

    Removed

    • The following deprecated flags were removed: --use-msvc-mangling, --rustfmt-bindings and --size_t-is-usize. (#2408)
    • The Bindings::emit_warnings and Bindings::warnings methods were removed in favor of --emit-diagnostics. (#2436)
    • Bindgen no longer generates C string constants that cannot be represented as byte slices. (#2487)
    Open source →
  19. 0.64.0 07 Feb 2023
    Release notes

    Added

    • Added a new set of flags --with-derive-custom, --with-derive-custom-struct, --with-derive-custom-enum and --with-derive-custom-enum to add custom derives from the CLI.
    • Added the --experimental flag on bindgen-cli and the experimental feature on bindgen to gate experimental features whose implementation is incomplete or are prone to change in a non-backwards compatible manner.
    • Added a new set of flags and their equivalent builder methods --wrap-static-fns, --wrap-static-fns-suffix and --wrap-static-fns-path to generate C function wrappers for static or static inline functions. This feature is experimental.

    Changed

    • Fixed name collisions when having a C enum and a typedef with the same name.
    • The ParseCallbacks::generated_name_override method now receives ItemInfo<'_> as argument instead of a &str.
    • Updated the clang-sys crate version to 1.4.0 to support clang 15.
    • The return type is now omitted in signatures of functions returning void.
    • Updated the clap dependency for bindgen-cli to 4.
    • Rewrote the bindgen-cli argument parser which could introduce unexpected behavior changes.
    • The ParseCallbacks::add_derives method now receives DeriveInfo<'_> as argument instead of a &str. This type also includes the kind of target type.
    Open source →
    Release notes

    Added

    • Added a new set of flags --with-derive-custom, --with-derive-custom-struct, --with-derive-custom-enum and --with-derive-custom-enum to add custom derives from the CLI.
    • Added the --experimental flag on bindgen-cli and the experimental feature on bindgen to gate experimental features whose implementation is incomplete or are prone to change in a non-backwards compatible manner.
    • Added a new set of flags and their equivalent builder methods --wrap-static-fns, --wrap-static-fns-suffix and --wrap-static-fns-path to generate C function wrappers for static or static inline functions. This feature is experimental.

    Changed

    • Fixed name collisions when having a C enum and a typedef with the same name.
    • The ParseCallbacks::generated_name_override method now receives ItemInfo<'_> as argument instead of a &str.
    • Updated the clang-sys crate version to 1.4.0 to support clang 15.
    • The return type is now ommited in signatures of functions returning void.
    • Updated the clap dependency for bindgen-cli to 4.
    • Rewrote the bindgen-cli argument parser which could introduce unexpected behavior changes.
    • The ParseCallbacks::add_derives method now receives DeriveInfo<'_> as argument instead of a &str. This type also includes the kind of target type.
    Open source →
  20. 0.63.0 22 Nov 2022
    Release notes

    Added

    • new feature: process_comments method to the ParseCallbacks trait to handle source code comments.

    Changed

    • Only wrap unsafe operations in unsafe blocks if the --wrap_unsafe_ops option is enabled.
    • Replace the name: &str argument for ParseCallbacks::add_derives by info: DeriveInfo.
    • All the rust targets equal or lower than 1.30 are being deprecated and will be removed in the future. If you have a good reason to use any of these targets, please report it in the issue tracker.

    Removed

    • The following deprecated methods and their equivalent CLI arguments were removed: whitelist_recursively, hide_type, blacklist_type, blacklist_function, blacklist_item, whitelisted_type, whitelist_type, whitelist_function, whitelisted_function, whitelist_var, whitelisted_var, unstable_rust.
    Open source →
  21. 0.62.0 17 Nov 2022
    Release notes

    Added

    • new feature: --override-abi flag to override the ABI used by functions matching a regular expression.
    • new feature: allow using the C-unwind ABI in --override-abi on nightly rust.

    Changed

    • Regex inputs are sanitized so alternation (a|b) is handled correctly but wildcard patterns (*) are now considered invalid. The .* pattern can be used as a replacement.
    • the ParseCallbackstrait does not require to implement UnwindSafe.
    • the Builder::parse_callbacks method no longer overwrites previously added callbacks and composes them in a last-to-first manner.
    • any generated rust code containing unsafe operations inside unsafe functions is wrapped in unsafe blocks now.

    Fixed

    • Various issues with upcoming clang/libclang versions have been fixed.
    Open source →
  22. 0.61.0 16 Oct 2022
    Release notes

    Released 2022/10/16

    Added

    • new feature: --sort-semantically flag to sort the output in a predefined manner (#1743).
    • new feature: Bindgen::emit_warnings method to emit warnings to stderr in build scripts.
    • new feature: --newtype-global-enum flag to generate enum variants as global constants.
    • new feature: --default-non-copy-union-style flag to set the default style of code used to generate unions with non-Copy members.
    • new feature: --bindgen-wrapper-union flag to mark any union that matches a regex and has a non-Copy member to use a bindgen-generated wrapper for its fields.
    • new feature: --manually-drop-union flag to mark any union that matches a regex and has a non-Copy member to use ManuallyDrop.
    • new feature: --merge-extern-blocks flag to merge several extern blocks that have the same ABI.
    • new feature: --no-size_t-is-usize flag to not bind size_t as usize.
    • new feature: Builder implements Clone.

    Changed

    • clap and regex have been updated, new msrv is 1.57.
    • The --enable-function-attribute-detection flag is also used to detect diverging functions so the generated bindings use ! as the return type.
    • The --size_t-is-usize flag is enabled by default.
    • Unused type aliases for <stdint.h> types are no longer emitted.
    • The blocklist options now can be used to block objective-C methods.
    • The core::ffi module is used the sized raw integer types instead of std::os::raw if the Rust target version is 1.64 or higher and the --use-core flag is enabled.
    • The bindgen CLI utility must be installed using cargo install bindgen-cli now.
    • Using bindgen as a library no longer pulls clap and any other CLI related dependencies.

    Fixed

    • Const correctness of incomplete arrays has been fixed. (#2301)
    • C++ inline namespaces don't panic. (#2294)
    Open source →
  23. 0.60.1 06 Jun 2022
    Release notes

    Released 2022/06/06

    Fixed

    • Fixed stack overflow in generated tests for structs with many fields (#2219).
    Open source →
  24. 0.60.0 05 Jun 2022
    Release notes

    Released 2022/06/05

    Added

    • Objective-C structs now derive Debug and Copy to support C and Objective-C structs. (#2176)
    • Allow fully-qualified derives. (#2156)
    • Bindings generation now returns a more suitable error (#2125)
    • --version --verbose now prints clang version (#2140).
    • Experimental vtable generation (#2145).
    • Added an --allowlist-file option (#2122).
    • Support for vectorcall ABI (#2177).

    Fixed

    • Fixed lifetimes with Objective-C trait templates. (#2176)
    • Fixed objc imports for non-#[macro_use] use. (#2176)
    • Handle differences between clang and rustc targets for RISCV (#2137).
    • BINDGEN_EXTRA_CLANG_ARGS is respected on the CLI now (#1723).
    • Use common type alias for anonymous enums in consts mode (#2191)
    • Look for #[must_use] in typedefs (#2206).
    • Fixed derive on packed structs (#2083).
    • Fixed warnings on layout tests (#2203).

    Changed

    • cexpr, clap, and nom have been updated, new msrv is 1.54.

    Removed

    • Support for ancient libclang versions has been removed.
    Open source →
  25. 0.59.2 26 Nov 2021
    Release notes

    Released 2021/11/26

    • cexpr+env_logger bump.
    • Various fixes for C++ crashes / hangs.
    • Enums now respect annotations and derives properly in more cases.
    • Some more APIs (blocklist-file, etc).
    • 'static lifetime is elided when appropriate.
    Open source →
  26. 0.59.1 25 Jul 2021
    Release notes

    Released 2021/07/26

    Fixed

    • Fixed incorrect bitfield constructors generated for very large bitfields (#2082).
    Open source →
  27. 0.59.0 20 Jul 2021
    Release notes

    Released 2021/07/20

    Added

    • Support emitting Makefile-syntax depfiles (#2026)
    • Add a C naming option (#2045)
    • Allow explicit padding (#2060)
    • Add custom derives callback (#2059)
    • Let Rust derive everything but Default for large arrays in 1.47 and later (#2070).

    Fixed

    • Constants now have docstrings (#2027)
    • Don't generate bindings for deleted member functions. (#2044)
    • Zero out padding in custom Default trait implementations (#2051)
    • Identify forward declarations in params. (#2052)
    • Add env var EXTRA_CLANG_ARGS_<target>. (#2031)

    Changed

    • cexpr and nom have been updated, new msrv is 1.44 (#2073).
    Open source →
  28. 0.58.1 06 Apr 2021
    Release notes

    Released 2021/04/06

    Added

    • Re-introduced unintentionally removed bindgen::Builder::whitelist_recursively (deprecated in favor of bindgen::Builder::allowlist_recursively). [#2022][]
    Open source →
  29. 0.58.0 03 Apr 2021
    Release notes

    Released 2021/04/03

    Added

    • Add option to translate enum integer types to native Rust integer types. [#2004][]
    • Add callback to check derives for blocklisted types. [#2007][]
    • Add a flag to ensure all symbols are resolved when a library is loaded. [#2013][]
    • Add from_library for generated dynamic library structs [#2011][].

    Fixed

    Changed

    Deprecated

    • bindgen::Builder::whitelist_type is deprecated in favor of bindgen::Builder::allowlist_type. [#1812][]

    • bindgen::Builder::whitelist_function is deprecated in favor of bindgen::Builder::allowlist_function. [#1812][]

    • bindgen::Builder::whitelist_var is deprecated in favor of bindgen::Builder::allowlist_var. [#1812][]

    • --whitelist-type is deprecated in favor of --allowlist-type. [#1812][]

    • --whitelist-function is deprecated in favor of --allowlist-function. [#1812][]

    • --whitelist-var is deprecated in favor of --allowlist-var. [#1812][]

    • bindgen::Builder::blacklist_type is deprecated in favor of bindgen::Builder::blocklist_type. [#1812][]

    • bindgen::Builder::blacklist_function is deprecated in favor of bindgen::Builder::blocklist_function. [#1812][]

    • bindgen::Builder::blacklist_item is deprecated in favor of bindgen::Builder::blocklist_item. [#1812][]

    • --blacklist-type is deprecated in favor of --blocklist-type. [#1812][]

    • --blacklist-function is deprecated in favor of --blocklist-function. [#1812][]

    • --blacklist-item is deprecated in favor of --blocklist-item. [#1812][]

    Removed

    Fixed

    Security


    Open source →
  30. 0.57.0 01 Feb 2021
    Release notes

    Released 2021/02/01

    Added

    • Expose module-raw-lines to the CLI (#1936)
    • Added an option to fit macro constants to smaller types (#1945)
    • Add an option to respect C++ access specifiers on fields (#1968)

    Fixed

    • Improved C++ auto-detection (#1933)
    • Fixed layout of bitfields in some edge cases (#1950)
    • Escape the dyn keyword properly (#1951)
    • Use absolute paths for unsaved files passed to clang (#1857).
    Open source →
  31. 0.56.0 26 Nov 2020
    Release notes

    Released 2020/11/26

    Added

    • Objective-c bindings generate From<ChildClass> for ParentClass as well as TryFrom<ParentClass> for ChildClass (#1883).
    • Experimental dynamic library support via dynamic_library_name (#1846).
    • Option to disable deriving Default on a per-struct basis (#1930).

    Changed

    • Objective-c bindings borrow self rather than take ownership (#1883).
    • Templates and enums now correctly use the same naming scheme as other types (#1891).

    Fixed

    • Constructors in wasm32 now return a value. (#1877).
    • Fixed objective-c protocol impl blocks for parent classes's protocols (#1883).

    Open source →
  32. 0.55.1 24 Aug 2020
    Release notes

    Released 2020/08/24.

    Fixed

    • Fixed a regression where anonymous enums referenced by members or such won't generate valid Rust code. (#1882).

    Open source →
  33. 0.55.0 24 Aug 2020
    Release notes

    Released 2020/08/23.

    Removed

    • Support for libclang 3.8 has been removed (#1830).

    Added

    • Added options to avoid deriving the Debug trait (#1858).

    • Added options to allow to override the default anonymous field prefix (#1859).

    • Added options to allow to override the default macro integer type from the command line (#1863).

    Changed

    • Typed anonymous enums now generate better code (#1850).

    • Objective-C bindings are more idiomatic now (#1847).

    • Updated to clang-sys 1.0. Minimum supported rust version is 1.40 as a consequence of that change.

    Fixed

    • Fixed constness of multi-dimensional arrays in some cases (#1861).

    • Fixed wrong target given to clang when compiling with a target which doesn't match the target clang expects (#1870, #1878).

    • Fixed wrong flags being computed for cross-compilation cases where the target wasn't explicitly provided via clang flags (#1872).

    Thanks again to all the awesome contributors that sent patches included in this release!


    Open source →
  34. 0.54.1 06 Jul 2020 withdrawn
    Release notes

    Released 2020/07/06.

    Yanked: The change in #1798 is technically breaking, see PR for details.

    Added

    • Added ParseCallbacks::func_macro to be able to process function-like macros. (#1792).

    • Allowed IntKind::Custom to represent paths instead of idents (#1800).

    Changed

    • Generated comment now includes the bindgen version, and can be disabled (#1814).

    • Various documentation improvements.

    Fixed

    • Typedefs for types with the same names as rust primitive types compiles (#1798).

    • Bindgen dependencies will now get rebuilt when various environment variables that affect bindgen change (#1809, #1813).

    • Various fixes to command_line_flags (#1816, #1819, #1821).

    • Functions that start with operator now get properly generated (#1817).

    Thanks to all the awesome contributors that sent patches included in this release!


    Open source →
  35. 0.54.0 21 May 2020
    Release notes

    Released 2020/05/21.

    Added

    • New command line flag to allow disabling untagged unions (#1789).

    Changed

    • Various documentation improvements (#1764, #1751, #1757).
    • Better Objective-C support (#1722, #1750).

    Fixed

    • Rust method wrappers are not emitted for blacklisted functions (#1775).
    • Fixed function signatures in some edge cases involving Objective-C or __stdcall (#1781).

    Open source →
  36. 0.53.3 21 May 2020
    Release notes

    Released 2020/05/21.

    Note: This release contains the same fixes and additions as 0.54.0, but without the Objective-C breaking changes

    Added

    • New command line flag to allow disabling untagged unions (#1789).

    Fixed

    • Rust method wrappers are not emitted for blacklisted functions (#1775).
    • Fixed function signatures in some edge cases involving Objective-C or __stdcall (#1781).

    Open source →
  37. 0.53.2 09 Mar 2020
    Release notes

    Released 2020/03/10.

    Changed

    • clang-sys and cexpr have been updated (#1741 and #1744).
    • Runtime of some commands has been improved (#1737)
    • Some error messages have been improved (#1734).

    Open source →
  38. 0.53.1 03 Feb 2020
    Release notes

    Released 2020/02/03.

    Added

    • Opt-in to convert size_t to usize again (#1720).

    Open source →
  39. 0.53.0 02 Feb 2020
    Release notes

    Released 2020/02/02.

    Added

    • Support for wasm_import_module. (#1691).
    • non_exhaustive feature is now stable (#1698).
    • Various objective-C improvements (#1702).

    Changed

    • Removed size_t to usize conversion rule (#1688).

    Fixed

    • Various unneeded padding fields shouldn't be generated anymore (#1710).
    • Bitfields on packed structs should generate correct layout (#1717).
    • Too large bitfield blocks now generate compiling code (#1719).

    Open source →
  40. 0.52.0 19 Nov 2019
    Release notes

    Released 2019/11/19.

    Added

    • Added newtype enum style, much like bitfield but without the bitwise ops (#1677).
    • Added support for MaybeUninit rather than mem::uninitialized() (#1666).
    • Allowed static linking (#1620) behind a feature. Note that if you're using default-features = false, you probably want to use the "runtime" feature to get the same behavior as before.

    Changed

    • Use c_void from core when --use-core is specified and available (#1634).
    • Various dependencies and features are non-default now (like regex unicode features).

    Fixed

    • Fixed crash when unknown keywords are used before a namespace (#1678).
    • Do not generate implementation for clone for flexible array members (#1664).
    • Fixed #[must_use] support for libclang 9+ (#1646).
    • Fixed BitfieldUnit constructor to handle 64 bit wide bitfields on 32 bit (#1640).
    • Added a ParseCallbacks handler for included files. (#1637).
    Open source →
  41. 0.51.1 23 Sep 2019
    Release notes

    Released 2019/09/23.

    Fixed

    • Mismatched Ord and PartialOrd implementations were fixed, which regresses bindgen in funny ways when using rustc nightly. Dot releases for a few of the previous versions of bindgen will be created with this fix. Also, a v0.51.1-oldsyn version was uploaded without the syn update. #1627

    Changed

    • Syn and related dependencies have been updated. #1611

    • Switches added to allow less dependencies. In particular: It won't pull failure and related dependencies by default, and there's a default-on which-rustfmt feature which allows to get rid of which altogether. #1615 / #1625

    • fxhash dependency was switched to rustc-hash. #1626

    Open source →
  42. 0.51.1-oldsyn 24 Sep 2019 pre-release

    Nothing published for this version

  43. 0.51.0 26 Jul 2019
    Release notes

    Released 2019/07/26.

    Fixed

    • Improve workaround for LLVM stack overflow when evaluating value-dependent expressions. #1591

    • Bindgen will properly detect the layout of incomplete arrays. #1592

    • Bindgen will properly detect the layout of empty unions and forward declarations of unions. #1593 and #1595. Thanks @pmarks!

    Changed

    • Refactored the way layout of wchar_t is computed. This is a breaking change since IntKind::WChar (exposed in ParseCallbacks) no longer needs a size member. #1596

    Added

    • Bindgen now reads RUSTFMT in the environment to try to find a suitable rustfmt binary. #1602
    Open source →
  44. 0.50.1 23 Sep 2019

    Nothing published for this version

  45. 0.50.0 02 Jul 2019
    Release notes

    Released 2019/07/01.

    Added

    • Fixed pointers to Objective C blocks #1582.

    • Various bindgen auto-generated types are now constructible in const fn contexts #1571

    • It is possible to generate #[non_exhaustive] enums for rust nightly targets. #1575

    • It is possible to avoid building clap now if you're using bindgen as a library. #1581.

    Open source →
  46. 0.49.4 04 Dec 2019

    Nothing published for this version

  47. 0.49.3 25 Jun 2019 withdrawn
    Release notes

    Released 2019/06/25. YANKED

    Added

    • Various bindgen auto-generated types are now constructible in const fn contexts #1571

    • It is possible to generate #[non_exhaustive] enums for rust nightly targets. #1575

    • It is possible to avoid building clap now if you're using bindgen as a library. #1581.

    Open source →
  48. 0.49.2 22 May 2019
    Release notes

    Released 2019/05/22

    Changed

    • Bindgen now has an option to generate array arguments as pointer to the array, not to the element (so void foo(int arr[2]) would be generated as arr: *mut [c_int; 2] rather than arr: *mut c_int. Thanks @elichai! #1564.
    Open source →
  49. 0.49.1 16 May 2019
    Release notes

    Released 2019/05/16

    Fixed

    • Bindgen will not emit #[link_name] attributes in win32 and macos for C functions and constants where it can detect it's not needed (thanks @michaelwoerister!). #1558

    Changed

    • Bindgen will no longer use hashbrown internally, and will use fxhash and std::HashMap. This is equivalent for newer rustcs since hashbrown was merged in libstd, and the performance difference should be close to zero for older rustcs.
    Open source →
  50. 0.49.0 27 Mar 2019
    Release notes

    Released 2019/03/27

    Added

    • BINDGEN_EXTRA_CLANG_ARGS environment variable was added (thanks @jhwgh1968!). #1537

    Fixed

    • Bindgen will properly name parameters inside nested function pointer declarations (thanks @flowbish!). #1535

    Changed

    • Derive code was greatly improved by @jethrogb. #1540
    • Derive analysis now handles trivial types more gracefully. #1492
    • clang-sys was updated by @eclipseo. [#1539][]
    • bindgen should now get include paths correctly even when --target is specified. The detect_include_paths option can be used to opt-out of this behavior.
    Open source →
  51. 0.48.1 06 Mar 2019
    Release notes

    Released 2019/03/06

    Fixed

    • Bindgen will properly lay out types that use reference members. #1531

    Open source →
  52. 0.48.0 04 Mar 2019
    Release notes

    Released 2019/03/04

    Changed

    • Default rust target was changed to 1.33, which means that bindgen can get much more often the layout of structs right. #1529

    Fixed

    • Bindgen will output repr(align) just when needed for unions. #1498

    Open source →
  53. 0.47.4 13 Nov 2020
    Release notes

    Released 2020/11/13

    Added

    • Backported BINDGEN_EXTRA_CLANG_ARGS support per request (#1910).

    Open source →
  54. 0.47.3 25 Feb 2019
    Release notes

    Released 2019/02/25

    Changed

    • Allowed to build with which 1.0.

    Open source →
  55. 0.47.2 23 Feb 2019
    Release notes

    Released 2019/02/22

    Fixed

    • @flowbish fixed code generation for nested function prototypes. #1508
    • Some complex C++ constructs no longer panic on code generation #1513
    • Implicit template parameters are now appended to base classes #1515
    • @flier fixed single-argument block pointers #1519
    • Bindgen won't panic when parsing an undeduced auto type #1525

    Open source →
  56. 0.47.1 29 Jan 2019
    Release notes

    Released 2019/02/02

    Changed

    • @luser improved the error message when rustfmt cannot be found #1501

    Fixed

    • Reverted clang-sys update for regressions #1505

    Open source →
  57. 0.47.0 19 Jan 2019
    Release notes

    Released 2019/01/19

    Changed

    • #pragma pack(n) is now translated to #[repr(C, packed(n))] when targeting Rust 1.33+. #537
    • Bitfield enums now use #[repr(transparent)] instead of #[repr(C)] when targeting Rust 1.28+. #1474

    Fixed

    • #[repr(packed)] is now properly added if the struct only contains a vtable. #1495
    • clang-sys should now more accurately find libclang versions when multiple of them are available. #1489

    Open source →
  58. 0.46.0 29 Dec 2018

    Nothing published for this version

  59. 0.45.0 14 Dec 2018

    Nothing published for this version

  60. 0.44.0 30 Nov 2018

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive