@@ -110,11 +110,13 @@ use self::Ordering::*;
110110pub trait PartialEq < Rhs : ?Sized = Self > {
111111 /// This method tests for `self` and `other` values to be equal, and is used
112112 /// by `==`.
113+ #[ must_use]
113114 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
114115 fn eq ( & self , other : & Rhs ) -> bool ;
115116
116117 /// This method tests for `!=`.
117118 #[ inline]
119+ #[ must_use]
118120 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
119121 fn ne ( & self , other : & Rhs ) -> bool { !self . eq ( other) }
120122}
@@ -625,6 +627,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
625627 /// let result = std::f64::NAN.partial_cmp(&1.0);
626628 /// assert_eq!(result, None);
627629 /// ```
630+ #[ must_use]
628631 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
629632 fn partial_cmp ( & self , other : & Rhs ) -> Option < Ordering > ;
630633
@@ -640,6 +643,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
640643 /// assert_eq!(result, false);
641644 /// ```
642645 #[ inline]
646+ #[ must_use]
643647 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
644648 fn lt ( & self , other : & Rhs ) -> bool {
645649 match self . partial_cmp ( other) {
@@ -661,6 +665,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
661665 /// assert_eq!(result, true);
662666 /// ```
663667 #[ inline]
668+ #[ must_use]
664669 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
665670 fn le ( & self , other : & Rhs ) -> bool {
666671 match self . partial_cmp ( other) {
@@ -681,6 +686,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
681686 /// assert_eq!(result, false);
682687 /// ```
683688 #[ inline]
689+ #[ must_use]
684690 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
685691 fn gt ( & self , other : & Rhs ) -> bool {
686692 match self . partial_cmp ( other) {
@@ -702,6 +708,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
702708 /// assert_eq!(result, true);
703709 /// ```
704710 #[ inline]
711+ #[ must_use]
705712 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
706713 fn ge ( & self , other : & Rhs ) -> bool {
707714 match self . partial_cmp ( other) {
0 commit comments