std: Remove deprecated ptr functions

The method with which backwards compatibility was retained ended up leading to
documentation that rustdoc didn't handle well and largely ended up confusing.
This commit is contained in:
Alex Crichton 2015-03-18 19:51:10 -07:00
parent ecf8c64e1b
commit e24fe5b8cf
8 changed files with 49 additions and 41 deletions

View file

@ -159,7 +159,7 @@ pub fn u64_to_be_bytes<T, F>(n: u64, size: uint, f: F) -> T where
/// that many bytes are parsed. For example, if `size` is 4, then a
/// 32-bit value is parsed.
pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 {
use ptr::{copy_nonoverlapping_memory};
use ptr::{copy_nonoverlapping};
assert!(size <= 8);
@ -171,7 +171,7 @@ pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 {
unsafe {
let ptr = data.as_ptr().offset(start as int);
let out = buf.as_mut_ptr();
copy_nonoverlapping_memory(out.offset((8 - size) as int), ptr, size);
copy_nonoverlapping(out.offset((8 - size) as int), ptr, size);
(*(out as *const u64)).to_be()
}
}