diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/env.rs | 12 | ||||
| -rw-r--r-- | src/libstd/macros.rs | 2 |
2 files changed, 13 insertions, 1 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 /// /// ``` diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 839b4c5656a..f2000936b9a 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -119,7 +119,7 @@ macro_rules! print { /// Prints to the standard output, with a newline. /// /// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone -/// (no additional CARRIAGE RETURN (`\r`/`U+000D`). +/// (no additional CARRIAGE RETURN (`\r`/`U+000D`)). /// /// Use the [`format!`] syntax to write data to the standard output. /// See [`std::fmt`] for more information. |
