@@ -28,17 +28,17 @@ 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 from cargo
31
+ // get the rustc version
32
32
// this way the rust-toolchain file version is honored
33
33
let rustc_version = String :: from_utf8 (
34
- std:: process:: Command :: new ( "cargo " )
34
+ std:: process:: Command :: new ( "rustc " )
35
35
. arg ( "--version" )
36
36
. output ( )
37
- . expect ( "failed to run 'cargo --version' " )
37
+ . expect ( "failed to run `rustc --version` " )
38
38
. stdout ,
39
39
)
40
40
. unwrap ( ) ;
41
- // extract "1 50 0" from "cargo 1.50 .0-nightly (a3c2627fb 2020-12-14 )"
41
+ // extract "1 XX 0" from "rustc 1.XX .0-nightly (<commit> <date> )"
42
42
let vsplit: Vec < & str > = rustc_version
43
43
. split ( ' ' )
44
44
. nth ( 1 )
@@ -50,9 +50,7 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
50
50
. collect ( ) ;
51
51
match vsplit. as_slice ( ) {
52
52
[ rustc_major, rustc_minor, _rustc_patch] => {
53
- // clippy 0.1.50 should correspond to rustc 1.50.0
54
- dbg ! ( & rustc_version) ;
55
- dbg ! ( & clippy_version) ;
53
+ // clippy 0.1.XX should correspond to rustc 1.XX.0
56
54
assert_eq ! ( clippy_major, 0 ) ; // this will probably stay the same for a long time
57
55
assert_eq ! (
58
56
clippy_minor. to_string( ) ,
@@ -68,8 +66,7 @@ fn check_that_clippy_has_the_same_major_version_as_rustc() {
68
66
// we don't want our tests failing suddenly
69
67
} ,
70
68
_ => {
71
- dbg ! ( vsplit) ;
72
- panic ! ( "Failed to parse rustc version" ) ;
69
+ panic ! ( "Failed to parse rustc version: {:?}" , vsplit) ;
73
70
} ,
74
71
} ;
75
72
}
0 commit comments