diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-09 15:18:29 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-09 15:18:29 +0100 |
commit | 95c498d913a2aec1b97ae3613290e7d7a104d0e4 (patch) | |
tree | 63a31ca57b77703d42f95a2c20deee10eda5580d /crates/project_model | |
parent | c1a8c032994ea9af478ccb48e229754ad0e677e1 (diff) | |
parent | 55ecfbb99b105a6c1be1e3889a61e8bba376f524 (diff) |
Merge #6185
6185: Add note if RUST_SRC_PATH is likely to be wrong r=jonas-schievink a=jonas-schievink
bors r+ :robot:
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/project_model')
-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..e529e07b0 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 incorrect, try unsetting it)" | ||
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 | ||