diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-06-24 20:54:52 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-07-12 10:40:40 +0200 |
| commit | 81e95c18b7d4c45c7ef41b231af4ecd40543567d (patch) | |
| tree | ced85ac151c5d6c0a892fc063906a232b3b49ea3 /src/libstd/sync | |
| parent | 2539c15b49530e882a3e8803b3f53a7914d367be (diff) | |
| download | rust-81e95c18b7d4c45c7ef41b231af4ecd40543567d.tar.gz rust-81e95c18b7d4c45c7ef41b231af4ecd40543567d.zip | |
Use `ptr::{null, null_mut}` instead of `0 as *{const, mut}`
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/once.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index e9ea465cc99..54c1fe6c564 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -65,6 +65,7 @@ // it! use marker; +use ptr; use sync::atomic::{AtomicUsize, AtomicBool, Ordering}; use thread::{self, Thread}; @@ -297,7 +298,7 @@ impl Once { let mut node = Waiter { thread: Some(thread::current()), signaled: AtomicBool::new(false), - next: 0 as *mut Waiter, + next: ptr::null_mut(), }; let me = &mut node as *mut Waiter as usize; assert!(me & STATE_MASK == 0); |
