Skip to content

Commit

Permalink
Check that c_int is i32 in FileDesc::new.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se authored Dec 20, 2020
1 parent 08b70ed commit 094b1da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
}
Expand Down

0 comments on commit 094b1da

Please sign in to comment.