We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81ea0b2 commit f429b3eCopy full SHA for f429b3e
example/mini_core.rs
@@ -546,7 +546,8 @@ impl<T> Box<T> {
546
547
impl<T: ?Sized, A> Drop for Box<T, A> {
548
fn drop(&mut self) {
549
- // drop is currently performed by compiler.
+ // inner value is dropped by compiler
550
+ libc::free(self.0.pointer.0 as *mut u8);
551
}
552
553
@@ -563,11 +564,6 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
563
564
libc::malloc(size)
565
566
-#[lang = "box_free"]
567
-unsafe fn box_free<T: ?Sized>(ptr: Unique<T>, _alloc: ()) {
568
- libc::free(ptr.pointer.0 as *mut u8);
569
-}
570
-
571
#[lang = "drop"]
572
pub trait Drop {
573
fn drop(&mut self);
0 commit comments