@@ -215,6 +215,7 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
215
215
#[ inline]
216
216
#[ must_use]
217
217
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
218
+ #[ default_method_body_is_const]
218
219
fn ne ( & self , other : & Rhs ) -> bool {
219
220
!self . eq ( other)
220
221
}
@@ -1031,6 +1032,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1031
1032
#[ inline]
1032
1033
#[ must_use]
1033
1034
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1035
+ #[ default_method_body_is_const]
1034
1036
fn lt ( & self , other : & Rhs ) -> bool {
1035
1037
matches ! ( self . partial_cmp( other) , Some ( Less ) )
1036
1038
}
@@ -1050,6 +1052,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1050
1052
#[ inline]
1051
1053
#[ must_use]
1052
1054
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1055
+ #[ default_method_body_is_const]
1053
1056
fn le ( & self , other : & Rhs ) -> bool {
1054
1057
// Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`.
1055
1058
// FIXME: The root cause was fixed upstream in LLVM with:
@@ -1072,6 +1075,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1072
1075
#[ inline]
1073
1076
#[ must_use]
1074
1077
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1078
+ #[ default_method_body_is_const]
1075
1079
fn gt ( & self , other : & Rhs ) -> bool {
1076
1080
matches ! ( self . partial_cmp( other) , Some ( Greater ) )
1077
1081
}
@@ -1091,6 +1095,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1091
1095
#[ inline]
1092
1096
#[ must_use]
1093
1097
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1098
+ #[ default_method_body_is_const]
1094
1099
fn ge ( & self , other : & Rhs ) -> bool {
1095
1100
matches ! ( self . partial_cmp( other) , Some ( Greater | Equal ) )
1096
1101
}
0 commit comments