Skip to content

Rollup of 6 pull requests #127832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
04eed9b
Initial implementation of annoymous_pipe
NobodyXu Jun 30, 2024
72bda33
Fix compilation errors
NobodyXu Jun 30, 2024
42e8beb
Implement validation in `TryFrom<OwnedFd> for PIpe*` on unix
NobodyXu Jun 30, 2024
e170c78
Move the mod `pipe` to `std::net`
NobodyXu Jun 30, 2024
473fbce
Fix typo
NobodyXu Jun 30, 2024
97626b6
Fix tidy errors
NobodyXu Jun 30, 2024
d60438f
Validate pipe in `TryFrom<OwnedHandle> for Pipe*`
NobodyXu Jun 30, 2024
b7af685
Refactor: Extract new method `FileDesc::get_access_mode`
NobodyXu Jun 30, 2024
4c6b6bb
Add testing for anonymous pipe
NobodyXu Jul 1, 2024
594abec
Refactor: Put mod `unix` & `windows` into separate files
NobodyXu Jul 2, 2024
d9f0980
Fix `anonymous_pipe` impl for not supported targets
NobodyXu Jul 2, 2024
6c755a3
Optimize: Add `#[inline]` to very simple function
NobodyXu Jul 2, 2024
d15cee5
Refactor: Make `AcessMode` an enum`
NobodyXu Jul 9, 2024
4fa2a9b
rewrite dump-ice-to-disk to rmake
Oneirical Jul 9, 2024
e22dd1a
Update mod.rs
NobodyXu Jul 10, 2024
100fe5c
Move `std::net::pip*` to a new mod `std::pipe`
NobodyXu Jul 10, 2024
62b846e
Remove use of `macro_rules!`
NobodyXu Jul 10, 2024
4547b30
Replace `TryFrom<Owned*>` with `From`
NobodyXu Jul 10, 2024
7f8f178
`impl Send + Sync` and override `count` for the `CStr::bytes` iterator
Sky9x Jul 7, 2024
23f26b1
lift_to_tcx -> lift_to_interner
compiler-errors Jul 16, 2024
8dafc5c
std: Use read_unaligned for reading DWARF
workingjubilee Jul 16, 2024
3eecff3
Fix compilation errors on unsupported targets
NobodyXu Jul 11, 2024
51bdcf6
Use futex.rs for Windows thread parking
ChrisDenton Jul 16, 2024
2f9dfd4
tcx -> cx in rustc_type_ir
compiler-errors Jul 16, 2024
b9487d3
Fix relations
compiler-errors Jul 16, 2024
d879ea3
rewrite panic-abort-eh_frame to rmake
Oneirical Jul 9, 2024
2499057
std: unwrapped unsafe is VERBOTEN!
workingjubilee Jul 16, 2024
6288dc4
Rollup merge of #127153 - NobodyXu:pipe, r=jhpratt
tgross35 Jul 16, 2024
be379de
Rollup merge of #127444 - Sky9x:cstr-bytes-iter, r=dtolnay
tgross35 Jul 16, 2024
1864a61
Rollup merge of #127523 - Oneirical:treasure-test, r=jieyouxu
tgross35 Jul 16, 2024
29f587d
Rollup merge of #127792 - workingjubilee:read-unaligned-is-dwarfier, …
tgross35 Jul 16, 2024
c7bff42
Rollup merge of #127807 - ChrisDenton:win-parking, r=joboet
tgross35 Jul 16, 2024
ad52051
Rollup merge of #127810 - compiler-errors:less-tcx, r=lcnr
tgross35 Jul 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix compilation errors on unsupported targets
Also fix typos

Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu and workingjubilee committed Jul 16, 2024
commit 3eecff33c9a3ff9905375be3ee9e64636eaa3aa5
15 changes: 9 additions & 6 deletions library/std/src/sys/anonymous_pipe/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
//! Module for annoymous pipe
//! Module for anonymous pipe
//!
//! ```
//! #![feature(anonymous_pipe)]
//!
//! # #[cfg(miri)] fn main() {}
//! # #[cfg(not(miri))]
//! # fn main() -> std::io::Result<()> {
//! let (reader, writer) = std::pipe::pipe()?;
//! # Ok(())
//! # }
//! ```

use crate::{io, process::Stdio, sys::pipe::AnonPipe};
use crate::{io, sys::pipe::AnonPipe};

/// Create annoymous pipe that is close-on-exec and blocking.
/// Create anonymous pipe that is close-on-exec and blocking.
#[unstable(feature = "anonymous_pipe", issue = "127154")]
#[inline]
pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
Expand All @@ -25,12 +28,12 @@ pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
}
}

/// Read end of the annoymous pipe.
/// Read end of the anonymous pipe.
#[unstable(feature = "anonymous_pipe", issue = "127154")]
#[derive(Debug)]
pub struct PipeReader(AnonPipe);

/// Write end of the annoymous pipe.
/// Write end of the anonymous pipe.
#[unstable(feature = "anonymous_pipe", issue = "127154")]
#[derive(Debug)]
pub struct PipeWriter(AnonPipe);
Expand Down Expand Up @@ -137,5 +140,5 @@ mod unix;
#[cfg(windows)]
mod windows;

#[cfg(test)]
#[cfg(all(test, not(miri)))]
mod tests;
1 change: 1 addition & 0 deletions library/std/src/sys/anonymous_pipe/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::*;

use crate::{
os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd},
process::Stdio,
sys::{
fd::FileDesc,
pipe::{anon_pipe, AnonPipe},
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/anonymous_pipe/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{
os::windows::io::{
AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle,
},
process::Stdio,
sys::{
handle::Handle,
pipe::{anon_pipe, AnonPipe, Pipes},
Expand Down
11 changes: 10 additions & 1 deletion library/std/src/sys/pal/unsupported/pipe.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
use crate::{
fmt,
io::{self, BorrowedCursor, IoSlice, IoSliceMut},
};

pub struct AnonPipe(!);

impl fmt::Debug for AnonPipe {
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0
}
}

impl AnonPipe {
pub fn try_clone(&self) -> io::Result<Self> {
self.0
Expand Down
Loading