Skip to content

Commit 887fb7f

Browse files
committed
Stabilize anonymous_pipe
Closes #127154.
1 parent 37c7bea commit 887fb7f

File tree

7 files changed

+40
-47
lines changed

7 files changed

+40
-47
lines changed

library/std/src/io/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ pub use self::error::RawOsError;
310310
pub use self::error::SimpleMessage;
311311
#[unstable(feature = "io_const_error", issue = "133448")]
312312
pub use self::error::const_error;
313-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
313+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
314314
pub use self::pipe::{PipeReader, PipeWriter, pipe};
315315
#[stable(feature = "is_terminal", since = "1.70.0")]
316316
pub use self::stdio::IsTerminal;

library/std/src/io/pipe.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
3232
/// # Examples
3333
///
3434
/// ```no_run
35-
/// #![feature(anonymous_pipe)]
3635
/// use std::process::Command;
3736
/// use std::io::{pipe, Read, Write};
3837
///
@@ -56,19 +55,19 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
5655
/// ```
5756
/// [changes]: io#platform-specific-behavior
5857
/// [man page]: https://man7.org/linux/man-pages/man7/pipe.7.html
59-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
58+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
6059
#[inline]
6160
pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
6261
pipe_inner().map(|(reader, writer)| (PipeReader(reader), PipeWriter(writer)))
6362
}
6463

6564
/// Read end of the anonymous pipe.
66-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
65+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
6766
#[derive(Debug)]
6867
pub struct PipeReader(pub(crate) AnonPipe);
6968

7069
/// Write end of the anonymous pipe.
71-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
70+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7271
#[derive(Debug)]
7372
pub struct PipeWriter(pub(crate) AnonPipe);
7473

@@ -78,7 +77,6 @@ impl PipeReader {
7877
/// # Examples
7978
///
8079
/// ```no_run
81-
/// #![feature(anonymous_pipe)]
8280
/// use std::fs;
8381
/// use std::io::{pipe, Write};
8482
/// use std::process::Command;
@@ -123,7 +121,7 @@ impl PipeReader {
123121
/// assert_eq!(xs, "x".repeat(NUM_PROC.into()));
124122
/// # Ok::<(), std::io::Error>(())
125123
/// ```
126-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
124+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
127125
pub fn try_clone(&self) -> io::Result<Self> {
128126
self.0.try_clone().map(Self)
129127
}
@@ -135,7 +133,6 @@ impl PipeWriter {
135133
/// # Examples
136134
///
137135
/// ```no_run
138-
/// #![feature(anonymous_pipe)]
139136
/// use std::process::Command;
140137
/// use std::io::{pipe, Read};
141138
///
@@ -160,13 +157,13 @@ impl PipeWriter {
160157
/// peer.wait()?;
161158
/// # Ok::<(), std::io::Error>(())
162159
/// ```
163-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
160+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
164161
pub fn try_clone(&self) -> io::Result<Self> {
165162
self.0.try_clone().map(Self)
166163
}
167164
}
168165

169-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
166+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
170167
impl io::Read for &PipeReader {
171168
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
172169
self.0.read(buf)
@@ -186,7 +183,7 @@ impl io::Read for &PipeReader {
186183
}
187184
}
188185

189-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
186+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
190187
impl io::Read for PipeReader {
191188
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
192189
self.0.read(buf)
@@ -206,7 +203,7 @@ impl io::Read for PipeReader {
206203
}
207204
}
208205

209-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
206+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
210207
impl io::Write for &PipeWriter {
211208
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
212209
self.0.write(buf)
@@ -224,7 +221,7 @@ impl io::Write for &PipeWriter {
224221
}
225222
}
226223

227-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
224+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
228225
impl io::Write for PipeWriter {
229226
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
230227
self.0.write(buf)

library/std/src/sys/anonymous_pipe/unix.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -12,88 +12,88 @@ pub fn pipe() -> io::Result<(AnonPipe, AnonPipe)> {
1212
anon_pipe().map(|(rx, wx)| (rx.into_inner(), wx.into_inner()))
1313
}
1414

15-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
15+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
1616
impl AsFd for PipeReader {
1717
fn as_fd(&self) -> BorrowedFd<'_> {
1818
self.0.as_fd()
1919
}
2020
}
21-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
21+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
2222
impl AsRawFd for PipeReader {
2323
fn as_raw_fd(&self) -> RawFd {
2424
self.0.as_raw_fd()
2525
}
2626
}
27-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
27+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
2828
impl From<PipeReader> for OwnedFd {
2929
fn from(pipe: PipeReader) -> Self {
3030
FileDesc::into_inner(pipe.0)
3131
}
3232
}
33-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
33+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
3434
impl FromRawFd for PipeReader {
3535
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
3636
unsafe { Self(FileDesc::from_raw_fd(raw_fd)) }
3737
}
3838
}
39-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
39+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
4040
impl IntoRawFd for PipeReader {
4141
fn into_raw_fd(self) -> RawFd {
4242
self.0.into_raw_fd()
4343
}
4444
}
45-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
45+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
4646
impl From<PipeReader> for Stdio {
4747
fn from(pipe: PipeReader) -> Self {
4848
Self::from(OwnedFd::from(pipe))
4949
}
5050
}
5151

52-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
52+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
5353
impl AsFd for PipeWriter {
5454
fn as_fd(&self) -> BorrowedFd<'_> {
5555
self.0.as_fd()
5656
}
5757
}
58-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
58+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
5959
impl AsRawFd for PipeWriter {
6060
fn as_raw_fd(&self) -> RawFd {
6161
self.0.as_raw_fd()
6262
}
6363
}
64-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
64+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
6565
impl From<PipeWriter> for OwnedFd {
6666
fn from(pipe: PipeWriter) -> Self {
6767
FileDesc::into_inner(pipe.0)
6868
}
6969
}
70-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
70+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7171
impl FromRawFd for PipeWriter {
7272
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
7373
unsafe { Self(FileDesc::from_raw_fd(raw_fd)) }
7474
}
7575
}
76-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
76+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7777
impl IntoRawFd for PipeWriter {
7878
fn into_raw_fd(self) -> RawFd {
7979
self.0.into_raw_fd()
8080
}
8181
}
82-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
82+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
8383
impl From<PipeWriter> for Stdio {
8484
fn from(pipe: PipeWriter) -> Self {
8585
Self::from(OwnedFd::from(pipe))
8686
}
8787
}
8888

