about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstd/env.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstd/env.rs b/src/libstd/env.rs
index 685139a7fc1..1f6761b54cb 100644
--- a/src/libstd/env.rs
+++ b/src/libstd/env.rs
@@ -262,8 +262,9 @@ impl Error for VarError {
 ///
 /// # Panics
 ///
-/// This function panics if the `key` string is empty or contains an ASCII
-/// equals sign.
+/// This function may panic if `key` is empty, contains an ASCII equals sign
+/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
+/// character.
 ///
 /// # Examples
 ///
@@ -299,8 +300,9 @@ fn _set_var(k: &OsStr, v: &OsStr) {
 ///
 /// # Panics
 ///
-/// This function panics if the `key` string is empty or contains an ASCII
-/// equals sign.
+/// This function may panic if `key` is empty, contains an ASCII equals sign
+/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
+/// character.
 ///
 /// # Examples
 ///