about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-02-18 15:21:44 +0100
committerUrgau <urgau@numericable.fr>2024-03-29 16:25:41 +0100
commit4a9f3cac887023d0230729e898240b85508aa791 (patch)
tree31be41dc9118575218fa27f7aac55502d9668708
parentc5e7f45b6219a963e8e27ef6e15587f22e80a3f5 (diff)
downloadrust-4a9f3cac887023d0230729e898240b85508aa791.tar.gz
rust-4a9f3cac887023d0230729e898240b85508aa791.zip
Add diagnostic items for Ord and PartialOrd methods
-rw-r--r--compiler/rustc_span/src/symbol.rs7
-rw-r--r--library/core/src/cmp.rs7
2 files changed, 14 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 891ddb7af5b..1f2c44ca71e 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -531,8 +531,15 @@ symbols! {
         cmp,
         cmp_max,
         cmp_min,
+        cmp_ord_max,
+        cmp_ord_min,
         cmp_partialeq_eq,
         cmp_partialeq_ne,
+        cmp_partialord_cmp,
+        cmp_partialord_ge,
+        cmp_partialord_gt,
+        cmp_partialord_le,
+        cmp_partialord_lt,
         cmpxchg16b_target_feature,
         cmse_nonsecure_entry,
         coerce_unsized,
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs
index a2f07814726..cc9ef673da7 100644
--- a/library/core/src/cmp.rs
+++ b/library/core/src/cmp.rs
@@ -848,6 +848,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
     #[stable(feature = "ord_max_min", since = "1.21.0")]
     #[inline]
     #[must_use]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_ord_max")]
     fn max(self, other: Self) -> Self
     where
         Self: Sized,
@@ -868,6 +869,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
     #[stable(feature = "ord_max_min", since = "1.21.0")]
     #[inline]
     #[must_use]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_ord_min")]
     fn min(self, other: Self) -> Self
     where
         Self: Sized,
@@ -1154,6 +1156,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     /// ```
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_partialord_cmp")]
     fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
 
     /// This method tests less than (for `self` and `other`) and is used by the `<` operator.
@@ -1168,6 +1171,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[inline]
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_partialord_lt")]
     fn lt(&self, other: &Rhs) -> bool {
         matches!(self.partial_cmp(other), Some(Less))
     }
@@ -1185,6 +1189,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[inline]
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_partialord_le")]
     fn le(&self, other: &Rhs) -> bool {
         matches!(self.partial_cmp(other), Some(Less | Equal))
     }
@@ -1201,6 +1206,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[inline]
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_partialord_gt")]
     fn gt(&self, other: &Rhs) -> bool {
         matches!(self.partial_cmp(other), Some(Greater))
     }
@@ -1218,6 +1224,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     #[inline]
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "cmp_partialord_ge")]
     fn ge(&self, other: &Rhs) -> bool {
         matches!(self.partial_cmp(other), Some(Greater | Equal))
     }