about summary refs log tree commit diff
path: root/src/libcore/util.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-05-19 19:46:54 -0700
committerBrian Anderson <banderson@mozilla.com>2013-05-19 23:34:32 -0700
commit66319b027888ceddf024a5919e007caceaf369f3 (patch)
treed210e635c950974972a086f7caa4268be6f33c93 /src/libcore/util.rs
parent3a481c0f88025318eba7c48907a5c1d966e01d27 (diff)
downloadrust-66319b027888ceddf024a5919e007caceaf369f3.tar.gz
rust-66319b027888ceddf024a5919e007caceaf369f3.zip
Register snapshots
Diffstat (limited to 'src/libcore/util.rs')
-rw-r--r--src/libcore/util.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/libcore/util.rs b/src/libcore/util.rs
index eaf1e31d403..e2b91594d12 100644
--- a/src/libcore/util.rs
+++ b/src/libcore/util.rs
@@ -60,7 +60,6 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
  * deinitialising or copying either one.
  */
 #[inline]
-#[cfg(not(stage0))]
 pub unsafe fn swap_ptr<T>(x: *mut T, y: *mut T) {
     if x == y { return }
 
@@ -79,29 +78,6 @@ pub unsafe fn swap_ptr<T>(x: *mut T, y: *mut T) {
 }
 
 /**
- * Swap the values at two mutable locations of the same type, without
- * deinitialising or copying either one.
- */
-#[inline]
-#[cfg(stage0)]
-pub unsafe fn swap_ptr<T>(x: *mut T, y: *mut T) {
-    if x == y { return }
-
-    // Give ourselves some scratch space to work with
-    let mut tmp: T = intrinsics::init();
-    let t = ptr::to_mut_unsafe_ptr(&mut tmp);
-
-    // Perform the swap
-    ptr::copy_memory(t, x, 1);
-    ptr::copy_memory(x, y, 1);
-    ptr::copy_memory(y, t, 1);
-
-    // y and t now point to the same thing, but we need to completely forget t
-    // because it's no longer relevant.
-    cast::forget(tmp);
-}
-
-/**
  * Replace the value at a mutable location with a new one, returning the old
  * value, without deinitialising or copying either one.
  */