Skip to content

Commit

Permalink
Clarify cfg(bootstrap) docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 authored and tshepang committed Apr 9, 2023
1 parent 26315eb commit c87993b
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit c87993b

Please sign in to comment.