Show appropriate feature flags in docs

This commit is contained in:
Steve Klabnik
2015-07-27 10:50:19 -04:00
parent d019a49ac8
commit ba5fcb726f
47 changed files with 419 additions and 214 deletions

View File

@@ -367,7 +367,8 @@ pub fn spawn<F, T>(f: F) -> JoinHandle<T> 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(|| {

View File

@@ -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<T> ScopedKey<T> {
/// # Examples
///
/// ```
/// # #![feature(scoped_tls)]
/// #![feature(scoped_tls)]
///
/// scoped_thread_local!(static FOO: u32);
///
/// FOO.set(&100, || {
@@ -189,7 +191,8 @@ impl<T> ScopedKey<T> {
/// # Examples
///
/// ```no_run
/// # #![feature(scoped_tls)]
/// #![feature(scoped_tls)]
///
/// scoped_thread_local!(static FOO: u32);
///
/// FOO.with(|slot| {