about summary refs log tree commit diff
path: root/library/core/src/slice
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-03-16 09:40:05 +0800
committerGitHub <noreply@github.com>2025-03-16 09:40:05 +0800
commite0846806dbfaa8d838832f48771a8a709f35ee0a (patch)
tree45f46999ca1eee33d3bc7bf6942416febe8bdc52 /library/core/src/slice
parent199e714a665fad0ca663e026e48ad26913379615 (diff)
parent638b226a6ab5c5c784955068f57ae249e0ed0f92 (diff)
Rollup merge of #138082 - thaliaarchi:slice-cfg-not-test, r=thomcc
Remove `#[cfg(not(test))]` gates in `core`

These gates are unnecessary now that unit tests for `core` are in a separate package, `coretests`, instead of in the same files as the source code. They previously prevented the two `core` versions from conflicting with each other.
Diffstat (limited to 'library/core/src/slice')
-rw-r--r--library/core/src/slice/ascii.rs1
-rw-r--r--library/core/src/slice/mod.rs5
2 files changed, 1 insertions, 5 deletions
diff --git a/library/core/src/slice/ascii.rs b/library/core/src/slice/ascii.rs
index 51b25fa40e3..91befdb8c78 100644
--- a/library/core/src/slice/ascii.rs
+++ b/library/core/src/slice/ascii.rs
@@ -7,7 +7,6 @@ use crate::fmt::{self, Write};
 use crate::intrinsics::const_eval_select;
 use crate::{ascii, iter, ops};
 
-#[cfg(not(test))]
 impl [u8] {
     /// Checks if all bytes in this slice are within the ASCII range.
     #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 3570d8d0876..2c699ee9fdd 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -97,7 +97,6 @@ enum Direction {
     Back,
 }
 
-#[cfg(not(test))]
 impl<T> [T] {
     /// Returns the number of elements in the slice.
     ///
@@ -1045,7 +1044,7 @@ impl<T> [T] {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
-    #[cfg_attr(not(test), rustc_diagnostic_item = "slice_iter")]
+    #[rustc_diagnostic_item = "slice_iter"]
     pub fn iter(&self) -> Iter<'_, T> {
         Iter::new(self)
     }
@@ -4844,7 +4843,6 @@ impl<T, const N: usize> [[T; N]] {
     }
 }
 
-#[cfg(not(test))]
 impl [f32] {
     /// Sorts the slice of floats.
     ///
@@ -4873,7 +4871,6 @@ impl [f32] {
     }
 }
 
-#[cfg(not(test))]
 impl [f64] {
     /// Sorts the slice of floats.
     ///