@@ -37,28 +37,23 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
3737    p 
3838} 
3939
40- #[lang = "exchange_free"] 
41- unsafe fn deallocate(ptr: *mut u8, _size: usize, _align: usize) { 
42-     libc::free(ptr as *mut libc::c_void) 
43- } 
44- 
4540#[lang = "box_free"] 
4641unsafe fn box_free<T: ?Sized>(ptr: *mut T) { 
47-     deallocate (ptr as *mut u8, ::core::mem::size_of_val(&*ptr), ::core::mem::align_of_val(&*ptr));  
42+     libc::free (ptr as *mut libc::c_void)  
4843} 
4944
5045#[start] 
51- fn main(argc : isize, argv : *const *const u8) -> isize { 
52-     let x  = box 1; 
46+ fn main(_argc : isize, _argv : *const *const u8) -> isize { 
47+     let _x  = box 1; 
5348
5449    0 
5550} 
5651
5752#[lang = "eh_personality"] extern fn rust_eh_personality() {} 
5853#[lang = "panic_fmt"] extern fn rust_begin_panic() -> ! { unsafe { intrinsics::abort() } } 
59- # # [lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {} 
60- # # [no_mangle] pub extern fn rust_eh_register_frames () {} 
61- # # [no_mangle] pub extern fn rust_eh_unregister_frames () {} 
54+ #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {} 
55+ #[no_mangle] pub extern fn rust_eh_register_frames () {} 
56+ #[no_mangle] pub extern fn rust_eh_unregister_frames () {} 
6257``` 
6358
6459Note the use of ` abort ` : the ` exchange_malloc `  lang item is assumed to
@@ -80,7 +75,7 @@ Other features provided by lang items include:
8075
8176Lang items are loaded lazily by the compiler; e.g. if one never uses
8277` Box `  then there is no need to define functions for ` exchange_malloc ` 
83- and ` exchange_free ` . ` rustc `  will emit an error when an item is needed
78+ and ` box_free ` . ` rustc `  will emit an error when an item is needed
8479but not found in the current crate or any that it depends on.
8580
8681Most lang items are defined by ` libcore ` , but if you're trying to build
@@ -318,4 +313,4 @@ the source code.
318313  -  ` phantom_data ` : ` libcore/marker.rs ` 
319314  -  ` freeze ` : ` libcore/marker.rs ` 
320315  -  ` debug_trait ` : ` libcore/fmt/mod.rs ` 
321-   -  ` non_zero ` : ` libcore/nonzero.rs ` 
316+   -  ` non_zero ` : ` libcore/nonzero.rs ` 
0 commit comments