Skip to content

Commit a507c27

Browse files
committed
Auto merge of rust-lang#6679 - flip1995:ra_setup_abs_path, r=Manishearth
Use absolute path to Rust repo in ra_setup This will convert the path to the Rust repo to an absolute path. This is important for the clippy_lints/Cargo.toml file. Otherwise if a relative path is passed, rst-analyzer won't find the Rust repo, because it starts the relative path search from the clippy_lints dir, not the rust-clippy dir where the ra_setup command was run from. changelog: none
2 parents 89f266a + 79dbf10 commit a507c27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_dev/src/ra_setup.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use std::path::{Path, PathBuf};
1313
/// Panics if `rustc_path` does not lead to a rustc repo or the files could not be read
1414
pub fn run(rustc_path: Option<&str>) {
1515
// we can unwrap here because the arg is required by clap
16-
let rustc_path = PathBuf::from(rustc_path.unwrap());
16+
let rustc_path = PathBuf::from(rustc_path.unwrap())
17+
.canonicalize()
18+
.expect("failed to get the absolute repo path");
1719
assert!(rustc_path.is_dir(), "path is not a directory");
1820
let rustc_source_basedir = rustc_path.join("compiler");
1921
assert!(

0 commit comments

Comments
 (0)