diff options
| author | bors <bors@rust-lang.org> | 2021-03-24 01:32:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-24 01:32:32 +0000 |
| commit | db492ecd5ba6bd82205612cebb9034710653f0c2 (patch) | |
| tree | b7c353ead50b6fac246982ac11529822593427bb /library/std/src/sys/unix/process/process_unix.rs | |
| parent | 673d0db5e393e9c64897005b470bfeb6d5aec61b (diff) | |
| parent | 5c0d880e4be68c98affee9cc5d40519dcf1e3b7b (diff) | |
| download | rust-db492ecd5ba6bd82205612cebb9034710653f0c2.tar.gz rust-db492ecd5ba6bd82205612cebb9034710653f0c2.zip | |
Auto merge of #83432 - Dylan-DPC:rollup-4z5f6al, r=Dylan-DPC
Rollup of 9 pull requests Successful merges: - #83051 (Sidebar trait items order) - #83313 (Only enable assert_dep_graph when query-dep-graph is enabled.) - #83353 (Add internal io::Error::new_const to avoid allocations.) - #83391 (Allow not emitting `uwtable` on Android) - #83392 (Change `-W help` to display edition level.) - #83393 (Codeblock tooltip position) - #83399 (rustdoc: Record crate name instead of using `None`) - #83405 (Slight visual improvements to warning boxes in the docs) - #83415 (Remove unnecessary `Option` wrapping around `Crate.module`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
| -rw-r--r-- | library/std/src/sys/unix/process/process_unix.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index 47aaca82af9..01f1318fe80 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -28,7 +28,10 @@ impl Command { let envp = self.capture_env(); if self.saw_nul() { - return Err(io::Error::new(ErrorKind::InvalidInput, "nul byte found in provided data")); + return Err(io::Error::new_const( + ErrorKind::InvalidInput, + &"nul byte found in provided data", + )); } let (ours, theirs) = self.setup_io(default, needs_stdin)?; @@ -118,7 +121,10 @@ impl Command { let envp = self.capture_env(); if self.saw_nul() { - return io::Error::new(ErrorKind::InvalidInput, "nul byte found in provided data"); + return io::Error::new_const( + ErrorKind::InvalidInput, + &"nul byte found in provided data", + ); } match self.setup_io(default, true) { @@ -442,9 +448,9 @@ impl Process { // and used for another process, and we probably shouldn't be killing // random processes, so just return an error. if self.status.is_some() { - Err(Error::new( + Err(Error::new_const( ErrorKind::InvalidInput, - "invalid argument: can't kill an exited process", + &"invalid argument: can't kill an exited process", )) } else { cvt(unsafe { libc::kill(self.pid, libc::SIGKILL) }).map(drop) |
