From b8f6d48eb6a551b9fd4b134ad68bc5a5f95e3a39 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Aug 2023 16:08:19 +0100 Subject: [PATCH 1/2] impl Default for ExitCode As suggested here https://github.com/rust-lang/rust/pull/106425#issuecomment-1382952598 --- library/std/src/process.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 47e28c27a8376..bb94596425c6d 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -1960,6 +1960,14 @@ impl ExitCode { } } +/// The default value is [`ExitCode::SUCCESS`] +#[stable(feature = "process-exitcode-default", since = "CURRENT_RUSTC_VERSION")] +impl Default for ExitCode { + fn default() -> Self { + ExitCode::SUCCESS + } +} + #[stable(feature = "process_exitcode", since = "1.61.0")] impl From for ExitCode { /// Construct an `ExitCode` from an arbitrary u8 value. From b149d16d3a48672a7cfb99d19e075ff8eef4846f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 15 Oct 2023 11:41:24 -0700 Subject: [PATCH 2/2] Deduplicate std::process Default impl feature names error[E0711]: feature `process-exitcode-default` is declared stable since 1.74.0-beta.1, but was previously declared stable since 1.73.0 --> library/std/src/process.rs:1964:1 | 1964 | #[stable(feature = "process-exitcode-default", since = "CURRENT_RUSTC_VERSION")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- library/std/src/process.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index bb94596425c6d..ad29eeb6a0bed 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -1594,7 +1594,7 @@ impl From for Stdio { pub struct ExitStatus(imp::ExitStatus); /// The default value is one which indicates successful completion. -#[stable(feature = "process-exitcode-default", since = "1.73.0")] +#[stable(feature = "process_exitstatus_default", since = "1.73.0")] impl Default for ExitStatus { fn default() -> Self { // Ideally this would be done by ExitCode::default().into() but that is complicated. @@ -1961,7 +1961,7 @@ impl ExitCode { } /// The default value is [`ExitCode::SUCCESS`] -#[stable(feature = "process-exitcode-default", since = "CURRENT_RUSTC_VERSION")] +#[stable(feature = "process_exitcode_default", since = "CURRENT_RUSTC_VERSION")] impl Default for ExitCode { fn default() -> Self { ExitCode::SUCCESS