Skip to content

Commit b250e0f

Browse files
authored
Merge pull request #18552 from lnicola/rust-src-message
internal: Fix missing `rust-src` message
2 parents 309c671 + 63b82dd commit b250e0f

File tree

1 file changed

+5
-4
lines changed
  • src/tools/rust-analyzer/crates/project-model/src

1 file changed

+5
-4
lines changed

src/tools/rust-analyzer/crates/project-model/src/sysroot.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,14 @@ fn discover_sysroot_src_dir_or_add_component(
444444
get_rust_src(sysroot_path)
445445
})
446446
.ok_or_else(|| {
447-
let error = "\
447+
tracing::error!(%sysroot_path, "can't load standard library, try installing `rust-src`");
448+
format_err!(
449+
"\
448450
can't load standard library from sysroot
449451
{sysroot_path}
450452
(discovered via `rustc --print sysroot`)
451-
try installing the Rust source the same way you installed rustc";
452-
tracing::error!(error);
453-
format_err!(error)
453+
try installing `rust-src` the same way you installed `rustc`"
454+
)
454455
})
455456
}
456457

0 commit comments

Comments
 (0)