Skip to content

Commit 836008e

Browse files
committed
Fix doctests.
1 parent 1481a87 commit 836008e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/alloc/src/string/string.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@ impl<A: Allocator> String<A> {
236236
/// Basic usage:
237237
///
238238
/// ```
239+
/// #![feature(string_allocator_api)]
239240
/// #![feature(allocator_api)]
240241
///
242+
/// use std::string::string::String;
241243
/// use std::alloc::System;
242244
///
243245
/// let s = String::new_in(System);
@@ -270,8 +272,10 @@ impl<A: Allocator> String<A> {
270272
/// Basic usage:
271273
///
272274
/// ```
275+
/// #![feature(string_allocator_api)]
273276
/// #![feature(allocator_api)]
274277
///
278+
/// use std::string::string::String;
275279
/// use std::alloc::System;
276280
///
277281
/// let mut s = String::with_capacity_in(10, System);
@@ -397,7 +401,9 @@ impl<A: Allocator> String<A> {
397401
///
398402
/// ```
399403
/// #![feature(vec_into_raw_parts)]
404+
/// #![feature(string_allocator_api)]
400405
/// #![feature(allocator_api)]
406+
/// use std::string::string::String;
401407
/// use std::alloc::System;
402408
/// let mut s = String::new_in(System);
403409
/// s.push_str("hello");
@@ -443,8 +449,10 @@ impl<A: Allocator> String<A> {
443449
/// Basic usage:
444450
///
445451
/// ```
452+
/// #![feature(string_allocator_api)]
446453
/// #![feature(allocator_api)]
447454
///
455+
/// use std::string::string::String;
448456
/// use std::mem;
449457
/// use std::alloc::System;
450458
///

0 commit comments

Comments
 (0)