Refactor the llvm_versions internal macro implementation and update its syntax to more closely match normal Rust syntax.
This means removing the latest special case in favor of half-open ranges (x..) and allowing to specify up to x (..x). This is also useful to have 2 different implementations of a function that changed at version y by having two items with llvm_version(..y) and llvm_version(y..), just like when slicing a string or a vector.
Since currently all supported versions are <major>.0.0, I've also allowed version specifiers to be just integers which represent just the major version.
This refactoring is in preparation to add a new cfg_attr-style macro for conditional attributes, for example deprecated, and to migrate remaining manual #[cfg(any(...))] to this macro.
The enum macro implementation is untouched, it was just moved to its own module.
Description
Refactor the
llvm_versions
internal macro implementation and update its syntax to more closely match normal Rust syntax.This means removing the up to x (
latest
special case in favor of half-open ranges (x..
) and allowing to specify..x
). This is also useful to have 2 different implementations of a function that changed at versiony
by having two items withllvm_version(..y)
andllvm_version(y..)
, just like when slicing a string or a vector.Since currently all supported versions are
<major>.0.0
, I've also allowed version specifiers to be just integers which represent just the major version.This refactoring is in preparation to add a new
cfg_attr
-style macro for conditional attributes, for exampledeprecated
, and to migrate remaining manual#[cfg(any(...))]
to this macro.The enum macro implementation is untouched, it was just moved to its own module.
How This Has Been Tested
Compiling a few selected LLVM versions.
Option\<Breaking Changes>
Only to the
llvm_versions
internal macro.Checklist