diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-27 11:18:36 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-27 11:19:03 +0300 |
| commit | 377b0900aede976b2d37a499bbd7b62c2e39b358 (patch) | |
| tree | b4a5a4431d36ed1a4e0a39c7d2ef2563ecac9bf4 /src/libcoretest | |
| parent | 6e8e4f847c2ea02fec021ea15dfb2de6beac797a (diff) | |
| download | rust-377b0900aede976b2d37a499bbd7b62c2e39b358.tar.gz rust-377b0900aede976b2d37a499bbd7b62c2e39b358.zip | |
Use `const fn` to abstract away the contents of UnsafeCell & friends.
Diffstat (limited to 'src/libcoretest')
| -rw-r--r-- | src/libcoretest/atomic.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcoretest/atomic.rs b/src/libcoretest/atomic.rs index 8e3c7f4595a..c50f18c2352 100644 --- a/src/libcoretest/atomic.rs +++ b/src/libcoretest/atomic.rs @@ -70,13 +70,15 @@ fn int_xor() { assert_eq!(x.load(SeqCst), 0xf731 ^ 0x137f); } -static S_BOOL : AtomicBool = ATOMIC_BOOL_INIT; -static S_INT : AtomicIsize = ATOMIC_ISIZE_INIT; -static S_UINT : AtomicUsize = ATOMIC_USIZE_INIT; +static S_FALSE: AtomicBool = AtomicBool::new(false); +static S_TRUE: AtomicBool = AtomicBool::new(true); +static S_INT: AtomicIsize = AtomicIsize::new(0); +static S_UINT: AtomicUsize = AtomicUsize::new(0); #[test] fn static_init() { - assert!(!S_BOOL.load(SeqCst)); + assert!(!S_FALSE.load(SeqCst)); + assert!(S_TRUE.load(SeqCst)); assert!(S_INT.load(SeqCst) == 0); assert!(S_UINT.load(SeqCst) == 0); } |
