From ba5fcb726fb88cc8393f48c9f46ba03fcadf0511 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 27 Jul 2015 10:50:19 -0400 Subject: Show appropriate feature flags in docs --- src/libstd/thread/mod.rs | 6 ++++-- src/libstd/thread/scoped_tls.rs | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/libstd/thread') diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 3388968c56c..2683f8e5022 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -367,7 +367,8 @@ pub fn spawn(f: F) -> JoinHandle where /// a join before any relevant stack frames are popped: /// /// ```rust -/// # #![feature(scoped)] +/// #![feature(scoped)] +/// /// use std::thread; /// /// let guard = thread::scoped(move || { @@ -447,7 +448,8 @@ pub fn panicking() -> bool { /// # Examples /// /// ``` -/// # #![feature(catch_panic)] +/// #![feature(catch_panic)] +/// /// use std::thread; /// /// let result = thread::catch_panic(|| { diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs index c2fad0aa89c..4fbfdec8e7e 100644 --- a/src/libstd/thread/scoped_tls.rs +++ b/src/libstd/thread/scoped_tls.rs @@ -24,7 +24,8 @@ //! # Examples //! //! ``` -//! # #![feature(scoped_tls)] +//! #![feature(scoped_tls)] +//! //! scoped_thread_local!(static FOO: u32); //! //! // Initially each scoped slot is empty. @@ -136,7 +137,8 @@ impl ScopedKey { /// # Examples /// /// ``` - /// # #![feature(scoped_tls)] + /// #![feature(scoped_tls)] + /// /// scoped_thread_local!(static FOO: u32); /// /// FOO.set(&100, || { @@ -189,7 +191,8 @@ impl ScopedKey { /// # Examples /// /// ```no_run - /// # #![feature(scoped_tls)] + /// #![feature(scoped_tls)] + /// /// scoped_thread_local!(static FOO: u32); /// /// FOO.with(|slot| { -- cgit 1.4.1-3-g733a5