Skip to content

Commit 327ab29

Browse files
authored
Merge pull request #18552 from lnicola/rust-src-message
internal: Fix missing `rust-src` message
2 parents a2bb014 + 8fc5f3d commit 327ab29

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/project-model/src/sysroot.rs

+5-4
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)