Show appropriate feature flags in docs
This commit is contained in:
@@ -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(|| {
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user