Skip to content

Commit f8f842b

Browse files
committed
rust: update custom rust-bindgen fork with new allow_or_block_item().
The rust-bindgen fork has been updated to use a new single method allow_or_block_item() instead of two separated `allow_item()` and `block_item()`. Change-Id: I042048f5f539d1a6eeed01c164b397bc69128546 Priv-Id: 37fef0fcf045641bca0ab675f658e7cfc0645697
1 parent 394dd37 commit f8f842b

3 files changed

Lines changed: 49 additions & 47 deletions

File tree

Cargo.lock

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ ptr_as_ptr = "allow"
220220

221221
[workspace.dependencies]
222222
# Used by waf-cargo-build
223-
bindgen = { version = "0.72.0", git = "https://github.com/Intersec/rust-bindgen.git", branch = "intersec/add-parse-callbacks-methods" }
223+
bindgen = { version = "0.72.0", git = "https://github.com/Intersec/rust-bindgen.git", rev = "f819034c69c6abd669e7ef12080d53546fdb1d3b" }
224224
cc = "1.2.25"
225225
serde = { version = "1.0.219", features = ["derive"] }
226226
serde_json = "1.0.140"

rust/waf-cargo-build/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//!
2727
//! The main entry point is the structure [`WafBuild`].
2828
29-
use bindgen::callbacks::{DeriveInfo, ItemInfo, ParseCallbacks, TypeKind};
29+
use bindgen::callbacks::{AllowOrBlockItem, DeriveInfo, ItemInfo, ParseCallbacks, TypeKind};
3030
use bindgen::{Builder, EnumVariation};
3131
use serde::Deserialize;
3232
use serde::de::DeserializeOwned;
@@ -204,8 +204,10 @@ impl LibcommonParseCallbacks {
204204

205205
impl ParseCallbacks for LibcommonParseCallbacks {
206206
/// Block the items in the list
207-
fn block_item(&self, item_info: ItemInfo<'_>) -> bool {
208-
self.blocked_items.contains(item_info.name)
207+
fn allow_or_block_item(&self, item_info: &ItemInfo<'_>) -> Option<AllowOrBlockItem> {
208+
self.blocked_items
209+
.contains(item_info.name)
210+
.then_some(AllowOrBlockItem::Block)
209211
}
210212

211213
/// Provide a list of custom derive attributes.

0 commit comments

Comments
 (0)