summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/context.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs
index edf320bf..750b9982 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -1804,7 +1804,9 @@ impl<'ctx> BindgenContext<'ctx> {
/// Compute whether we can derive debug.
fn compute_cannot_derive_debug(&mut self) {
assert!(self.cannot_derive_debug.is_none());
- self.cannot_derive_debug = Some(analyze::<CannotDeriveDebug>(self));
+ if self.options.derive_debug {
+ self.cannot_derive_debug = Some(analyze::<CannotDeriveDebug>(self));
+ }
}
/// Look up whether the item with `id` can
@@ -1821,7 +1823,9 @@ impl<'ctx> BindgenContext<'ctx> {
/// Compute whether we can derive default.
fn compute_cannot_derive_default(&mut self) {
assert!(self.cannot_derive_default.is_none());
- self.cannot_derive_default = Some(analyze::<CannotDeriveDefault>(self));
+ if self.options.derive_default {
+ self.cannot_derive_default = Some(analyze::<CannotDeriveDefault>(self));
+ }
}
/// Look up whether the item with `id` can
@@ -1844,7 +1848,9 @@ impl<'ctx> BindgenContext<'ctx> {
/// Compute whether we can derive hash.
fn compute_cannot_derive_hash(&mut self) {
assert!(self.cannot_derive_hash.is_none());
- self.cannot_derive_hash = Some(analyze::<CannotDeriveHash>(self));
+ if self.options.derive_hash {
+ self.cannot_derive_hash = Some(analyze::<CannotDeriveHash>(self));
+ }
}
/// Look up whether the item with `id` can