From e76cde90ce0c9e244ae0cd3624246d557f8114a4 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Mon, 14 Aug 2017 16:31:57 -0700 Subject: 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. --- src/ir/context.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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::(self)); + if self.options.derive_partialeq { + self.cannot_derive_partialeq = Some(analyze::(self)); + } } /// Look up whether the item with `id` can -- cgit v1.2.3