You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Don't treat it as deprecated on stable and beta channels. Before, it
would give confusing and incorrect output:
```
warning: the 'output-format' flag is considered deprecated
|
= warning: see issue #44136 <#44136> for more information
error: json output format isn't supported for doc generation
```
Both of those are wrong: output-format isn't deprecated, and json
output is supported.
- Require -Z unstable-options for `--output-format json`
Previously, it was allowed by default on nightly, which made it hard
to realize the flag wouldn't be accepted on beta or stable.
Note that this still allows `--output-format html`, which has been
stable since 1.0.
- Remove unnecessary double-checking of the feature gate when parsing
the output format
- Add custom run-make test since compiletest passes -Zunstable-options
by default
Copy file name to clipboardExpand all lines: src/librustdoc/config.rs
+13-14
Original file line number
Diff line number
Diff line change
@@ -379,6 +379,17 @@ impl Options {
379
379
}
380
380
}
381
381
382
+
// check for `--output-format=json`
383
+
if !matches!(matches.opt_str("output-format").as_deref(),None | Some("html"))
384
+
&& !matches.opt_present("show-coverage")
385
+
&& !nightly_options::is_unstable_enabled(matches)
386
+
{
387
+
rustc_session::early_error(
388
+
error_format,
389
+
"the -Z unstable-options flag must be passed to enable --output-format for documentation generation (see https://github.com/rust-lang/rust/issues/76578)",
390
+
);
391
+
}
392
+
382
393
let to_check = matches.opt_strs("check-theme");
383
394
if !to_check.is_empty(){
384
395
let paths = theme::load_css_paths(static_files::themes::LIGHT.as_bytes());
@@ -575,13 +586,7 @@ impl Options {
575
586
let output_format = match matches.opt_str("output-format"){
error: the -Z unstable-options flag must be passed to enable --output-format for documentation generation (see https://github.com/rust-lang/rust/issues/76578)
0 commit comments