diff --git a/clippy_dev/src/sync.rs b/clippy_dev/src/sync.rs index 982fb757f04b..0f08f143c44a 100644 --- a/clippy_dev/src/sync.rs +++ b/clippy_dev/src/sync.rs @@ -63,18 +63,19 @@ fn rustc_version() -> String { let version = String::from_utf8( process::Command::new("rustc") .arg("--version") + .arg("--verbose") .output() .expect("failed to run rustc") .stdout, ) .unwrap(); version - .rsplit_once('(') - .unwrap() - .1 + .lines() + .find(|line| line.starts_with("commit-hash:")) + .expect("failed to parse `rustc -vV`") .split_whitespace() - .next() - .expect("failed to get commit from `rustc --version`") + .nth(1) + .expect("failed to get commit from `rustc -vV`") .to_string() }