File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,11 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
28
28
let clippy_minor = clippy_version. minor ;
29
29
let clippy_patch = clippy_version. patch ;
30
30
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 ( ) ) ;
33
34
let rustc_version = String :: from_utf8 (
34
- std:: process:: Command :: new ( " rustc" )
35
+ std:: process:: Command :: new ( & rustc)
35
36
. arg ( "--version" )
36
37
. output ( )
37
38
. expect ( "failed to run `rustc --version`" )
You can’t perform that action at this time.
0 commit comments