mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: fix compilation errors after rust-anlyzer update
This commit is contained in:
@@ -106,7 +106,7 @@ impl Config {
|
||||
let sysroot_src_input = self.sysroot_src.as_ref().map(|p| join_path_buf(dir, p));
|
||||
match (sysroot_input, sysroot_src_input) {
|
||||
(None, None) => Sysroot::discover(dir, &self.cargo_extra_env),
|
||||
(Some(sysroot), None) => Sysroot::discover_sysroot_src_dir(sysroot),
|
||||
(Some(sysroot), None) => Sysroot::discover_rust_lib_src_dir(sysroot),
|
||||
(None, Some(sysroot_src)) => {
|
||||
Sysroot::discover_with_src_override(dir, &self.cargo_extra_env, sysroot_src)
|
||||
}
|
||||
@@ -130,7 +130,7 @@ impl Config {
|
||||
(
|
||||
CargoConfig {
|
||||
all_targets: self.cargo_all_targets,
|
||||
sysroot_src: sysroot.src_root().map(ToOwned::to_owned),
|
||||
sysroot_src: sysroot.rust_lib_src_root().map(ToOwned::to_owned),
|
||||
rustc_source: self
|
||||
.rustc_src
|
||||
.as_ref()
|
||||
|
||||
@@ -297,4 +297,5 @@ pub(crate) fn path_to_file_id(path: &Path, vfs: &Vfs) -> Option<FileId> {
|
||||
.and_then(|x| AbsPathBuf::try_from(x).ok())
|
||||
.map(VfsPath::from)
|
||||
.and_then(|x| vfs.file_id(&x))
|
||||
.map(|(id, _excluded)| id)
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ impl<'a> Translator<'a> {
|
||||
}
|
||||
}
|
||||
ItemContainer::Module(it) => self.canonical_path_from_hir_module(it),
|
||||
ItemContainer::ExternBlock() | ItemContainer::Crate(_) => Some("".to_owned()),
|
||||
ItemContainer::ExternBlock(..) | ItemContainer::Crate(..) => Some("".to_owned()),
|
||||
}?;
|
||||
Some(format!("{prefix}::{name}"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user