From 7d0772e79630924149a9dca7376ed2ab9d2c0dce Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 9 Oct 2020 16:11:16 +0200 Subject: Add note if RUST_SRC_PATH is likely to be wrong --- crates/project_model/src/sysroot.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/project_model/src/sysroot.rs') 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 { } if sysroot.by_name("core").is_none() { + let var_note = if env::var_os("RUST_SRC_PATH").is_some() { + " (`RUST_SRC_PATH` might be set incorrectly)" + } else { + "" + }; anyhow::bail!( - "could not find libcore in sysroot path `{}`", - sysroot_src_dir.as_ref().display() + "could not find libcore in sysroot path `{}`{}", + sysroot_src_dir.as_ref().display(), + var_note, ); } -- cgit v1.2.3 From 55ecfbb99b105a6c1be1e3889a61e8bba376f524 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 9 Oct 2020 16:17:05 +0200 Subject: Update crates/project_model/src/sysroot.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- crates/project_model/src/sysroot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/project_model/src/sysroot.rs') diff --git a/crates/project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs index fed9ce789..e529e07b0 100644 --- a/crates/project_model/src/sysroot.rs +++ b/crates/project_model/src/sysroot.rs @@ -91,7 +91,7 @@ impl Sysroot { if sysroot.by_name("core").is_none() { let var_note = if env::var_os("RUST_SRC_PATH").is_some() { - " (`RUST_SRC_PATH` might be set incorrectly)" + " (`RUST_SRC_PATH` might be incorrect, try unsetting it)" } else { "" }; -- cgit v1.2.3