move strdup_uniq lang item to std::str

This commit is contained in:
Daniel Micay 2013-08-10 13:42:53 -04:00
parent 768c9a43ab
commit 774c9aebb3
2 changed files with 8 additions and 6 deletions

View File

@ -959,6 +959,14 @@ pub mod raw {
::cast::transmute(v)
}
#[lang="strdup_uniq"]
#[cfg(not(test))]
#[allow(missing_doc)]
#[inline]
pub unsafe fn strdup_uniq(ptr: *u8, len: uint) -> ~str {
from_buf_len(ptr, len)
}
/// Create a Rust string from a null-terminated C string
pub unsafe fn from_c_str(buf: *libc::c_char) -> ~str {
let mut curr = buf;

View File

@ -93,12 +93,6 @@ pub unsafe fn check_not_borrowed(a: *u8,
borrowck::check_not_borrowed(a, file, line)
}
#[lang="strdup_uniq"]
#[inline]
pub unsafe fn strdup_uniq(ptr: *c_uchar, len: uint) -> ~str {
str::raw::from_buf_len(ptr, len)
}
#[lang="annihilate"]
pub unsafe fn annihilate() {
::cleanup::annihilate()