summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorSergey Pepyakin <s.pepyakin@gmail.com>2017-09-19 17:42:44 +0300
committerSergey Pepyakin <s.pepyakin@gmail.com>2017-09-19 17:42:44 +0300
commitd6b4213e0842a766574bb34b673ad3d682c80ccf (patch)
tree39e698499225598f8651444600f151c5b624073d /src/codegen/mod.rs
parentf3225ffa8d0504b03d3640fd8012ffedcb11d0c1 (diff)
Emit derive(PartialOrd)
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index e0d4e46d..810f1367 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -12,7 +12,8 @@ use ir::comp::{Base, Bitfield, BitfieldUnit, CompInfo, CompKind, Field,
FieldData, FieldMethods, Method, MethodKind};
use ir::context::{BindgenContext, ItemId};
use ir::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault,
- CanDeriveHash, CanDerivePartialEq, CanDeriveEq};
+ CanDeriveHash, CanDerivePartialOrd, CanDerivePartialEq,
+ CanDeriveEq};
use ir::dot;
use ir::enum_ty::{Enum, EnumVariant, EnumVariantValue};
use ir::function::{Abi, Function, FunctionSig};
@@ -1489,6 +1490,10 @@ impl CodeGenerator for CompInfo {
derives.push("Hash");
}
+ if item.can_derive_partialord(ctx) {
+ derives.push("PartialOrd");
+ }
+
if item.can_derive_partialeq(ctx) {
derives.push("PartialEq");
}