diff options
| author | bors <bors@rust-lang.org> | 2013-10-25 11:46:11 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-25 11:46:11 -0700 |
| commit | 953e56052fb6d82bfc2d38bd93049a62d427a703 (patch) | |
| tree | 76bcae5933100bfcf64c4120c8b0f7e5f3438067 /src/libstd | |
| parent | baeed886aa64943ad48121cc3b57dabec12bc835 (diff) | |
| parent | 568576bab035ac1ed769e55c83edb31e427df8bd (diff) | |
| download | rust-953e56052fb6d82bfc2d38bd93049a62d427a703.tar.gz rust-953e56052fb6d82bfc2d38bd93049a62d427a703.zip | |
auto merge of #10066 : sanxiyn/rust/mut-ptr-clone, r=thestinger
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ptr.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<T> Clone for *T { } } +impl<T> 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<T>(buf: *T, f: &fn(&T) -> bool) -> uint { |
