mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
fix: resolve core::arch module
See https://users.rust-lang.org/t/rust-analyzer-unable-to-resolve-target-specific-module/63797/4?u=matklad The fix is to put all sysroot crates into the same source root
This commit is contained in:
parent
3004f2ec90
commit
4924c24d91
3 changed files with 32 additions and 24 deletions
|
@ -5,7 +5,7 @@ use std::{
|
|||
|
||||
use base_db::{CrateGraph, FileId};
|
||||
use expect_test::{expect, Expect};
|
||||
use paths::AbsPath;
|
||||
use paths::{AbsPath, AbsPathBuf};
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
use crate::{
|
||||
|
@ -19,7 +19,7 @@ fn load_cargo(file: &str) -> CrateGraph {
|
|||
let project_workspace = ProjectWorkspace::Cargo {
|
||||
cargo: cargo_workspace,
|
||||
build_scripts: WorkspaceBuildScripts::default(),
|
||||
sysroot: Sysroot::default(),
|
||||
sysroot: None,
|
||||
rustc: None,
|
||||
rustc_cfg: Vec::new(),
|
||||
cfg_overrides: CfgOverrides::default(),
|
||||
|
@ -71,8 +71,8 @@ fn get_test_path(file: &str) -> PathBuf {
|
|||
|
||||
fn get_fake_sysroot() -> Sysroot {
|
||||
let sysroot_path = get_test_path("fake-sysroot");
|
||||
let sysroot_src_dir = AbsPath::assert(&sysroot_path);
|
||||
Sysroot::load(&sysroot_src_dir).unwrap()
|
||||
let sysroot_src_dir = AbsPathBuf::assert(sysroot_path);
|
||||
Sysroot::load(sysroot_src_dir).unwrap()
|
||||
}
|
||||
|
||||
fn rooted_project_json(data: ProjectJsonData) -> ProjectJson {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue