We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ce6715 commit b2df015Copy full SHA for b2df015
src/project.rs
@@ -1,5 +1,6 @@
1
use glob::glob;
2
use serde::{Deserialize, Serialize};
3
+use std::env;
4
use std::error::Error;
5
use std::process::Command;
6
@@ -64,6 +65,12 @@ impl RustAnalyzerProject {
64
65
66
/// Use `rustc` to determine the default toolchain
67
pub fn get_sysroot_src(&mut self) -> Result<(), Box<dyn Error>> {
68
+ // check if RUST_SRC_PATH is set
69
+ if let Ok(path) = env::var("RUST_SRC_PATH") {
70
+ self.sysroot_src = path;
71
+ return Ok(());
72
+ }
73
+
74
let toolchain = Command::new("rustc")
75
.arg("--print")
76
.arg("sysroot")
0 commit comments