Cleanup and update to rustc 2023-06-19
This commit is contained in:
parent
3d7ec5923d
commit
607cbfda14
7 changed files with 9 additions and 99 deletions
|
|
@ -504,7 +504,10 @@ impl<T> Box<T> {
|
|||
|
||||
impl<T: ?Sized, A: Allocator> Drop for Box<T, A> {
|
||||
fn drop(&mut self) {
|
||||
// drop is currently performed by compiler.
|
||||
// inner value is dropped by compiler.
|
||||
unsafe {
|
||||
libc::free(self.0.pointer.0 as *mut u8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -521,11 +524,6 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
|
|||
libc::malloc(size)
|
||||
}
|
||||
|
||||
#[lang = "box_free"]
|
||||
unsafe fn box_free<T: ?Sized>(ptr: Unique<T>, _alloc: ()) {
|
||||
libc::free(ptr.pointer.0 as *mut u8);
|
||||
}
|
||||
|
||||
#[lang = "drop"]
|
||||
pub trait Drop {
|
||||
fn drop(&mut self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue