Remove comment that is now false
This commit is contained in:
parent
bfbb7197d7
commit
6854265161
@ -37,7 +37,7 @@ pub fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
|
||||
ptr::addr_of(&outsz),
|
||||
lz_norm);
|
||||
assert res as int != 0;
|
||||
let out = vec::raw::from_buf(res as *u8,
|
||||
let out = vec::raw::from_buf_raw(res as *u8,
|
||||
outsz as uint);
|
||||
libc::free(res);
|
||||
move out
|
||||
@ -55,7 +55,7 @@ pub fn inflate_bytes(bytes: &[const u8]) -> ~[u8] {
|
||||
ptr::addr_of(&outsz),
|
||||
0);
|
||||
assert res as int != 0;
|
||||
let out = vec::raw::from_buf(res as *u8,
|
||||
let out = vec::raw::from_buf_raw(res as *u8,
|
||||
outsz as uint);
|
||||
libc::free(res);
|
||||
move out
|
||||
|
@ -759,8 +759,8 @@ fn test_cant_dup_task_builder() {
|
||||
let b = task().unlinked();
|
||||
do b.spawn { }
|
||||
// FIXME(#3724): For now, this is a -runtime- failure, because we haven't
|
||||
// got move mode on self. When 3724 is fixed, this test should fail to compile
|
||||
// instead, and should go in tests/compile-fail.
|
||||
// got move mode on self. When 3724 is fixed, this test should fail to
|
||||
// compile instead, and should go in tests/compile-fail.
|
||||
do b.spawn { } // b should have been consumed by the previous call
|
||||
}
|
||||
|
||||
|
@ -1657,9 +1657,22 @@ fn dedup(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a vector from an unsafe pointer to a buffer
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* * ptr - An unsafe pointer to a buffer of `T`
|
||||
* * elts - The number of elements in the buffer
|
||||
*/
|
||||
// Wrapper for fn in raw: needs to be called by net_tcp::on_tcp_read_cb
|
||||
pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
|
||||
raw::from_buf_raw(ptr, elts)
|
||||
}
|
||||
|
||||
/// Unsafe operations
|
||||
pub mod raw {
|
||||
// FIXME: This should have crate visibility (#1893 blocks that)
|
||||
mod raw {
|
||||
|
||||
/// The internal representation of a (boxed) vector
|
||||
pub struct VecRepr {
|
||||
@ -1679,22 +1692,6 @@ pub struct UnboxedVecRepr {
|
||||
mut len: uint
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a vector from an unsafe pointer to a buffer
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* * ptr - An unsafe pointer to a buffer of `T`
|
||||
* * elts - The number of elements in the buffer
|
||||
*/
|
||||
#[inline(always)]
|
||||
pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
|
||||
let mut dst = with_capacity(elts);
|
||||
set_len(&mut dst, elts);
|
||||
as_mut_buf(dst, |p_dst, _len_dst| ptr::memcpy(p_dst, ptr, elts));
|
||||
move dst
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the length of a vector
|
||||
*
|
||||
@ -1775,6 +1772,23 @@ pub unsafe fn init_elem<T>(v: &[mut T], i: uint, val: T) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a vector from an unsafe pointer to a buffer
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* * ptr - An unsafe pointer to a buffer of `T`
|
||||
* * elts - The number of elements in the buffer
|
||||
*/
|
||||
// Was in raw, but needs to be called by net_tcp::on_tcp_read_cb
|
||||
#[inline(always)]
|
||||
pub unsafe fn from_buf_raw<T>(ptr: *T, elts: uint) -> ~[T] {
|
||||
let mut dst = with_capacity(elts);
|
||||
set_len(&mut dst, elts);
|
||||
as_mut_buf(dst, |p_dst, _len_dst| ptr::memcpy(p_dst, ptr, elts));
|
||||
move dst
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies data from one vector to another.
|
||||
*
|
||||
|
@ -190,7 +190,7 @@ unsafe fn access_cond<U>(blk: fn(x: &x/mut T, c: &c/Condvar) -> U) -> U {
|
||||
*
|
||||
* Will additionally fail if another task has failed while accessing the arc.
|
||||
*/
|
||||
// FIXME(#2585) make this a by-move method on the arc
|
||||
// FIXME(#3724) make this a by-move method on the arc
|
||||
pub fn unwrap_mutex_arc<T: Send>(arc: MutexARC<T>) -> T {
|
||||
let MutexARC { x: x } <- arc;
|
||||
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
||||
@ -368,7 +368,7 @@ fn downgrade(token: RWWriteMode/&a<T>) -> RWReadMode/&a<T> {
|
||||
* Will additionally fail if another task has failed while accessing the arc
|
||||
* in write mode.
|
||||
*/
|
||||
// FIXME(#2585) make this a by-move method on the arc
|
||||
// FIXME(#3724) make this a by-move method on the arc
|
||||
pub fn unwrap_rw_arc<T: Const Send>(arc: RWARC<T>) -> T {
|
||||
let RWARC { x: x, _ } <- arc;
|
||||
let inner = unsafe { unwrap_shared_mutable_state(move x) };
|
||||
|
@ -6,9 +6,7 @@
|
||||
use uv::iotask;
|
||||
use uv::iotask::IoTask;
|
||||
use future_spawn = future::spawn;
|
||||
// FIXME #1935
|
||||
// should be able to, but can't atm, replace w/ result::{result, extensions};
|
||||
use result::*;
|
||||
use result::{Result};
|
||||
use libc::size_t;
|
||||
use io::{Reader, ReaderUtil, Writer};
|
||||
use comm = core::comm;
|
||||
@ -1093,7 +1091,7 @@ fn to_tcp_err() -> TcpErrData {
|
||||
log(debug, fmt!("tcp on_read_cb nread: %d", nread as int));
|
||||
let reader_ch = (*socket_data_ptr).reader_ch;
|
||||
let buf_base = uv::ll::get_base_from_buf(buf);
|
||||
let new_bytes = vec::raw::from_buf(buf_base, nread as uint);
|
||||
let new_bytes = vec::from_buf(buf_base, nread as uint);
|
||||
core::comm::send(reader_ch, result::Ok(new_bytes));
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +233,6 @@ fn is_exported(i: ident, m: _mod) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: glob-exports aren't supported yet. (#2006)
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user