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') 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