File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -111,20 +111,23 @@ fn main() {
111111 }
112112}
113113
114+ /// Run `rustc --version` and capture the output, adjusting arguments as needed if `clippy-driver`
115+ /// is used instead.
114116fn rustc_version_cmd ( is_clippy_driver : bool ) -> Output {
115117 let rustc_wrapper = env:: var_os ( "RUSTC_WRAPPER" ) . filter ( |w| !w. is_empty ( ) ) ;
116118 let rustc = env:: var_os ( "RUSTC" ) . expect ( "Failed to get rustc version: missing RUSTC env" ) ;
117119
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+ }
124127
125- cmd
126- } else {
127- Command :: new ( rustc)
128+ cmd
129+ }
130+ None => Command :: new ( rustc) ,
128131 } ;
129132
130133 cmd. arg ( "--version" ) ;
@@ -141,6 +144,8 @@ fn rustc_version_cmd(is_clippy_driver: bool) -> Output {
141144 output
142145}
143146
147+ /// Return the minor version of `rustc`, as well as a bool indicating whether or not the version
148+ /// is a nightly.
144149fn rustc_minor_nightly ( ) -> ( u32 , bool ) {
145150 macro_rules! otry {
146151 ( $e: expr) => {
You can’t perform that action at this time.
0 commit comments