summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorSergey Pepyakin <s.pepyakin@gmail.com>2017-10-29 17:50:02 +0300
committerSergey Pepyakin <s.pepyakin@gmail.com>2017-10-30 17:51:09 +0300
commit230545e7c9d135bbf338642b69ac01c5d1e0bf2d (patch)
tree4f6058b8404b933af6c2dd79250c9d0221b3c34e /src/codegen/mod.rs
parentc1a188c865952771865834848c7f84f2652985c9 (diff)
Refactor derive_partialeq_or_partialord.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 53ed24ff..d36decb0 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -17,7 +17,7 @@ use ir::comp::{Base, Bitfield, BitfieldUnit, CompInfo, CompKind, Field,
use ir::context::{BindgenContext, ItemId};
use ir::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault,
CanDeriveHash, CanDerivePartialOrd, CanDeriveOrd,
- CanDerivePartialEq, CanDeriveEq, CannotDeriveReason};
+ CanDerivePartialEq, CanDeriveEq, CanDerive};
use ir::dot;
use ir::enum_ty::{Enum, EnumVariant, EnumVariantValue};
use ir::function::{Abi, Function, FunctionSig, Linkage};
@@ -1676,10 +1676,7 @@ impl CodeGenerator for CompInfo {
needs_partialeq_impl =
ctx.options().derive_partialeq &&
ctx.options().impl_partialeq &&
- ctx.lookup_can_derive_partialeq_or_partialord(item.id())
- .map_or(true, |x| {
- x == CannotDeriveReason::ArrayTooLarge
- });
+ ctx.lookup_can_derive_partialeq_or_partialord(item.id()) == CanDerive::ArrayTooLarge;
}
if item.can_derive_eq(ctx) {