Skip to content

Commit 8acff46

Browse files
committed
Stablise anonymous-pipe
Signed-off-by: Jiahao XU <[email protected]>
1 parent 2f58193 commit 8acff46

File tree

11 files changed

+44
-51
lines changed

11 files changed

+44
-51
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
/// # #[cfg(miri)] fn main() {}
4544
/// # #[cfg(not(miri))]
4645
/// # fn main() -> std::io::Result<()> {
@@ -67,19 +66,19 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
6766
/// ```
6867
/// [changes]: io#platform-specific-behavior
6968
/// [man page]: https://man7.org/linux/man-pages/man7/pipe.7.html
70-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
69+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7170
#[inline]
7271
pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
7372
pipe_inner().map(|(reader, writer)| (PipeReader(reader), PipeWriter(writer)))
7473
}
7574

7675
/// Read end of an anonymous pipe.
77-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
76+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
7877
#[derive(Debug)]
7978
pub struct PipeReader(pub(crate) AnonPipe);
8079

8180
/// Write end of an anonymous pipe.
82-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
81+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
8382
#[derive(Debug)]
8483
pub struct PipeWriter(pub(crate) AnonPipe);
8584

@@ -89,7 +88,6 @@ impl PipeReader {
8988
/// # Examples
9089
///
9190
/// ```no_run
92-
/// #![feature(anonymous_pipe)]
9391
/// # #[cfg(miri)] fn main() {}
9492
/// # #[cfg(not(miri))]
9593
/// # fn main() -> std::io::Result<()> {
@@ -137,7 +135,7 @@ impl PipeReader {
137135
/// # Ok(())
138136
/// # }
139137
/// ```
140-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
138+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
141139
pub fn try_clone(&self) -> io::Result<Self> {
142140
self.0.try_clone().map(Self)
143141
}
@@ -149,7 +147,6 @@ impl PipeWriter {
149147
/// # Examples
150148
///
151149
/// ```no_run
152-
/// #![feature(anonymous_pipe)]
153150
/// # #[cfg(miri)] fn main() {}
154151
/// # #[cfg(not(miri))]
155152
/// # fn main() -> std::io::Result<()> {
@@ -177,13 +174,13 @@ impl PipeWriter {
177174
/// # Ok(())
178175
/// # }
179176
/// ```
180-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
177+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
181178
pub fn try_clone(&self) -> io::Result<Self> {
182179
self.0.try_clone().map(Self)
183180
}
184181
}
185182

186-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
183+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
187184
impl io::Read for &PipeReader {
188185
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
189186
self.0.read(buf)
@@ -203,7 +200,7 @@ impl io::Read for &PipeReader {
203200
}
204201
}
205202

206-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
203+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
207204
impl io::Read for PipeReader {
208205
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
209206
self.0.read(buf)
@@ -223,7 +220,7 @@ impl io::Read for PipeReader {
223220
}
224221
}
225222

226-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
223+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
227224
impl io::Write for &PipeWriter {
228225
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
229226
self.0.write(buf)
@@ -241,7 +238,7 @@ impl io::Write for &PipeWriter {
241238
}
242239
}
243240

244-
#[unstable(feature = "anonymous_pipe", issue = "127154")]
241+
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
245242
impl io::Write for PipeWriter {
246243
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
247244
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/doc/book

Submodule book updated 102 files

src/llvm-project

src/tools/cargo

Submodule cargo updated 185 files

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)