remove const_slice_index annotations, it never had a feature gate anyway
This commit is contained in:
parent
332fa6aa6e
commit
7a3a317618
@ -149,7 +149,6 @@
|
||||
#![feature(const_size_of_val_raw)]
|
||||
#![feature(const_slice_from_raw_parts_mut)]
|
||||
#![feature(const_slice_from_ref)]
|
||||
#![feature(const_slice_index)]
|
||||
#![feature(const_slice_split_at_mut)]
|
||||
#![feature(const_str_from_utf8_unchecked_mut)]
|
||||
#![feature(const_strict_overflow_ops)]
|
||||
|
@ -31,7 +31,6 @@ fn index_mut(&mut self, index: I) -> &mut I::Output {
|
||||
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
|
||||
#[cfg_attr(feature = "panic_immediate_abort", inline)]
|
||||
#[track_caller]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
const fn slice_start_index_len_fail(index: usize, len: usize) -> ! {
|
||||
// FIXME(const-hack): once integer formatting in panics is possible, we
|
||||
// should use the same implementation at compiletime and runtime.
|
||||
@ -53,7 +52,6 @@ const fn slice_start_index_len_fail_ct(_: usize, _: usize) -> ! {
|
||||
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
|
||||
#[cfg_attr(feature = "panic_immediate_abort", inline)]
|
||||
#[track_caller]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
const fn slice_end_index_len_fail(index: usize, len: usize) -> ! {
|
||||
// FIXME(const-hack): once integer formatting in panics is possible, we
|
||||
// should use the same implementation at compiletime and runtime.
|
||||
@ -75,7 +73,6 @@ const fn slice_end_index_len_fail_ct(_: usize, _: usize) -> ! {
|
||||
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
|
||||
#[cfg_attr(feature = "panic_immediate_abort", inline)]
|
||||
#[track_caller]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
const fn slice_index_order_fail(index: usize, end: usize) -> ! {
|
||||
// FIXME(const-hack): once integer formatting in panics is possible, we
|
||||
// should use the same implementation at compiletime and runtime.
|
||||
@ -249,7 +246,6 @@ pub unsafe trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
|
||||
|
||||
/// The methods `index` and `index_mut` panic if the index is out of bounds.
|
||||
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for usize {
|
||||
type Output = T;
|
||||
|
||||
@ -389,7 +385,6 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
/// - the start of the range is greater than the end of the range or
|
||||
/// - the end of the range is out of bounds.
|
||||
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for ops::Range<usize> {
|
||||
type Output = [T];
|
||||
|
||||
@ -525,7 +520,6 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
|
||||
/// The methods `index` and `index_mut` panic if the end of the range is out of bounds.
|
||||
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
|
||||
type Output = [T];
|
||||
|
||||
@ -564,7 +558,6 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
|
||||
/// The methods `index` and `index_mut` panic if the start of the range is out of bounds.
|
||||
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
|
||||
type Output = [T];
|
||||
|
||||
@ -647,7 +640,6 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
}
|
||||
|
||||
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for ops::RangeFull {
|
||||
type Output = [T];
|
||||
|
||||
@ -687,7 +679,6 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
/// - the start of the range is greater than the end of the range or
|
||||
/// - the end of the range is out of bounds.
|
||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
|
||||
type Output = [T];
|
||||
|
||||
@ -769,7 +760,6 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
|
||||
/// The methods `index` and `index_mut` panic if the end of the range is out of bounds.
|
||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
|
||||
type Output = [T];
|
||||
|
||||
|
@ -51,7 +51,6 @@ const fn memchr_naive(x: u8, text: &[u8]) -> Option<usize> {
|
||||
}
|
||||
|
||||
#[rustc_allow_const_fn_unstable(const_cmp)]
|
||||
#[rustc_allow_const_fn_unstable(const_slice_index)]
|
||||
#[rustc_allow_const_fn_unstable(const_align_offset)]
|
||||
#[rustc_const_stable(feature = "const_memchr", since = "1.65.0")]
|
||||
const fn memchr_aligned(x: u8, text: &[u8]) -> Option<usize> {
|
||||
|
@ -92,7 +92,6 @@ const fn str_index_overflow_fail() -> ! {
|
||||
///
|
||||
/// Equivalent to `&self[0 .. len]` or `&mut self[0 .. len]`.
|
||||
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl SliceIndex<str> for ops::RangeFull {
|
||||
type Output = str;
|
||||
#[inline]
|
||||
@ -157,7 +156,6 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
|
||||
/// // &s[3 .. 100];
|
||||
/// ```
|
||||
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl SliceIndex<str> for ops::Range<usize> {
|
||||
type Output = str;
|
||||
#[inline]
|
||||
@ -429,7 +427,6 @@ fn index_mut(self, slice: &mut str) -> &mut str {
|
||||
/// Panics if `end` does not point to the starting byte offset of a
|
||||
/// character (as defined by `is_char_boundary`), or if `end > len`.
|
||||
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl SliceIndex<str> for ops::RangeTo<usize> {
|
||||
type Output = str;
|
||||
#[inline]
|
||||
@ -498,7 +495,6 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
|
||||
/// Panics if `begin` does not point to the starting byte offset of
|
||||
/// a character (as defined by `is_char_boundary`), or if `begin > len`.
|
||||
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl SliceIndex<str> for ops::RangeFrom<usize> {
|
||||
type Output = str;
|
||||
#[inline]
|
||||
@ -625,7 +621,6 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
|
||||
/// to the ending byte offset of a character (`end + 1` is either a starting
|
||||
/// byte offset or equal to `len`), if `begin > end`, or if `end >= len`.
|
||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl SliceIndex<str> for ops::RangeInclusive<usize> {
|
||||
type Output = str;
|
||||
#[inline]
|
||||
@ -714,7 +709,6 @@ fn index_mut(self, slice: &mut str) -> &mut Self::Output {
|
||||
/// (`end + 1` is either a starting byte offset as defined by
|
||||
/// `is_char_boundary`, or equal to `len`), or if `end >= len`.
|
||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_slice_index", issue = "none")]
|
||||
unsafe impl SliceIndex<str> for ops::RangeToInclusive<usize> {
|
||||
type Output = str;
|
||||
#[inline]
|
||||
|
@ -1,7 +1,5 @@
|
||||
//@ known-bug: #110395
|
||||
|
||||
#![feature(const_slice_index)]
|
||||
|
||||
const A: [(); 5] = [(), (), (), (), ()];
|
||||
|
||||
// Since the indexing is on a ZST, the addresses are all fine,
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0015]: cannot call non-const fn `core::slice::<impl [()]>::get_unchecked::<std::ops::Range<usize>>` in constants
|
||||
--> $DIR/ub-slice-get-unchecked.rs:9:29
|
||||
--> $DIR/ub-slice-get-unchecked.rs:7:29
|
||||
|
|
||||
LL | const B: &[()] = unsafe { A.get_unchecked(3..1) };
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user