Skip to content

Commit fe2a47b

Browse files
committed
Say that std::env::{set_var, unset_var} *may* panic
Previously the documentation suggested that the documentation about the panics are guarantees.
1 parent 5794950 commit fe2a47b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/libstd/env.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ impl Error for VarError {
262262
///
263263
/// # Panics
264264
///
265-
/// This function panics if the `key` string is empty or contains an ASCII
266-
/// equals sign.
265+
/// This function may panic if `key` is empty, contains an ASCII equals sign
266+
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
267+
/// character.
267268
///
268269
/// # Examples
269270
///
@@ -299,8 +300,9 @@ fn _set_var(k: &OsStr, v: &OsStr) {
299300
///
300301
/// # Panics
301302
///
302-
/// This function panics if the `key` string is empty or contains an ASCII
303-
/// equals sign.
303+
/// This function may panic if `key` is empty, contains an ASCII equals sign
304+
/// `'='` or the NUL character `'\0'`, or when the value contains the NUL
305+
/// character.
304306
///
305307
/// # Examples
306308
///

0 commit comments

Comments
 (0)