drop some const unstables, due to revert no longer possible
This commit is contained in:
parent
80ec986f9f
commit
28e5e93fc2
|
@ -682,8 +682,7 @@ pub unsafe fn uninitialized<T>() -> T {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_swap", issue = "83163")]
|
||||
pub const fn swap<T>(x: &mut T, y: &mut T) {
|
||||
pub fn swap<T>(x: &mut T, y: &mut T) {
|
||||
// SAFETY: the raw pointers have been created from safe mutable references satisfying all the
|
||||
// constraints on `ptr::swap_nonoverlapping_one`
|
||||
unsafe {
|
||||
|
@ -813,8 +812,7 @@ 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"]
|
||||
#[rustc_const_unstable(feature = "const_replace", issue = "83164")]
|
||||
pub const fn replace<T>(dest: &mut T, src: T) -> T {
|
||||
pub fn replace<T>(dest: &mut T, src: T) -> T {
|
||||
// SAFETY: We read from `dest` but directly write `src` into it afterwards,
|
||||
// such that the old value is not duplicated. Nothing is dropped and
|
||||
// nothing here can panic.
|
||||
|
|
|
@ -463,8 +463,7 @@ pub const unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
#[rustc_const_unstable(feature = "const_swap", issue = "83163")]
|
||||
pub(crate) const unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) {
|
||||
pub(crate) unsafe fn swap_nonoverlapping_one<T>(x: *mut T, y: *mut T) {
|
||||
// For types smaller than the block optimization below,
|
||||
// just swap directly to avoid pessimizing codegen.
|
||||
if mem::size_of::<T>() < 32 {
|
||||
|
|
|
@ -1013,9 +1013,8 @@ impl<T: ?Sized> *mut T {
|
|||
///
|
||||
/// [`ptr::write`]: crate::ptr::write()
|
||||
#[stable(feature = "pointer_methods", since = "1.26.0")]
|
||||
#[rustc_const_unstable(feature = "const_ptr_write", issue = "none")]
|
||||
#[inline]
|
||||
pub const unsafe fn write(self, val: T)
|
||||
pub unsafe fn write(self, val: T)
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue