summaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorJethro Beekman <jethro@fortanix.com>2019-03-21 00:15:20 -0700
committerJethro Beekman <jethro@fortanix.com>2019-03-21 22:04:35 -0700
commitfbc5da76a0b2715504d25506b4a80473eb25d405 (patch)
tree24c6802a68acbfe270fee8ff4ebd585a436b3a42 /src/codegen
parent843eb1c4c98468acd96a1f113af60ebb5a9af622 (diff)
Unify derive logic
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/impl_debug.rs3
-rw-r--r--src/codegen/mod.rs2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/codegen/impl_debug.rs b/src/codegen/impl_debug.rs
index d429e328..fd486511 100644
--- a/src/codegen/impl_debug.rs
+++ b/src/codegen/impl_debug.rs
@@ -1,6 +1,5 @@
use ir::comp::{BitfieldUnit, CompKind, Field, FieldData, FieldMethods};
use ir::context::BindgenContext;
-use ir::derive::CanTriviallyDeriveDebug;
use ir::item::{HasTypeParamInArray, IsOpaque, Item, ItemCanonicalName};
use ir::ty::{RUST_DERIVE_IN_ARRAY_LIMIT, TypeKind};
use proc_macro2;
@@ -236,7 +235,7 @@ impl<'a> ImplDebug<'a> for Item {
let inner_type = ctx.resolve_type(inner).canonical_type(ctx);
match *inner_type.kind() {
TypeKind::Function(ref sig)
- if !sig.can_trivially_derive_debug(ctx) => {
+ if !sig.function_pointers_can_derive() => {
Some((format!("{}: FunctionPointer", name), vec![]))
}
_ => debug_print(name, quote! { #name_ident }),
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index d7f98c13..0956eb7a 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -1746,7 +1746,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()) == CanDerive::ArrayTooLarge;
+ ctx.lookup_can_derive_partialeq_or_partialord(item.id()) == CanDerive::Manually;
}
if item.can_derive_eq(ctx) {