Merge pull request #18552 from lnicola/rust-src-message

internal: Fix missing `rust-src` message
This commit is contained in:
Laurențiu Nicola 2024-11-24 16:42:18 +00:00 committed by GitHub
commit 327ab2958f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -444,13 +444,14 @@ fn discover_sysroot_src_dir_or_add_component(
get_rust_src(sysroot_path)
})
.ok_or_else(|| {
let error = "\
tracing::error!(%sysroot_path, "can't load standard library, try installing `rust-src`");
format_err!(
"\
can't load standard library from sysroot
{sysroot_path}
(discovered via `rustc --print sysroot`)
try installing the Rust source the same way you installed rustc";
tracing::error!(error);
format_err!(error)
try installing `rust-src` the same way you installed `rustc`"
)
})
}