summary refs log tree commit diff
path: root/library/std/src/process.rs
AgeCommit message (Collapse)AuthorLines
2025-02-01Fix sentence in process::abortMarijn Schouten-8/+4
2025-01-08Rollup merge of #135176 - kornelski:env-example, r=cuviperJacob Pratt-7/+15
More compelling env_clear() examples `ls` isn't a command that people usually set env vars for, and `PATH` in particular isn't even used by `ls`.
2025-01-07Avoid naming variables `str`Josh Triplett-2/+2
This renames variables named `str` to other names, to make sure `str` always refers to a type. It's confusing to read code where `str` (or another standard type name) is used as an identifier. It also produces misleading syntax highlighting.
2025-01-06More compelling env_clear() examplesKornel-7/+15
2024-12-21Less unwrap() in documentationKornel-14/+15
2024-10-25library: consistently use American spelling for 'behavior'Ralf Jung-2/+2
2024-09-29Fix std tests for wasm32-wasip2 targetNicola Krumschmidt-1/+9
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-16Auto merge of #127633 - SamuelMarks:eq-exit-code, r=dtolnaybors-5/+9
[library/std/src/process.rs] `PartialEq` for `ExitCode` Converting a third-party CLI to a library so started passing around [`std::process::ExitCode`](https://doc.rust-lang.org/std/process/struct.ExitCode.html) in an `Either`. Then I realised the tests can't be modified to compare equality of `ExitCode`s. This PR fixes this oversight.
2024-09-06[library/std/src/process.rs] Remove `Eq` `derive`Samuel Marks-1/+1
2024-09-05[library/std/src/process.rs] Update docstring with @joshtriplett's ↵Samuel Marks-4/+8
replacement text
2024-09-02process.rs: remove "Basic usage" text where not usefulTshepang Mbambo-36/+0
Is not useful because just a single example is given.
2024-08-25exit: explain our expectations for the exit handlers registered in a Rust ↵Ralf Jung-0/+9
program
2024-07-29Reformat `use` declarations.Nicholas Nethercote-5/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-26Fix doc nitsJohn Arundel-2/+2
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-07-13Fix minor typos in std::process doc on Win argvJubilee Young-2/+2
2024-07-11[library/std/src/process.rs] `PartialEq` & `Eq` for `ExitCode`Samuel Marks-1/+1
2024-06-10Clarify `Command::new` behavior if passed programs with arguments许杰友 Jieyou Xu (Joe)-0/+19
2024-05-19Rollup merge of #123709 - tgross35:windows-cmd-docs-update, r=ChrisDentonMichael Goulet-21/+27
Update documentation related to the recent cmd.exe fix Fix some grammar nits, change `bat` (extension) -> `batch` (file), and make line wrapping more consistent.
2024-05-04Rollup merge of #122441 - a1phyr:improve_read_impls, r=ChrisDentonMatthias Krüger-0/+4
Improve several `Read` implementations - `read_to_end` and `read_to_string` for `Cursor` - Error on OOM in `read_to_string` of `&[u8]` and `VecDeque<u8>` - Avoid making the slices contiguous in `VecDeque::read_to_string` - ~`read_exact` and (unstable) `read_buf_exact` for `Take`~ - ~`read_buf` for `UnixStream` and `&UnixStream`~ (moved to #123084) - `read_to_end` for `ChildStdErr`
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+2
2024-04-12Improve several `Read` implementationsBenoît du Garreau-0/+4
2024-04-09Update documentation related to the recent cmd.exe fixTrevor Gross-21/+27
Fix some grammar nits, change `bat` (extension) -> `batch` (file), and make line wrapping more consistent.
2024-04-09Document Windows argument splittingChris Denton-0/+79
2024-02-22Use generic `NonZero` everywhere in `std`.Markus Reiter-7/+7
2024-02-13Fix incorrect use of `compile_fail`Noah Lev-3/+3
`compile_fail` should only be used when the code is meant to show what *not* to do. In other words, there should be a fundamental flaw in the code. However, in this case, the example is just incomplete, so we should use `ignore` to avoid confusing readers.
2023-12-15Cfg remove lang items in doctestCameron Steffen-1/+1
2023-11-22add missing period in `std::process::Command` docsMax Heller-1/+1
2023-11-15Substitute version placeholdersMark Rousskov-1/+1
2023-10-15Deduplicate std::process Default impl feature namesDavid Tolnay-2/+2
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")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-08-07impl Default for ExitCodeIan Jackson-0/+8
As suggested here https://github.com/rust-lang/rust/pull/106425#issuecomment-1382952598
2023-10-14Auto merge of #116407 - Mark-Simulacrum:bootstrap-bump, r=onur-ozkanbors-2/+2
Bump bootstrap compiler to just-released beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2023-10-05Add more diagnostic items for clippyJason Newcomb-0/+2
2023-10-04Rollup merge of #116146 - Milo123459:milo/clarify-arg-documentation, r=thomccMatthias Krüger-2/+2
Clarify `arg` and `args` documentation Fixes #95400
2023-10-03Bump version placeholdersMark Rousskov-2/+2
2023-09-28Auto merge of #114428 - ChaiTRex:master, r=dtolnaybors-3/+3
Convert `Into<ExitStatus> for ExitStatusError` to `From<ExitStatusError> for ExitStatus` in `std::process` Implementing suggestion from https://github.com/rust-lang/rust/issues/84908#issuecomment-912352902: > I believe the impl on ExitStatusError should be > > ```rust > impl From<ExitStatusError> for ExitStatus > ``` > > rather than > > ```rust > impl Into<ExitStatus> for ExitStatusError > ``` > > (there is generally never anything implemented as `Into` first, because implementing `From` reflexively provides `Into`)
2023-09-28Rollup merge of #115535 - tshepang:patch-2, r=dtolnayMatthias Krüger-71/+69
format doc-comment code examples in std::process
2023-09-25update other placeMilo-1/+1
2023-09-25clarify documentation about variable substituionMilo-1/+1
2023-09-22Rollup merge of #114379 - RalfJung:command-removed-env-vars, r=m-ou-seMatthias Krüger-1/+1
Command: also print removed env vars There is no real shell syntax for unsetting an env var so easily, so we have to make one up. But we already do that for showing the 'program' name so I hope that's okay here, too. No strong opinion on what that should look like, I went with `unset(VAR_NAME)` for now.
2023-09-19Auto merge of #104101 - betrusted-io:xous-libstd-initial, r=bjorn3bors-1/+1
Add initial libstd support for Xous This patchset adds some minimal support to the tier-3 target `riscv32imac-unknown-xous-elf`. The following features are supported: * alloc * thread creation and joining * thread sleeping * thread_local * panic_abort * mutex * condvar * stdout Additionally, internal support for the various Xous primitives surrounding IPC have been added as part of the Xous FFI. These may be exposed as part of `std::os::xous::ffi` in the future, however for now they are not public. This represents the minimum viable product. A future patchset will add support for networking and filesystem support.
2023-09-09Auto merge of #114590 - ijackson:stdio-stdio-2, r=dtolnaybors-0/+60
Allow redirecting subprocess stdout to our stderr etc. (redux) This is the code from #88561, tidied up, including review suggestions, and with the for-testing-only CI commit removed. FCP for the API completed in #88561. I have made a new MR to facilitate review. The discussion there is very cluttered and the branch is full of changes (in many cases as a result of changes to other Rust stdlib APIs since then). Assuming this MR is approvedl we should close that one. ### Reviewer doing a de novo review Just code review these four commits.. FCP discussion starts here: https://github.com/rust-lang/rust/pull/88561#issuecomment-1640527595 Portability tests: you can see that this branch works on Windows too by looking at the CI results in #88561, which has the same code changes as this branch but with an additional "DO NOT MERGE" commit to make the Windows tests run. ### Reviewer doing an incremental review from some version of #88561 Review the new commits since your last review. I haven't force pushed the branch there. git diff the two branches (eg `git diff 176886197d6..0842b69c219`). You'll see that the only difference is in gitlab CI files. You can also see that *this* MR doesn't touch those files.
2023-09-04"what would rustfmt do"Tshepang Mbambo-71/+69
2023-08-24fix a typo in env_clear docsRalf Jung-1/+1
2023-08-22std: process: skip tests on xousSean Cross-1/+1
Xous does not yet support spawning processes. Signed-off-by: Sean Cross <sean@xobs.io>
2023-08-22Replace version placeholders with 1.73.0Mark Rousskov-1/+1
2023-08-15Document Default for ExitStatusIan Jackson-1/+10
This lets us put a version on the impl, too.
2023-08-10Rollup merge of #114194 - thomcc:flushinline, r=cuviperMichael Goulet-0/+2
Inline trivial (noop) flush calls At work I noticed that `writer.flush()?` didn't get optimized away in cases where the flush is obviously a no-op, which I had expected (well, desired). I went through and added `#[inline]` to a bunch of cases that were obviously noops, or delegated to ones that were obviously noops. I omitted platforms I don't have access to (some tier3). I didn't do this very scientifically, in cases where it was non-obvious I left `#[inline]` off.
2023-08-08Rollup merge of #106425 - ijackson:exit-status-default, r=dtolnayMatthias Krüger-1/+1
Make ExitStatus implement Default And, necessarily, make it inhabited even on platforms without processes. I noticed while preparing https://github.com/rust-lang/rfcs/pull/3362 that there was no way for anyone to construct an `ExitStatus`. This would be insta-stable so needs an FCP.
2023-08-07impl Default for ExitStatusIan Jackson-1/+1