From 094b1da3a1beb23b47e58aabe8d2c8ce74bb4f7f Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sun, 20 Dec 2020 11:56:51 +0000 Subject: [PATCH] Check that c_int is i32 in FileDesc::new. --- library/std/src/sys/unix/fd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs index 08c63444e2b..821851a6c65 100644 --- a/library/std/src/sys/unix/fd.rs +++ b/library/std/src/sys/unix/fd.rs @@ -68,7 +68,7 @@ const fn max_iov() -> usize { impl FileDesc { pub fn new(fd: c_int) -> FileDesc { - assert_ne!(fd, -1); + assert_ne!(fd, -1i32); // SAFETY: we just asserted that the value is in the valid range and isn't `-1` (the only value bigger than `0xFF_FF_FF_FE` unsigned) unsafe { FileDesc { fd } } }