File tree 1 file changed +14
-9
lines changed
1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -111,20 +111,23 @@ fn main() {
111
111
}
112
112
}
113
113
114
+ /// Run `rustc --version` and capture the output, adjusting arguments as needed if `clippy-driver`
115
+ /// is used instead.
114
116
fn rustc_version_cmd ( is_clippy_driver : bool ) -> Output {
115
117
let rustc_wrapper = env:: var_os ( "RUSTC_WRAPPER" ) . filter ( |w| !w. is_empty ( ) ) ;
116
118
let rustc = env:: var_os ( "RUSTC" ) . expect ( "Failed to get rustc version: missing RUSTC env" ) ;
117
119
118
- let mut cmd = if let Some ( wrapper) = rustc_wrapper {
119
- let mut cmd = Command :: new ( wrapper) ;
120
- cmd. arg ( rustc) ;
121
- if is_clippy_driver {
122
- cmd. arg ( "--rustc" ) ;
123
- }
120
+ let mut cmd = match rustc_wrapper {
121
+ Some ( wrapper) => {
122
+ let mut cmd = Command :: new ( wrapper) ;
123
+ cmd. arg ( rustc) ;
124
+ if is_clippy_driver {
125
+ cmd. arg ( "--rustc" ) ;
126
+ }
124
127
125
- cmd
126
- } else {
127
- Command :: new ( rustc)
128
+ cmd
129
+ }
130
+ None => Command :: new ( rustc) ,
128
131
} ;
129
132
130
133
cmd. arg ( "--version" ) ;
@@ -141,6 +144,8 @@ fn rustc_version_cmd(is_clippy_driver: bool) -> Output {
141
144
output
142
145
}
143
146
147
+ /// Return the minor version of `rustc`, as well as a bool indicating whether or not the version
148
+ /// is a nightly.
144
149
fn rustc_minor_nightly ( ) -> ( u32 , bool ) {
145
150
macro_rules! otry {
146
151
( $e: expr) => {
You can’t perform that action at this time.
0 commit comments