Check that c_int is i32 in FileDesc::new.

This commit is contained in:
Mara Bos 2020-12-20 11:56:51 +00:00 committed by GitHub
parent 08b70eda2c
commit 094b1da3a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 } }
}