Skip to content

Commit 9c66599

Browse files
committed
Address unused variables warning with TcpStream
1 parent 13af92f commit 9c66599

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libstd/net/tcp.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,9 @@ impl TcpListener {
729729
/// ```
730730
#[stable(feature = "rust1", since = "1.0.0")]
731731
pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> {
732+
// On WASM, `TcpStream` is uninhabited (as it's unsupported) and so
733+
// the `a` variable here is technically unused.
734+
#[cfg_attr(target_arch = "wasm32", allow(unused_variables))]
732735
self.0.accept().map(|(a, b)| (TcpStream(a), b))
733736
}
734737

0 commit comments

Comments
 (0)