diff --git a/1.9/ja/book/lang-items.md b/1.9/ja/book/lang-items.md index 48879000..48b34ba6 100644 --- a/1.9/ja/book/lang-items.md +++ b/1.9/ja/book/lang-items.md @@ -46,11 +46,17 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 { p } + #[lang = "exchange_free"] unsafe fn deallocate(ptr: *mut u8, _size: usize, _align: usize) { libc::free(ptr as *mut libc::c_void) } +#[lang = "box_free"] +unsafe fn box_free(ptr: *mut T) { + deallocate(ptr as *mut u8, ::core::mem::size_of::(), ::core::mem::align_of::()); +} + #[start] fn main(argc: isize, argv: *const *const u8) -> isize { let x = box 1; diff --git a/diff-1.6.0..1.9.0/src/doc/book/lang-items.md b/diff-1.6.0..1.9.0/src/doc/book/lang-items.md deleted file mode 100644 index 9044ac39..00000000 --- a/diff-1.6.0..1.9.0/src/doc/book/lang-items.md +++ /dev/null @@ -1,21 +0,0 @@ ---- a/src/doc/book/lang-items.md -+++ b/src/doc/book/lang-items.md -@@ -39,11 +39,17 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 { - - p - } -+ - #[lang = "exchange_free"] - unsafe fn deallocate(ptr: *mut u8, _size: usize, _align: usize) { - libc::free(ptr as *mut libc::c_void) - } - -+#[lang = "box_free"] -+unsafe fn box_free(ptr: *mut T) { -+ deallocate(ptr as *mut u8, ::core::mem::size_of::(), ::core::mem::align_of::()); -+} -+ - #[start] - fn main(argc: isize, argv: *const *const u8) -> isize { - let x = box 1; -diff --git a/src/doc/book/learn-rust.md b/src/doc/book/learn-rust.md