about summary refs log tree commit diff
path: root/library/alloc/src/string.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-08 04:50:28 +0000
committerbors <bors@rust-lang.org>2023-05-08 04:50:28 +0000
commitea0c22ea4f58f181d6739fbe624329e576ce7994 (patch)
tree5e3dea659dd2ed390720bb92f62ef287b1c8e41f /library/alloc/src/string.rs
parent04c53444dff325a0a3a4cb88cb952fbf341861ec (diff)
parent4e7c14fe9f03dd0189f954bd9cb97c3c513e7eed (diff)
downloadrust-ea0c22ea4f58f181d6739fbe624329e576ce7994.tar.gz
rust-ea0c22ea4f58f181d6739fbe624329e576ce7994.zip
Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, r=Mark-Simulacrum
enable `rust_2018_idioms` lint group for doctests

With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests.

Resolves #106086
Resolves #99144

Signed-off-by: ozkanonur <work@onurozkan.dev>
Diffstat (limited to 'library/alloc/src/string.rs')
-rw-r--r--library/alloc/src/string.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index b9ef76c109a..088139a6907 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -2741,7 +2741,7 @@ impl<'a> From<Cow<'a, str>> for String {
     /// ```
     /// # use std::borrow::Cow;
     /// // If the string is not owned...
-    /// let cow: Cow<str> = Cow::Borrowed("eggplant");
+    /// let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
     /// // It will allocate on the heap and copy the string.
     /// let owned: String = String::from(cow);
     /// assert_eq!(&owned[..], "eggplant");