summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-08-14 16:31:57 -0700
committerNick Fitzgerald <fitzgen@gmail.com>2017-08-14 16:31:57 -0700
commite76cde90ce0c9e244ae0cd3624246d557f8114a4 (patch)
tree43a5300dde70a8e30be9de3f8cb3f6dc87401eeb
parent492714c97cef6e9ebb1cc23414b419118b11fc64 (diff)
Only compute which types we can derive PartialEq for if we'll use it
If we aren't going to derive `PartialEq`, then it doesn't make sense to even run the analysis.
-rw-r--r--src/ir/context.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs
index 750b9982..6209098b 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -1867,7 +1867,9 @@ impl<'ctx> BindgenContext<'ctx> {
/// Compute whether we can derive hash.
fn compute_cannot_derive_partialeq(&mut self) {
assert!(self.cannot_derive_partialeq.is_none());
- self.cannot_derive_partialeq = Some(analyze::<CannotDerivePartialEq>(self));
+ if self.options.derive_partialeq {
+ self.cannot_derive_partialeq = Some(analyze::<CannotDerivePartialEq>(self));
+ }
}
/// Look up whether the item with `id` can