about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-07 19:15:33 +0100
committerGitHub <noreply@github.com>2025-03-07 19:15:33 +0100
commitf5a143f796d9227e45a8c0f4d101d2b644fa0cc8 (patch)
tree2931e05792fe3f648428e1d40c93b4621f6f3a1f /library/std/src
parent03eb45452305f2d52348279d0caa5fc1f12c438d (diff)
parentd2bde63b7ade858b7fa819aa042f6b2e196863ff (diff)
downloadrust-f5a143f796d9227e45a8c0f4d101d2b644fa0cc8.tar.gz
rust-f5a143f796d9227e45a8c0f4d101d2b644fa0cc8.zip
Rollup merge of #134797 - spastorino:ergonomic-ref-counting-1, r=nikomatsakis
Ergonomic ref counting

This is an experimental first version of ergonomic ref counting.

This first version implements most of the RFC but doesn't implement any of the optimizations. This was left for following iterations.

RFC: https://github.com/rust-lang/rfcs/pull/3680
Tracking issue: https://github.com/rust-lang/rust/issues/132290
Project goal: https://github.com/rust-lang/rust-project-goals/issues/107

r? ```@nikomatsakis```
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/keyword_docs.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index bdd330611de..5ac3dbc3e98 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -2121,8 +2121,8 @@ mod unsafe_keyword {}
 
 #[doc(keyword = "use")]
 //
-/// Import or rename items from other crates or modules, or specify precise capturing
-/// with `use<..>`.
+/// Import or rename items from other crates or modules, use values under ergonomic clones
+/// semantic, or specify precise capturing with `use<..>`.
 ///
 /// ## Importing items
 ///
@@ -2205,6 +2205,11 @@ mod unsafe_keyword {}
 ///
 /// For more details about precise capturing, see the [Reference][ref-impl-trait].
 ///
+/// ## Ergonomic clones
+///
+/// Use a values, copying its content if the value implements `Copy`, cloning the contents if the
+/// value implements `UseCloned` or moving it otherwise.
+///
 /// [`crate`]: keyword.crate.html
 /// [`self`]: keyword.self.html
 /// [`super`]: keyword.super.html