diff options
| author | bors <bors@rust-lang.org> | 2025-01-20 17:07:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-20 17:07:30 +0000 |
| commit | 9f4d9dc102fee5c1fe8adce2c4a58254cae510f4 (patch) | |
| tree | b32038aedef7c6ae68b28d1cd80ae9d71b6ead45 /library/std/src/env.rs | |
| parent | 6a64e3b89724395d87a394ed9ebd954c474b080a (diff) | |
| parent | ecfb55762ca4e2be1b0f900c3d0e9e166cd68f41 (diff) | |
| download | rust-9f4d9dc102fee5c1fe8adce2c4a58254cae510f4.tar.gz rust-9f4d9dc102fee5c1fe8adce2c4a58254cae510f4.zip | |
Auto merge of #135769 - jieyouxu:rollup-3h384pz, r=jieyouxu
Rollup of 5 pull requests Successful merges: - #135433 (Add Profile Override for Non-Git Sources) - #135626 (doc: Point to methods on `Command` as alternatives to `set/remove_var`) - #135658 (Do not include GCC source code in source tarballs) - #135676 (rustc_resolve: use structured fields in traces) - #135762 (Correct counting to four in cell module docs) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/env.rs')
| -rw-r--r-- | library/std/src/env.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 11a29cdae62..bbd506127fb 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -336,7 +336,10 @@ impl Error for VarError { /// - [Austin Group Bugzilla](https://austingroupbugs.net/view.php?id=188) /// - [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2) /// +/// To pass an environment variable to a child process, you can instead use [`Command::env`]. +/// /// [`std::net::ToSocketAddrs`]: crate::net::ToSocketAddrs +/// [`Command::env`]: crate::process::Command::env /// /// # Panics /// @@ -396,7 +399,12 @@ pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) { /// - [Austin Group Bugzilla](https://austingroupbugs.net/view.php?id=188) /// - [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2) /// +/// To prevent a child process from inheriting an environment variable, you can +/// instead use [`Command::env_remove`] or [`Command::env_clear`]. +/// /// [`std::net::ToSocketAddrs`]: crate::net::ToSocketAddrs +/// [`Command::env_remove`]: crate::process::Command::env_remove +/// [`Command::env_clear`]: crate::process::Command::env_clear /// /// # Panics /// |
