diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2024-11-24 16:42:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-24 16:42:18 +0000 |
| commit | b250e0f04397db4da776241dbc2463d574b495b7 (patch) | |
| tree | 5ef88086f6e065f1e80c5a7d141ab669430b441d | |
| parent | 309c671083006dcc5b16dd023f90cb91d4230002 (diff) | |
| parent | 63b82dd0415f8902d22d7db630d6c0fc04366946 (diff) | |
| download | rust-b250e0f04397db4da776241dbc2463d574b495b7.tar.gz rust-b250e0f04397db4da776241dbc2463d574b495b7.zip | |
Merge pull request #18552 from lnicola/rust-src-message
internal: Fix missing `rust-src` message
| -rw-r--r-- | src/tools/rust-analyzer/crates/project-model/src/sysroot.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs b/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs index 19f4c35b5ad..d47b4976aa2 100644 --- a/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs +++ b/src/tools/rust-analyzer/crates/project-model/src/sysroot.rs @@ -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`" + ) }) } |
