File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
contrib/tools/config-docs-generator/src Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -156,10 +156,18 @@ fn generate_rustdoc_json(package: &str) -> Result<serde_json::Value> {
156
156
157
157
// WARNING: This tool relies on nightly rustdoc JSON output (-Z unstable-options --output-format json)
158
158
// The JSON format is subject to change with new Rust nightly versions and could break this tool.
159
- // Use cargo rustdoc with nightly to generate JSON for the main package
159
+ // Determine the toolchain to use for rustdoc. Allow callers to override the
160
+ // default "+nightly" prefix via the `RUST_NIGHTLY_VERSION` environment variable
161
+ // so CI can pin a specific nightly (e.g. "+nightly-2025-06-17").
162
+ let toolchain_arg =
163
+ std:: env:: var ( "RUST_NIGHTLY_VERSION" ) . unwrap_or_else ( |_| "nightly" . to_string ( ) ) ;
164
+
165
+ let toolchain_arg = format ! ( "+{}" , toolchain_arg) ;
166
+
167
+ // Use cargo rustdoc with the selected toolchain to generate JSON for the main package
160
168
let output = StdCommand :: new ( "cargo" )
161
169
. args ( [
162
- "+nightly" ,
170
+ toolchain_arg . as_str ( ) ,
163
171
"rustdoc" ,
164
172
"--lib" ,
165
173
"-p" ,
@@ -189,7 +197,7 @@ fn generate_rustdoc_json(package: &str) -> Result<serde_json::Value> {
189
197
) ;
190
198
let output = StdCommand :: new ( "cargo" )
191
199
. args ( [
192
- "+nightly" ,
200
+ toolchain_arg . as_str ( ) ,
193
201
"rustdoc" ,
194
202
"--lib" ,
195
203
"-p" ,
You can’t perform that action at this time.
0 commit comments