Rollup merge of #138189 - GuillaumeGomez:env-var, r=joshtriplett

Mention `env` and `option_env` macros in `std::env::var` docs

Fixes https://github.com/rust-lang/rust/issues/138159.

Just like there are mentions in `env!` and `option_env!` docs to `std::env::var`, it'd be nice to have a "mention back" as well.
This commit is contained in:
Jacob Pratt
2025-03-08 01:27:23 -05:00
committed by GitHub

View File

@@ -202,6 +202,9 @@ impl fmt::Debug for VarsOs {
/// Returns [`VarError::NotUnicode`] if the variable's value is not valid /// Returns [`VarError::NotUnicode`] if the variable's value is not valid
/// Unicode. If this is not desired, consider using [`var_os`]. /// Unicode. If this is not desired, consider using [`var_os`].
/// ///
/// Use [`env!`] or [`option_env!`] instead if you want to check environment
/// variables at compile time.
///
/// # Examples /// # Examples
/// ///
/// ``` /// ```