Skip to content

Commit 78eaa5e

Browse files
committed
Move feature to doc comment.
1 parent 4ee922a commit 78eaa5e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@
146146
#![feature(slice_ptr_len)]
147147
#![feature(slice_range)]
148148
#![feature(str_internals)]
149-
#![feature(string_leak)]
150149
#![feature(strict_provenance)]
151150
#![feature(trusted_len)]
152151
#![feature(trusted_random_access)]

library/alloc/src/string.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1862,9 +1862,13 @@ impl String {
18621862
/// Simple usage:
18631863
///
18641864
/// ```
1865-
/// let x = String::from("bucket");
1866-
/// let static_ref: &'static mut str = x.leak();
1867-
/// assert_eq!(static_ref, "bucket");
1865+
/// #![feature(string_leak)]
1866+
///
1867+
/// pub fn main() {
1868+
/// let x = String::from("bucket");
1869+
/// let static_ref: &'static mut str = x.leak();
1870+
/// assert_eq!(static_ref, "bucket");
1871+
/// }
18681872
/// ```
18691873
#[cfg(not(no_global_oom_handling))]
18701874
#[unstable(feature = "string_leak", issue = "102929")]

0 commit comments

Comments
 (0)