We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d35d827 commit 5dd64b3Copy full SHA for 5dd64b3
src/tools/clippy/tests/versioncheck.rs
@@ -28,10 +28,11 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
28
let clippy_minor = clippy_version.minor;
29
let clippy_patch = clippy_version.patch;
30
31
- // get the rustc version
32
- // this way the rust-toolchain file version is honored
+ // get the rustc version either from the rustc installed with the toolchain file or from
+ // `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());
34
let rustc_version = String::from_utf8(
- std::process::Command::new("rustc")
35
+ std::process::Command::new(&rustc)
36
.arg("--version")
37
.output()
38
.expect("failed to run `rustc --version`")
0 commit comments