]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/rc.rs
Auto merge of #77502 - varkor:const-generics-suggest-enclosing-braces, r=petrochenkov
[rust.git] / library / alloc / src / rc.rs
index 939ebe074ed690ce8d98fdd978a0c365d463e0cd..72e5e0a82424bf3d80c387c185a94aab4df63b08 100644 (file)
@@ -1034,7 +1034,7 @@ unsafe fn allocate_for_ptr(ptr: *const T) -> *mut RcBox<T> {
 
     fn from_box(v: Box<T>) -> Rc<T> {
         unsafe {
-            let box_unique = Box::into_unique(v);
+            let (box_unique, alloc) = Box::into_unique(v);
             let bptr = box_unique.as_ptr();
 
             let value_size = size_of_val(&*bptr);
@@ -1048,7 +1048,7 @@ fn from_box(v: Box<T>) -> Rc<T> {
             );
 
             // Free the allocation without dropping its contents
-            box_free(box_unique);
+            box_free(box_unique, alloc);
 
             Self::from_ptr(ptr)
         }