Skip to content

Commit 604faa6

Browse files
committed
Stabilize anonymous_pipe
Closes #127154.
1 parent e1f9370 commit 604faa6

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
@@ -40,7 +40,6 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
4040
/// # Examples
4141
///
4242
/// ```no_run
43-
/// #![feature(anonymous_pipe)]
4443
/// use std::process::Command;
4544
/// use std::io::{pipe, Read, Write};
4645
///
@@ -64,19 +63,19 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
6463
/// ```
6564
/// [changes]: io#platform-specific-behavior
6665
/// [man page]: https://man7.org/linux/man-pages/man7/pipe.7.html
67-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
66+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
6867
#[inline]
6968
pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
7069
pipe_inner().map(|(reader, writer)| (PipeReader(reader), PipeWriter(writer)))
7170
}
7271

7372
/// Read end of an anonymous pipe.
74-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
73+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7574
#[derive(Debug)]
7675
pub struct PipeReader(pub(crate) AnonPipe);
7776

7877
/// Write end of an anonymous pipe.
79-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
78+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
8079
#[derive(Debug)]
8180
pub struct PipeWriter(pub(crate) AnonPipe);
8281

@@ -86,7 +85,6 @@ impl PipeReader {
8685
/// # Examples
8786
///
8887
/// ```no_run
89-
/// #![feature(anonymous_pipe)]
9088
/// use std::fs;
9189
/// use std::io::{pipe, Write};
9290
/// use std::process::Command;
@@ -131,7 +129,7 @@ impl PipeReader {
131129
/// assert_eq!(xs, "x".repeat(NUM_PROC.into()));
132130
/// # Ok::<(), std::io::Error>(())
133131
/// ```
134-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
132+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
135133
pub fn try_clone(&self) -> io::Result<Self> {
136134
self.0.try_clone().map(Self)
137135
}
@@ -143,7 +141,6 @@ impl PipeWriter {
143141
/// # Examples
144142
///
145143
/// ```no_run
146-
/// #![feature(anonymous_pipe)]
147144
/// use std::process::Command;
148145
/// use std::io::{pipe, Read};
149146
///
@@ -168,13 +165,13 @@ impl PipeWriter {
168165
/// peer.wait()?;
169166
/// # Ok::<(), std::io::Error>(())
170167
/// ```
171-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
168+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
172169
pub fn try_clone(&self) -> io::Result<Self> {
173170
self.0.try_clone().map(Self)
174171
}
175172
}
176173

177-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
174+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
178175
impl io::Read for &PipeReader {
179176
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
180177
self.0.read(buf)
@@ -194,7 +191,7 @@ impl io::Read for &PipeReader {
194191
}
195192
}
196193

197-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
194+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
198195
impl io::Read for PipeReader {
199196
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
200197
self.0.read(buf)
@@ -214,7 +211,7 @@ impl io::Read for PipeReader {
214211
}
215212
}
216213

217-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
214+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
218215
impl io::Write for &PipeWriter {
219216
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
220217
self.0.write(buf)
@@ -232,7 +229,7 @@ impl io::Write for &PipeWriter {
232229
}
233230
}
234231

235-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
232+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
236233
impl io::Write for PipeWriter {
237234
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
238235
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), not(target_os = "emscripten")))]
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)