Make language around ToOwned for BorrowedFd more precise · model-checking/verify-rust-std@455bd57 (original) (raw)

Original file line number Diff line number Diff line change
@@ -24,9 +24,11 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
24 24 /// passed as an argument, it is not captured or consumed, and it never has the
25 25 /// value `-1`.
26 26 ///
27 -/// This type's `.to_owned()` implementation returns another `BorrowedFd`
28 -/// rather than an `OwnedFd`. It just makes a trivial copy of the raw file
29 -/// descriptor, which is then borrowed under the same lifetime.
27 +/// This type does not have a [`ToOwned`][crate::borrow::ToOwned]
28 +/// implementation. Calling `.to_owned()` on a variable of this type will call
29 +/// it on `&BorrowedFd` and use `Clone::clone()` like `ToOwned` does for all
30 +/// types implementing `Clone`. The result will be descriptor borrowed under
31 +/// the same lifetime.
30 32 #[derive(Copy, Clone)]
31 33 #[repr(transparent)]
32 34 #[rustc_layout_scalar_valid_range_start(0)]