Skip to content

Commit

Permalink
clippy-driver: use rustc_tools_util to get version info.
Browse files Browse the repository at this point in the history
This will add git hash information to `clippy-driver -V` output.
  • Loading branch information
matthiaskrgr committed May 1, 2019
1 parent 5162ea5 commit 6967cf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
}
ret
},
// FIXME: cover all useable cases.
// FIXME: cover all usable cases.
_ => None,
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 6967cf5

Please sign in to comment.