Skip to content

Commit cd8a8db

Browse files
committed
Require T: Copy for setsockopt
Try to catch errors which would otherwise look odd
1 parent ca7d4db commit cd8a8db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sys/unix/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,9 @@ impl Socket {
692692
unsafe fn setsockopt<T>(&self,
693693
opt: c_int,
694694
val: c_int,
695-
payload: T) -> io::Result<()> {
695+
payload: T) -> io::Result<()>
696+
where T: Copy,
697+
{
696698
let payload = &payload as *const T as *const c_void;
697699
cvt(libc::setsockopt(self.fd,
698700
opt,

0 commit comments

Comments
 (0)