diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-10-24 18:04:45 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-10-24 18:04:47 -0700 |
| commit | 51f7fbab92ec13c660c500be863c3f91c2648e62 (patch) | |
| tree | bf7049e16ec3b1aa11557d02a8943d6a77bec3ec | |
| parent | fd8907f9cfcebcf0a8ae182a9f7006b494ef1d5d (diff) | |
| download | rust-51f7fbab92ec13c660c500be863c3f91c2648e62.tar.gz rust-51f7fbab92ec13c660c500be863c3f91c2648e62.zip | |
CFG_RELEASE is mandatory, no need for option_env
The same file already contains another env!("CFG_RELEASE") on line 632,
so it's impossible for this crate to compile without CFG_RELEASE set.
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index a31b683b1af..c43042bd85e 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -25,8 +25,7 @@ use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause}; pub const VERSION_PLACEHOLDER: &str = "CURRENT_RUSTC_VERSION"; pub fn rust_version_symbol() -> Symbol { - let version = option_env!("CFG_RELEASE").unwrap_or("<current>"); - Symbol::intern(&version) + Symbol::intern(env!("CFG_RELEASE")) } pub fn is_builtin_attr(attr: &Attribute) -> bool { |
