mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Make robust about target directory
This commit is contained in:
parent
c083515eec
commit
0010d62cad
1 changed files with 1 additions and 4 deletions
|
@ -126,10 +126,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_loading_rust_analyzer() {
|
fn test_loading_rust_analyzer() {
|
||||||
let mut path = std::env::current_exe().unwrap();
|
let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap();
|
||||||
while !path.join("Cargo.toml").is_file() {
|
|
||||||
path = path.parent().unwrap().to_owned();
|
|
||||||
}
|
|
||||||
let (db, roots) = BatchDatabase::load_cargo(path).unwrap();
|
let (db, roots) = BatchDatabase::load_cargo(path).unwrap();
|
||||||
let mut n_crates = 0;
|
let mut n_crates = 0;
|
||||||
for root in roots {
|
for root in roots {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue