Skip to content

Conversation

Thomasdezeeuw
Copy link
Collaborator

Since we now use the niche feature on Unix it's unsound to use
SockRef::from(-1), but it can be done without any unsafe. This change
adds an assertion to ensure we hit this soundness issue.

Still need to wait on the I/O safety RFC:
https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
Tracking issue: rust-lang/rust#87074
Implementation pr: rust-lang/rust#87329

Closes #229 (again)
Updates #218
Closes #244

Since we now use the niche feature on Unix it's unsound to use
SockRef::from(-1), but it can be done without any unsafe. This change
adds an assertion to ensure we hit this soundness issue.

Still need to wait on the I/O safety RFC:
https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
Tracking issue: rust-lang/rust#87074
Implementation pr: rust-lang/rust#87329
Doesn't work on 1.46, the AsRawFd implementation for RawFd was
added in Rust 1.48.
@Thomasdezeeuw Thomasdezeeuw force-pushed the 244_sockref_from_unsound branch from 06b7fe5 to bccd366 Compare July 28, 2021 16:51
@Thomasdezeeuw Thomasdezeeuw merged commit b65a640 into rust-lang:master Jul 28, 2021
@Thomasdezeeuw Thomasdezeeuw deleted the 244_sockref_from_unsound branch July 28, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant