diff options
author | Aleksey Kladov <[email protected]> | 2021-01-26 13:10:51 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-26 13:40:08 +0000 |
commit | a733f65126451784c8b158d6c6318b556d68ebfc (patch) | |
tree | 41578764898b2eb1bb28219ea4ac14769ac4ee2f /crates | |
parent | e0f2e1560fd1073c20c61cd0ab232be241f1121e (diff) |
Allow non-absolute paths to rust source
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 8 |
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 | ||
10 | use std::{convert::TryFrom, ffi::OsString, iter, path::PathBuf}; | 10 | use std::{ffi::OsString, iter, path::PathBuf}; |
11 | 11 | ||
12 | use flycheck::FlycheckConfig; | 12 | use flycheck::FlycheckConfig; |
13 | use hir::PrefixKind; | 13 | use 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, |