about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-09-03 23:30:37 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-09-04 01:40:02 +0530
commit9ea8f3e2ddf281ce02985a0757c599a9b9971616 (patch)
treec57519e0081e9b2bebd46c4536089b5602fc44e4 /src/libstd/sys/unix/stack_overflow.rs
parent67616f71916c94b194164278f685fc7d82b3b4d0 (diff)
parent06fb196256bbab1e7aa4f43daf45321efaa6e0eb (diff)
downloadrust-9ea8f3e2ddf281ce02985a0757c599a9b9971616.tar.gz
rust-9ea8f3e2ddf281ce02985a0757c599a9b9971616.zip
Rollup merge of #28187 - petrochenkov:null, r=aturon
And replace more `0 as *const T`/`0 as *mut T`s with `null()`/`null_mut()`s

I'm not sure what is the general policy about making simple functions `const`, but `null()` and `null_mut()` seem to be good candidates.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
-rw-r--r--src/libstd/sys/unix/stack_overflow.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/stack_overflow.rs b/src/libstd/sys/unix/stack_overflow.rs
index 1aa75fa18b7..baff3c6bcbb 100644
--- a/src/libstd/sys/unix/stack_overflow.rs
+++ b/src/libstd/sys/unix/stack_overflow.rs
@@ -93,7 +93,7 @@ mod imp {
         // See comment above for why this function returns.
     }
 
-    static mut MAIN_ALTSTACK: *mut libc::c_void = 0 as *mut libc::c_void;
+    static mut MAIN_ALTSTACK: *mut libc::c_void = ptr::null_mut();
 
     pub unsafe fn init() {
         PAGE_SIZE = ::sys::os::page_size();
@@ -155,7 +155,7 @@ mod imp {
     }
 
     pub unsafe fn make_handler() -> super::Handler {
-        super::Handler { _data: 0 as *mut libc::c_void }
+        super::Handler { _data: ptr::null_mut() }
     }
 
     pub unsafe fn drop_handler(_handler: &mut super::Handler) {