aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-09 15:18:29 +0100
committerGitHub <[email protected]>2020-10-09 15:18:29 +0100
commit95c498d913a2aec1b97ae3613290e7d7a104d0e4 (patch)
tree63a31ca57b77703d42f95a2c20deee10eda5580d /crates
parentc1a8c032994ea9af478ccb48e229754ad0e677e1 (diff)
parent55ecfbb99b105a6c1be1e3889a61e8bba376f524 (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')
-rw-r--r--crates/project_model/src/sysroot.rs10
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