From 323c20c8a4747aa96285c90005a00aa43228af8e Mon Sep 17 00:00:00 2001 From: Oliver 'ker' Schneider Date: Fri, 11 Nov 2016 11:55:47 +0100 Subject: [breaking-change] change the `box_free` item to accept pointers to unsized types --- src/doc/book/lang-items.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/doc') diff --git a/src/doc/book/lang-items.md b/src/doc/book/lang-items.md index de7dbab3f12..9fb130845fb 100644 --- a/src/doc/book/lang-items.md +++ b/src/doc/book/lang-items.md @@ -46,8 +46,8 @@ unsafe fn deallocate(ptr: *mut u8, _size: usize, _align: usize) { } #[lang = "box_free"] -unsafe fn box_free(ptr: *mut T) { - deallocate(ptr as *mut u8, ::core::mem::size_of::(), ::core::mem::align_of::()); +unsafe fn box_free(ptr: *mut T) { + deallocate(ptr as *mut u8, ::core::mem::size_of_val(&*ptr), ::core::mem::align_of_val(&*ptr)); } #[start] -- cgit 1.4.1-3-g733a5