diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-03 09:49:50 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-03 09:49:50 +0300 |
| commit | 06fb196256bbab1e7aa4f43daf45321efaa6e0eb (patch) | |
| tree | 23863826af019b2bc07d295882e092d244c36699 /src/libstd/thread/scoped_tls.rs | |
| parent | 3903ea96f557dc923cf73d3905554083cd921a01 (diff) | |
| download | rust-06fb196256bbab1e7aa4f43daf45321efaa6e0eb.tar.gz rust-06fb196256bbab1e7aa4f43daf45321efaa6e0eb.zip | |
Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`
Diffstat (limited to 'src/libstd/thread/scoped_tls.rs')
| -rw-r--r-- | src/libstd/thread/scoped_tls.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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<T> ScopedKey<T> { #[doc(hidden)] mod imp { use cell::Cell; + use ptr; pub struct KeyInner<T> { inner: Cell<*mut T> } @@ -233,7 +234,7 @@ mod imp { impl<T> KeyInner<T> { pub const fn new() -> KeyInner<T> { - 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() } |
