Skip to content

Commit 5dd64b3

Browse files
committed
Use bootstrap rustc for versioncheck in Clippy
1 parent d35d827 commit 5dd64b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/tools/clippy/tests/versioncheck.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
2828
let clippy_minor = clippy_version.minor;
2929
let clippy_patch = clippy_version.patch;
3030

31-
// get the rustc version
32-
// this way the rust-toolchain file version is honored
31+
// get the rustc version either from the rustc installed with the toolchain file or from
32+
// `RUSTC_REAL` if Clippy is build in the Rust repo with `./x.py`.
33+
let rustc = std::env::var("RUSTC_REAL").unwrap_or_else(|_| "rustc".to_string());
3334
let rustc_version = String::from_utf8(
34-
std::process::Command::new("rustc")
35+
std::process::Command::new(&rustc)
3536
.arg("--version")
3637
.output()
3738
.expect("failed to run `rustc --version`")

0 commit comments

Comments
 (0)