about summary refs log tree commit diff
path: root/library/std/src/env.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/env.rs')
-rw-r--r--library/std/src/env.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index 3fcf96c761b..63338bd5876 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -236,7 +236,13 @@ fn _var(key: &OsStr) -> Result<String, VarError> {
 }
 
 /// Fetches the environment variable `key` from the current process, returning
-/// [`None`] if the variable isn't set or there's another error.
+/// [`None`] in the following situations:
+///
+///  - the environment variable isn't set
+///  - the environment variable's name contains
+/// the equal sign character (`=`) or the NUL character
+///
+/// If this is not desired, consider using [`var_os`].
 ///
 /// Note that the method will not check if the environment variable
 /// is valid Unicode. If you want to have an error on invalid UTF-8,