auto merge of #10066 : sanxiyn/rust/mut-ptr-clone, r=thestinger
This commit is contained in:
commit
953e56052f
1 changed files with 7 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue