File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,11 @@ impl Config {
151151
152152 pub fn to_cargo_config ( & self , dir : & AbsPath ) -> ( CargoConfig , LoadCargoConfig ) {
153153 let sysroot = self . sysroot ( dir) ;
154+ let mut extra_env = FxHashMap :: default ( ) ;
155+ // RUSTUP_AUTO_INSTALL is set to 0 by rust-analyzer (https://github.com/rust-lang/rust-analyzer/issues/20719),
156+ // but we do want to allow rustup to auto-install toolchains if needed, so we set it to 1 here.
157+ extra_env. insert ( "RUSTUP_AUTO_INSTALL" . to_owned ( ) , Some ( "1" . to_owned ( ) ) ) ;
158+ extra_env. extend ( self . cargo_extra_env . clone ( ) ) ;
154159 (
155160 CargoConfig {
156161 all_targets : self . cargo_all_targets ,
@@ -166,7 +171,7 @@ impl Config {
166171 . map ( ToOwned :: to_owned)
167172 . map ( RustLibSource :: Path ) ,
168173
169- extra_env : self . cargo_extra_env . clone ( ) ,
174+ extra_env,
170175 extra_args : self . cargo_extra_args . clone ( ) ,
171176 extra_includes : self
172177 . extra_includes
You can’t perform that action at this time.
0 commit comments