Skip to content

Commit 0aa39c4

Browse files
committed
fix: Run cargo metadata on sysroot with cwd=sysroot
1 parent 7a15d6d commit 0aa39c4

File tree

4 files changed

+1
-8
lines changed

4 files changed

+1
-8
lines changed

src/tools/rust-analyzer/crates/project-model/src/sysroot.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ impl Sysroot {
210210
&self,
211211
sysroot_source_config: &RustSourceWorkspaceConfig,
212212
no_deps: bool,
213-
current_dir: &AbsPath,
214213
target_dir: &Utf8Path,
215214
progress: &dyn Fn(String),
216215
) -> Option<RustLibSrcWorkspace> {
@@ -224,7 +223,7 @@ impl Sysroot {
224223
if fs::metadata(&library_manifest).is_ok() {
225224
match self.load_library_via_cargo(
226225
&library_manifest,
227-
current_dir,
226+
src_root,
228227
target_dir,
229228
cargo_config,
230229
no_deps,

src/tools/rust-analyzer/crates/project-model/src/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ fn smoke_test_real_sysroot_cargo() {
241241
let loaded_sysroot = sysroot.load_workspace(
242242
&RustSourceWorkspaceConfig::default_cargo(),
243243
false,
244-
&cwd,
245244
&Utf8PathBuf::default(),
246245
&|_| (),
247246
);

src/tools/rust-analyzer/crates/project-model/src/workspace.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ impl ProjectWorkspace {
383383
toolchain.clone(),
384384
)),
385385
config.no_deps,
386-
workspace_dir,
387386
&target_dir,
388387
progress,
389388
)
@@ -487,7 +486,6 @@ impl ProjectWorkspace {
487486
sysroot.load_workspace(
488487
&RustSourceWorkspaceConfig::Json(*sysroot_project),
489488
config.no_deps,
490-
project_root,
491489
&target_dir,
492490
progress,
493491
)
@@ -499,7 +497,6 @@ impl ProjectWorkspace {
499497
toolchain.clone(),
500498
)),
501499
config.no_deps,
502-
project_root,
503500
&target_dir,
504501
progress,
505502
)
@@ -561,7 +558,6 @@ impl ProjectWorkspace {
561558
toolchain.clone(),
562559
)),
563560
config.no_deps,
564-
dir,
565561
&target_dir,
566562
&|_| (),
567563
);

src/tools/rust-analyzer/crates/rust-analyzer/src/cli/rustc_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ impl Tester {
7878
let loaded_sysroot = sysroot.load_workspace(
7979
&RustSourceWorkspaceConfig::default_cargo(),
8080
false,
81-
&path,
8281
&Utf8PathBuf::default(),
8382
&|_| (),
8483
);

0 commit comments

Comments
 (0)