File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -585,6 +585,11 @@ pub async fn main(
585585 write ! ( process. stdout( ) . lock( ) , "{err}" ) ?;
586586 info ! ( "This is the version for the rustup toolchain manager, not the rustc compiler." ) ;
587587 let mut cfg = Cfg :: from_env ( current_dir, true , process) ?;
588+ cfg. toolchain_override = cfg
589+ . process
590+ . args ( )
591+ . find_map ( |arg| arg. strip_prefix ( '+' ) . map ( ResolvableToolchainName :: try_from) )
592+ . transpose ( ) ?;
588593 match cfg. active_rustc_version ( ) . await {
589594 Ok ( Some ( version) ) => info ! ( "The currently active `rustc` version is `{version}`" ) ,
590595 Ok ( None ) => info ! ( "No `rustc` is currently active" ) ,
Original file line number Diff line number Diff line change @@ -700,11 +700,6 @@ impl<'a> Cfg<'a> {
700700
701701 #[ tracing:: instrument( level = "trace" ) ]
702702 pub ( crate ) async fn active_rustc_version ( & mut self ) -> Result < Option < String > > {
703- if let Some ( t) = self . process . args ( ) . find ( |x| x. starts_with ( '+' ) ) {
704- trace ! ( "Fetching rustc version from toolchain `{}`" , t) ;
705- self . toolchain_override = Some ( ResolvableToolchainName :: try_from ( & t[ 1 ..] ) ?) ;
706- }
707-
708703 let Some ( ( name, _) ) = self . maybe_ensure_active_toolchain ( None ) . await ? else {
709704 return Ok ( None ) ;
710705 } ;
You can’t perform that action at this time.
0 commit comments