summaryrefslogtreecommitdiff
path: root/src/ir/function.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-09-19 18:07:51 -0400
committerGitHub <noreply@github.com>2018-09-19 18:07:51 -0400
commit6fc0a31febb63d77da1a38aa2eea9d10fbea0d0d (patch)
treecb09d8cb35d94b1af4e3cf4f4bdf447d29a76029 /src/ir/function.rs
parenta54a9dc796372478d26fa5b165c3b4d129cbcfce (diff)
parentc09c74e18b6ce8b69626a59737d8e82a3eb1d1b8 (diff)
Auto merge of #1391 - emilio:u128, r=fitzgen
codegen: Generate u128 / i128 when available. This is the first step to fix #1370 / #1338 / etc. Fix for that will build up on this.
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r--src/ir/function.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs
index 5e8d2fc8..f7f4398b 100644
--- a/src/ir/function.rs
+++ b/src/ir/function.rs
@@ -581,26 +581,23 @@ impl Trace for FunctionSig {
}
impl CanTriviallyDeriveDebug for FunctionSig {
- fn can_trivially_derive_debug(&self) -> bool {
+ fn can_trivially_derive_debug(&self, _: &BindgenContext) -> bool {
self.function_pointers_can_derive()
}
}
impl CanTriviallyDeriveHash for FunctionSig {
- fn can_trivially_derive_hash(&self) -> bool {
+ fn can_trivially_derive_hash(&self, _: &BindgenContext) -> bool {
self.function_pointers_can_derive()
}
}
impl CanTriviallyDerivePartialEqOrPartialOrd for FunctionSig {
- fn can_trivially_derive_partialeq_or_partialord(&self) -> CanDerive {
- if self.argument_types.len() > RUST_DERIVE_FUNPTR_LIMIT {
- return CanDerive::No;
- }
-
- match self.abi {
- Abi::C | Abi::Unknown(..) => CanDerive::Yes,
- _ => CanDerive::No,
+ fn can_trivially_derive_partialeq_or_partialord(&self, _: &BindgenContext) -> CanDerive {
+ if self.function_pointers_can_derive() {
+ CanDerive::Yes
+ } else {
+ CanDerive::No
}
}
}