Repository: tokio-rs/tokio
File: tokio/src/process/mod.rs (Rust)

Code before:
    /// attributes that customize the exact behavior of the spawn operation.
    ///
    /// # Examples
    ///
    /// Basic usage:
    ///
    /// ```no_run
    /// # async fn test() { // allow using await
    /// use std::process::Stdio;
    ///
    /// let output = tokio::process::Command::new("ls")
    ///     .stdin(Stdio::null())
    ///     .stdout(Stdio::piped())
    ///     .stderr(Stdio::piped())
    ///     .spawn_with(std::process::Command::spawn)
    ///     .unwrap()
    ///     .wait_with_output()
    ///     .await
    ///     .unwrap();
    /// # }
    /// ```
    ///
    /// Actually customizing the spawn under Windows:
    ///
    /// ```ignore
    /// # #![feature(windows_process_extensions_raw_attribute)]
    /// # #[cfg(windows)]   // Windows-only nightly APIs are used here.
    /// # async fn test() { // Allow using await.
    /// use std::os::windows::process::{CommandExt, ProcThreadAttributeList};
    /// use std::process::Stdio;
    /// use tokio::process::Command;
    ///
    /// let parent = Command::new("cmd").spawn().unwrap();
    /// let parent_process_handle = parent.raw_handle();
    ///
    /// const PROC_THREAD_ATTRIBUTE_PARENT_PROCESS: usize = 0x00020000;
    /// let attribute_list = ProcThreadAttributeList::build()
    ///     .attribute(PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &parent_process_handle)
    ///     .finish()
    ///     .unwrap();
    ///
    /// let _output = Command::new("ls")
    ///     .stdin(Stdio::null())
    ///     .stdout(Stdio::piped())
    ///     .stderr(Stdio::piped())
    ///     .spawn_with(|cmd| cmd.spawn_with_attributes(&attribute_list))
    ///     .unwrap()
    ///     .wait_with_output()
    ///     .await
    ///     .unwrap();
    /// # }

Review comment (suggestion):
It seems useful to include this `#![feature]` in the rendered documentation.

Code after:
    /// attributes that customize the exact behavior of the spawn operation.
    ///
    /// # Examples
    ///
    /// Basic usage:
    ///
    /// ```no_run
    /// # async fn test() { // allow using await
    /// use std::process::Stdio;
    ///
    /// let output = tokio::process::Command::new("ls")
    ///     .stdin(Stdio::null())
    ///     .stdout(Stdio::piped())
    ///     .stderr(Stdio::piped())
    ///     .spawn_with(std::process::Command::spawn)
    ///     .unwrap()
    ///     .wait_with_output()
    ///     .await
    ///     .unwrap();
    /// # }
    /// ```
    ///
    /// Actually customizing the spawn under Windows:
    ///
    /// ```ignore
    /// #![feature(windows_process_extensions_raw_attribute)]
    /// # #[cfg(windows)]   // Windows-only nightly APIs are used here.
    /// # async fn test() { // Allow using await.
    /// use std::os::windows::process::{CommandExt, ProcThreadAttributeList};
    /// use std::process::Stdio;
    /// use tokio::process::Command;
    ///
    /// let parent = Command::new("cmd").spawn().unwrap();
    /// let parent_process_handle = parent.raw_handle();
    ///
    /// const PROC_THREAD_ATTRIBUTE_PARENT_PROCESS: usize = 0x00020000;
    /// let attribute_list = ProcThreadAttributeList::build()
    ///     .attribute(PROC_THREAD_ATTRIBUTE_PARENT_PROCESS, &parent_process_handle)
    ///     .finish()
    ///     .unwrap();
    ///
    /// let _output = Command::new("ls")
    ///     .stdin(Stdio::null())
    ///     .stdout(Stdio::piped())
    ///     .stderr(Stdio::piped())
    ///     .spawn_with(|cmd| cmd.spawn_with_attributes(&attribute_list))
    ///     .unwrap()
    ///     .wait_with_output()
    ///     .await
    ///     .unwrap();
    /// # }