update bootstrap configs
This commit is contained in:
@@ -3,9 +3,6 @@
|
||||
#[allow(unused_imports)]
|
||||
#[stable(feature = "simd_arch", since = "1.27.0")]
|
||||
pub use crate::core_arch::arch::*;
|
||||
#[unstable(feature = "naked_functions", issue = "90957")]
|
||||
#[cfg(bootstrap)]
|
||||
pub use crate::naked_asm;
|
||||
|
||||
/// Inline assembly.
|
||||
///
|
||||
@@ -20,37 +17,6 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
|
||||
/* compiler built-in */
|
||||
}
|
||||
|
||||
/// Inline assembly used in combination with `#[naked]` functions.
|
||||
///
|
||||
/// Refer to [Rust By Example] for a usage guide and the [reference] for
|
||||
/// detailed information about the syntax and available options.
|
||||
///
|
||||
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
|
||||
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
|
||||
#[unstable(feature = "naked_functions", issue = "90957")]
|
||||
#[macro_export]
|
||||
#[cfg(bootstrap)]
|
||||
macro_rules! naked_asm {
|
||||
([$last:expr], [$($pushed:expr),*]) => {
|
||||
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
|
||||
{
|
||||
core::arch::asm!($($pushed),*, options(att_syntax, noreturn))
|
||||
}
|
||||
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
|
||||
{
|
||||
core::arch::asm!($($pushed),* , $last, options(noreturn))
|
||||
}
|
||||
};
|
||||
|
||||
([$first:expr $(, $rest:expr)*], [$($pushed:expr),*]) => {
|
||||
naked_asm!([$($rest),*], [$($pushed,)* $first]);
|
||||
};
|
||||
|
||||
($($expr:expr),* $(,)?) => {
|
||||
naked_asm!([$($expr),*], []);
|
||||
};
|
||||
}
|
||||
|
||||
/// Inline assembly used in combination with `#[naked]` functions.
|
||||
///
|
||||
/// Refer to [Rust By Example] for a usage guide and the [reference] for
|
||||
@@ -60,7 +26,6 @@ macro_rules! naked_asm {
|
||||
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
|
||||
#[unstable(feature = "naked_functions", issue = "90957")]
|
||||
#[rustc_builtin_macro]
|
||||
#[cfg(not(bootstrap))]
|
||||
pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
|
||||
/* compiler built-in */
|
||||
}
|
||||
|
||||
@@ -147,7 +147,6 @@ pub const fn from_ref<T>(s: &T) -> &[T; 1] {
|
||||
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
|
||||
#[stable(feature = "array_from_ref", since = "1.53.0")]
|
||||
#[rustc_const_stable(feature = "const_array_from_ref", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
|
||||
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
|
||||
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }
|
||||
|
||||
@@ -2181,7 +2181,6 @@ impl<T: ?Sized> UnsafeCell<T> {
|
||||
/// ```
|
||||
#[inline(always)]
|
||||
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_unsafecell_get_mut", since = "1.83.0")]
|
||||
pub const fn get_mut(&mut self) -> &mut T {
|
||||
&mut self.value
|
||||
|
||||
@@ -676,7 +676,6 @@ impl char {
|
||||
#[stable(feature = "unicode_encode_char", since = "1.15.0")]
|
||||
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "1.83.0")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn encode_utf8(self, dst: &mut [u8]) -> &mut str {
|
||||
// SAFETY: `char` is not a surrogate, so this is valid UTF-8.
|
||||
unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) }
|
||||
@@ -1284,7 +1283,6 @@ impl char {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_uppercase(&mut self) {
|
||||
*self = self.to_ascii_uppercase();
|
||||
}
|
||||
@@ -1311,7 +1309,6 @@ impl char {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_lowercase(&mut self) {
|
||||
*self = self.to_ascii_lowercase();
|
||||
}
|
||||
@@ -1777,7 +1774,6 @@ const fn len_utf16(code: u32) -> usize {
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
#[rustc_allow_const_fn_unstable(const_eval_select)]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
|
||||
const fn panic_at_const(_code: u32, _len: usize, _dst_len: usize) {
|
||||
// Note that we cannot format in constant expressions.
|
||||
|
||||
@@ -1807,7 +1807,6 @@ extern "rust-intrinsic" {
|
||||
/// is selected, and that may depend on optimization level and context, for
|
||||
/// example.
|
||||
#[rustc_nounwind]
|
||||
#[cfg(not(bootstrap))]
|
||||
pub fn fmuladdf16(a: f16, b: f16, c: f16) -> f16;
|
||||
/// Returns `a * b + c` for `f32` values, non-deterministically executing
|
||||
/// either a fused multiply-add or two operations with rounding of the
|
||||
@@ -1820,7 +1819,6 @@ extern "rust-intrinsic" {
|
||||
/// is selected, and that may depend on optimization level and context, for
|
||||
/// example.
|
||||
#[rustc_nounwind]
|
||||
#[cfg(not(bootstrap))]
|
||||
pub fn fmuladdf32(a: f32, b: f32, c: f32) -> f32;
|
||||
/// Returns `a * b + c` for `f64` values, non-deterministically executing
|
||||
/// either a fused multiply-add or two operations with rounding of the
|
||||
@@ -1833,7 +1831,6 @@ extern "rust-intrinsic" {
|
||||
/// is selected, and that may depend on optimization level and context, for
|
||||
/// example.
|
||||
#[rustc_nounwind]
|
||||
#[cfg(not(bootstrap))]
|
||||
pub fn fmuladdf64(a: f64, b: f64, c: f64) -> f64;
|
||||
/// Returns `a * b + c` for `f128` values, non-deterministically executing
|
||||
/// either a fused multiply-add or two operations with rounding of the
|
||||
@@ -1846,7 +1843,6 @@ extern "rust-intrinsic" {
|
||||
/// is selected, and that may depend on optimization level and context, for
|
||||
/// example.
|
||||
#[rustc_nounwind]
|
||||
#[cfg(not(bootstrap))]
|
||||
pub fn fmuladdf128(a: f128, b: f128, c: f128) -> f128;
|
||||
|
||||
/// Returns the largest integer less than or equal to an `f16`.
|
||||
|
||||
@@ -173,9 +173,6 @@
|
||||
//
|
||||
// Language features:
|
||||
// tidy-alphabetical-start
|
||||
#![cfg_attr(bootstrap, feature(const_mut_refs))]
|
||||
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
|
||||
#![cfg_attr(bootstrap, feature(const_refs_to_static))]
|
||||
#![feature(abi_unadjusted)]
|
||||
#![feature(adt_const_params)]
|
||||
#![feature(allow_internal_unsafe)]
|
||||
|
||||
@@ -570,7 +570,6 @@ impl<T> MaybeUninit<T> {
|
||||
/// until they are, it is advisable to avoid them.)
|
||||
#[stable(feature = "maybe_uninit", since = "1.36.0")]
|
||||
#[rustc_const_stable(feature = "const_maybe_uninit_as_mut_ptr", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[inline(always)]
|
||||
pub const fn as_mut_ptr(&mut self) -> *mut T {
|
||||
// `MaybeUninit` and `ManuallyDrop` are both `repr(transparent)` so we can cast the pointer.
|
||||
@@ -910,7 +909,6 @@ impl<T> MaybeUninit<T> {
|
||||
/// };
|
||||
/// ```
|
||||
#[stable(feature = "maybe_uninit_ref", since = "1.55.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(
|
||||
feature = "const_maybe_uninit_assume_init",
|
||||
since = "CURRENT_RUSTC_VERSION"
|
||||
@@ -1000,7 +998,6 @@ impl<T> MaybeUninit<T> {
|
||||
///
|
||||
/// [`assume_init_mut`]: MaybeUninit::assume_init_mut
|
||||
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")]
|
||||
#[inline(always)]
|
||||
pub const unsafe fn slice_assume_init_mut(slice: &mut [Self]) -> &mut [T] {
|
||||
|
||||
@@ -857,7 +857,6 @@ pub fn take<T: Default>(dest: &mut T) -> T {
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[must_use = "if you don't need the old value, you can just assign the new value directly"]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "mem_replace")]
|
||||
pub const fn replace<T>(dest: &mut T, src: T) -> T {
|
||||
|
||||
@@ -626,7 +626,6 @@ impl u8 {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_uppercase(&mut self) {
|
||||
*self = self.to_ascii_uppercase();
|
||||
}
|
||||
@@ -653,7 +652,6 @@ impl u8 {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_lowercase(&mut self) {
|
||||
*self = self.to_ascii_lowercase();
|
||||
}
|
||||
|
||||
@@ -723,7 +723,6 @@ impl<T> Option<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
|
||||
pub const fn as_mut(&mut self) -> Option<&mut T> {
|
||||
match *self {
|
||||
@@ -1716,7 +1715,6 @@ impl<T> Option<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
|
||||
pub const fn take(&mut self) -> Option<T> {
|
||||
// FIXME(const-hack) replace `mem::replace` by `mem::take` when the latter is const ready
|
||||
@@ -1775,7 +1773,6 @@ impl<T> Option<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "option_replace", since = "1.31.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
|
||||
pub const fn replace(&mut self, value: T) -> Option<T> {
|
||||
mem::replace(self, Some(value))
|
||||
@@ -1937,7 +1934,6 @@ impl<T> Option<&mut T> {
|
||||
/// ```
|
||||
#[must_use = "`self` will be dropped if the result is not used"]
|
||||
#[stable(feature = "copied", since = "1.35.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
|
||||
pub const fn copied(self) -> Option<T>
|
||||
where
|
||||
|
||||
@@ -1265,7 +1265,6 @@ const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, coun
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
|
||||
#[rustc_diagnostic_item = "ptr_replace"]
|
||||
pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
|
||||
@@ -1518,7 +1517,6 @@ pub const unsafe fn read<T>(src: *const T) -> T {
|
||||
#[inline]
|
||||
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
|
||||
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_diagnostic_item = "ptr_read_unaligned"]
|
||||
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
|
||||
@@ -1725,7 +1723,6 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_refs_to_cell))]
|
||||
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
|
||||
#[rustc_diagnostic_item = "ptr_write_unaligned"]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
@@ -1918,7 +1915,7 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
|
||||
/// than trying to adapt this to accommodate that change.
|
||||
///
|
||||
/// Any questions go to @nagisa.
|
||||
#[cfg_attr(not(bootstrap), allow(ptr_to_integer_transmute_in_consts))]
|
||||
#[allow(ptr_to_integer_transmute_in_consts)]
|
||||
#[lang = "align_offset"]
|
||||
pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
|
||||
// FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=
|
||||
|
||||
@@ -1678,7 +1678,6 @@ impl<T: ?Sized> *mut T {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(const_pointer_is_aligned)]
|
||||
/// # #![cfg_attr(bootstrap, feature(const_mut_refs))]
|
||||
///
|
||||
/// // On some platforms, the alignment of primitives is less than their size.
|
||||
/// #[repr(align(4))]
|
||||
@@ -1804,7 +1803,6 @@ impl<T: ?Sized> *mut T {
|
||||
/// ```
|
||||
/// #![feature(pointer_is_aligned_to)]
|
||||
/// #![feature(const_pointer_is_aligned)]
|
||||
/// # #![cfg_attr(bootstrap, feature(const_mut_refs))]
|
||||
///
|
||||
/// // On some platforms, the alignment of i32 is less than 4.
|
||||
/// #[repr(align(4))]
|
||||
|
||||
@@ -394,7 +394,6 @@ impl<T: ?Sized> NonNull<T> {
|
||||
///
|
||||
/// [the module documentation]: crate::ptr#safety
|
||||
#[stable(feature = "nonnull", since = "1.25.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_ptr_as_ref", since = "1.83.0")]
|
||||
#[must_use]
|
||||
#[inline(always)]
|
||||
|
||||
@@ -735,7 +735,6 @@ impl<T, E> Result<T, E> {
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn as_mut(&mut self) -> Result<&mut T, &mut E> {
|
||||
match *self {
|
||||
Ok(ref mut x) => Ok(x),
|
||||
@@ -1589,7 +1588,6 @@ impl<T, E> Result<&mut T, E> {
|
||||
#[inline]
|
||||
#[stable(feature = "result_copied", since = "1.59.0")]
|
||||
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
|
||||
pub const fn copied(self) -> Result<T, E>
|
||||
where
|
||||
|
||||
@@ -69,7 +69,6 @@ impl [u8] {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_uppercase(&mut self) {
|
||||
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
|
||||
let mut i = 0;
|
||||
@@ -92,7 +91,6 @@ impl [u8] {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_lowercase(&mut self) {
|
||||
// FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions.
|
||||
let mut i = 0;
|
||||
|
||||
@@ -171,7 +171,6 @@ impl<T> [T] {
|
||||
/// assert_eq!(None, y.first_mut());
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
@@ -214,7 +213,6 @@ impl<T> [T] {
|
||||
/// assert_eq!(x, &[3, 4, 5]);
|
||||
/// ```
|
||||
#[stable(feature = "slice_splits", since = "1.5.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
@@ -257,7 +255,6 @@ impl<T> [T] {
|
||||
/// assert_eq!(x, &[4, 5, 3]);
|
||||
/// ```
|
||||
#[stable(feature = "slice_splits", since = "1.5.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
@@ -300,7 +297,6 @@ impl<T> [T] {
|
||||
/// assert_eq!(None, y.last_mut());
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
@@ -357,7 +353,6 @@ impl<T> [T] {
|
||||
#[inline]
|
||||
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
|
||||
if self.len() < N {
|
||||
None
|
||||
@@ -423,7 +418,6 @@ impl<T> [T] {
|
||||
#[inline]
|
||||
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn split_first_chunk_mut<const N: usize>(
|
||||
&mut self,
|
||||
) -> Option<(&mut [T; N], &mut [T])> {
|
||||
@@ -494,7 +488,6 @@ impl<T> [T] {
|
||||
#[inline]
|
||||
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn split_last_chunk_mut<const N: usize>(
|
||||
&mut self,
|
||||
) -> Option<(&mut [T], &mut [T; N])> {
|
||||
@@ -564,7 +557,6 @@ impl<T> [T] {
|
||||
#[inline]
|
||||
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
|
||||
if self.len() < N {
|
||||
None
|
||||
@@ -853,7 +845,6 @@ impl<T> [T] {
|
||||
/// [`as_mut_ptr`]: slice::as_mut_ptr
|
||||
#[stable(feature = "slice_ptr_range", since = "1.48.0")]
|
||||
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs, const_refs_to_cell))]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub const fn as_mut_ptr_range(&mut self) -> Range<*mut T> {
|
||||
@@ -1908,7 +1899,6 @@ impl<T> [T] {
|
||||
#[track_caller]
|
||||
#[must_use]
|
||||
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
|
||||
match self.split_at_mut_checked(mid) {
|
||||
Some(pair) => pair,
|
||||
@@ -2011,7 +2001,6 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "slice_split_at_unchecked", since = "1.79.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub const unsafe fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
|
||||
@@ -2112,7 +2101,6 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "split_at_checked", since = "1.80.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])> {
|
||||
|
||||
@@ -172,7 +172,6 @@ pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T]
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_from_raw_parts_mut", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[must_use]
|
||||
#[rustc_diagnostic_item = "slice_from_raw_parts_mut"]
|
||||
pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T] {
|
||||
@@ -205,7 +204,6 @@ pub const fn from_ref<T>(s: &T) -> &[T] {
|
||||
/// Converts a reference to T into a slice of length 1 (without copying).
|
||||
#[stable(feature = "from_ref", since = "1.28.0")]
|
||||
#[rustc_const_stable(feature = "const_slice_from_ref", since = "1.83.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[must_use]
|
||||
pub const fn from_mut<T>(s: &mut T) -> &mut [T] {
|
||||
array::from_mut(s)
|
||||
|
||||
@@ -195,7 +195,6 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[stable(feature = "str_mut_extras", since = "1.20.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_str_from_utf8_unchecked_mut", since = "1.83.0")]
|
||||
#[rustc_diagnostic_item = "str_from_utf8_unchecked_mut"]
|
||||
pub const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
|
||||
|
||||
@@ -339,7 +339,6 @@ impl str {
|
||||
/// assert_eq!("🍔∈🌏", s);
|
||||
/// ```
|
||||
#[stable(feature = "str_mut_extras", since = "1.20.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_str_as_mut", since = "1.83.0")]
|
||||
#[must_use]
|
||||
#[inline(always)]
|
||||
@@ -386,7 +385,6 @@ impl str {
|
||||
/// It is your responsibility to make sure that the string slice only gets
|
||||
/// modified in a way that it remains valid UTF-8.
|
||||
#[stable(feature = "str_as_mut_ptr", since = "1.36.0")]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
#[rustc_const_stable(feature = "const_str_as_mut", since = "1.83.0")]
|
||||
#[rustc_never_returns_null_ptr]
|
||||
#[must_use]
|
||||
@@ -2477,7 +2475,6 @@ impl str {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_uppercase(&mut self) {
|
||||
// SAFETY: changing ASCII letters only does not invalidate UTF-8.
|
||||
let me = unsafe { self.as_bytes_mut() };
|
||||
@@ -2506,7 +2503,6 @@ impl str {
|
||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||
pub const fn make_ascii_lowercase(&mut self) {
|
||||
// SAFETY: changing ASCII letters only does not invalidate UTF-8.
|
||||
let me = unsafe { self.as_bytes_mut() };
|
||||
|
||||
Reference in New Issue
Block a user