@@ -414,10 +414,10 @@ impl UvIoFactory {
414414/// callback in a situation where the task wil be immediately blocked
415415/// afterwards. The `FsCallback` yielded must be invoked to reschedule the task
416416/// (once the result of the operation is known).
417- fn uv_fs_helper < T > ( loop_ : & mut Loop ,
418- retfn : extern "Rust" fn ( & mut FsRequest ) -> T ,
419- cb : & fn ( & mut FsRequest , & mut Loop , FsCallback ) )
420- -> Result < T , IoError > {
417+ fn uv_fs_helper < T : Send > ( loop_ : & mut Loop ,
418+ retfn : extern "Rust" fn ( & mut FsRequest ) -> T ,
419+ cb : & fn ( & mut FsRequest , & mut Loop , FsCallback ) )
420+ -> Result < T , IoError > {
421421 let result_cell = Cell :: new_empty ( ) ;
422422 let result_cell_ptr: * Cell < Result < T , IoError > > = & result_cell;
423423 do task:: unkillable { // FIXME(#8674)
@@ -1025,14 +1025,12 @@ fn read_stream(mut watcher: StreamWatcher,
10251025 let result_cell = Cell :: new_empty ( ) ;
10261026 let result_cell_ptr: * Cell < Result < uint , IoError > > = & result_cell;
10271027
1028- let buf_ptr : * & mut [ u8 ] = & buf;
1028+ let uv_buf = slice_to_uv_buf ( buf) ;
10291029 do scheduler. deschedule_running_task_and_then |_sched, task| {
10301030 let task_cell = Cell :: new ( task) ;
10311031 // XXX: We shouldn't reallocate these callbacks every
10321032 // call to read
1033- let alloc: AllocCallback = |_| unsafe {
1034- slice_to_uv_buf ( * buf_ptr)
1035- } ;
1033+ let alloc: AllocCallback = |_| uv_buf;
10361034 do watcher. read_start ( alloc) |mut watcher, nread, _buf, status| {
10371035
10381036 // Stop reading so that no read callbacks are
@@ -1280,11 +1278,10 @@ impl RtioUdpSocket for UvUdpSocket {
12801278 do self . home_for_io_with_sched |self_, scheduler| {
12811279 let result_cell = Cell :: new_empty ( ) ;
12821280 let result_cell_ptr: * Cell < Result < ( uint , SocketAddr ) , IoError > > = & result_cell;
1283-
1284- let buf_ptr: * & mut [ u8 ] = & buf;
1281+ let uv_buf = slice_to_uv_buf ( buf) ;
12851282 do scheduler. deschedule_running_task_and_then |_, task| {
12861283 let task_cell = Cell :: new ( task) ;
1287- let alloc: AllocCallback = |_| unsafe { slice_to_uv_buf ( * buf_ptr ) } ;
1284+ let alloc: AllocCallback = |_| uv_buf ;
12881285 do self_. watcher . recv_start ( alloc) |mut watcher, nread, _buf, addr, flags, status| {
12891286 let _ = flags; // /XXX add handling for partials?
12901287
0 commit comments