Skip to content

Commit 5f22daa

Browse files
committed
Seal process::Command extension traits.
1 parent e85baac commit 5f22daa

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

library/std/src/process.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ pub struct Command {
498498
inner: imp::Command,
499499
}
500500

501+
/// Allows extension traits within `std`.
502+
#[unstable(feature = "sealed", issue = "none")]
503+
impl crate::sealed::Sealed for Command {}
504+
501505
impl Command {
502506
/// Constructs a new `Command` for launching the program at
503507
/// path `program`, with the following default configuration:

library/std/src/sys/unix/ext/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
1212

1313
/// Unix-specific extensions to the [`process::Command`] builder.
1414
#[stable(feature = "rust1", since = "1.0.0")]
15-
pub trait CommandExt {
15+
pub trait CommandExt: Sealed {
1616
/// Sets the child process's user ID. This translates to a
1717
/// `setuid` call in the child process. Failure in the `setuid`
1818
/// call will cause the spawn to fail.

library/std/src/sys/windows/ext/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl ExitStatusExt for process::ExitStatus {
9494

9595
/// Windows-specific extensions to the [`process::Command`] builder.
9696
#[stable(feature = "windows_process_extensions", since = "1.16.0")]
97-
pub trait CommandExt {
97+
pub trait CommandExt: Sealed {
9898
/// Sets the [process creation flags][1] to be passed to `CreateProcess`.
9999
///
100100
/// These will always be ORed with `CREATE_UNICODE_ENVIRONMENT`.

0 commit comments

Comments
 (0)