Skip to content

Assert validity on the raw socket in SockRef::from #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove sockref_from_invalid_fd test
Doesn't work on 1.46, the AsRawFd implementation for RawFd was
added in Rust 1.48.
  • Loading branch information
Thomasdezeeuw committed Jul 28, 2021
commit bccd366de7a7d5b35c46635039dad858caac175b
8 changes: 0 additions & 8 deletions src/sockref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,3 @@ impl fmt::Debug for SockRef<'_> {
.finish()
}
}

#[test]
#[should_panic]
#[cfg(unix)]
fn sockref_from_invalid_fd() {
let raw: std::os::unix::io::RawFd = -1;
let _ = SockRef::from(&raw);
}