Skip to content

Commit 953e560

Browse files
committed
auto merge of #10066 : sanxiyn/rust/mut-ptr-clone, r=thestinger
2 parents baeed88 + 568576b commit 953e560

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libstd/ptr.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ impl<T> Clone for *T {
4747
}
4848
}
4949

50+
impl<T> Clone for *mut T {
51+
#[inline]
52+
fn clone(&self) -> *mut T {
53+
*self
54+
}
55+
}
56+
5057
/// Return the first offset `i` such that `f(buf[i]) == true`.
5158
#[inline]
5259
pub unsafe fn position<T>(buf: *T, f: &fn(&T) -> bool) -> uint {

0 commit comments

Comments
 (0)