Skip to content

Commit ae15152

Browse files
Undinyopox
authored andcommitted
CARGO: don't fetch stdlib metadata for rustc project
In [rustc](https://github.com/rust-lang/rust) project, we use project crates as stdlib so we don't need to do anything special to get proper metadata for them. Otherwise, it may break our analysis
1 parent fd5ba46 commit ae15152

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/org/rust/cargo/project/model/impl/CargoSyncTask.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class CargoSyncTask(
119119
.withWorkspace(fetchCargoWorkspace(context, rustcInfo))
120120
CargoProjectWithStdlib(
121121
cargoProjectWithRustcInfoAndWorkspace,
122-
fetchStdlib(context, rustcInfo)
122+
fetchStdlib(context, cargoProjectWithRustcInfoAndWorkspace, rustcInfo)
123123
)
124124
}
125125
}
@@ -351,11 +351,11 @@ private fun fetchCargoWorkspace(context: CargoSyncTask.SyncContext, rustcInfo: R
351351
}
352352
}
353353

354-
private fun fetchStdlib(context: CargoSyncTask.SyncContext, rustcInfo: RustcInfo?): TaskResult<StandardLibrary> {
354+
private fun fetchStdlib(context: CargoSyncTask.SyncContext, cargoProject: CargoProjectImpl, rustcInfo: RustcInfo?): TaskResult<StandardLibrary> {
355355
return context.runWithChildProgress("Getting Rust stdlib") { childContext ->
356356

357-
val workingDirectory = childContext.oldCargoProject.workingDirectory
358-
if (childContext.oldCargoProject.doesProjectLooksLikeRustc()) {
357+
val workingDirectory = cargoProject.workingDirectory
358+
if (cargoProject.doesProjectLooksLikeRustc()) {
359359
// rust-lang/rust contains stdlib inside the project
360360
val std = StandardLibrary.fromPath(
361361
childContext.project,

0 commit comments

Comments
 (0)