Skip to content

Commit 990d683

Browse files
committed
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"
2 parents 5162ea5 + 6967cf5 commit 990d683

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

clippy_lints/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
344344
}
345345
ret
346346
},
347-
// FIXME: cover all useable cases.
347+
// FIXME: cover all usable cases.
348348
_ => None,
349349
}
350350
}

src/driver.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ extern crate rustc_interface;
1010
extern crate rustc_plugin;
1111

1212
use rustc_interface::interface;
13+
use rustc_tools_util::*;
14+
1315
use std::path::Path;
1416
use std::process::{exit, Command};
1517

16-
fn show_version() {
17-
println!(env!("CARGO_PKG_VERSION"));
18-
}
19-
2018
/// If a command-line option matches `find_arg`, then apply the predicate `pred` on its value. If
2119
/// true, then return it. The parameter is assumed to be either `--arg=value` or `--arg value`.
2220
fn arg_value<'a>(
@@ -117,7 +115,8 @@ pub fn main() {
117115
use std::env;
118116

119117
if std::env::args().any(|a| a == "--version" || a == "-V") {
120-
show_version();
118+
let version_info = rustc_tools_util::get_version_info!();
119+
println!("{}", version_info);
121120
exit(0);
122121
}
123122

0 commit comments

Comments
 (0)