Skip to content

Commit af83a96

Browse files
committed
std: Stabilize command_access
Tracking issue: rust-lang#44434
1 parent 42a2a53 commit af83a96

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

library/std/src/process.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ use crate::path::Path;
115115
use crate::str;
116116
use crate::sys::pipe::{read2, AnonPipe};
117117
use crate::sys::process as imp;
118-
#[unstable(feature = "command_access", issue = "44434")]
118+
#[stable(feature = "command_access", since = "1.56.0")]
119119
pub use crate::sys_common::process::CommandEnvs;
120120
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
121121

@@ -943,13 +943,12 @@ impl Command {
943943
/// # Examples
944944
///
945945
/// ```
946-
/// # #![feature(command_access)]
947946
/// use std::process::Command;
948947
///
949948
/// let cmd = Command::new("echo");
950949
/// assert_eq!(cmd.get_program(), "echo");
951950
/// ```
952-
#[unstable(feature = "command_access", issue = "44434")]
951+
#[stable(feature = "command_access", since = "1.56.0")]
953952
pub fn get_program(&self) -> &OsStr {
954953
self.inner.get_program()
955954
}
@@ -963,7 +962,6 @@ impl Command {
963962
/// # Examples
964963
///
965964
/// ```
966-
/// # #![feature(command_access)]
967965
/// use std::ffi::OsStr;
968966
/// use std::process::Command;
969967
///
@@ -972,7 +970,7 @@ impl Command {
972970
/// let args: Vec<&OsStr> = cmd.get_args().collect();
973971
/// assert_eq!(args, &["first", "second"]);
974972
/// ```
975-
#[unstable(feature = "command_access", issue = "44434")]
973+
#[stable(feature = "command_access", since = "1.56.0")]
976974
pub fn get_args(&self) -> CommandArgs<'_> {
977975
CommandArgs { inner: self.inner.get_args() }
978976
}
@@ -992,7 +990,6 @@ impl Command {
992990
/// # Examples
993991
///
994992
/// ```
995-
/// # #![feature(command_access)]
996993
/// use std::ffi::OsStr;
997994
/// use std::process::Command;
998995
///
@@ -1004,7 +1001,7 @@ impl Command {
10041001
/// (OsStr::new("TZ"), None)
10051002
/// ]);
10061003
/// ```
1007-
#[unstable(feature = "command_access", issue = "44434")]
1004+
#[stable(feature = "command_access", since = "1.56.0")]
10081005
pub fn get_envs(&self) -> CommandEnvs<'_> {
10091006
self.inner.get_envs()
10101007
}
@@ -1016,7 +1013,6 @@ impl Command {
10161013
/// # Examples
10171014
///
10181015
/// ```
1019-
/// # #![feature(command_access)]
10201016
/// use std::path::Path;
10211017
/// use std::process::Command;
10221018
///
@@ -1025,7 +1021,7 @@ impl Command {
10251021
/// cmd.current_dir("/bin");
10261022
/// assert_eq!(cmd.get_current_dir(), Some(Path::new("/bin")));
10271023
/// ```
1028-
#[unstable(feature = "command_access", issue = "44434")]
1024+
#[stable(feature = "command_access", since = "1.56.0")]
10291025
pub fn get_current_dir(&self) -> Option<&Path> {
10301026
self.inner.get_current_dir()
10311027
}
@@ -1057,13 +1053,13 @@ impl AsInnerMut<imp::Command> for Command {
10571053
///
10581054
/// This struct is created by [`Command::get_args`]. See its documentation for
10591055
/// more.
1060-
#[unstable(feature = "command_access", issue = "44434")]
1056+
#[stable(feature = "command_access", since = "1.56.0")]
10611057
#[derive(Debug)]
10621058
pub struct CommandArgs<'a> {
10631059
inner: imp::CommandArgs<'a>,
10641060
}
10651061

1066-
#[unstable(feature = "command_access", issue = "44434")]
1062+
#[stable(feature = "command_access", since = "1.56.0")]
10671063
impl<'a> Iterator for CommandArgs<'a> {
10681064
type Item = &'a OsStr;
10691065
fn next(&mut self) -> Option<&'a OsStr> {
@@ -1074,7 +1070,7 @@ impl<'a> Iterator for CommandArgs<'a> {
10741070
}
10751071
}
10761072

1077-
#[unstable(feature = "command_access", issue = "44434")]
1073+
#[stable(feature = "command_access", since = "1.56.0")]
10781074
impl<'a> ExactSizeIterator for CommandArgs<'a> {
10791075
fn len(&self) -> usize {
10801076
self.inner.len()

library/std/src/sys_common/process.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ impl CommandEnv {
106106
/// This struct is created by
107107
/// [`Command::get_envs`][crate::process::Command::get_envs]. See its
108108
/// documentation for more.
109-
#[unstable(feature = "command_access", issue = "44434")]
109+
#[stable(feature = "command_access", since = "1.56.0")]
110110
#[derive(Debug)]
111111
pub struct CommandEnvs<'a> {
112112
iter: crate::collections::btree_map::Iter<'a, EnvKey, Option<OsString>>,
113113
}
114114

115-
#[unstable(feature = "command_access", issue = "44434")]
115+
#[stable(feature = "command_access", since = "1.56.0")]
116116
impl<'a> Iterator for CommandEnvs<'a> {
117117
type Item = (&'a OsStr, Option<&'a OsStr>);
118118
fn next(&mut self) -> Option<Self::Item> {
@@ -123,7 +123,7 @@ impl<'a> Iterator for CommandEnvs<'a> {
123123
}
124124
}
125125

126-
#[unstable(feature = "command_access", issue = "44434")]
126+
#[stable(feature = "command_access", since = "1.56.0")]
127127
impl<'a> ExactSizeIterator for CommandEnvs<'a> {
128128
fn len(&self) -> usize {
129129
self.iter.len()

0 commit comments

Comments
 (0)