summaryrefslogtreecommitdiff
path: root/bindgen-integration/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bindgen-integration/build.rs')
-rw-r--r--bindgen-integration/build.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs
index 980d40b9..0f30ad47 100644
--- a/bindgen-integration/build.rs
+++ b/bindgen-integration/build.rs
@@ -1,7 +1,9 @@
extern crate bindgen;
extern crate cc;
-use bindgen::callbacks::{IntKind, MacroParsingBehavior, ParseCallbacks};
+use bindgen::callbacks::{
+ DeriveInfo, IntKind, MacroParsingBehavior, ParseCallbacks,
+};
use bindgen::{Builder, EnumVariation};
use std::collections::HashSet;
use std::env;
@@ -121,10 +123,10 @@ impl ParseCallbacks for MacroCallback {
}
// Test the "custom derives" capability by adding `PartialEq` to the `Test` struct.
- fn add_derives(&self, name: &str) -> Vec<String> {
- if name == "Test" {
+ fn add_derives(&self, info: &DeriveInfo<'_>) -> Vec<String> {
+ if info.name == "Test" {
vec!["PartialEq".into()]
- } else if name == "MyOrderedEnum" {
+ } else if info.name == "MyOrderedEnum" {
vec!["std::cmp::PartialOrd".into()]
} else {
vec![]