fix missing_panics_doc in std::os::fd::owned

https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
This commit is contained in:
xtqqczze 2025-12-31 17:05:41 +00:00 committed by GitHub
parent 2848c2ebe9
commit 215768a734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,7 +77,11 @@ impl BorrowedFd<'_> {
/// # Safety
///
/// The resource pointed to by `fd` must remain open for the duration of
/// the returned `BorrowedFd`, and it must not have the value `-1`.
/// the returned `BorrowedFd`.
///
/// # Panics
///
/// Panics if the raw file descriptor has the value `-1`.
#[inline]
#[track_caller]
#[rustc_const_stable(feature = "io_safety", since = "1.63.0")]
@ -177,6 +181,10 @@ impl FromRawFd for OwnedFd {
/// [ownership][io-safety]. The resource must not require any cleanup other than `close`.
///
/// [io-safety]: io#io-safety
///
/// # Panics
///
/// Panics if the raw file descriptor has the value `-1`.
#[inline]
#[track_caller]
unsafe fn from_raw_fd(fd: RawFd) -> Self {