From 6b3f64cbe0b4f971aae83d43ad1121376a35afe7 Mon Sep 17 00:00:00 2001 From: Zachary S Date: Thu, 18 Jan 2024 22:33:46 -0600 Subject: [PATCH] Fix doctests. --- library/alloc/src/string/string.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/alloc/src/string/string.rs b/library/alloc/src/string/string.rs index fc1f1d94a23c0..8c34e79d13eca 100644 --- a/library/alloc/src/string/string.rs +++ b/library/alloc/src/string/string.rs @@ -507,8 +507,10 @@ impl String { /// Basic usage: /// /// ``` + /// #![feature(string_allocator_api)] /// #![feature(allocator_api)] /// + /// use std::string::string::String; /// use std::alloc::System; /// /// let s = String::new_in(System); @@ -541,8 +543,10 @@ impl String { /// Basic usage: /// /// ``` + /// #![feature(string_allocator_api)] /// #![feature(allocator_api)] /// + /// use std::string::string::String; /// use std::alloc::System; /// /// let mut s = String::with_capacity_in(10, System); @@ -653,7 +657,9 @@ impl String { /// /// ``` /// #![feature(vec_into_raw_parts)] + /// #![feature(string_allocator_api)] /// #![feature(allocator_api)] + /// use std::string::string::String; /// use std::alloc::System; /// let mut s = String::new_in(System); /// s.push_str("hello"); @@ -699,8 +705,10 @@ impl String { /// Basic usage: /// /// ``` + /// #![feature(string_allocator_api)] /// #![feature(allocator_api)] /// + /// use std::string::string::String; /// use std::mem; /// use std::alloc::System; ///