diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-09-03 23:30:37 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-09-04 01:40:02 +0530 |
| commit | 9ea8f3e2ddf281ce02985a0757c599a9b9971616 (patch) | |
| tree | c57519e0081e9b2bebd46c4536089b5602fc44e4 /src/libstd/thread | |
| parent | 67616f71916c94b194164278f685fc7d82b3b4d0 (diff) | |
| parent | 06fb196256bbab1e7aa4f43daf45321efaa6e0eb (diff) | |
| download | rust-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/thread')
| -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() } |
