@@ -541,7 +541,7 @@ pub async fn main() -> Result<utils::ExitCode> {
541541 info ! ( "This is the version for the rustup toolchain manager, not the rustc compiler." ) ;
542542
543543 #[ cfg_attr( feature = "otel" , tracing:: instrument) ]
544- fn rustc_version ( ) -> std:: result:: Result < String , Box < dyn std:: error:: Error > > {
544+ async fn rustc_version ( ) -> std:: result:: Result < String , Box < dyn std:: error:: Error > > {
545545 let cfg = & mut common:: set_globals ( false , true ) ?;
546546 let cwd = std:: env:: current_dir ( ) ?;
547547
@@ -550,12 +550,12 @@ pub async fn main() -> Result<utils::ExitCode> {
550550 cfg. set_toolchain_override ( & ResolvableToolchainName :: try_from ( & t[ 1 ..] ) ?) ;
551551 }
552552
553- let toolchain = cfg. find_or_install_active_toolchain ( & cwd) ?. 0 ;
553+ let toolchain = cfg. find_or_install_active_toolchain ( & cwd) . await ?. 0 ;
554554
555555 Ok ( toolchain. rustc_version ( ) )
556556 }
557557
558- match rustc_version ( ) {
558+ match rustc_version ( ) . await {
559559 Ok ( version) => info ! ( "The currently active `rustc` version is `{}`" , version) ,
560560 Err ( err) => debug ! ( "Wanted to tell you the current rustc version, too, but ran into this error: {}" , err) ,
561561 }
@@ -640,7 +640,7 @@ pub async fn main() -> Result<utils::ExitCode> {
640640 TargetSubcmd :: List {
641641 toolchain,
642642 installed,
643- } => handle_epipe ( target_list ( cfg, toolchain, installed) ) ,
643+ } => handle_epipe ( target_list ( cfg, toolchain, installed) . await ) ,
644644 TargetSubcmd :: Add { target, toolchain } => target_add ( cfg, target, toolchain) . await ,
645645 TargetSubcmd :: Remove { target, toolchain } => {
646646 target_remove ( cfg, target, toolchain) . await
@@ -650,7 +650,7 @@ pub async fn main() -> Result<utils::ExitCode> {
650650 ComponentSubcmd :: List {
651651 toolchain,
652652 installed,
653- } => handle_epipe ( component_list ( cfg, toolchain, installed) ) ,
653+ } => handle_epipe ( component_list ( cfg, toolchain, installed) . await ) ,
654654 ComponentSubcmd :: Add {
655655 component,
656656 toolchain,
@@ -676,15 +676,15 @@ pub async fn main() -> Result<utils::ExitCode> {
676676 command,
677677 install,
678678 } => run ( cfg, toolchain, command, install) . map ( ExitCode :: from) ,
679- RustupSubcmd :: Which { command, toolchain } => which ( cfg, & command, toolchain) ,
679+ RustupSubcmd :: Which { command, toolchain } => which ( cfg, & command, toolchain) . await ,
680680 RustupSubcmd :: Doc {
681681 path,
682682 toolchain,
683683 topic,
684684 page,
685- } => doc ( cfg, path, toolchain, topic. as_deref ( ) , & page) ,
685+ } => doc ( cfg, path, toolchain, topic. as_deref ( ) , & page) . await ,
686686 #[ cfg( not( windows) ) ]
687- RustupSubcmd :: Man { command, toolchain } => man ( cfg, & command, toolchain) ,
687+ RustupSubcmd :: Man { command, toolchain } => man ( cfg, & command, toolchain) . await ,
688688 RustupSubcmd :: Self_ { subcmd } => match subcmd {
689689 SelfSubcmd :: Update => self_update:: update ( cfg) . await ,
690690 SelfSubcmd :: Uninstall { no_prompt } => self_update:: uninstall ( no_prompt) ,
@@ -904,7 +904,7 @@ fn run(
904904 command:: run_command_for_dir ( cmd, & command[ 0 ] , & command[ 1 ..] )
905905}
906906
907- fn which (
907+ async fn which (
908908 cfg : & Cfg ,
909909 binary : & str ,
910910 toolchain : Option < ResolvableToolchainName > ,
@@ -913,7 +913,7 @@ fn which(
913913 let desc = toolchain. resolve ( & cfg. get_default_host_triple ( ) ?) ?;
914914 Toolchain :: new ( cfg, desc. into ( ) ) ?. binary_file ( binary)
915915 } else {
916- cfg. which_binary ( & utils:: current_dir ( ) ?, binary) ?
916+ cfg. which_binary ( & utils:: current_dir ( ) ?, binary) . await ?
917917 } ;
918918
919919 utils:: assert_is_file ( & binary_path) ?;
@@ -1091,13 +1091,13 @@ fn show_rustup_home(cfg: &Cfg) -> Result<utils::ExitCode> {
10911091 Ok ( utils:: ExitCode ( 0 ) )
10921092}
10931093
1094- fn target_list (
1094+ async fn target_list (
10951095 cfg : & Cfg ,
10961096 toolchain : Option < PartialToolchainDesc > ,
10971097 installed_only : bool ,
10981098) -> Result < utils:: ExitCode > {
10991099 // downcasting required because the toolchain files can name any toolchain
1100- let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) ?;
1100+ let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) . await ?;
11011101 common:: list_items (
11021102 distributable,
11031103 |c| {
@@ -1122,7 +1122,7 @@ async fn target_add(
11221122 // isn't a feature yet.
11231123 // list_components *and* add_component would both be inappropriate for
11241124 // custom toolchains.
1125- let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) ?;
1125+ let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) . await ?;
11261126 let components = distributable. components ( ) ?;
11271127
11281128 if targets. contains ( & "all" . to_string ( ) ) {
@@ -1166,7 +1166,7 @@ async fn target_remove(
11661166 targets : Vec < String > ,
11671167 toolchain : Option < PartialToolchainDesc > ,
11681168) -> Result < utils:: ExitCode > {
1169- let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) ?;
1169+ let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) . await ?;
11701170
11711171 for target in targets {
11721172 let target = TargetTriple :: new ( target) ;
@@ -1195,13 +1195,13 @@ async fn target_remove(
11951195 Ok ( utils:: ExitCode ( 0 ) )
11961196}
11971197
1198- fn component_list (
1198+ async fn component_list (
11991199 cfg : & Cfg ,
12001200 toolchain : Option < PartialToolchainDesc > ,
12011201 installed_only : bool ,
12021202) -> Result < utils:: ExitCode > {
12031203 // downcasting required because the toolchain files can name any toolchain
1204- let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) ?;
1204+ let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) . await ?;
12051205 common:: list_items ( distributable, |c| Some ( & c. name ) , installed_only) ?;
12061206 Ok ( utils:: ExitCode ( 0 ) )
12071207}
@@ -1212,7 +1212,7 @@ async fn component_add(
12121212 toolchain : Option < PartialToolchainDesc > ,
12131213 target : Option < String > ,
12141214) -> Result < utils:: ExitCode > {
1215- let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) ?;
1215+ let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) . await ?;
12161216 let target = get_target ( target, & distributable) ;
12171217
12181218 for component in & components {
@@ -1238,7 +1238,7 @@ async fn component_remove(
12381238 toolchain : Option < PartialToolchainDesc > ,
12391239 target : Option < String > ,
12401240) -> Result < utils:: ExitCode > {
1241- let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) ?;
1241+ let distributable = DistributableToolchain :: from_partial ( toolchain, cfg) . await ?;
12421242 let target = get_target ( target, & distributable) ;
12431243
12441244 for component in & components {
@@ -1418,14 +1418,14 @@ docs_data![
14181418 ( embedded_book, "The Embedded Rust Book" , "embedded-book/index.html" ) ,
14191419] ;
14201420
1421- fn doc (
1421+ async fn doc (
14221422 cfg : & Cfg ,
14231423 path_only : bool ,
14241424 toolchain : Option < PartialToolchainDesc > ,
14251425 mut topic : Option < & str > ,
14261426 doc_page : & DocPage ,
14271427) -> Result < utils:: ExitCode > {
1428- let toolchain = Toolchain :: from_partial ( toolchain, cfg) ?;
1428+ let toolchain = Toolchain :: from_partial ( toolchain, cfg) . await ?;
14291429
14301430 if let Ok ( distributable) = DistributableToolchain :: try_from ( & toolchain) {
14311431 if let [ _] = distributable
@@ -1481,14 +1481,14 @@ fn doc(
14811481}
14821482
14831483#[ cfg( not( windows) ) ]
1484- fn man (
1484+ async fn man (
14851485 cfg : & Cfg ,
14861486 command : & str ,
14871487 toolchain : Option < PartialToolchainDesc > ,
14881488) -> Result < utils:: ExitCode > {
14891489 use crate :: currentprocess:: varsource:: VarSource ;
14901490
1491- let toolchain = Toolchain :: from_partial ( toolchain, cfg) ?;
1491+ let toolchain = Toolchain :: from_partial ( toolchain, cfg) . await ?;
14921492 let mut path = toolchain. path ( ) . to_path_buf ( ) ;
14931493 path. push ( "share" ) ;
14941494 path. push ( "man" ) ;
0 commit comments