Not directly.
There is a rustc_version
box that tells you the rustc
version available on the command line; it is intended to be used in a build script. There's also rustc_version_runtime
, which does something similar, but provides information like a run-time call (that is, it detects the compiler version at compile time, but provides it at run time).
Standard Disclaimer: Be very careful when writing down everything that depends on the compiler version. Ideally, you should check only the minimum versions for which functions are supported using semver (which both libraries support directly).
source share