move strdup_uniq
lang item to std::str
This commit is contained in:
parent
768c9a43ab
commit
774c9aebb3
@ -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;
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user