Bug 1709505 - Fix -D dead-code bustage in third_party/rust/mio. r=emilio

After bug 1708379, the build fails with --enable-warnings-as-errors with
rustc 1.52.

```
error: field is never read: `hdr`
    --> third_party/rust/mio/src/sys/unix/uds.rs:190:17
     |
 190 |                 hdr: libc::cmsghdr,
     |                 ^^^^^^^^^^^^^^^^^^
     |
     = note: `-D dead-code` implied by `-D warnings`
```

```
error: field is never read: `instant_notify`
   --> third_party/rust/mio/src/sys/windows/tcp.rs:85:5
    |
 85 |     instant_notify: bool,
    |     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`
```

Differential Revision: https://phabricator.services.mozilla.com/D114311
This commit is contained in:
Mike Hommey 2021-05-05 06:54:23 +00:00
parent 4178828587
commit f1cf961151
2 changed files with 1 additions and 3 deletions

View File

@ -187,6 +187,7 @@ impl UnixSocket {
iov_len: buf.len(),
};
struct Cmsg {
#[allow(dead_code)]
hdr: libc::cmsghdr,
data: [libc::c_int; 1],
}

View File

@ -82,7 +82,6 @@ struct ListenerInner {
iocp: ReadyBinding,
accept: State<net::TcpStream, (net::TcpStream, SocketAddr)>,
accept_buf: AcceptAddrsBuf,
instant_notify: bool,
}
enum State<T, U> {
@ -667,7 +666,6 @@ impl TcpListener {
iocp: ReadyBinding::new(),
accept: State::Empty,
accept_buf: AcceptAddrsBuf::new(),
instant_notify: false,
}),
}),
},
@ -808,7 +806,6 @@ impl Evented for TcpListener {
unsafe {
super::no_notify_on_instant_completion(self.imp.inner.socket.as_raw_socket() as HANDLE)?;
me.instant_notify = true;
}
self.imp.schedule_accept(&mut me);