Skip to content

Commit 425619d

Browse files
committed
Auto merge of #15014 - Wilfred:document_sysroot, r=Veykril
Document the sysroot field in JsonProject rust-analyzer supports both `sysroot` and `sysroot_src` in `rust-project.json`. Document `sysroot` and show example values for both fields.
2 parents 2796851 + 5da1423 commit 425619d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/user/manual.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,28 @@ However, if you use some other build system, you'll have to describe the structu
653653
[source,TypeScript]
654654
----
655655
interface JsonProject {
656+
/// Path to the sysroot directory.
657+
///
658+
/// The sysroot is where rustc looks for the
659+
/// crates that are built-in to rust, such as
660+
/// std.
661+
///
662+
/// https://doc.rust-lang.org/rustc/command-line-arguments.html#--sysroot-override-the-system-root
663+
///
664+
/// To see the current value of sysroot, you
665+
/// can query rustc:
666+
///
667+
/// ```
668+
/// $ rustc --print sysroot
669+
/// /Users/yourname/.rustup/toolchains/stable-x86_64-apple-darwin
670+
/// ```
671+
sysroot?: string;
656672
/// Path to the directory with *source code* of
657673
/// sysroot crates.
658674
///
675+
/// By default, this is `lib/rustlib/src/rust/library`
676+
/// relative to the sysroot.
677+
///
659678
/// It should point to the directory where std,
660679
/// core, and friends can be found:
661680
///

0 commit comments

Comments
 (0)