diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-02-08 02:46:55 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-02-09 00:17:40 -0800 |
| commit | d433b80e026960b28ba660ebdb09175237e02e05 (patch) | |
| tree | 8b18795290b7b6c9d717e14f07e7ce5b99eeff6b /src/libstd/util.rs | |
| parent | 49ac48db3fe2666751908668ba8e5ab16e2fb07a (diff) | |
| download | rust-d433b80e026960b28ba660ebdb09175237e02e05.tar.gz rust-d433b80e026960b28ba660ebdb09175237e02e05.zip | |
std: Add init and uninit to mem. Replace direct intrinsic usage
Diffstat (limited to 'src/libstd/util.rs')
| -rw-r--r-- | src/libstd/util.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/util.rs b/src/libstd/util.rs index 715a10b9112..05c5d7e1588 100644 --- a/src/libstd/util.rs +++ b/src/libstd/util.rs @@ -11,8 +11,8 @@ //! Miscellaneous helpers for common patterns use cast; +use mem; use ptr; -use unstable::intrinsics; /// The identity function. #[inline] @@ -26,7 +26,7 @@ pub fn id<T>(x: T) -> T { x } pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { // Give ourselves some scratch space to work with - let mut tmp: T = intrinsics::uninit(); + let mut tmp: T = mem::uninit(); let t: *mut T = &mut tmp; // Perform the swap, `&mut` pointers never alias |
