From 568576bab035ac1ed769e55c83edb31e427df8bd Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 25 Oct 2013 18:43:55 +0900 Subject: [PATCH] Implement Clone trait for mutable unsafe pointers --- src/libstd/ptr.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs index 8803d39b0c6..376d178f8f7 100644 --- a/src/libstd/ptr.rs +++ b/src/libstd/ptr.rs @@ -47,6 +47,13 @@ impl Clone for *T { } } +impl Clone for *mut T { + #[inline] + fn clone(&self) -> *mut T { + *self + } +} + /// Return the first offset `i` such that `f(buf[i]) == true`. #[inline] pub unsafe fn position(buf: *T, f: &fn(&T) -> bool) -> uint {