Skip to content

Commit bba84aa

Browse files
committed
Auto merge of rust-lang#17750 - davidbarsky:david/remove-abspath-requirement-in-linked-projects, r=Veykril
fix: remove AbsPath requirement from linkedProjects Should (fingers crossed!) fix rust-lang/rust-analyzer#17664. I opened the `rustc` workspace with the [suggested configuration](https://github.com/rust-lang/rust/blob/e552c168c72c95dc28950a9aae8ed7030199aa0d/src/etc/rust_analyzer_settings.json) and I was able to successfully open some rustc crates (`rustc_incremental`) and have IDE functionality. `@Veykril:` can you try these changes and let me know if it fixed rustc?
2 parents 9fb03f0 + e8a9051 commit bba84aa

File tree

1 file changed

+6
-8
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src

1 file changed

+6
-8
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ impl Config {
16771677
!self.linkedProjects(None).is_empty()
16781678
}
16791679

1680-
pub fn linked_manifests(&self) -> impl Iterator<Item = &AbsPath> + '_ {
1680+
pub fn linked_manifests(&self) -> impl Iterator<Item = &Utf8Path> + '_ {
16811681
self.linkedProjects(None).iter().filter_map(|it| match it {
16821682
ManifestOrProjectJson::Manifest(p) => Some(&**p),
16831683
// despite having a buildfile, using this variant as a manifest
@@ -2273,11 +2273,7 @@ mod single_or_array {
22732273
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
22742274
#[serde(untagged)]
22752275
enum ManifestOrProjectJson {
2276-
Manifest(
2277-
#[serde(serialize_with = "serialize_abs_pathbuf")]
2278-
#[serde(deserialize_with = "deserialize_abs_pathbuf")]
2279-
AbsPathBuf,
2280-
),
2276+
Manifest(Utf8PathBuf),
22812277
ProjectJson(ProjectJsonData),
22822278
DiscoveredProjectJson {
22832279
data: ProjectJsonData,
@@ -2306,10 +2302,12 @@ where
23062302
}
23072303

23082304
impl ManifestOrProjectJson {
2309-
fn manifest(&self) -> Option<&AbsPath> {
2305+
fn manifest(&self) -> Option<&Utf8Path> {
23102306
match self {
23112307
ManifestOrProjectJson::Manifest(manifest) => Some(manifest),
2312-
ManifestOrProjectJson::DiscoveredProjectJson { buildfile, .. } => Some(buildfile),
2308+
ManifestOrProjectJson::DiscoveredProjectJson { buildfile, .. } => {
2309+
Some(buildfile.as_ref())
2310+
}
23132311
ManifestOrProjectJson::ProjectJson(_) => None,
23142312
}
23152313
}

0 commit comments

Comments
 (0)