Auto merge of #4048 - matthiaskrgr:driver_version, r=phansch

clippy-driver: use rustc_tools_util to get version info.

changelog: make "clippy-driver -V" output the same information as "cargo clippy -V"
This commit is contained in:
bors 2019-05-01 18:42:58 +00:00
commit 990d6833b2
2 changed files with 5 additions and 6 deletions

View file

@ -344,7 +344,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
}
ret
},
// FIXME: cover all useable cases.
// FIXME: cover all usable cases.
_ => None,
}
}

View file

@ -10,13 +10,11 @@ extern crate rustc_interface;
extern crate rustc_plugin;
use rustc_interface::interface;
use rustc_tools_util::*;
use std::path::Path;
use std::process::{exit, Command};
fn show_version() {
println!(env!("CARGO_PKG_VERSION"));
}
/// If a command-line option matches `find_arg`, then apply the predicate `pred` on its value. If
/// true, then return it. The parameter is assumed to be either `--arg=value` or `--arg value`.
fn arg_value<'a>(
@ -117,7 +115,8 @@ pub fn main() {
use std::env;
if std::env::args().any(|a| a == "--version" || a == "-V") {
show_version();
let version_info = rustc_tools_util::get_version_info!();
println!("{}", version_info);
exit(0);
}