Skip to content

Clarify cfg(bootstrap) docs #1669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/building/bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'?

Expand Down