The plain rustc --version string is not well structured, and in
particular the git commit info is not necessarily present when rustc was
built out of tree, like distro builds. Furthermore, rust-lang/rust#79115
made it possible to have completely custom information in that version's
parenthesized block, which may not look like git info at all.
Adding --verbose outputs each field on its own line, in particular
"release: ..." for the version number and "commit-date: ..." for the git
info, although the latter is just "unknown" for out-of-tree builds. This
still works all the way back to Rust 1.0.0.
The plain
rustc --version
string is not well structured, and in particular the git commit info is not necessarily present when rustc was built out of tree, like distro builds. Furthermore, rust-lang/rust#79115 made it possible to have completely custom information in that version's parenthesized block, which may not look like git info at all.Adding
--verbose
outputs each field on its own line, in particular "release: ..." for the version number and "commit-date: ..." for the git info, although the latter is just "unknown" for out-of-tree builds. This still works all the way back to Rust 1.0.0.