Skip to content

Commit

Permalink
Refactor derive_partialeq_or_partialord.
Browse files Browse the repository at this point in the history
  • Loading branch information
pepyakin committed Oct 30, 2017
1 parent c1a188c commit 230545e
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 155 deletions.
7 changes: 2 additions & 5 deletions src/codegen/mod.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 230545e

Please sign in to comment.