Skip to content

Commit 231e8cb

Browse files
committed
add "Compiler environment variables" section to the unstable book
1 parent 4de3f89 commit 231e8cb

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Compiler environment variables

src/doc/unstable-book/src/compiler-flags/rustc-bootstrap.md renamed to src/doc/unstable-book/src/compiler-environment-variables/RUSTC_BOOTSTRAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Cargo disallows setting `cargo::rustc-env=RUSTC_BOOTSTRAP` in build scripts.
1414
Build systems can limit the features they enable with [`-Z allow-features=feature1,feature2`][Z-allow-features].
1515
Crates can fully opt out of unstable features by using [`#![forbid(unstable_features)]`][unstable-features] at the crate root (or any other way of enabling lints, such as `-F unstable-features`).
1616

17-
[Z-allow-features]: ./allow-features.html
17+
[Z-allow-features]: ../compiler-flags/allow-features.html
1818
[unstable-features]: ../../rustc/lints/listing/allowed-by-default.html#unstable-features
1919

2020
## Why does this environment variable exist?

src/doc/unstable-book/src/compiler-flags/allow-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Features are comma-separated, for example `-Z allow-features=ffi_pure,f16`.
1111
If the flag is present, any feature listed will be allowed and any feature not listed will be disallowed.
1212
Any unrecognized feature is ignored.
1313

14-
[`RUSTC_BOOTSTRAP`]: ./rustc-bootstrap.html
14+
[`RUSTC_BOOTSTRAP`]: ../compiler-environment-variables/RUSTC_BOOTSTRAP.html

src/tools/unstable-book-gen/src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[The Unstable Book](the-unstable-book.md)
22

3+
- [Compiler environment variables](compiler-environment-variables.md)
4+
{compiler_env_vars}
35
- [Compiler flags](compiler-flags.md)
46
{compiler_flags}
57
- [Language features](language-features.md)

src/tools/unstable-book-gen/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ fn set_to_summary_str(set: &BTreeSet<String>, dir: &str) -> String {
3030

3131
fn generate_summary(path: &Path, lang_features: &Features, lib_features: &Features) {
3232
let compiler_flags = collect_unstable_book_section_file_names(&path.join("src/compiler-flags"));
33+
let compiler_env_vars =
34+
collect_unstable_book_section_file_names(&path.join("src/compiler-environment-variables"));
3335

3436
let compiler_flags_str = set_to_summary_str(&compiler_flags, "compiler-flags");
37+
let compiler_env_vars_str =
38+
set_to_summary_str(&compiler_env_vars, "compiler-environment-variables");
3539

3640
let unstable_lang_features = collect_unstable_feature_names(&lang_features);
3741
let unstable_lib_features = collect_unstable_feature_names(&lib_features);
@@ -42,6 +46,7 @@ fn generate_summary(path: &Path, lang_features: &Features, lib_features: &Featur
4246
let summary_path = path.join("src/SUMMARY.md");
4347
let content = format!(
4448
include_str!("SUMMARY.md"),
49+
compiler_env_vars = compiler_env_vars_str,
4550
compiler_flags = compiler_flags_str,
4651
language_features = lang_features_str,
4752
library_features = lib_features_str

0 commit comments

Comments
 (0)