Skip to content

Commit 74834c7

Browse files
author
bors-servo
authored
Auto merge of rust-lang#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
2 parents 492714c + e76cde9 commit 74834c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ir/context.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,9 @@ impl<'ctx> BindgenContext<'ctx> {
18671867
/// Compute whether we can derive hash.
18681868
fn compute_cannot_derive_partialeq(&mut self) {
18691869
assert!(self.cannot_derive_partialeq.is_none());
1870-
self.cannot_derive_partialeq = Some(analyze::<CannotDerivePartialEq>(self));
1870+
if self.options.derive_partialeq {
1871+
self.cannot_derive_partialeq = Some(analyze::<CannotDerivePartialEq>(self));
1872+
}
18711873
}
18721874

18731875
/// Look up whether the item with `id` can

0 commit comments

Comments
 (0)