summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-08-14 18:58:17 -0500
committerGitHub <noreply@github.com>2017-08-14 18:58:17 -0500
commit74834c70f50648972e4bb0d48837f180428c1447 (patch)
tree43a5300dde70a8e30be9de3f8cb3f6dc87401eeb /src
parent492714c97cef6e9ebb1cc23414b419118b11fc64 (diff)
parente76cde90ce0c9e244ae0cd3624246d557f8114a4 (diff)
Auto merge of #913 - fitzgen:only-partialeq-if-needed, r=photoszzt
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. r? @photoszzt or @emilio
Diffstat (limited to 'src')
-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