about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-13 18:15:14 +0000
committerbors <bors@rust-lang.org>2023-07-13 18:15:14 +0000
commita161ab00dbf660dd587ee42a8c855bac94047ddb (patch)
treee0615e207acf3fec0d089d1ec334e63c8bcb40cb /library/alloc/src
parent1b3e68692592d71938df8e7fd8e53fbe5e7ef58c (diff)
parente8b0b1781d177ab4aa0dca80d3c648f47287d149 (diff)
downloadrust-a161ab00dbf660dd587ee42a8c855bac94047ddb.tar.gz
rust-a161ab00dbf660dd587ee42a8c855bac94047ddb.zip
Auto merge of #113637 - Mark-Simulacrum:bootstrap-bump, r=ozkanonur
Bump bootstrap to 1.72 beta
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/alloc.rs21
-rw-r--r--library/alloc/src/string.rs2
2 files changed, 1 insertions, 22 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index e24a0fe51bd..c8751ba4911 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -4,11 +4,7 @@
 
 #[cfg(not(test))]
 use core::intrinsics;
-#[cfg(all(bootstrap, not(test)))]
-use core::intrinsics::{min_align_of_val, size_of_val};
 
-#[cfg(all(bootstrap, not(test)))]
-use core::ptr::Unique;
 #[cfg(not(test))]
 use core::ptr::{self, NonNull};
 
@@ -337,23 +333,6 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
     }
 }
 
-#[cfg(all(bootstrap, not(test)))]
-#[lang = "box_free"]
-#[inline]
-// This signature has to be the same as `Box`, otherwise an ICE will happen.
-// When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as
-// well.
-// For example if `Box` is changed to  `struct Box<T: ?Sized, A: Allocator>(Unique<T>, A)`,
-// this function has to be changed to `fn box_free<T: ?Sized, A: Allocator>(Unique<T>, A)` as well.
-unsafe fn box_free<T: ?Sized, A: Allocator>(ptr: Unique<T>, alloc: A) {
-    unsafe {
-        let size = size_of_val(ptr.as_ref());
-        let align = min_align_of_val(ptr.as_ref());
-        let layout = Layout::from_size_align_unchecked(size, align);
-        alloc.deallocate(From::from(ptr.cast()), layout)
-    }
-}
-
 // # Allocation error handler
 
 #[cfg(not(no_global_oom_handling))]
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 1c6815fa941..ad7b77f5497 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -1873,7 +1873,7 @@ impl String {
     /// let static_ref: &'static mut str = x.leak();
     /// assert_eq!(static_ref, "bucket");
     /// ```
-    #[stable(feature = "string_leak", since = "CURRENT_RUSTC_VERSION")]
+    #[stable(feature = "string_leak", since = "1.72.0")]
     #[inline]
     pub fn leak<'a>(self) -> &'a mut str {
         let slice = self.vec.leak();