diff options
| author | bors <bors@rust-lang.org> | 2014-11-17 11:22:00 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-17 11:22:00 +0000 | 
| commit | 0047dbe59c41b951d34ce6324f3a8c0e15d523e9 (patch) | |
| tree | e4f717adb4830ca6e737a23c81abbab3bb3a80b5 /src/libstd/sys/unix | |
| parent | edfb83c9e28df2a8f326d688f3d5b1f6faa72db8 (diff) | |
| parent | ca08540a0039e827114752d11166ea8cb1387068 (diff) | |
| download | rust-0047dbe59c41b951d34ce6324f3a8c0e15d523e9.tar.gz rust-0047dbe59c41b951d34ce6324f3a8c0e15d523e9.zip | |
auto merge of #19027 : nick29581/rust/coercions-4, r=alexcrichton
The forwards compatible parts of #18645, rebased. Converts implicit coercions from `[T, ..n]` to `&[T]` into explicit references.
Diffstat (limited to 'src/libstd/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/helper_signal.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/pipe.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/process.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/unix/tcp.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/timer.rs | 2 | 
6 files changed, 13 insertions, 13 deletions
| diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 2d02c34e958..816876b5e4a 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -376,7 +376,7 @@ mod tests { writer.write(b"test").ok().unwrap(); let mut buf = [0u8, ..4]; - match reader.read(buf) { + match reader.read(&mut buf) { Ok(4) => { assert_eq!(buf[0], 't' as u8); assert_eq!(buf[1], 'e' as u8); @@ -386,7 +386,7 @@ mod tests { r => panic!("invalid read: {}", r), } - assert!(writer.read(buf).is_err()); - assert!(reader.write(buf).is_err()); + assert!(writer.read(&mut buf).is_err()); + assert!(reader.write(&buf).is_err()); } } diff --git a/src/libstd/sys/unix/helper_signal.rs b/src/libstd/sys/unix/helper_signal.rs index a806bea2568..ed9bd0a239f 100644 --- a/src/libstd/sys/unix/helper_signal.rs +++ b/src/libstd/sys/unix/helper_signal.rs @@ -21,7 +21,7 @@ pub fn new() -> (signal, signal) { } pub fn signal(fd: libc::c_int) { - FileDesc::new(fd, false).write([0]).ok().unwrap(); + FileDesc::new(fd, false).write(&[0]).ok().unwrap(); } pub fn close(fd: libc::c_int) { diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 67384848a94..3fba06e0c7f 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -281,8 +281,8 @@ impl UnixAcceptor { fd => return Ok(UnixStream::new(Arc::new(Inner::new(fd)))), } } - try!(await([self.fd(), self.inner.reader.fd()], - deadline, Readable)); + try!(await(&[self.fd(), self.inner.reader.fd()], + deadline, Readable)); } Err(eof()) @@ -295,7 +295,7 @@ impl UnixAcceptor { pub fn close_accept(&mut self) -> IoResult<()> { self.inner.closed.store(true, atomic::SeqCst); let fd = FileDesc::new(self.inner.writer.fd(), false); - match fd.write([0]) { + match fd.write(&[0]) { Ok(..) => Ok(()), Err(..) if wouldblock() => Ok(()), Err(e) => Err(e), diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 0965d98d9b0..d7de841f958 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -107,7 +107,7 @@ impl Process { } else if pid > 0 { drop(output); let mut bytes = [0, ..4]; - return match input.read(bytes) { + return match input.read(&mut bytes) { Ok(4) => { let errno = (bytes[0] as i32 << 24) | (bytes[1] as i32 << 16) | @@ -160,7 +160,7 @@ impl Process { (errno >> 8) as u8, (errno >> 0) as u8, ]; - assert!(output.write(bytes).is_ok()); + assert!(output.write(&bytes).is_ok()); unsafe { libc::_exit(1) } } diff --git a/src/libstd/sys/unix/tcp.rs b/src/libstd/sys/unix/tcp.rs index 962475e4177..00643ac0a79 100644 --- a/src/libstd/sys/unix/tcp.rs +++ b/src/libstd/sys/unix/tcp.rs @@ -121,8 +121,8 @@ impl TcpAcceptor { -1 => return Err(last_net_error()), fd => return Ok(TcpStream::new(fd as sock_t)), } - try!(await([self.fd(), self.inner.reader.fd()], - deadline, Readable)); + try!(await(&[self.fd(), self.inner.reader.fd()], + deadline, Readable)); } Err(sys_common::eof()) @@ -139,7 +139,7 @@ impl TcpAcceptor { pub fn close_accept(&mut self) -> IoResult<()> { self.inner.closed.store(true, atomic::SeqCst); let fd = FileDesc::new(self.inner.writer.fd(), false); - match fd.write([0]) { + match fd.write(&[0]) { Ok(..) => Ok(()), Err(..) if wouldblock() => Ok(()), Err(e) => Err(e), diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs index a1e6ac3db7e..184ef3adce1 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -193,7 +193,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) { // drain the file descriptor let mut buf = [0]; - assert_eq!(fd.read(buf).ok().unwrap(), 1); + assert_eq!(fd.read(&mut buf).ok().unwrap(), 1); } -1 if os::errno() == libc::EINTR as uint => {} | 
