about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-05-27 01:29:21 +0800
committerGitHub <noreply@github.com>2025-05-27 01:29:21 +0800
commitd5a26c5660f6f62d4ea3c05c74bbc4dd30898224 (patch)
treea6720fc635464e53354a80fd947caea6d4acd9d1 /src/tools
parent408dc51f9798241da1e5d95b3add232e8b5b54b6 (diff)
parent231e8cb34e6a2c549ffd1f0c69ff2521b0ccc3e9 (diff)
downloadrust-d5a26c5660f6f62d4ea3c05c74bbc4dd30898224.tar.gz
rust-d5a26c5660f6f62d4ea3c05c74bbc4dd30898224.zip
Rollup merge of #141526 - jyn514:env-vars, r=petrochenkov
add a dedicated section for compiler environment variables in the unstable book

rendered: ![image](https://github.com/user-attachments/assets/dcb6e2a3-2e2d-43bb-8f45-79715705bf45)

fixes https://github.com/rust-lang/rust/issues/141523
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/unstable-book-gen/src/SUMMARY.md2
-rw-r--r--src/tools/unstable-book-gen/src/main.rs5
2 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/unstable-book-gen/src/SUMMARY.md b/src/tools/unstable-book-gen/src/SUMMARY.md
index 933c928e2f0..fd4ea1dada6 100644
--- a/src/tools/unstable-book-gen/src/SUMMARY.md
+++ b/src/tools/unstable-book-gen/src/SUMMARY.md
@@ -1,5 +1,7 @@
 [The Unstable Book](the-unstable-book.md)
 
+- [Compiler environment variables](compiler-environment-variables.md)
+{compiler_env_vars}
 - [Compiler flags](compiler-flags.md)
 {compiler_flags}
 - [Language features](language-features.md)
diff --git a/src/tools/unstable-book-gen/src/main.rs b/src/tools/unstable-book-gen/src/main.rs
index 33435772960..159a1d0fa17 100644
--- a/src/tools/unstable-book-gen/src/main.rs
+++ b/src/tools/unstable-book-gen/src/main.rs
@@ -35,8 +35,12 @@ fn set_to_summary_str(set: &BTreeSet<String>, dir: &str) -> String {
 
 fn generate_summary(path: &Path, lang_features: &Features, lib_features: &Features) {
     let compiler_flags = collect_unstable_book_section_file_names(&path.join("src/compiler-flags"));
+    let compiler_env_vars =
+        collect_unstable_book_section_file_names(&path.join("src/compiler-environment-variables"));
 
     let compiler_flags_str = set_to_summary_str(&compiler_flags, "compiler-flags");
+    let compiler_env_vars_str =
+        set_to_summary_str(&compiler_env_vars, "compiler-environment-variables");
 
     let unstable_lang_features = collect_unstable_feature_names(&lang_features);
     let unstable_lib_features = collect_unstable_feature_names(&lib_features);
@@ -47,6 +51,7 @@ fn generate_summary(path: &Path, lang_features: &Features, lib_features: &Featur
     let summary_path = path.join("src/SUMMARY.md");
     let content = format!(
         include_str!("SUMMARY.md"),
+        compiler_env_vars = compiler_env_vars_str,
         compiler_flags = compiler_flags_str,
         language_features = lang_features_str,
         library_features = lib_features_str