summary refs log tree commit diff
path: root/library/core/src/mem
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-03 20:56:34 +0000
committerbors <bors@rust-lang.org>2021-05-03 20:56:34 +0000
commit88f19c6dab716c6281af7602e30f413e809c5974 (patch)
treef7af4b32537043e9dfbdd884f811ee8fe0122d90 /library/core/src/mem
parent9a1dfd2dc5c42a2ee84b4606aa08cdadf8c0ee87 (diff)
parent47c7b9c5788055ddbbb59d0d1fc909af7b48668d (diff)
downloadrust-1.52.0.tar.gz
rust-1.52.0.zip
Auto merge of #84864 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.52.0
[stable] 1.52.0 release

This includes the release notes (#84183) as well as cherry-picked commits from:

* [beta] revert PR #77885 #84710
* [beta] remove assert_matches #84759
* Revert PR 81473 to resolve (on beta) issues 81626 and 81658. #83171
* [beta] rustdoc revert deref recur #84868
*  Fix ICE of for-loop mut borrowck where no suggestions are available #83401

Additionally in "fresh work" we're also:

* reverting: directly expose copy and copy_nonoverlapping intrinsics #81238 to avoid https://github.com/rust-lang/rust/issues/84297 on 1.52
Diffstat (limited to 'library/core/src/mem')
-rw-r--r--library/core/src/mem/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index 37e8d65db6a..c4f0d917674 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -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.