diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | libbindgen/Cargo.toml | 1 | ||||
-rw-r--r-- | libbindgen/src/ir/context.rs | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index df1a5156..d5fb4455 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,8 @@ before_install: . ./ci/before_install.sh before_script: cd libbindgen script: - - cargo test --features "$BINDGEN_FEATURES" - - cargo test --release --features "$BINDGEN_FEATURES" + - cargo test --features "$BINDGEN_FEATURES assert_no_dangling_items" + - cargo test --release --features "$BINDGEN_FEATURES assert_no_dangling_items" - git add -A - git diff @ - git diff-index --quiet HEAD diff --git a/libbindgen/Cargo.toml b/libbindgen/Cargo.toml index 6e6b0455..df22afdd 100644 --- a/libbindgen/Cargo.toml +++ b/libbindgen/Cargo.toml @@ -50,6 +50,7 @@ features = ["with-syntex"] version = "0.26" [features] +assert_no_dangling_items = [] default = ["logging"] llvm_stable = [] logging = ["env_logger", "log"] diff --git a/libbindgen/src/ir/context.rs b/libbindgen/src/ir/context.rs index 4cf772dc..ba8ffe82 100644 --- a/libbindgen/src/ir/context.rs +++ b/libbindgen/src/ir/context.rs @@ -473,7 +473,7 @@ impl<'ctx> BindgenContext<'ctx> { /// This function trying to find any dangling references inside of `items` fn assert_no_dangling_references(&self) { - if cfg!(debug_assertions) { + if cfg!(feature = "assert_no_dangling_items") { for _ in self.assert_no_dangling_item_traversal() { // The iterator's next method does the asserting for us. } |