about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2024-06-28 09:17:04 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2024-07-17 14:33:39 +0200
commit538b31e9774e3c6e0561e8dbcef378deba9f3fdc (patch)
treebdf209911a39cb362d2651ff83bc1dc4ff8dfd3b /library/std/src
parentcb12b52f160c633551bd6e5be8d4c6e2e8660950 (diff)
downloadrust-538b31e9774e3c6e0561e8dbcef378deba9f3fdc.tar.gz
rust-538b31e9774e3c6e0561e8dbcef378deba9f3fdc.zip
Make language around `ToOwned` for `BorrowedFd` more precise
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/os/fd/owned.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs
index a1f83029d27..f11f7ef938a 100644
--- a/library/std/src/os/fd/owned.rs
+++ b/library/std/src/os/fd/owned.rs
@@ -24,9 +24,11 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
 /// passed as an argument, it is not captured or consumed, and it never has the
 /// value `-1`.
 ///
-/// This type's `.to_owned()` implementation returns another `BorrowedFd`
-/// rather than an `OwnedFd`. It just makes a trivial copy of the raw file
-/// descriptor, which is then borrowed under the same lifetime.
+/// This type does not have a [`ToOwned`][crate::borrow::ToOwned]
+/// implementation. Calling `.to_owned()` on a variable of this type will call
+/// it on `&BorrowedFd` and use `Clone::clone()` like `ToOwned` does for all
+/// types implementing `Clone`. The result will be descriptor borrowed under
+/// the same lifetime.
 #[derive(Copy, Clone)]
 #[repr(transparent)]
 #[rustc_layout_scalar_valid_range_start(0)]