Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention std::env::var in env! #95646

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,10 @@ pub(crate) mod builtin {
/// Inspects an environment variable at compile time.
///
/// This macro will expand to the value of the named environment variable at
/// compile time, yielding an expression of type `&'static str`.
/// compile time, yielding an expression of type `&'static str`. Use
/// [`std::env::var`] instead if you want to read the value at runtime.
mgeisler marked this conversation as resolved.
Show resolved Hide resolved
///
/// [`std::env::var`]: ../std/env/fn.var.html
///
/// If the environment variable is not defined, then a compilation error
/// will be emitted. To not emit a compile error, use the [`option_env!`]
Expand Down Expand Up @@ -950,7 +953,10 @@ pub(crate) mod builtin {
/// expand into an expression of type `Option<&'static str>` whose value is
/// `Some` of the value of the environment variable. If the environment
/// variable is not present, then this will expand to `None`. See
/// [`Option<T>`][Option] for more information on this type.
/// [`Option<T>`][Option] for more information on this type. Use
/// [`std::env::var`] instead if you want to read the value at runtime.
///
/// [`std::env::var`]: ../std/env/fn.var.html
///
/// A compile time error is never emitted when using this macro regardless
/// of whether the environment variable is present or not.
Expand Down