Make language around `ToOwned` for `BorrowedFd` more precise · model-checking/verify-rust-std@455bd57

Original file line numberDiff line numberDiff line change

@@ -24,9 +24,11 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};

2424

/// passed as an argument, it is not captured or consumed, and it never has the

2525

/// value `-1`.

2626

///

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.

3032

#[derive(Copy, Clone)]

3133

#[repr(transparent)]

3234

#[rustc_layout_scalar_valid_range_start(0)]