Skip to content

Commit 5794950

Browse files
committed
Document possible panics for std::env::{set_var, unset_var}
1 parent 92dd81a commit 5794950

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libstd/env.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ impl Error for VarError {
260260
/// - [Austin Group Bugzilla](http://austingroupbugs.net/view.php?id=188)
261261
/// - [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2)
262262
///
263+
/// # Panics
264+
///
265+
/// This function panics if the `key` string is empty or contains an ASCII
266+
/// equals sign.
267+
///
263268
/// # Examples
264269
///
265270
/// ```
@@ -292,6 +297,11 @@ fn _set_var(k: &OsStr, v: &OsStr) {
292297
/// - [Austin Group Bugzilla](http://austingroupbugs.net/view.php?id=188)
293298
/// - [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2)
294299
///
300+
/// # Panics
301+
///
302+
/// This function panics if the `key` string is empty or contains an ASCII
303+
/// equals sign.
304+
///
295305
/// # Examples
296306
///
297307
/// ```

0 commit comments

Comments
 (0)