Skip to content

Commit

Permalink
CommandExt::before_exec: deprecate safety in edition 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 4, 2024
1 parent 90d6255 commit 6eec199
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/std/src/os/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ pub trait CommandExt: Sealed {
/// that, it got deprecated in favor of the unsafe [`pre_exec`].
///
/// [`pre_exec`]: CommandExt::pre_exec
#[cfg(not(bootstrap))]
#[stable(feature = "process_exec", since = "1.15.0")]
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
#[rustc_deprecated_safe_2024]
unsafe fn before_exec<F>(&mut self, f: F) -> &mut process::Command
where
F: FnMut() -> io::Result<()> + Send + Sync + 'static,
{
unsafe { self.pre_exec(f) }
}

#[cfg(bootstrap)]
#[stable(feature = "process_exec", since = "1.15.0")]
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
fn before_exec<F>(&mut self, f: F) -> &mut process::Command
Expand Down

0 comments on commit 6eec199

Please sign in to comment.