diff options
| author | Tom Milligan <tommilligan@users.noreply.github.com> | 2019-08-11 12:49:02 +0100 |
|---|---|---|
| committer | Tom Milligan <tommilligan@users.noreply.github.com> | 2019-08-11 12:49:02 +0100 |
| commit | af5625dc85d186060637acc5f9f0417a7e2b1088 (patch) | |
| tree | aedd3442ad7b14a126ab20feec7ef55b2c5f2a5d /src/libstd | |
| parent | ee36cfaff97116bcc6230408015dbeb3fb5e2bb9 (diff) | |
docs: add stdlib env::var(_os) panic
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/env.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 1f5de25b65c..eca93399e58 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -182,6 +182,12 @@ impl fmt::Debug for VarsOs { /// * Environment variable is not present /// * Environment variable is not valid unicode /// +/// # Panics +/// +/// 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 /// /// ``` @@ -210,6 +216,12 @@ fn _var(key: &OsStr) -> Result<String, VarError> { /// /// [`None`]: ../option/enum.Option.html#variant.None /// +/// # Panics +/// +/// 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 /// /// ``` |
