about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorjD91mZM2 <me@krake.one>2018-06-18 07:15:59 +0200
committerjD91mZM2 <me@krake.one>2018-06-26 20:31:35 +0200
commit4286ad7f0d3e1c39ac31205e43011e29b1486dcf (patch)
treec761d3af4568752479e5d0db21e4b952560e8e39 /src/libstd/sys
parent2161254d8a211e9e5caecf259ac9fbcad6479030 (diff)
downloadrust-4286ad7f0d3e1c39ac31205e43011e29b1486dcf.tar.gz
rust-4286ad7f0d3e1c39ac31205e43011e29b1486dcf.zip
Disallow constructing SocketAddr from third-party code
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/redox/ext/net.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/redox/ext/net.rs b/src/libstd/sys/redox/ext/net.rs
index 396a140fa1b..2ae7803378e 100644
--- a/src/libstd/sys/redox/ext/net.rs
+++ b/src/libstd/sys/redox/ext/net.rs
@@ -37,7 +37,7 @@ use sys::{cvt, fd::FileDesc, syscall};
 /// let addr = socket.local_addr().expect("Couldn't get local address");
 /// ```
 #[derive(Clone)]
-pub struct SocketAddr;
+pub struct SocketAddr(());
 
 impl SocketAddr {
     /// Returns the contents of this address if it is a `pathname` address.
@@ -516,7 +516,7 @@ impl UnixListener {
     /// }
     /// ```
     pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> {
-        self.0.duplicate_path(b"listen").map(|fd| (UnixStream(fd), SocketAddr))
+        self.0.duplicate_path(b"listen").map(|fd| (UnixStream(fd), SocketAddr(())))
     }
 
     /// Creates a new independently owned handle to the underlying socket.