Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note if RUST_SRC_PATH is likely to be wrong #6185

Merged
merged 2 commits into from
Oct 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/project_model/src/sysroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 incorrect, try unsetting it)"
} 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,
);
}

Expand Down