From e16d1aff3f9d4fb447771e03f60ff16b154dea2a Mon Sep 17 00:00:00 2001 From: Christian Poveda Ruiz <31802960+pvdrz@users.noreply.github.com> Date: Mon, 28 Nov 2022 14:01:25 -0500 Subject: [PATCH] Document callback changes and avoid static lifetime (#2366) --- CHANGELOG.md | 2 ++ bindgen/callbacks.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7519b62..ff6d35ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -156,6 +156,8 @@ ## Changed * Fixed name collisions when having a C `enum` and a `typedef` with the same name. + * The `ParseCallbacks::generated_name_override` now receives `ItemInfo<'_>` as + argument instead of a `&str`. ## Removed diff --git a/bindgen/callbacks.rs b/bindgen/callbacks.rs index 1e48a302..cba406cb 100644 --- a/bindgen/callbacks.rs +++ b/bindgen/callbacks.rs @@ -32,7 +32,10 @@ pub trait ParseCallbacks: fmt::Debug { /// This function will run for every extern variable and function. The returned value determines /// the name visible in the bindings. - fn generated_name_override(&self, _item_info: ItemInfo) -> Option { + fn generated_name_override( + &self, + _item_info: ItemInfo<'_>, + ) -> Option { None }