Skip to content

Commit 230545e

Browse files
committed
Refactor derive_partialeq_or_partialord.
1 parent c1a188c commit 230545e

File tree

7 files changed

+185
-155
lines changed

7 files changed

+185
-155
lines changed

src/codegen/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ir::comp::{Base, Bitfield, BitfieldUnit, CompInfo, CompKind, Field,
1717
use ir::context::{BindgenContext, ItemId};
1818
use ir::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault,
1919
CanDeriveHash, CanDerivePartialOrd, CanDeriveOrd,
20-
CanDerivePartialEq, CanDeriveEq, CannotDeriveReason};
20+
CanDerivePartialEq, CanDeriveEq, CanDerive};
2121
use ir::dot;
2222
use ir::enum_ty::{Enum, EnumVariant, EnumVariantValue};
2323
use ir::function::{Abi, Function, FunctionSig, Linkage};
@@ -1676,10 +1676,7 @@ impl CodeGenerator for CompInfo {
16761676
needs_partialeq_impl =
16771677
ctx.options().derive_partialeq &&
16781678
ctx.options().impl_partialeq &&
1679-
ctx.lookup_can_derive_partialeq_or_partialord(item.id())
1680-
.map_or(true, |x| {
1681-
x == CannotDeriveReason::ArrayTooLarge
1682-
});
1679+
ctx.lookup_can_derive_partialeq_or_partialord(item.id()) == CanDerive::ArrayTooLarge;
16831680
}
16841681

16851682
if item.can_derive_eq(ctx) {

0 commit comments

Comments
 (0)