/// the returned `BorrowedFd`, and it must not have the value `-1`.
#[inline]
#[unstable(feature = "io_safety", issue = "87074")]
- pub unsafe fn borrow_raw_fd(fd: RawFd) -> Self {
+ pub unsafe fn borrow_raw(fd: RawFd) -> Self {
assert_ne!(fd, u32::MAX as RawFd);
// 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 { Self { fd, _phantom: PhantomData } }
// Safety: `OwnedFd` and `BorrowedFd` have the same validity
// invariants, and the `BorrowdFd` is bounded by the lifetime
// of `&self`.
- unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
+ unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}