Skip to content

Commit 6eec199

Browse files
committed
CommandExt::before_exec: deprecate safety in edition 2024
1 parent 90d6255 commit 6eec199

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/std/src/os/unix/process.rs

+12
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ pub trait CommandExt: Sealed {
115115
/// that, it got deprecated in favor of the unsafe [`pre_exec`].
116116
///
117117
/// [`pre_exec`]: CommandExt::pre_exec
118+
#[cfg(not(bootstrap))]
119+
#[stable(feature = "process_exec", since = "1.15.0")]
120+
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
121+
#[rustc_deprecated_safe_2024]
122+
unsafe fn before_exec<F>(&mut self, f: F) -> &mut process::Command
123+
where
124+
F: FnMut() -> io::Result<()> + Send + Sync + 'static,
125+
{
126+
unsafe { self.pre_exec(f) }
127+
}
128+
129+
#[cfg(bootstrap)]
118130
#[stable(feature = "process_exec", since = "1.15.0")]
119131
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
120132
fn before_exec<F>(&mut self, f: F) -> &mut process::Command

0 commit comments

Comments
 (0)