diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2025-02-24 16:00:56 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2025-03-06 17:58:34 -0300 |
| commit | a68db7e3a844839028c90dbb2ab0a56ddc63c718 (patch) | |
| tree | d5cf5cfc49f954f940bfac7b58c0796340ff92f8 /library/std/src | |
| parent | 1702c000562b914e926e4b586f1fb4a6945ab345 (diff) | |
| download | rust-a68db7e3a844839028c90dbb2ab0a56ddc63c718.tar.gz rust-a68db7e3a844839028c90dbb2ab0a56ddc63c718.zip | |
Add examples in stdlib demonstrating the use syntax
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/keyword_docs.rs | 9 |
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 |
