mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-28 07:30:57 +00:00
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.
This commit is contained in:
parent
357c6a7e27
commit
79dbf10736
1 changed files with 3 additions and 1 deletions
|
@ -13,7 +13,9 @@ use std::path::{Path, PathBuf};
|
||||||
/// Panics if `rustc_path` does not lead to a rustc repo or the files could not be read
|
/// Panics if `rustc_path` does not lead to a rustc repo or the files could not be read
|
||||||
pub fn run(rustc_path: Option<&str>) {
|
pub fn run(rustc_path: Option<&str>) {
|
||||||
// we can unwrap here because the arg is required by clap
|
// we can unwrap here because the arg is required by clap
|
||||||
let rustc_path = PathBuf::from(rustc_path.unwrap());
|
let rustc_path = PathBuf::from(rustc_path.unwrap())
|
||||||
|
.canonicalize()
|
||||||
|
.expect("failed to get the absolute repo path");
|
||||||
assert!(rustc_path.is_dir(), "path is not a directory");
|
assert!(rustc_path.is_dir(), "path is not a directory");
|
||||||
let rustc_source_basedir = rustc_path.join("compiler");
|
let rustc_source_basedir = rustc_path.join("compiler");
|
||||||
assert!(
|
assert!(
|
||||||
|
|
Loading…
Reference in a new issue