diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-01 23:53:35 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-03 23:43:57 -0800 |
| commit | 7d8d06f86b48520814596bd5363d2b82bc619774 (patch) | |
| tree | eda093ca208286fd8679da8de9f3597b7a024c50 /src/libcoretest/ptr.rs | |
| parent | 470118f3e915cdc8f936aca0640b28a7a3d8dc6c (diff) | |
| download | rust-7d8d06f86b48520814596bd5363d2b82bc619774.tar.gz rust-7d8d06f86b48520814596bd5363d2b82bc619774.zip | |
Remove deprecated functionality
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
Diffstat (limited to 'src/libcoretest/ptr.rs')
| -rw-r--r-- | src/libcoretest/ptr.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libcoretest/ptr.rs b/src/libcoretest/ptr.rs index 162f75763de..875affe0ac7 100644 --- a/src/libcoretest/ptr.rs +++ b/src/libcoretest/ptr.rs @@ -10,6 +10,7 @@ use core::ptr::*; use core::mem; +use std::iter::repeat; #[test] fn test() { @@ -56,19 +57,15 @@ fn test() { fn test_is_null() { let p: *const int = null(); assert!(p.is_null()); - assert!(!p.is_not_null()); let q = unsafe { p.offset(1) }; assert!(!q.is_null()); - assert!(q.is_not_null()); let mp: *mut int = null_mut(); assert!(mp.is_null()); - assert!(!mp.is_not_null()); let mq = unsafe { mp.offset(1) }; assert!(!mq.is_null()); - assert!(mq.is_not_null()); } #[test] @@ -116,7 +113,7 @@ fn test_as_mut() { #[test] fn test_ptr_addition() { unsafe { - let xs = Vec::from_elem(16, 5i); + let xs = repeat(5i).take(16).collect::<Vec<_>>(); let mut ptr = xs.as_ptr(); let end = ptr.offset(16); @@ -134,7 +131,7 @@ fn test_ptr_addition() { m_ptr = m_ptr.offset(1); } - assert!(xs_mut == Vec::from_elem(16, 10i)); + assert!(xs_mut == repeat(10i).take(16).collect::<Vec<_>>()); } } |
