@@ -110,11 +110,13 @@ use self::Ordering::*;
110
110
pub trait PartialEq<Rhs: ?Sized = Self> {
111
111
/// This method tests for `self` and `other` values to be equal, and is used
112
112
/// by `==`.
113
+ #[must_use]
113
114
#[stable(feature = "rust1", since = "1.0.0")]
114
115
fn eq(&self, other: &Rhs) -> bool;
115
116
116
117
/// This method tests for `!=`.
117
118
#[inline]
119
+ #[must_use]
118
120
#[stable(feature = "rust1", since = "1.0.0")]
119
121
fn ne(&self, other: &Rhs) -> bool { !self.eq(other) }
120
122
}
@@ -625,6 +627,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
625
627
/// let result = std::f64::NAN.partial_cmp(&1.0);
626
628
/// assert_eq!(result, None);
627
629
/// ```
630
+ #[must_use]
628
631
#[stable(feature = "rust1", since = "1.0.0")]
629
632
fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
630
633
@@ -640,6 +643,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
640
643
/// assert_eq!(result, false);
641
644
/// ```
642
645
#[inline]
646
+ #[must_use]
643
647
#[stable(feature = "rust1", since = "1.0.0")]
644
648
fn lt(&self, other: &Rhs) -> bool {
645
649
match self.partial_cmp(other) {
@@ -661,6 +665,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
661
665
/// assert_eq!(result, true);
662
666
/// ```
663
667
#[inline]
668
+ #[must_use]
664
669
#[stable(feature = "rust1", since = "1.0.0")]
665
670
fn le(&self, other: &Rhs) -> bool {
666
671
match self.partial_cmp(other) {
@@ -681,6 +686,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
681
686
/// assert_eq!(result, false);
682
687
/// ```
683
688
#[inline]
689
+ #[must_use]
684
690
#[stable(feature = "rust1", since = "1.0.0")]
685
691
fn gt(&self, other: &Rhs) -> bool {
686
692
match self.partial_cmp(other) {
@@ -702,6 +708,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
702
708
/// assert_eq!(result, true);
703
709
/// ```
704
710
#[inline]
711
+ #[must_use]
705
712
#[stable(feature = "rust1", since = "1.0.0")]
706
713
fn ge(&self, other: &Rhs) -> bool {
707
714
match self.partial_cmp(other) {
0 commit comments