Skip to content

Commit 4b400b4

Browse files
authored
refactor: configure cargo (#1573)
Without this, `cargo` never tries to load any of the settings from `.cargo/config.toml`, etc. For example, it doesn't load the `[unstable] sparse-registry = true` in `config.toml` set by crisp, which is what is causing the hang in `cargo refactor` in crisp.
2 parents dd8429f + 338d60d commit 4b400b4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

c2rust-refactor/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,20 @@ fn get_rustc_cargo_args(target_type: CargoTarget) -> Vec<RustcArgs> {
248248
use cargo_util::ProcessBuilder;
249249
use std::sync::Mutex;
250250

251-
let config = Config::default().unwrap();
251+
let mut config = Config::default().unwrap();
252+
config
253+
.configure(
254+
Default::default(),
255+
Default::default(),
256+
Default::default(),
257+
Default::default(),
258+
Default::default(),
259+
Default::default(),
260+
&Default::default(),
261+
Default::default(),
262+
Default::default(),
263+
)
264+
.unwrap();
252265
config.shell().set_verbosity(Verbosity::Quiet);
253266
let mode = CompileMode::Check { test: false };
254267
let mut compile_opts = CompileOptions::new(&config, mode).unwrap();

0 commit comments

Comments
 (0)