Skip to content

Commit d699813

Browse files
authored
Merge pull request #1540 from jethrogb/unify-derive
Unify derive
2 parents ab5d31a + 8ad6d67 commit d699813

23 files changed

+783
-2145
lines changed

src/codegen/impl_debug.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use ir::comp::{BitfieldUnit, CompKind, Field, FieldData, FieldMethods};
22
use ir::context::BindgenContext;
3-
use ir::derive::CanTriviallyDeriveDebug;
43
use ir::item::{HasTypeParamInArray, IsOpaque, Item, ItemCanonicalName};
54
use ir::ty::{RUST_DERIVE_IN_ARRAY_LIMIT, TypeKind};
65
use proc_macro2;
@@ -236,7 +235,7 @@ impl<'a> ImplDebug<'a> for Item {
236235
let inner_type = ctx.resolve_type(inner).canonical_type(ctx);
237236
match *inner_type.kind() {
238237
TypeKind::Function(ref sig)
239-
if !sig.can_trivially_derive_debug(ctx) => {
238+
if !sig.function_pointers_can_derive() => {
240239
Some((format!("{}: FunctionPointer", name), vec![]))
241240
}
242241
_ => debug_print(name, quote! { #name_ident }),

src/codegen/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ impl CodeGenerator for CompInfo {
17461746
needs_partialeq_impl =
17471747
ctx.options().derive_partialeq &&
17481748
ctx.options().impl_partialeq &&
1749-
ctx.lookup_can_derive_partialeq_or_partialord(item.id()) == CanDerive::ArrayTooLarge;
1749+
ctx.lookup_can_derive_partialeq_or_partialord(item.id()) == CanDerive::Manually;
17501750
}
17511751

17521752
if item.can_derive_eq(ctx) {

0 commit comments

Comments
 (0)