aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-26 13:10:51 +0000
committerAleksey Kladov <[email protected]>2021-01-26 13:40:08 +0000
commita733f65126451784c8b158d6c6318b556d68ebfc (patch)
tree41578764898b2eb1bb28219ea4ac14769ac4ee2f /crates
parente0f2e1560fd1073c20c61cd0ab232be241f1121e (diff)
Allow non-absolute paths to rust source
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/config.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 071fde64d..c135913e2 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -7,7 +7,7 @@
7//! configure the server itself, feature flags are passed into analysis, and 7//! configure the server itself, feature flags are passed into analysis, and
8//! tweak things like automatic insertion of `()` in completions. 8//! tweak things like automatic insertion of `()` in completions.
9 9
10use std::{convert::TryFrom, ffi::OsString, iter, path::PathBuf}; 10use std::{ffi::OsString, iter, path::PathBuf};
11 11
12use flycheck::FlycheckConfig; 12use flycheck::FlycheckConfig;
13use hir::PrefixKind; 13use hir::PrefixKind;
@@ -468,11 +468,7 @@ impl Config {
468 self.data.cargo_autoreload 468 self.data.cargo_autoreload
469 } 469 }
470 pub fn cargo(&self) -> CargoConfig { 470 pub fn cargo(&self) -> CargoConfig {
471 let rustc_source = self.data.rustcSource.clone().and_then(|it| { 471 let rustc_source = self.data.rustcSource.as_ref().map(|it| self.root_path.join(&it));
472 AbsPathBuf::try_from(it)
473 .map_err(|_| log::error!("rustc source directory must be an absolute path"))
474 .ok()
475 });
476 472
477 CargoConfig { 473 CargoConfig {
478 no_default_features: self.data.cargo_noDefaultFeatures, 474 no_default_features: self.data.cargo_noDefaultFeatures,