Skip to content
/ rust Public
forked from rust-lang/rust

Commit 0d61b83

Browse files
authored
Rollup merge of rust-lang#138875 - thaliaarchi:trusty-build, r=randomPoison,saethlin
Trusty: Fix build for anonymous pipes and std::sys::process PRs rust-lang#136842 (Add libstd support for Trusty targets), rust-lang#137793 (Stablize anonymous pipe), and rust-lang#136929 (std: move process implementations to `sys`) merged around the same time, so update Trusty to take them into account. cc `@randomPoison`
2 parents 8b61871 + b672659 commit 0d61b83

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

library/std/src/os/fd/owned.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ use crate::mem::ManuallyDrop;
1515
target_os = "trusty"
1616
)))]
1717
use crate::sys::cvt;
18-
use crate::sys_common::FromInner;
1918
#[cfg(not(target_os = "trusty"))]
20-
use crate::sys_common::{AsInner, IntoInner};
19+
use crate::sys_common::{AsInner, FromInner, IntoInner};
2120
use crate::{fmt, io};
2221

2322
type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>;
@@ -507,41 +506,47 @@ impl<'a> AsFd for io::StderrLock<'a> {
507506
}
508507

509508
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
509+
#[cfg(not(target_os = "trusty"))]
510510
impl AsFd for io::PipeReader {
511511
fn as_fd(&self) -> BorrowedFd<'_> {
512512
self.0.as_fd()
513513
}
514514
}
515515

516516
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
517+
#[cfg(not(target_os = "trusty"))]
517518
impl From<io::PipeReader> for OwnedFd {
518519
fn from(pipe: io::PipeReader) -> Self {
519520
pipe.0.into_inner()
520521
}
521522
}
522523

523524
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
525+
#[cfg(not(target_os = "trusty"))]
524526
impl AsFd for io::PipeWriter {
525527
fn as_fd(&self) -> BorrowedFd<'_> {
526528
self.0.as_fd()
527529
}
528530
}
529531

530532
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
533+
#[cfg(not(target_os = "trusty"))]
531534
impl From<io::PipeWriter> for OwnedFd {
532535
fn from(pipe: io::PipeWriter) -> Self {
533536
pipe.0.into_inner()
534537
}
535538
}
536539

537540
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
541+
#[cfg(not(target_os = "trusty"))]
538542
impl From<OwnedFd> for io::PipeReader {
539543
fn from(owned_fd: OwnedFd) -> Self {
540544
Self(FromInner::from_inner(owned_fd))
541545
}
542546
}
543547

544548
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
549+
#[cfg(not(target_os = "trusty"))]
545550
impl From<OwnedFd> for io::PipeWriter {
546551
fn from(owned_fd: OwnedFd) -> Self {
547552
Self(FromInner::from_inner(owned_fd))

library/std/src/os/fd/raw.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ use crate::os::unix::io::AsFd;
1818
use crate::os::unix::io::OwnedFd;
1919
#[cfg(target_os = "wasi")]
2020
use crate::os::wasi::io::OwnedFd;
21-
use crate::sys_common::FromInner;
2221
#[cfg(not(target_os = "trusty"))]
23-
use crate::sys_common::{AsInner, IntoInner};
22+
use crate::sys_common::{AsInner, FromInner, IntoInner};
2423

2524
/// Raw file descriptors.
2625
#[stable(feature = "rust1", since = "1.0.0")]
@@ -287,41 +286,47 @@ impl<T: AsRawFd> AsRawFd for Box<T> {
287286
}
288287

289288
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
289+
#[cfg(not(target_os = "trusty"))]
290290
impl AsRawFd for io::PipeReader {
291291
fn as_raw_fd(&self) -> RawFd {
292292
self.0.as_raw_fd()
293293
}
294294
}
295295

296296
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
297+
#[cfg(not(target_os = "trusty"))]
297298
impl FromRawFd for io::PipeReader {
298299
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
299300
Self::from_inner(unsafe { FromRawFd::from_raw_fd(raw_fd) })
300301
}
301302
}
302303

303304
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
305+
#[cfg(not(target_os = "trusty"))]
304306
impl IntoRawFd for io::PipeReader {
305307
fn into_raw_fd(self) -> RawFd {
306308
self.0.into_raw_fd()
307309
}
308310
}
309311

310312
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
313+
#[cfg(not(target_os = "trusty"))]
311314
impl AsRawFd for io::PipeWriter {
312315
fn as_raw_fd(&self) -> RawFd {
313316
self.0.as_raw_fd()
314317
}
315318
}
316319

317320
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
321+
#[cfg(not(target_os = "trusty"))]
318322
impl FromRawFd for io::PipeWriter {
319323
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
320324
Self::from_inner(unsafe { FromRawFd::from_raw_fd(raw_fd) })
321325
}
322326
}
323327

324328
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
329+
#[cfg(not(target_os = "trusty"))]
325330
impl IntoRawFd for io::PipeWriter {
326331
fn into_raw_fd(self) -> RawFd {
327332
self.0.into_raw_fd()

library/std/src/sys/pal/trusty/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ pub mod env;
1111
pub mod os;
1212
#[path = "../unsupported/pipe.rs"]
1313
pub mod pipe;
14-
#[path = "../unsupported/process.rs"]
15-
pub mod process;
1614
#[path = "../unsupported/thread.rs"]
1715
pub mod thread;
1816
#[path = "../unsupported/time.rs"]

0 commit comments

Comments
 (0)