@@ -742,6 +742,7 @@ impl<'a> Cfg<'a> {
742742 #[ tracing:: instrument( level = "trace" , skip_all) ]
743743 pub ( crate ) async fn find_or_install_active_toolchain (
744744 & self ,
745+ force_non_host : bool ,
745746 verbose : bool ,
746747 ) -> Result < ( LocalToolchainName , ActiveReason ) > {
747748 if let Some ( ( override_config, reason) ) = self . find_override_config ( ) ? {
@@ -753,16 +754,23 @@ impl<'a> Cfg<'a> {
753754 profile,
754755 } = override_config
755756 {
756- self . ensure_installed ( & toolchain, components, targets, profile, verbose)
757- . await ?;
757+ self . ensure_installed (
758+ & toolchain,
759+ components,
760+ targets,
761+ profile,
762+ force_non_host,
763+ verbose,
764+ )
765+ . await ?;
758766 } else {
759767 Toolchain :: with_reason ( self , toolchain. clone ( ) , & reason) ?;
760768 }
761769 Ok ( ( toolchain, reason) )
762770 } else if let Some ( toolchain) = self . get_default ( ) ? {
763771 let reason = ActiveReason :: Default ;
764772 if let ToolchainName :: Official ( desc) = & toolchain {
765- self . ensure_installed ( desc, vec ! [ ] , vec ! [ ] , None , verbose)
773+ self . ensure_installed ( desc, vec ! [ ] , vec ! [ ] , None , force_non_host , verbose)
766774 . await ?;
767775 } else {
768776 Toolchain :: with_reason ( self , toolchain. clone ( ) . into ( ) , & reason) ?;
@@ -782,13 +790,14 @@ impl<'a> Cfg<'a> {
782790 components : Vec < String > ,
783791 targets : Vec < String > ,
784792 profile : Option < Profile > ,
793+ force_non_host : bool ,
785794 verbose : bool ,
786795 ) -> Result < ( UpdateStatus , Toolchain < ' _ > ) > {
787796 common:: warn_if_host_is_incompatible (
788797 toolchain,
789798 & TargetTriple :: from_host_or_build ( self . process ) ,
790799 & toolchain. target ,
791- false ,
800+ force_non_host ,
792801 ) ?;
793802 if verbose {
794803 ( self . notify_handler ) ( Notification :: LookingForToolchain ( toolchain) ) ;
0 commit comments