Skip to content

Commit bfcf9ea

Browse files
author
Paolo Tranquilli
committed
Rust: fix compilation errors after rust-anlyzer update
1 parent cbae16b commit bfcf9ea

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

rust/extractor/src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl Config {
106106
let sysroot_src_input = self.sysroot_src.as_ref().map(|p| join_path_buf(dir, p));
107107
match (sysroot_input, sysroot_src_input) {
108108
(None, None) => Sysroot::discover(dir, &self.cargo_extra_env),
109-
(Some(sysroot), None) => Sysroot::discover_sysroot_src_dir(sysroot),
109+
(Some(sysroot), None) => Sysroot::discover_rust_lib_src_dir(sysroot),
110110
(None, Some(sysroot_src)) => {
111111
Sysroot::discover_with_src_override(dir, &self.cargo_extra_env, sysroot_src)
112112
}
@@ -130,7 +130,7 @@ impl Config {
130130
(
131131
CargoConfig {
132132
all_targets: self.cargo_all_targets,
133-
sysroot_src: sysroot.src_root().map(ToOwned::to_owned),
133+
sysroot_src: sysroot.rust_lib_src_root().map(ToOwned::to_owned),
134134
rustc_source: self
135135
.rustc_src
136136
.as_ref()

rust/extractor/src/rust_analyzer.rs

+1
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,5 @@ pub(crate) fn path_to_file_id(path: &Path, vfs: &Vfs) -> Option<FileId> {
297297
.and_then(|x| AbsPathBuf::try_from(x).ok())
298298
.map(VfsPath::from)
299299
.and_then(|x| vfs.file_id(&x))
300+
.map(|(id, _excluded)| id)
300301
}

rust/extractor/src/translate/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<'a> Translator<'a> {
417417
}
418418
}
419419
ItemContainer::Module(it) => self.canonical_path_from_hir_module(it),
420-
ItemContainer::ExternBlock() | ItemContainer::Crate(_) => Some("".to_owned()),
420+
ItemContainer::ExternBlock(..) | ItemContainer::Crate(..) => Some("".to_owned()),
421421
}?;
422422
Some(format!("{prefix}::{name}"))
423423
}

0 commit comments

Comments
 (0)