89-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
89+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
9090
impl From<OwnedFd> for PipeReader {
9191
fn from(owned_fd: OwnedFd) -> Self {
9292
Self(FileDesc::from_inner(owned_fd))
9393
}
9494
}
9595

96-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
96+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
9797
impl From<OwnedFd> for PipeWriter {
9898
fn from(owned_fd: OwnedFd) -> Self {
9999
Self(FileDesc::from_inner(owned_fd))

library/std/src/sys/anonymous_pipe/unsupported.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ pub fn pipe() -> io::Result<(AnonPipe, AnonPipe)> {
77
Err(io::Error::UNSUPPORTED_PLATFORM)
88
}
99

10-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
10+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
1111
impl From<PipeReader> for Stdio {
1212
fn from(pipe: PipeReader) -> Self {
1313
pipe.0.diverge()
1414
}
1515
}
1616

17-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
17+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
1818
impl From<PipeWriter> for Stdio {
1919
fn from(pipe: PipeWriter) -> Self {
2020
pipe.0.diverge()

library/std/src/sys/anonymous_pipe/windows.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -23,92 +23,92 @@ pub fn pipe() -> io::Result<(AnonPipe, AnonPipe)> {
2323
}
2424
}
2525

26-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
26+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
2727
impl AsHandle for PipeReader {
2828
fn as_handle(&self) -> BorrowedHandle<'_> {
2929
self.0.as_handle()
3030
}
3131
}
32-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
32+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
3333
impl AsRawHandle for PipeReader {
3434
fn as_raw_handle(&self) -> RawHandle {
3535
self.0.as_raw_handle()
3636
}
3737
}
3838

39-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
39+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
4040
impl FromRawHandle for PipeReader {
4141
unsafe fn from_raw_handle(raw_handle: RawHandle) -> Self {
4242
unsafe { Self(Handle::from_raw_handle(raw_handle)) }
4343
}
4444
}
45-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
45+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
4646
impl IntoRawHandle for PipeReader {
4747
fn into_raw_handle(self) -> RawHandle {
4848
self.0.into_raw_handle()
4949
}
5050
}
5151

52-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
52+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
5353
impl From<PipeReader> for OwnedHandle {
5454
fn from(pipe: PipeReader) -> Self {
5555
Handle::into_inner(pipe.0)
5656
}
5757
}
58-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
58+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
5959
impl From<PipeReader> for Stdio {
6060
fn from(pipe: PipeReader) -> Self {
6161
Self::from(OwnedHandle::from(pipe))
6262
}
6363
}
6464

65-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
65+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
6666
impl AsHandle for PipeWriter {
6767
fn as_handle(&self) -> BorrowedHandle<'_> {
6868
self.0.as_handle()
6969
}
7070
}
71-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
71+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7272
impl AsRawHandle for PipeWriter {
7373
fn as_raw_handle(&self) -> RawHandle {
7474
self.0.as_raw_handle()
7575
}
7676
}
7777

78-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
78+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7979
impl FromRawHandle for PipeWriter {
8080
unsafe fn from_raw_handle(raw_handle: RawHandle) -> Self {
8181
unsafe { Self(Handle::from_raw_handle(raw_handle)) }
8282
}
8383
}
84-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
84+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
8585
impl IntoRawHandle for PipeWriter {
8686
fn into_raw_handle(self) -> RawHandle {
8787
self.0.into_raw_handle()
8888
}
8989
}
9090

91-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
91+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
9292
impl From<PipeWriter> for OwnedHandle {
9393
fn from(pipe: PipeWriter) -> Self {
9494
Handle::into_inner(pipe.0)
9595
}
9696
}
97-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
97+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
9898
impl From<PipeWriter> for Stdio {
9999
fn from(pipe: PipeWriter) -> Self {
100100
Self::from(OwnedHandle::from(pipe))
101101
}
102102
}
103103

104-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
104+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
105105
impl From<OwnedHandle> for PipeReader {
106106
fn from(owned_handle: OwnedHandle) -> Self {
107107
Self(Handle::from_inner(owned_handle))
108108
}
109109
}
110110

111-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
111+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
112112
impl From<OwnedHandle> for PipeWriter {
113113
fn from(owned_handle: OwnedHandle) -> Self {
114114
Self(Handle::from_inner(owned_handle))

library/std/tests/pipe_subprocess.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(anonymous_pipe)]
2-
31
fn main() {
42
#[cfg(all(not(miri), any(unix, windows)))]
53
{

src/tools/miri/tests/pass/shims/pipe.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ignore-target: windows
22

3-
#![feature(anonymous_pipe)]
4-
53
use std::io::{Read, Write, pipe};
64

75
fn main() {

0 commit comments

Comments
 (0)