Skip to content

Commit 95c498d

Browse files
Merge #6185
6185: Add note if RUST_SRC_PATH is likely to be wrong r=jonas-schievink a=jonas-schievink bors r+ 🤖 Co-authored-by: Jonas Schievink <[email protected]>
2 parents c1a8c03 + 55ecfbb commit 95c498d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

crates/project_model/src/sysroot.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,15 @@ impl Sysroot {
9090
}
9191

9292
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+
};
9398
anyhow::bail!(
94-
"could not find libcore in sysroot path `{}`",
95-
sysroot_src_dir.as_ref().display()
99+
"could not find libcore in sysroot path `{}`{}",
100+
sysroot_src_dir.as_ref().display(),
101+
var_note,
96102
);
97103
}
98104

0 commit comments

Comments
 (0)