Implement Clone trait for mutable unsafe pointers

This commit is contained in:
Seo Sanghyeon 2013-10-25 18:43:55 +09:00
parent f27dfa04e5
commit 568576bab0

View file

@ -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 {