File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -1048,7 +1048,13 @@ async fn which(
10481048 binary : & str ,
10491049 toolchain : Option < ResolvableToolchainName > ,
10501050) -> Result < ExitCode > {
1051- let toolchain = cfg. resolve_toolchain ( toolchain) . await ?;
1051+ let toolchain = cfg
1052+ . local_toolchain ( match toolchain {
1053+ Some ( name) => Some ( name. resolve ( & cfg. get_default_host_triple ( ) ?) ?. into ( ) ) ,
1054+ None => None ,
1055+ } )
1056+ . await ?;
1057+
10521058 let binary_path = toolchain. binary_file ( binary) ;
10531059 if utils:: is_file ( & binary_path) {
10541060 writeln ! ( cfg. process. stdout( ) . lock( ) , "{}" , binary_path. display( ) ) ?;
Original file line number Diff line number Diff line change @@ -706,16 +706,6 @@ impl<'a> Cfg<'a> {
706706 Ok ( Some ( Toolchain :: new ( self , name) ?. rustc_version ( ) ) )
707707 }
708708
709- pub ( crate ) async fn resolve_toolchain (
710- & self ,
711- name : Option < ResolvableToolchainName > ,
712- ) -> Result < Toolchain < ' _ > > {
713- let toolchain = name
714- . map ( |name| anyhow:: Ok ( name. resolve ( & self . get_default_host_triple ( ) ?) ?. into ( ) ) )
715- . transpose ( ) ?;
716- self . local_toolchain ( toolchain) . await
717- }
718-
719709 pub ( crate ) async fn resolve_local_toolchain (
720710 & self ,
721711 name : Option < ResolvableLocalToolchainName > ,
@@ -726,7 +716,10 @@ impl<'a> Cfg<'a> {
726716 self . local_toolchain ( local) . await
727717 }
728718
729- async fn local_toolchain ( & self , name : Option < LocalToolchainName > ) -> Result < Toolchain < ' _ > > {
719+ pub ( crate ) async fn local_toolchain (
720+ & self ,
721+ name : Option < LocalToolchainName > ,
722+ ) -> Result < Toolchain < ' _ > > {
730723 match name {
731724 Some ( tc) => {
732725 let install_if_missing = self . should_auto_install ( ) ?;
You can’t perform that action at this time.
0 commit comments