move strdup_uniq lang item to std::str
This commit is contained in:
@@ -959,6 +959,14 @@ pub mod raw {
|
|||||||
::cast::transmute(v)
|
::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
|
/// Create a Rust string from a null-terminated C string
|
||||||
pub unsafe fn from_c_str(buf: *libc::c_char) -> ~str {
|
pub unsafe fn from_c_str(buf: *libc::c_char) -> ~str {
|
||||||
let mut curr = buf;
|
let mut curr = buf;
|
||||||
|
|||||||
@@ -93,12 +93,6 @@ pub unsafe fn check_not_borrowed(a: *u8,
|
|||||||
borrowck::check_not_borrowed(a, file, line)
|
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"]
|
#[lang="annihilate"]
|
||||||
pub unsafe fn annihilate() {
|
pub unsafe fn annihilate() {
|
||||||
::cleanup::annihilate()
|
::cleanup::annihilate()
|
||||||
|
|||||||
Reference in New Issue
Block a user