diff options
author | Jonas Schievink <[email protected]> | 2020-10-09 15:11:16 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-10-09 15:11:16 +0100 |
commit | 7d0772e79630924149a9dca7376ed2ab9d2c0dce (patch) | |
tree | f5cc9061be6e10f7157c581e4f3d10ebd7778f3c /crates | |
parent | c1a8c032994ea9af478ccb48e229754ad0e677e1 (diff) |
Add note if RUST_SRC_PATH is likely to be wrong
Diffstat (limited to 'crates')
-rw-r--r-- | crates/project_model/src/sysroot.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs index 871808d89..fed9ce789 100644 --- a/crates/project_model/src/sysroot.rs +++ b/crates/project_model/src/sysroot.rs | |||
@@ -90,9 +90,15 @@ impl Sysroot { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | if sysroot.by_name("core").is_none() { | 92 | if sysroot.by_name("core").is_none() { |
93 | let var_note = if env::var_os("RUST_SRC_PATH").is_some() { | ||
94 | " (`RUST_SRC_PATH` might be set incorrectly)" | ||
95 | } else { | ||
96 | "" | ||
97 | }; | ||
93 | anyhow::bail!( | 98 | anyhow::bail!( |
94 | "could not find libcore in sysroot path `{}`", | 99 | "could not find libcore in sysroot path `{}`{}", |
95 | sysroot_src_dir.as_ref().display() | 100 | sysroot_src_dir.as_ref().display(), |
101 | var_note, | ||
96 | ); | 102 | ); |
97 | } | 103 | } |
98 | 104 | ||