File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -198,9 +198,16 @@ pub fn version() -> Result<Version> {
198
198
/// Returns the `rustc` SemVer version and additional metadata
199
199
/// like the git short hash and build date.
200
200
pub fn version_meta ( ) -> Result < VersionMeta > {
201
- let cmd = env:: var_os ( "RUSTC" ) . unwrap_or_else ( || OsString :: from ( "rustc" ) ) ;
201
+ let rustc = env:: var_os ( "RUSTC" ) . unwrap_or_else ( || OsString :: from ( "rustc" ) ) ;
202
+ let cmd = if let Some ( wrapper) = env:: var_os ( "RUSTC_WRAPPER" ) {
203
+ let mut cmd = Command :: new ( wrapper) ;
204
+ cmd. arg ( rustc) ;
205
+ cmd
206
+ } else {
207
+ Command :: new ( rustc)
208
+ } ;
202
209
203
- VersionMeta :: for_command ( Command :: new ( cmd) )
210
+ VersionMeta :: for_command ( cmd)
204
211
}
205
212
206
213
/// Parses a "rustc -vV" output string and returns
@@ -263,7 +270,7 @@ pub fn version_meta_for(verbose_version_string: &str) -> Result<VersionMeta> {
263
270
264
271
fn expect_key_or_unknown ( key : & str , map : & HashMap < & str , & str > ) -> Result < Option < String > , Error > {
265
272
match map. get ( key) {
266
- Some ( & v ) if v == "unknown" => Ok ( None ) ,
273
+ Some ( & "unknown" ) => Ok ( None ) ,
267
274
Some ( & v) => Ok ( Some ( String :: from ( v) ) ) ,
268
275
None => Err ( Error :: UnexpectedVersionFormat ) ,
269
276
}
You can’t perform that action at this time.
0 commit comments