From 06fb196256bbab1e7aa4f43daf45321efaa6e0eb Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 3 Sep 2015 09:49:50 +0300 Subject: Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T` --- src/libstd/thread/scoped_tls.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstd/thread') diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs index bfcaabdbc17..87f58b4c849 100644 --- a/src/libstd/thread/scoped_tls.rs +++ b/src/libstd/thread/scoped_tls.rs @@ -226,6 +226,7 @@ impl ScopedKey { #[doc(hidden)] mod imp { use cell::Cell; + use ptr; pub struct KeyInner { inner: Cell<*mut T> } @@ -233,7 +234,7 @@ mod imp { impl KeyInner { pub const fn new() -> KeyInner { - KeyInner { inner: Cell::new(0 as *mut _) } + KeyInner { inner: Cell::new(ptr::null_mut()) } } pub unsafe fn set(&self, ptr: *mut T) { self.inner.set(ptr); } pub unsafe fn get(&self) -> *mut T { self.inner.get() } -- cgit 1.4.1-3-g733a5