Skip to content

Commit 4802ecf

Browse files
committed
remove const_slice_index annotations, it never had a feature gate anyway
1 parent 7f9a541 commit 4802ecf

File tree

5 files changed

+2
-22
lines changed

5 files changed

+2
-22
lines changed

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
#![feature(const_size_of_val_raw)]
150150
#![feature(const_slice_from_raw_parts_mut)]
151151
#![feature(const_slice_from_ref)]
152-
#![feature(const_slice_index)]
153152
#![feature(const_slice_split_at_mut)]
154153
#![feature(const_str_from_utf8_unchecked_mut)]
155154
#![feature(const_strict_overflow_ops)]

library/core/src/slice/index.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ where
3131
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
3232
#[cfg_attr(feature = "panic_immediate_abort", inline)]
3333
#[track_caller]
34-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
3534
const fn slice_start_index_len_fail(index: usize, len: usize) -> ! {
3635
const_eval_select((index, len), slice_start_index_len_fail_ct, slice_start_index_len_fail_rt)
3736
}
@@ -52,7 +51,6 @@ const fn slice_start_index_len_fail_ct(_: usize, _: usize) -> ! {
5251
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
5352
#[cfg_attr(feature = "panic_immediate_abort", inline)]
5453
#[track_caller]
55-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
5654
const fn slice_end_index_len_fail(index: usize, len: usize) -> ! {
5755
const_eval_select((index, len), slice_end_index_len_fail_ct, slice_end_index_len_fail_rt)
5856
}
@@ -73,7 +71,6 @@ const fn slice_end_index_len_fail_ct(_: usize, _: usize) -> ! {
7371
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
7472
#[cfg_attr(feature = "panic_immediate_abort", inline)]
7573
#[track_caller]
76-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
7774
const fn slice_index_order_fail(index: usize, end: usize) -> ! {
7875
const_eval_select((index, end), slice_index_order_fail_ct, slice_index_order_fail_rt)
7976
}
@@ -246,7 +243,6 @@ pub unsafe trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
246243

247244
/// The methods `index` and `index_mut` panic if the index is out of bounds.
248245
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
249-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
250246
unsafe impl<T> SliceIndex<[T]> for usize {
251247
type Output = T;
252248

@@ -386,7 +382,6 @@ unsafe impl<T> SliceIndex<[T]> for ops::IndexRange {
386382
/// - the start of the range is greater than the end of the range or
387383
/// - the end of the range is out of bounds.
388384
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
389-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
390385
unsafe impl<T> SliceIndex<[T]> for ops::Range<usize> {
391386
type Output = [T];
392387

@@ -522,7 +517,6 @@ unsafe impl<T> SliceIndex<[T]> for range::Range<usize> {
522517

523518
/// The methods `index` and `index_mut` panic if the end of the range is out of bounds.
524519
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
525-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
526520
unsafe impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
527521
type Output = [T];
528522

@@ -561,7 +555,6 @@ unsafe impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
561555

562556
/// The methods `index` and `index_mut` panic if the start of the range is out of bounds.
563557
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
564-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
565558
unsafe impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
566559
type Output = [T];
567560

@@ -644,7 +637,6 @@ unsafe impl<T> SliceIndex<[T]> for range::RangeFrom<usize> {
644637
}
645638

646639
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
647-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
648640
unsafe impl<T> SliceIndex<[T]> for ops::RangeFull {
649641
type Output = [T];
650642

@@ -684,7 +676,6 @@ unsafe impl<T> SliceIndex<[T]> for ops::RangeFull {
684676
/// - the start of the range is greater than the end of the range or
685677
/// - the end of the range is out of bounds.
686678
#[stable(feature = "inclusive_range", since = "1.26.0")]
687-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
688679
unsafe impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
689680
type Output = [T];
690681

@@ -766,7 +757,6 @@ unsafe impl<T> SliceIndex<[T]> for range::RangeInclusive<usize> {
766757

767758
/// The methods `index` and `index_mut` panic if the end of the range is out of bounds.
768759
#[stable(feature = "inclusive_range", since = "1.26.0")]
769-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
770760
unsafe impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
771761
type Output = [T];
772762

library/core/src/slice/memchr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const fn memchr_naive(x: u8, text: &[u8]) -> Option<usize> {
5151
}
5252

5353
#[rustc_allow_const_fn_unstable(const_cmp)]
54-
#[rustc_allow_const_fn_unstable(const_slice_index)]
5554
#[rustc_allow_const_fn_unstable(const_align_offset)]
5655
#[rustc_const_stable(feature = "const_memchr", since = "1.65.0")]
5756
const fn memchr_aligned(x: u8, text: &[u8]) -> Option<usize> {

library/core/src/str/traits.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const fn str_index_overflow_fail() -> ! {
9292
///
9393
/// Equivalent to `&self[0 .. len]` or `&mut self[0 .. len]`.
9494
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
95-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
9695
unsafe impl SliceIndex<str> for ops::RangeFull {
9796
type Output = str;
9897
#[inline]
@@ -157,7 +156,6 @@ unsafe impl SliceIndex<str> for ops::RangeFull {
157156
/// // &s[3 .. 100];
158157
/// ```
159158
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
160-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
161159
unsafe impl SliceIndex<str> for ops::Range<usize> {
162160
type Output = str;
163161
#[inline]
@@ -429,7 +427,6 @@ unsafe impl SliceIndex<str> for (ops::Bound<usize>, ops::Bound<usize>) {
429427
/// Panics if `end` does not point to the starting byte offset of a
430428
/// character (as defined by `is_char_boundary`), or if `end > len`.
431429
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
432-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
433430
unsafe impl SliceIndex<str> for ops::RangeTo<usize> {
434431
type Output = str;
435432
#[inline]
@@ -498,7 +495,6 @@ unsafe impl SliceIndex<str> for ops::RangeTo<usize> {
498495
/// Panics if `begin` does not point to the starting byte offset of
499496
/// a character (as defined by `is_char_boundary`), or if `begin > len`.
500497
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
501-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
502498
unsafe impl SliceIndex<str> for ops::RangeFrom<usize> {
503499
type Output = str;
504500
#[inline]
@@ -625,7 +621,6 @@ unsafe impl SliceIndex<str> for range::RangeFrom<usize> {
625621
/// to the ending byte offset of a character (`end + 1` is either a starting
626622
/// byte offset or equal to `len`), if `begin > end`, or if `end >= len`.
627623
#[stable(feature = "inclusive_range", since = "1.26.0")]
628-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
629624
unsafe impl SliceIndex<str> for ops::RangeInclusive<usize> {
630625
type Output = str;
631626
#[inline]
@@ -714,7 +709,6 @@ unsafe impl SliceIndex<str> for range::RangeInclusive<usize> {
714709
/// (`end + 1` is either a starting byte offset as defined by
715710
/// `is_char_boundary`, or equal to `len`), or if `end >= len`.
716711
#[stable(feature = "inclusive_range", since = "1.26.0")]
717-
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
718712
unsafe impl SliceIndex<str> for ops::RangeToInclusive<usize> {
719713
type Output = str;
720714
#[inline]

library/core/src/unicode/unicode_data.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ const fn bitset_search<
1818
let bucket_idx = (needle / 64) as usize;
1919
let chunk_map_idx = bucket_idx / CHUNK_SIZE;
2020
let chunk_piece = bucket_idx % CHUNK_SIZE;
21-
// FIXME: const-hack: Revert to `slice::get` after `const_slice_index`
22-
// feature stabilizes.
21+
// FIXME(const-hack): Revert to `slice::get` when slice indexing becomes possible in const.
2322
let chunk_idx = if chunk_map_idx < chunk_idx_map.len() {
2423
chunk_idx_map[chunk_map_idx]
2524
} else {
2625
return false;
2726
};
2827
let idx = bitset_chunk_idx[chunk_idx as usize][chunk_piece] as usize;
29-
// FIXME: const-hack: Revert to `slice::get` after `const_slice_index`
30-
// feature stabilizes.
28+
// FIXME(const-hack): Revert to `slice::get` when slice indexing becomes possible in const.
3129
let word = if idx < bitset_canonical.len() {
3230
bitset_canonical[idx]
3331
} else {

0 commit comments

Comments
 (0)