Skip to content

Commit 4286ad7

Browse files
committed
Disallow constructing SocketAddr from third-party code
1 parent 2161254 commit 4286ad7

File tree

1 file changed

+2
-2
lines changed
  • src/libstd/sys/redox/ext

1 file changed

+2
-2
lines changed

src/libstd/sys/redox/ext/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use sys::{cvt, fd::FileDesc, syscall};
3737
/// let addr = socket.local_addr().expect("Couldn't get local address");
3838
/// ```
3939
#[derive(Clone)]
40-
pub struct SocketAddr;
40+
pub struct SocketAddr(());
4141

4242
impl SocketAddr {
4343
/// Returns the contents of this address if it is a `pathname` address.
@@ -516,7 +516,7 @@ impl UnixListener {
516516
/// }
517517
/// ```
518518
pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> {
519-
self.0.duplicate_path(b"listen").map(|fd| (UnixStream(fd), SocketAddr))
519+
self.0.duplicate_path(b"listen").map(|fd| (UnixStream(fd), SocketAddr(())))
520520
}
521521

522522
/// Creates a new independently owned handle to the underlying socket.

0 commit comments

Comments
 (0)