1
Fork 0

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.
This commit is contained in:
Nicholas Nethercote 2023-11-08 17:05:44 +11:00
parent fdaaaf9f92
commit 49908b4d90
3 changed files with 12 additions and 30 deletions

View file

@ -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 {