about summary refs log tree commit diff
path: root/src/libstd/sys/common
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-05 15:22:48 +0000
committerbors <bors@rust-lang.org>2015-02-05 15:22:48 +0000
commit2c05354211b04a52cc66a0b8ad8b2225eaf9e972 (patch)
treed9e86702774074efe4d9f44aba0fad8355e1655e /src/libstd/sys/common
parent2bd8ec2d197809fc0f0efccf1de14419ffb17b2b (diff)
parent92f11e938a80a719badcd2168a2e38a2a800fcb6 (diff)
downloadrust-2c05354211b04a52cc66a0b8ad8b2225eaf9e972.tar.gz
rust-2c05354211b04a52cc66a0b8ad8b2225eaf9e972.zip
Auto merge of #21843 - japaric:kindless, r=alexcrichton
This needs a snapshot that includes #21805 before it can be merged.

There are some places where type inference regressed after I removed the annotations (see `FIXME`s). cc @nikomatsakis.

r? @eddyb or anyone
(I'll remove the `FIXME`s before merging, as they are only intended to point out regressions)
Diffstat (limited to 'src/libstd/sys/common')
-rw-r--r--src/libstd/sys/common/helper_thread.rs4
-rw-r--r--src/libstd/sys/common/net.rs14
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs
index 6f6179a436e..255f474d4f4 100644
--- a/src/libstd/sys/common/helper_thread.rs
+++ b/src/libstd/sys/common/helper_thread.rs
@@ -95,14 +95,14 @@ impl<M: Send> Helper<M> {
                 let receive = RaceBox(receive);
 
                 let t = f();
-                Thread::spawn(move |:| {
+                Thread::spawn(move || {
                     helper(receive.0, rx, t);
                     let _g = self.lock.lock().unwrap();
                     *self.shutdown.get() = true;
                     self.cond.notify_one()
                 });
 
-                rt::at_exit(move|:| { self.shutdown() });
+                rt::at_exit(move|| { self.shutdown() });
                 *self.initialized.get() = true;
             }
         }
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs
index 833de8adda4..7325e0a5ac8 100644
--- a/src/libstd/sys/common/net.rs
+++ b/src/libstd/sys/common/net.rs
@@ -723,8 +723,8 @@ impl TcpStream {
 
     pub fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
         let fd = self.fd();
-        let dolock = |&:| self.lock_nonblocking();
-        let doread = |&mut: nb| unsafe {
+        let dolock = || self.lock_nonblocking();
+        let doread = |nb| unsafe {
             let flags = if nb {c::MSG_DONTWAIT} else {0};
             libc::recv(fd,
                        buf.as_mut_ptr() as *mut libc::c_void,
@@ -736,8 +736,8 @@ impl TcpStream {
 
     pub fn write(&mut self, buf: &[u8]) -> IoResult<()> {
         let fd = self.fd();
-        let dolock = |&:| self.lock_nonblocking();
-        let dowrite = |&: nb: bool, buf: *const u8, len: uint| unsafe {
+        let dolock = || self.lock_nonblocking();
+        let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe {
             let flags = if nb {c::MSG_DONTWAIT} else {0};
             libc::send(fd,
                        buf as *const _,
@@ -871,7 +871,7 @@ impl UdpSocket {
         let mut addrlen: libc::socklen_t =
                 mem::size_of::<libc::sockaddr_storage>() as libc::socklen_t;
 
-        let dolock = |&:| self.lock_nonblocking();
+        let dolock = || self.lock_nonblocking();
         let n = try!(read(fd, self.read_deadline, dolock, |nb| unsafe {
             let flags = if nb {c::MSG_DONTWAIT} else {0};
             libc::recvfrom(fd,
@@ -892,8 +892,8 @@ impl UdpSocket {
         let dstp = &storage as *const _ as *const libc::sockaddr;
 
         let fd = self.fd();
-        let dolock = |&: | self.lock_nonblocking();
-        let dowrite = |&mut: nb, buf: *const u8, len: uint| unsafe {
+        let dolock = || self.lock_nonblocking();
+        let dowrite = |nb, buf: *const u8, len: uint| unsafe {
             let flags = if nb {c::MSG_DONTWAIT} else {0};
             libc::sendto(fd,
                          buf as *const libc::c_void,