diff options
| author | bors <bors@rust-lang.org> | 2014-09-16 23:26:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-16 23:26:11 +0000 |
| commit | 0e784e16840e8a0c623cc6166de26da9334db3d6 (patch) | |
| tree | cb9ee37525225e3cbe4cda7d7954f2f72d24acb8 /src/liballoc | |
| parent | ceb9bbfbf5933f9df238fecdd14e75304439c4f4 (diff) | |
| parent | fc525eeb4ec3443d29bce677f589b19f31c189bb (diff) | |
| download | rust-0e784e16840e8a0c623cc6166de26da9334db3d6.tar.gz rust-0e784e16840e8a0c623cc6166de26da9334db3d6.zip | |
auto merge of #17268 : aturon/rust/mut-conventions, r=alexcrichton
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. Additional details and motivation in the RFC. Note that the iterator *type* names are not changed by this RFC; those are awaiting a separate RFC for standardization. Closes #13660 Closes #16810 [breaking-change]
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/heap.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/libc_heap.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 2905b30deeb..51e1f64e006 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -140,7 +140,7 @@ static MIN_ALIGN: uint = 16; #[cfg(jemalloc)] mod imp { use core::option::{None, Option}; - use core::ptr::{RawPtr, mut_null, null}; + use core::ptr::{RawPtr, null_mut, null}; use core::num::Int; use libc::{c_char, c_int, c_void, size_t}; use super::MIN_ALIGN; @@ -230,7 +230,7 @@ mod imp { pub fn stats_print() { unsafe { - je_malloc_stats_print(None, mut_null(), null()) + je_malloc_stats_print(None, null_mut(), null()) } } } diff --git a/src/liballoc/libc_heap.rs b/src/liballoc/libc_heap.rs index e3fa639929f..4f6400630fd 100644 --- a/src/liballoc/libc_heap.rs +++ b/src/liballoc/libc_heap.rs @@ -12,7 +12,7 @@ //! The global (exchange) heap. use libc::{c_void, size_t, free, malloc, realloc}; -use core::ptr::{RawPtr, mut_null}; +use core::ptr::{RawPtr, null_mut}; /// A wrapper around libc::malloc, aborting on out-of-memory. #[inline] @@ -20,7 +20,7 @@ pub unsafe fn malloc_raw(size: uint) -> *mut u8 { // `malloc(0)` may allocate, but it may also return a null pointer // http://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html if size == 0 { - mut_null() + null_mut() } else { let p = malloc(size as size_t); if p.is_null() { @@ -37,7 +37,7 @@ pub unsafe fn realloc_raw(ptr: *mut u8, size: uint) -> *mut u8 { // http://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html if size == 0 { free(ptr as *mut c_void); - mut_null() + null_mut() } else { let p = realloc(ptr as *mut c_void, size as size_t); if p.is_null() { |
