From 49908b4d90688bea6edb5ef811d78e61ba3aa5f3 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 8 Nov 2023 17:05:44 +1100 Subject: Simplify the `current_rustc_version` macro. It currently has the syntax `current_rustc_version!(env!("CFG_RELEASE"))` where the `env!("CFG_RELEASE")` part looks like a normal expression but it is actually parsed and processed by the `current_rustc_version` macro. The documented rationale for this is that you'll find it if you grep for `env!("CFG_RELEASE")`. But I think that's of very little use -- I would personally grep for just "CFG_RELEASE" -- and it complicates the macro, requiring the use of `syn`. This commit simplifies the macro. --- compiler/rustc_session/src/version.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/version.rs b/compiler/rustc_session/src/version.rs index 1ad8620bfba..c0c088bcef7 100644 --- a/compiler/rustc_session/src/version.rs +++ b/compiler/rustc_session/src/version.rs @@ -9,7 +9,7 @@ pub struct RustcVersion { } impl RustcVersion { - pub const CURRENT: Self = current_rustc_version!(env!("CFG_RELEASE")); + pub const CURRENT: Self = current_rustc_version!(); } impl Display for RustcVersion { -- cgit 1.4.1-3-g733a5