From bea76af07dce7d16711c28b1f8df8d680c8a0f23 Mon Sep 17 00:00:00 2001 From: jyn Date: Sat, 8 Apr 2023 16:53:36 -0400 Subject: [PATCH] Clarify cfg(bootstrap) docs --- src/building/bootstrapping.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index bac445ad..d53896f8 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -256,6 +256,10 @@ So the stage2 compiler has to recompile `std` for the target. ### Why does only libstd use `cfg(bootstrap)`? +NOTE: for docs on `cfg(bootstrap)` itself, see [Complications of Bootstrapping][complications]. + +[complications]: #complications-of-bootstrapping + The `rustc` generated by the stage0 compiler is linked to the freshly-built `std`, which means that for the most part only `std` needs to be cfg-gated, so that `rustc` can use features added to std immediately after their addition, @@ -265,7 +269,7 @@ Note this is different from any other Rust program: stage1 `rustc` is built by the _beta_ compiler, but using the _master_ version of libstd! The only time `rustc` uses `cfg(bootstrap)` is when it adds internal lints -that use diagnostic items. This happens very rarely. +that use diagnostic items, or when it uses unstable library features that were recently changed. ### What is a 'sysroot'?