]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/cmp.rs
Added diagnostic items to functions for Clippy
[rust.git] / library / core / src / cmp.rs
index 6c2f09514a611a38e978daeb9144e7cfd6468832..79610bb409d37c06b383ea7622452560b179ebf6 100644 (file)
@@ -41,7 +41,7 @@
 ///
 /// If [`PartialOrd`] or [`Ord`] are also implemented for `Self` and `Rhs`, their methods must also
 /// be consistent with `PartialEq` (see the documentation of those traits for the exact
-/// requirememts). It's easy to accidentally make them disagree by deriving some of the traits and
+/// requirements). It's easy to accidentally make them disagree by deriving some of the traits and
 /// manually implementing others.
 ///
 /// The equality relation `==` must satisfy the following conditions
@@ -1104,6 +1104,7 @@ fn ge(&self, other: &Rhs) -> bool {
 #[inline]
 #[must_use]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[cfg_attr(not(test), rustc_diagnostic_item = "cmp_min")]
 pub fn min<T: Ord>(v1: T, v2: T) -> T {
     v1.min(v2)
 }
@@ -1166,6 +1167,7 @@ pub fn min_by_key<T, F: FnMut(&T) -> K, K: Ord>(v1: T, v2: T, mut f: F) -> T {
 #[inline]
 #[must_use]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[cfg_attr(not(test), rustc_diagnostic_item = "cmp_max")]
 pub fn max<T: Ord>(v1: T, v2: T) -> T {
     v1.max(v2)
 }