about summary refs log tree commit diff
path: root/library/std/src/env.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-19 06:23:49 +0000
committerbors <bors@rust-lang.org>2024-08-19 06:23:49 +0000
commite3f909b2bbd0b10db6f164d466db237c582d3045 (patch)
tree35f38ab5390b874a6baf8282ad9d22f5f2c33cf7 /library/std/src/env.rs
parent804be74e3c4ec3646b448dfdb7a0fc31237a5818 (diff)
parent8a513f1720926799f4507c0bb8fb8d1b164ed459 (diff)
Auto merge of #129261 - tgross35:rollup-xjbvqx7, r=tgross35
Rollup of 7 pull requests

Successful merges:

 - #127679 (Stabilize `raw_ref_op` (RFC 2582))
 - #128084 (Suggest adding Result return type for associated method in E0277.)
 - #128628 (When deduplicating unreachable blocks, erase the source information.)
 - #128902 (doc: std::env::var: Returns None for names with '=' or NUL byte)
 - #129048 (Update `crosstool-ng` for loongarch64)
 - #129116 (Include a copy of `compiler-rt` source in the `download-ci-llvm` tarball)
 - #129208 (Fix order of normalization and recursion in const folding.)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/env.rs')
-rw-r--r--library/std/src/env.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index 80890e61471..e06a851658c 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -198,13 +198,12 @@ impl fmt::Debug for VarsOs {
 ///
 /// # Errors
 ///
-/// This function will return an error if the environment variable isn't set.
+/// Returns [`VarError::NotPresent`] if:
+/// - The variable is not set.
+/// - The variable's name contains an equal sign or NUL (`'='` or `'\0'`).
 ///
-/// This function may return an error if the environment variable's name contains
-/// the equal sign character (`=`) or the NUL character.
-///
-/// This function will return an error if the environment variable's value is
-/// not valid Unicode. If this is not desired, consider using [`var_os`].
+/// Returns [`VarError::NotUnicode`] if the variable's value is not valid
+/// Unicode. If this is not desired, consider using [`var_os`].
 ///
 /// # Examples
 ///