From fe2a47b88a5c35b2076b195ad09d3bc2c5b1c7d5 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Sun, 25 Oct 2015 20:03:42 +0000 Subject: [PATCH] Say that `std::env::{set_var, unset_var}` *may* panic Previously the documentation suggested that the documentation about the panics are guarantees. --- src/libstd/env.rs | 10 ++++++---- 1 file 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 ///